From 30a7b60c456410b4a9aca4529bfb23a6466e3531 Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Tue, 28 Nov 2023 12:03:12 +0530 Subject: [PATCH 01/77] refactor(web): top-juror-component-refactor --- .../Home/TopJurors/Header/DesktopHeader.tsx | 60 +++++++++++++++ .../Home/TopJurors/Header/JurorTitle.tsx | 9 --- .../Home/TopJurors/Header/MobileHeader.tsx | 43 +++++++++++ web/src/pages/Home/TopJurors/Header/Rank.tsx | 10 --- .../pages/Home/TopJurors/Header/Rewards.tsx | 2 - web/src/pages/Home/TopJurors/Header/index.tsx | 75 ++----------------- .../Home/TopJurors/JurorCard/DesktopCard.tsx | 33 +++----- .../{HowItWorks.tsx => JurorLevel.tsx} | 7 +- .../Home/TopJurors/JurorCard/JurorTitle.tsx | 9 +-- .../Home/TopJurors/JurorCard/MobileCard.tsx | 6 +- .../pages/Home/TopJurors/JurorCard/Rank.tsx | 4 +- .../Home/TopJurors/JurorCard/Rewards.tsx | 10 +-- web/src/pages/Home/TopJurors/index.tsx | 10 ++- 13 files changed, 141 insertions(+), 137 deletions(-) create mode 100644 web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx delete mode 100644 web/src/pages/Home/TopJurors/Header/JurorTitle.tsx create mode 100644 web/src/pages/Home/TopJurors/Header/MobileHeader.tsx delete mode 100644 web/src/pages/Home/TopJurors/Header/Rank.tsx rename web/src/pages/Home/TopJurors/JurorCard/{HowItWorks.tsx => JurorLevel.tsx} (86%) diff --git a/web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx b/web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx new file mode 100644 index 000000000..34bf66c2d --- /dev/null +++ b/web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx @@ -0,0 +1,60 @@ +import React from "react"; +import { useToggle } from "react-use"; +import styled, { css } from "styled-components"; +import { landscapeStyle } from "styles/landscapeStyle"; +import Rewards from "./Rewards"; +import Coherency from "./Coherency"; +import HowItWorks from "components/HowItWorks"; +import JurorLevels from "components/Popup/MiniGuides/JurorLevels"; + +const Container = styled.div` + display: none; + width: 100%; + background-color: ${({ theme }) => theme.lightBlue}; + border 1px solid ${({ theme }) => theme.stroke}; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + border-bottom: 1px solid ${({ theme }) => theme.stroke}; + padding: 18.6px 32px; + + ${landscapeStyle( + () => + css` + display: grid; + grid-template-columns: + min-content repeat(2, calc(80px + (210 - 60) * (min(max(100vw, 375px), 1250px) - 375px) / 875)) + max-content auto; + column-gap: calc(16px + (28 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + align-items: center; + ` + )} +`; + +const StyledLabel = styled.label` + font-size: 16px; +`; + +const HowItWorksContainer = styled.div` + display: flex; + justify-content: end; +`; + +export const DesktopHeader: React.FC = () => { + const [isJurorLevelsMiniGuideOpen, toggleJurorLevelsMiniGuide] = useToggle(false); + + return ( + + # + Juror + + + + + + + ); +}; diff --git a/web/src/pages/Home/TopJurors/Header/JurorTitle.tsx b/web/src/pages/Home/TopJurors/Header/JurorTitle.tsx deleted file mode 100644 index ad7ed62e1..000000000 --- a/web/src/pages/Home/TopJurors/Header/JurorTitle.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import React from "react"; -import styled from "styled-components"; - -const StyledLabel = styled.label` - width: calc(40px + (220 - 40) * (min(max(100vw, 375px), 1250px) - 375px) / 875); -`; - -const JurorTitle: React.FC = () => Juror; -export default JurorTitle; diff --git a/web/src/pages/Home/TopJurors/Header/MobileHeader.tsx b/web/src/pages/Home/TopJurors/Header/MobileHeader.tsx new file mode 100644 index 000000000..32de5c257 --- /dev/null +++ b/web/src/pages/Home/TopJurors/Header/MobileHeader.tsx @@ -0,0 +1,43 @@ +import React from "react"; +import { useToggle } from "react-use"; +import styled, { css } from "styled-components"; +import { landscapeStyle } from "styles/landscapeStyle"; +import HowItWorks from "components/HowItWorks"; +import JurorLevels from "components/Popup/MiniGuides/JurorLevels"; + +const Container = styled.div` +display: flex; +justify-content: space-between; +width: 100%; +background-color: ${({ theme }) => theme.lightBlue}; +padding: 24px; +border 1px solid ${({ theme }) => theme.stroke}; +border-top-left-radius: 3px; +border-top-right-radius: 3px; +border-bottom: none; +flex-wrap: wrap; +${landscapeStyle( + () => + css` + display: none; + ` +)} +`; + +const StyledLabel = styled.label` + font-size: 16px; +`; + +export const MobileHeader: React.FC = () => { + const [isJurorLevelsMiniGuideOpen, toggleJurorLevelsMiniGuide] = useToggle(false); + return ( + + Ranking + + + ); +}; diff --git a/web/src/pages/Home/TopJurors/Header/Rank.tsx b/web/src/pages/Home/TopJurors/Header/Rank.tsx deleted file mode 100644 index e4f279a8f..000000000 --- a/web/src/pages/Home/TopJurors/Header/Rank.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React from "react"; -import styled from "styled-components"; - -const StyledLabel = styled.label` - width: calc(16px + (24 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); -`; - -const Rank: React.FC = () => #; - -export default Rank; diff --git a/web/src/pages/Home/TopJurors/Header/Rewards.tsx b/web/src/pages/Home/TopJurors/Header/Rewards.tsx index 6f55edfae..c0a869e45 100644 --- a/web/src/pages/Home/TopJurors/Header/Rewards.tsx +++ b/web/src/pages/Home/TopJurors/Header/Rewards.tsx @@ -16,8 +16,6 @@ const Container = styled.div` ${landscapeStyle( () => css` - width: calc(60px + (240 - 60) * (min(max(100vw, 375px), 1250px) - 375px) / 875); - font-size: 14px !important; &::before { content: "Total Rewards"; diff --git a/web/src/pages/Home/TopJurors/Header/index.tsx b/web/src/pages/Home/TopJurors/Header/index.tsx index 5a061ad3c..cd703ef67 100644 --- a/web/src/pages/Home/TopJurors/Header/index.tsx +++ b/web/src/pages/Home/TopJurors/Header/index.tsx @@ -1,76 +1,13 @@ import React from "react"; -import styled, { css } from "styled-components"; -import { landscapeStyle } from "styles/landscapeStyle"; -import { useToggle } from "react-use"; -import Rank from "./Rank"; -import JurorTitle from "./JurorTitle"; -import Rewards from "./Rewards"; -import Coherency from "./Coherency"; -import HowItWorks from "components/HowItWorks"; -import JurorLevels from "components/Popup/MiniGuides/JurorLevels"; - -const Container = styled.div` - display: flex; - justify-content: space-between; - width: 100%; - background-color: ${({ theme }) => theme.lightBlue}; - padding: 24px; - border 1px solid ${({ theme }) => theme.stroke}; - border-top-left-radius: 3px; - border-top-right-radius: 3px; - border-bottom: none; - flex-wrap: wrap; - - ${landscapeStyle( - () => - css` - border-bottom: 1px solid ${({ theme }) => theme.stroke}; - padding: 18.6px 32px; - ` - )} -`; - -const PlaceAndTitleAndRewardsAndCoherency = styled.div` - display: none; - - ${landscapeStyle( - () => - css` - display: flex; - flex-direction: row; - gap: calc(20px + (28 - 20) * (min(max(100vw, 375px), 1250px) - 375px) / 875); - align-items: center; - ` - )} -`; - -const StyledLabel = styled.label` - ${landscapeStyle( - () => - css` - display: none; - ` - )} -`; +import { MobileHeader } from "./MobileHeader"; +import { DesktopHeader } from "./DesktopHeader"; const Header: React.FC = () => { - const [isJurorLevelsMiniGuideOpen, toggleJurorLevelsMiniGuide] = useToggle(false); - return ( - - Ranking - - - - - - - - + <> + + + ); }; diff --git a/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx b/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx index 66079c866..b13a8475f 100644 --- a/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx +++ b/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx @@ -5,13 +5,10 @@ import Rank from "./Rank"; import JurorTitle from "./JurorTitle"; import Rewards from "./Rewards"; import Coherency from "./Coherency"; -import HowItWorks from "./HowItWorks"; +import JurorLevel from "./JurorLevel"; const Container = styled.div` display: none; - - justify-content: space-between; - flex-wrap: wrap; width: 100%; background-color: ${({ theme }) => theme.whiteBackground}; border: 1px solid ${({ theme }) => theme.stroke}; @@ -19,23 +16,17 @@ const Container = styled.div` align-items: center; padding: 15.55px 32px; - label { - font-size: 16px; - } - ${landscapeStyle( () => css` - display: flex; + display: grid; + grid-template-columns: + min-content repeat(2, calc(80px + (210 - 60) * (min(max(100vw, 375px), 1250px) - 375px) / 875)) + min-content auto; + column-gap: calc(16px + (28 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); ` )} `; -const PlaceAndTitleAndRewardsAndCoherency = styled.div` - display: flex; - flex-direction: row; - gap: calc(20px + (28 - 20) * (min(max(100vw, 375px), 1250px) - 375px) / 875); -`; - interface IDesktopCard { rank: number; address: string; @@ -53,13 +44,11 @@ const DesktopCard: React.FC = ({ }) => { return ( - - - - - - - + + + + + ); }; diff --git a/web/src/pages/Home/TopJurors/JurorCard/HowItWorks.tsx b/web/src/pages/Home/TopJurors/JurorCard/JurorLevel.tsx similarity index 86% rename from web/src/pages/Home/TopJurors/JurorCard/HowItWorks.tsx rename to web/src/pages/Home/TopJurors/JurorCard/JurorLevel.tsx index bb92948f3..74047484c 100644 --- a/web/src/pages/Home/TopJurors/JurorCard/HowItWorks.tsx +++ b/web/src/pages/Home/TopJurors/JurorCard/JurorLevel.tsx @@ -12,6 +12,7 @@ const Container = styled.div` ${landscapeStyle( () => css` gap: 16px; + justify-content: end; ` )} `; @@ -34,11 +35,11 @@ const StyledLabel = styled.label` )} `; -interface IHowItWorks { +interface IJurorLevel { coherenceScore: number; } -const HowItWorks: React.FC = ({ coherenceScore }) => { +const JurorLevel: React.FC = ({ coherenceScore }) => { const userLevelData = getUserLevelData(coherenceScore); const level = userLevelData.level; @@ -49,4 +50,4 @@ const HowItWorks: React.FC = ({ coherenceScore }) => { ); }; -export default HowItWorks; +export default JurorLevel; diff --git a/web/src/pages/Home/TopJurors/JurorCard/JurorTitle.tsx b/web/src/pages/Home/TopJurors/JurorCard/JurorTitle.tsx index 62624909e..3e8831375 100644 --- a/web/src/pages/Home/TopJurors/JurorCard/JurorTitle.tsx +++ b/web/src/pages/Home/TopJurors/JurorCard/JurorTitle.tsx @@ -1,6 +1,5 @@ import React from "react"; -import styled, { css } from "styled-components"; -import { landscapeStyle } from "styles/landscapeStyle"; +import styled from "styled-components"; import { IdenticonOrAvatar, AddressOrName } from "components/ConnectWallet/AccountDisplay"; const Container = styled.div` @@ -17,12 +16,6 @@ const Container = styled.div` height: 20px; border-radius: 10%; } - - ${landscapeStyle( - () => css` - width: calc(40px + (220 - 40) * (min(max(100vw, 375px), 1250px) - 375px) / 875); - ` - )} `; interface IJurorTitle { diff --git a/web/src/pages/Home/TopJurors/JurorCard/MobileCard.tsx b/web/src/pages/Home/TopJurors/JurorCard/MobileCard.tsx index 479006212..ad9ec48e0 100644 --- a/web/src/pages/Home/TopJurors/JurorCard/MobileCard.tsx +++ b/web/src/pages/Home/TopJurors/JurorCard/MobileCard.tsx @@ -2,7 +2,7 @@ import React from "react"; import styled, { css } from "styled-components"; import { landscapeStyle } from "styles/landscapeStyle"; import Coherency from "./Coherency"; -import HowItWorks from "./HowItWorks"; +import JurorLevel from "./JurorLevel"; import JurorTitle from "./JurorTitle"; import Rank from "./Rank"; import Rewards from "./Rewards"; @@ -61,7 +61,7 @@ const HeaderCoherencyAndCoherency = styled.div` display: flex; flex-direction: column; align-items: flex-end; - gap: 3px; + gap: 5px; svg { margin-right: 0; @@ -84,7 +84,7 @@ const MobileCard: React.FC = ({ rank, address, coherenceScore, tota - + diff --git a/web/src/pages/Home/TopJurors/JurorCard/Rank.tsx b/web/src/pages/Home/TopJurors/JurorCard/Rank.tsx index 8fd80b5d8..3c423c0c4 100644 --- a/web/src/pages/Home/TopJurors/JurorCard/Rank.tsx +++ b/web/src/pages/Home/TopJurors/JurorCard/Rank.tsx @@ -12,7 +12,9 @@ const Container = styled.div` ${landscapeStyle( () => css` - width: calc(16px + (24 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + display: flex; + align-items: center; + justify-content: start; &::before { display: none; } diff --git a/web/src/pages/Home/TopJurors/JurorCard/Rewards.tsx b/web/src/pages/Home/TopJurors/JurorCard/Rewards.tsx index bdf6b7d2a..cbccf1316 100644 --- a/web/src/pages/Home/TopJurors/JurorCard/Rewards.tsx +++ b/web/src/pages/Home/TopJurors/JurorCard/Rewards.tsx @@ -1,6 +1,5 @@ import React from "react"; -import styled, { css } from "styled-components"; -import { landscapeStyle } from "styles/landscapeStyle"; +import styled from "styled-components"; import { getFormattedRewards } from "utils/jurorRewardConfig"; import EthIcon from "assets/svgs/icons/eth.svg"; import PnkIcon from "assets/svgs/icons/kleros.svg"; @@ -11,13 +10,6 @@ const Container = styled.div` gap: 8px; align-items: center; flex-wrap: wrap; - - ${landscapeStyle( - () => - css` - width: calc(60px + (240 - 60) * (min(max(100vw, 375px), 1250px) - 375px) / 875); - ` - )} `; const StyledIcon = styled.div` diff --git a/web/src/pages/Home/TopJurors/index.tsx b/web/src/pages/Home/TopJurors/index.tsx index c0d77ea43..c7b2fee4f 100644 --- a/web/src/pages/Home/TopJurors/index.tsx +++ b/web/src/pages/Home/TopJurors/index.tsx @@ -1,10 +1,11 @@ import React from "react"; -import styled from "styled-components"; +import styled, { css } from "styled-components"; import { SkeletonDisputeListItem } from "components/StyledSkeleton"; import Header from "./Header"; import JurorCard from "./JurorCard"; import { isUndefined } from "utils/index"; import { useTopUsersByCoherenceScore } from "queries/useTopUsersByCoherenceScore"; +import { landscapeStyle } from "styles/landscapeStyle"; const Container = styled.div` margin-top: calc(64px + (80 - 64) * (min(max(100vw, 375px), 1250px) - 375px) / 875); @@ -18,6 +19,13 @@ const ListContainer = styled.div` display: flex; flex-direction: column; justify-content: center; + + ${landscapeStyle( + () => css` + display: grid; + grid-template-columns: 1fr; + ` + )} `; const TopJurors: React.FC = () => { From 7e0dd17b34d1d988beb18e1dc945749c51246c45 Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Tue, 28 Nov 2023 12:57:50 +0530 Subject: [PATCH 02/77] fix(web): top-juror-heading-width --- web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx | 2 +- web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx b/web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx index 34bf66c2d..65e921b6f 100644 --- a/web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx +++ b/web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx @@ -22,7 +22,7 @@ const Container = styled.div` css` display: grid; grid-template-columns: - min-content repeat(2, calc(80px + (210 - 60) * (min(max(100vw, 375px), 1250px) - 375px) / 875)) + min-content repeat(2, calc(80px + (200 - 60) * (min(max(100vw, 375px), 1250px) - 375px) / 875)) max-content auto; column-gap: calc(16px + (28 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); align-items: center; diff --git a/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx b/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx index b13a8475f..a7c7cc8b2 100644 --- a/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx +++ b/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx @@ -20,7 +20,7 @@ const Container = styled.div` () => css` display: grid; grid-template-columns: - min-content repeat(2, calc(80px + (210 - 60) * (min(max(100vw, 375px), 1250px) - 375px) / 875)) + min-content repeat(2, calc(80px + (200 - 60) * (min(max(100vw, 375px), 1250px) - 375px) / 875)) min-content auto; column-gap: calc(16px + (28 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); ` From c1c6553a38f2c4de4c303a83508ae0c6a8befe8a Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Tue, 28 Nov 2023 18:25:16 +0530 Subject: [PATCH 03/77] refactor(web): move-WithHelpTooltip-to-components --- .../CasesDisplay/CasesListHeader.tsx | 2 +- .../WithHelpTooltip.tsx | 0 .../pages/Dashboard/JurorInfo/Coherency.tsx | 2 +- .../Dashboard/JurorInfo/JurorRewards.tsx | 2 +- .../Dashboard/JurorInfo/StakingRewards.tsx | 2 +- .../pages/Home/TopJurors/Header/Coherency.tsx | 2 +- .../Home/TopJurors/Header/MobileHeader.tsx | 27 +++++++++---------- .../pages/Home/TopJurors/Header/Rewards.tsx | 2 +- 8 files changed, 19 insertions(+), 20 deletions(-) rename web/src/{pages/Dashboard => components}/WithHelpTooltip.tsx (100%) diff --git a/web/src/components/CasesDisplay/CasesListHeader.tsx b/web/src/components/CasesDisplay/CasesListHeader.tsx index 780f6ca20..bf5967a1b 100644 --- a/web/src/components/CasesDisplay/CasesListHeader.tsx +++ b/web/src/components/CasesDisplay/CasesListHeader.tsx @@ -1,7 +1,7 @@ import React from "react"; import styled, { css } from "styled-components"; import { landscapeStyle } from "styles/landscapeStyle"; -import WithHelpTooltip from "pages/Dashboard/WithHelpTooltip"; +import WithHelpTooltip from "components/WithHelpTooltip"; const Container = styled.div` display: flex; diff --git a/web/src/pages/Dashboard/WithHelpTooltip.tsx b/web/src/components/WithHelpTooltip.tsx similarity index 100% rename from web/src/pages/Dashboard/WithHelpTooltip.tsx rename to web/src/components/WithHelpTooltip.tsx diff --git a/web/src/pages/Dashboard/JurorInfo/Coherency.tsx b/web/src/pages/Dashboard/JurorInfo/Coherency.tsx index 548c03901..eb869b498 100644 --- a/web/src/pages/Dashboard/JurorInfo/Coherency.tsx +++ b/web/src/pages/Dashboard/JurorInfo/Coherency.tsx @@ -2,7 +2,7 @@ import React from "react"; import styled, { css } from "styled-components"; import { landscapeStyle } from "styles/landscapeStyle"; import { CircularProgress } from "@kleros/ui-components-library"; -import WithHelpTooltip from "../WithHelpTooltip"; +import WithHelpTooltip from "components/WithHelpTooltip"; const Container = styled.div` display: flex; diff --git a/web/src/pages/Dashboard/JurorInfo/JurorRewards.tsx b/web/src/pages/Dashboard/JurorInfo/JurorRewards.tsx index 2c8653e5a..23ddd0c73 100644 --- a/web/src/pages/Dashboard/JurorInfo/JurorRewards.tsx +++ b/web/src/pages/Dashboard/JurorInfo/JurorRewards.tsx @@ -2,7 +2,7 @@ import React from "react"; import styled from "styled-components"; import { useAccount } from "wagmi"; import TokenRewards from "./TokenRewards"; -import WithHelpTooltip from "../WithHelpTooltip"; +import WithHelpTooltip from "components/WithHelpTooltip"; import { getFormattedRewards } from "utils/jurorRewardConfig"; import { CoinIds } from "consts/coingecko"; import { useUserQuery } from "queries/useUser"; diff --git a/web/src/pages/Dashboard/JurorInfo/StakingRewards.tsx b/web/src/pages/Dashboard/JurorInfo/StakingRewards.tsx index 119d1d3e0..7a613f2ba 100644 --- a/web/src/pages/Dashboard/JurorInfo/StakingRewards.tsx +++ b/web/src/pages/Dashboard/JurorInfo/StakingRewards.tsx @@ -2,7 +2,7 @@ import React from "react"; import styled from "styled-components"; import { Box as _Box, Button } from "@kleros/ui-components-library"; import TokenRewards from "./TokenRewards"; -import WithHelpTooltip from "../WithHelpTooltip"; +import WithHelpTooltip from "components/WithHelpTooltip"; import { EnsureChain } from "components/EnsureChain"; const Container = styled.div` diff --git a/web/src/pages/Home/TopJurors/Header/Coherency.tsx b/web/src/pages/Home/TopJurors/Header/Coherency.tsx index 832793291..b3c8a4712 100644 --- a/web/src/pages/Home/TopJurors/Header/Coherency.tsx +++ b/web/src/pages/Home/TopJurors/Header/Coherency.tsx @@ -2,7 +2,7 @@ import React from "react"; import styled, { css } from "styled-components"; import { BREAKPOINT_LANDSCAPE, landscapeStyle } from "styles/landscapeStyle"; import { useWindowSize } from "react-use"; -import WithHelpTooltip from "pages/Dashboard/WithHelpTooltip"; +import WithHelpTooltip from "components/WithHelpTooltip"; const Container = styled.div` display: flex; diff --git a/web/src/pages/Home/TopJurors/Header/MobileHeader.tsx b/web/src/pages/Home/TopJurors/Header/MobileHeader.tsx index 32de5c257..67cd7b3a9 100644 --- a/web/src/pages/Home/TopJurors/Header/MobileHeader.tsx +++ b/web/src/pages/Home/TopJurors/Header/MobileHeader.tsx @@ -6,22 +6,21 @@ import HowItWorks from "components/HowItWorks"; import JurorLevels from "components/Popup/MiniGuides/JurorLevels"; const Container = styled.div` -display: flex; -justify-content: space-between; -width: 100%; -background-color: ${({ theme }) => theme.lightBlue}; -padding: 24px; -border 1px solid ${({ theme }) => theme.stroke}; -border-top-left-radius: 3px; -border-top-right-radius: 3px; -border-bottom: none; -flex-wrap: wrap; -${landscapeStyle( - () => - css` + display: flex; + justify-content: space-between; + width: 100%; + background-color: ${({ theme }) => theme.lightBlue}; + padding: 24px; + border 1px solid ${({ theme }) => theme.stroke}; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + border-bottom: none; + flex-wrap: wrap; + ${landscapeStyle( + () => css` display: none; ` -)} + )} `; const StyledLabel = styled.label` diff --git a/web/src/pages/Home/TopJurors/Header/Rewards.tsx b/web/src/pages/Home/TopJurors/Header/Rewards.tsx index c0a869e45..e48516c0e 100644 --- a/web/src/pages/Home/TopJurors/Header/Rewards.tsx +++ b/web/src/pages/Home/TopJurors/Header/Rewards.tsx @@ -1,7 +1,7 @@ import React from "react"; import styled, { css } from "styled-components"; import { landscapeStyle } from "styles/landscapeStyle"; -import WithHelpTooltip from "pages/Dashboard/WithHelpTooltip"; +import WithHelpTooltip from "components/WithHelpTooltip"; const Container = styled.div` display: flex; From 517b1d0e61eb9a9f4ea59a0854f80f00e5e3d4cd Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Tue, 28 Nov 2023 18:59:41 +0530 Subject: [PATCH 04/77] refactor(web): center-top-juror-column-content --- web/src/pages/Home/TopJurors/Header/Coherency.tsx | 1 + web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx | 6 +++--- web/src/pages/Home/TopJurors/Header/Rewards.tsx | 1 + web/src/pages/Home/TopJurors/JurorCard/Coherency.tsx | 1 + web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx | 6 +++--- web/src/pages/Home/TopJurors/JurorCard/Rewards.tsx | 9 ++++++++- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/web/src/pages/Home/TopJurors/Header/Coherency.tsx b/web/src/pages/Home/TopJurors/Header/Coherency.tsx index b3c8a4712..2ad5bce5c 100644 --- a/web/src/pages/Home/TopJurors/Header/Coherency.tsx +++ b/web/src/pages/Home/TopJurors/Header/Coherency.tsx @@ -17,6 +17,7 @@ const Container = styled.div` () => css` font-size: 14px !important; + justify-content: center; &::before { content: "Coherent Votes"; } diff --git a/web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx b/web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx index 65e921b6f..937686535 100644 --- a/web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx +++ b/web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx @@ -22,9 +22,9 @@ const Container = styled.div` css` display: grid; grid-template-columns: - min-content repeat(2, calc(80px + (200 - 60) * (min(max(100vw, 375px), 1250px) - 375px) / 875)) - max-content auto; - column-gap: calc(16px + (28 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + min-content repeat(3, calc(160px + (180 - 160) * (min(max(100vw, 900px), 1250px) - 900px) / 350)) + auto; + column-gap: calc(12px + (28 - 12) * (min(max(100vw, 900px), 1250px) - 900px) / 350); align-items: center; ` )} diff --git a/web/src/pages/Home/TopJurors/Header/Rewards.tsx b/web/src/pages/Home/TopJurors/Header/Rewards.tsx index e48516c0e..9a9deb147 100644 --- a/web/src/pages/Home/TopJurors/Header/Rewards.tsx +++ b/web/src/pages/Home/TopJurors/Header/Rewards.tsx @@ -17,6 +17,7 @@ const Container = styled.div` () => css` font-size: 14px !important; + justify-content: center; &::before { content: "Total Rewards"; } diff --git a/web/src/pages/Home/TopJurors/JurorCard/Coherency.tsx b/web/src/pages/Home/TopJurors/JurorCard/Coherency.tsx index e2b02d044..7b3b19448 100644 --- a/web/src/pages/Home/TopJurors/JurorCard/Coherency.tsx +++ b/web/src/pages/Home/TopJurors/JurorCard/Coherency.tsx @@ -7,6 +7,7 @@ const Container = styled.div` font-weight: 600; color: ${({ theme }) => theme.primaryText}; flex-wrap: wrap; + justify-content: center; `; interface ICoherency { diff --git a/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx b/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx index a7c7cc8b2..cd8aa3ebc 100644 --- a/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx +++ b/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx @@ -20,9 +20,9 @@ const Container = styled.div` () => css` display: grid; grid-template-columns: - min-content repeat(2, calc(80px + (200 - 60) * (min(max(100vw, 375px), 1250px) - 375px) / 875)) - min-content auto; - column-gap: calc(16px + (28 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + min-content repeat(3, calc(160px + (180 - 160) * (min(max(100vw, 900px), 1250px) - 900px) / 350)) + auto; + column-gap: calc(12px + (28 - 12) * (min(max(100vw, 900px), 1250px) - 900px) / 350); ` )} `; diff --git a/web/src/pages/Home/TopJurors/JurorCard/Rewards.tsx b/web/src/pages/Home/TopJurors/JurorCard/Rewards.tsx index cbccf1316..71228f581 100644 --- a/web/src/pages/Home/TopJurors/JurorCard/Rewards.tsx +++ b/web/src/pages/Home/TopJurors/JurorCard/Rewards.tsx @@ -1,15 +1,22 @@ import React from "react"; -import styled from "styled-components"; +import styled, { css } from "styled-components"; import { getFormattedRewards } from "utils/jurorRewardConfig"; import EthIcon from "assets/svgs/icons/eth.svg"; import PnkIcon from "assets/svgs/icons/kleros.svg"; import { useUserQuery } from "hooks/queries/useUser"; +import { landscapeStyle } from "styles/landscapeStyle"; const Container = styled.div` display: flex; gap: 8px; align-items: center; flex-wrap: wrap; + + ${landscapeStyle( + () => css` + justify-content: center; + ` + )} `; const StyledIcon = styled.div` From 4b73dd6cf60d55786cd8613afa96404c48c966db Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Fri, 1 Dec 2023 14:35:37 +0530 Subject: [PATCH 05/77] fix(subgraph): casting-fixes --- subgraph/DisputeTemplateRegistry/src/DisputeTemplateRegistry.ts | 2 +- subgraph/src/entities/Penalty.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/subgraph/DisputeTemplateRegistry/src/DisputeTemplateRegistry.ts b/subgraph/DisputeTemplateRegistry/src/DisputeTemplateRegistry.ts index 5395e8166..b3e990f88 100644 --- a/subgraph/DisputeTemplateRegistry/src/DisputeTemplateRegistry.ts +++ b/subgraph/DisputeTemplateRegistry/src/DisputeTemplateRegistry.ts @@ -4,7 +4,7 @@ import { DisputeTemplate } from "../generated/schema"; export function handleDisputeTemplate(event: DisputeTemplateEvent): void { const disputeTemplateId = event.params._templateId.toString(); const disputeTemplate = new DisputeTemplate(disputeTemplateId); - disputeTemplate.templateTag = event.params._templateTag.toString(); + disputeTemplate.templateTag = event.params._templateTag.toHexString(); disputeTemplate.templateData = event.params._templateData.toString(); disputeTemplate.templateDataMappings = event.params._templateDataMappings.toString(); disputeTemplate.save(); diff --git a/subgraph/src/entities/Penalty.ts b/subgraph/src/entities/Penalty.ts index 213fa6b31..ec6e6c8f8 100644 --- a/subgraph/src/entities/Penalty.ts +++ b/subgraph/src/entities/Penalty.ts @@ -6,7 +6,7 @@ export function updatePenalty(event: TokenAndETHShift): void { const disputeID = event.params._disputeID.toString(); const roundIndex = event.params._roundID.toString(); const roundID = `${disputeID}-${roundIndex}`; - const jurorAddress = event.params._account; + const jurorAddress = event.params._account.toHexString(); const penaltyID = `${roundID}-${jurorAddress}`; const penalty = Penalty.load(penaltyID); if (penalty) { From 007a5705601a38ba1d3783608bb6dd618003cd73 Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Wed, 6 Dec 2023 22:15:15 +0530 Subject: [PATCH 06/77] refactor(web): extract-calc-to-ResponsiveSize-func --- .../CasesDisplay/CasesListHeader.tsx | 9 +++--- web/src/components/CasesDisplay/Search.tsx | 3 +- web/src/components/CasesDisplay/index.tsx | 5 ++-- .../components/DisputeCard/DisputeInfo.tsx | 3 +- web/src/components/DisputeCard/index.tsx | 7 +++-- web/src/components/EvidenceCard.tsx | 5 ++-- web/src/components/LatestCases.tsx | 5 ++-- .../components/Popup/Description/Appeal.tsx | 11 +++---- .../Popup/Description/StakeWithdraw.tsx | 11 +++---- .../ExtraInfo/StakeWithdrawExtraInfo.tsx | 7 +++-- .../ExtraInfo/VoteWithCommitExtraInfo.tsx | 3 +- .../MiniGuides/MainStructureTemplate.tsx | 13 +++++---- .../MiniGuides/Onboarding/PnkLogoAndTitle.tsx | 5 ++-- .../Popup/MiniGuides/PageContentsTemplate.tsx | 3 +- web/src/components/Popup/index.tsx | 26 +++++++++-------- web/src/components/StatDisplay.tsx | 3 +- web/src/components/StyledSkeleton.tsx | 3 +- .../components/Verdict/DisputeTimeline.tsx | 3 +- web/src/components/Verdict/VerdictBanner.tsx | 3 +- web/src/layout/Header/DesktopHeader.tsx | 8 +++-- web/src/layout/Header/navbar/DappList.tsx | 5 ++-- web/src/layout/Header/navbar/Explore.tsx | 3 +- .../Header/navbar/Menu/Settings/index.tsx | 3 +- web/src/layout/Header/navbar/Product.tsx | 3 +- .../pages/Cases/CaseDetails/Appeal/index.tsx | 3 +- .../Cases/CaseDetails/Evidence/index.tsx | 3 +- .../Cases/CaseDetails/Overview/Policies.tsx | 3 +- .../Cases/CaseDetails/Overview/index.tsx | 5 ++-- web/src/pages/Cases/CaseDetails/Timeline.tsx | 5 ++-- .../pages/Cases/CaseDetails/Voting/index.tsx | 5 ++-- web/src/pages/Cases/CaseDetails/index.tsx | 3 +- web/src/pages/Cases/index.tsx | 7 +++-- web/src/pages/Courts/CourtDetails/index.tsx | 5 ++-- web/src/pages/Courts/index.tsx | 8 +++-- web/src/pages/Dashboard/Courts/Header.tsx | 3 +- web/src/pages/Dashboard/JurorInfo/Header.tsx | 3 +- web/src/pages/Dashboard/JurorInfo/index.tsx | 3 +- web/src/pages/Dashboard/index.tsx | 10 ++++--- web/src/pages/Home/Community/index.tsx | 5 ++-- web/src/pages/Home/CourtOverview/Chart.tsx | 3 +- web/src/pages/Home/CourtOverview/Stats.tsx | 5 ++-- .../Home/TopJurors/Header/DesktopHeader.tsx | 3 +- .../Home/TopJurors/JurorCard/DesktopCard.tsx | 3 +- web/src/pages/Home/TopJurors/index.tsx | 5 ++-- web/src/pages/Home/index.tsx | 7 +++-- web/src/styles/responsiveSize.ts | 29 +++++++++++++++++++ 46 files changed, 177 insertions(+), 99 deletions(-) create mode 100644 web/src/styles/responsiveSize.ts diff --git a/web/src/components/CasesDisplay/CasesListHeader.tsx b/web/src/components/CasesDisplay/CasesListHeader.tsx index bf5967a1b..b19347953 100644 --- a/web/src/components/CasesDisplay/CasesListHeader.tsx +++ b/web/src/components/CasesDisplay/CasesListHeader.tsx @@ -2,11 +2,12 @@ import React from "react"; import styled, { css } from "styled-components"; import { landscapeStyle } from "styles/landscapeStyle"; import WithHelpTooltip from "components/WithHelpTooltip"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` display: flex; justify-content: space-between; - gap: calc(15vw + (40 - 15) * ((100vw - 300px) / (1250 - 300))); + ${responsiveSize("gap", 15, 40, 300, 1250, "vw")} width: 100%; height: 100%; `; @@ -16,10 +17,10 @@ const CasesData = styled.div` align-items: center; justify-content: space-around; width: 100%; - margin-left: calc(0px + (33) * (100vw - 370px) / (1250 - 370)); + ${responsiveSize("marginLeft", 0, 33, 370)} flex-wrap: wrap; padding: 0 3%; - gap: calc(24px + (48 - 24) * ((100vw - 300px) / (1250 - 300))); + ${responsiveSize("gap", 24, 48, 300)} `; const CaseTitle = styled.div` @@ -42,7 +43,7 @@ const CaseTitle = styled.div` `; const StyledLabel = styled.label` - padding-left: calc(4px + (8 - 4) * ((100vw - 300px) / (900 - 300))); + ${responsiveSize("marginLeft", 4, 8, 300, 900)} `; const tooltipMsg = diff --git a/web/src/components/CasesDisplay/Search.tsx b/web/src/components/CasesDisplay/Search.tsx index 42c911d58..393430bd8 100644 --- a/web/src/components/CasesDisplay/Search.tsx +++ b/web/src/components/CasesDisplay/Search.tsx @@ -8,6 +8,7 @@ import { Searchbar, DropdownCascader } from "@kleros/ui-components-library"; import { rootCourtToItems, useCourtTree } from "queries/useCourtTree"; import { isUndefined } from "utils/index"; import { decodeURIFilter, encodeURIFilter, useRootPath } from "utils/uri"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` display: flex; @@ -18,7 +19,7 @@ const Container = styled.div` () => css` flex-direction: row; - gap: calc(4px + (22 - 4) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("gap", 4, 22)} ` )} `; diff --git a/web/src/components/CasesDisplay/index.tsx b/web/src/components/CasesDisplay/index.tsx index 03dd742e4..94361961f 100644 --- a/web/src/components/CasesDisplay/index.tsx +++ b/web/src/components/CasesDisplay/index.tsx @@ -3,17 +3,18 @@ import styled from "styled-components"; import Search from "./Search"; import StatsAndFilters from "./StatsAndFilters"; import CasesGrid, { ICasesGrid } from "./CasesGrid"; +import { responsiveSize } from "styles/responsiveSize"; const Divider = styled.hr` display: flex; border: none; height: 1px; background-color: ${({ theme }) => theme.stroke}; - margin: calc(20px + (24 - 20) * (min(max(100vw, 375px), 1250px) - 375px) / 875) 0; + ${responsiveSize("margin", 20, 24)} `; const StyledTitle = styled.h1` - margin-bottom: calc(32px + (48 - 32) * (min(max(100vw, 375px), 1250px) - 375px) / 875) !important; + ${responsiveSize("marginBottom", 32, 48)} `; interface ICasesDisplay extends ICasesGrid { diff --git a/web/src/components/DisputeCard/DisputeInfo.tsx b/web/src/components/DisputeCard/DisputeInfo.tsx index c50dab7ea..f5e806b63 100644 --- a/web/src/components/DisputeCard/DisputeInfo.tsx +++ b/web/src/components/DisputeCard/DisputeInfo.tsx @@ -11,6 +11,7 @@ import RoundIcon from "svgs/icons/round.svg"; import Field from "../Field"; import { getCourtsPath } from "pages/Courts/CourtDetails"; import { useCourtTree } from "hooks/queries/useCourtTree"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div<{ isList: boolean; isOverview?: boolean }>` display: flex; @@ -56,7 +57,7 @@ const RestOfFieldsContainer = styled.div<{ isList?: boolean; isOverview?: boolea ${landscapeStyle( () => css` flex-direction: row; - gap: calc(4px + (24px - 4px) * ((100vw - 300px) / (900 - 300))); + ${responsiveSize("gap", 4, 24, 300, 900)} justify-content: space-around; ` )} diff --git a/web/src/components/DisputeCard/index.tsx b/web/src/components/DisputeCard/index.tsx index c449806e9..e9bbbfc4a 100644 --- a/web/src/components/DisputeCard/index.tsx +++ b/web/src/components/DisputeCard/index.tsx @@ -15,10 +15,11 @@ import DisputeInfo from "./DisputeInfo"; import PeriodBanner from "./PeriodBanner"; import { isUndefined } from "utils/index"; import { getLocalRounds } from "utils/getLocalRounds"; +import { responsiveSize } from "styles/responsiveSize"; const StyledCard = styled(Card)` width: 100%; - height: calc(280px + (296 - 280) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("height", 280, 296)} ${landscapeStyle( () => @@ -42,7 +43,7 @@ const StyledListItem = styled(Card)` const CardContainer = styled.div` height: calc(100% - 45px); - padding: calc(20px + (24 - 20) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("padding", 20, 24)} display: flex; flex-direction: column; justify-content: space-between; @@ -67,7 +68,7 @@ const ListTitle = styled.div` height: 100%; justify-content: start; align-items: center; - width: calc(30vw + (40 - 30) * ((100vw - 300px) / (1250 - 300))); + ${responsiveSize("width", 30, 40, 300, 1250, "vw")} `; export const getPeriodEndTimestamp = ( diff --git a/web/src/components/EvidenceCard.tsx b/web/src/components/EvidenceCard.tsx index c6f8d0154..9ba922bca 100644 --- a/web/src/components/EvidenceCard.tsx +++ b/web/src/components/EvidenceCard.tsx @@ -7,6 +7,7 @@ import AttachmentIcon from "svgs/icons/attachment.svg"; import { useIPFSQuery } from "hooks/useIPFSQuery"; import { shortenAddress } from "utils/shortenAddress"; import { IPFS_GATEWAY } from "consts/index"; +import { responsiveSize } from "styles/responsiveSize"; const StyledCard = styled(Card)` width: 100%; @@ -14,7 +15,7 @@ const StyledCard = styled(Card)` `; const TextContainer = styled.div` - padding: calc(8px + (24 - 8) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("padding", 8, 24)} > * { overflow-wrap: break-word; margin: 0; @@ -45,7 +46,7 @@ const BottomShade = styled.div` const StyledA = styled.a` display: flex; margin-left: auto; - gap: calc(5px + (6 - 5) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("gap", 5, 6)} ${landscapeStyle( () => css` diff --git a/web/src/components/LatestCases.tsx b/web/src/components/LatestCases.tsx index 2439b910c..b0d2492e1 100644 --- a/web/src/components/LatestCases.tsx +++ b/web/src/components/LatestCases.tsx @@ -5,13 +5,14 @@ import { DisputeDetailsFragment, useCasesQuery } from "queries/useCasesQuery"; import DisputeCard from "components/DisputeCard"; import { SkeletonDisputeCard } from "components/StyledSkeleton"; import { isUndefined } from "utils/index"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` - margin-top: calc(48px + (80 - 48) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("marginTop", 48, 80)} `; const Title = styled.h1` - margin-bottom: calc(16px + (48 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("marginBottom", 16, 48)} `; const DisputeContainer = styled.div` diff --git a/web/src/components/Popup/Description/Appeal.tsx b/web/src/components/Popup/Description/Appeal.tsx index e994b96c1..3c1d0aca0 100644 --- a/web/src/components/Popup/Description/Appeal.tsx +++ b/web/src/components/Popup/Description/Appeal.tsx @@ -1,5 +1,6 @@ import React from "react"; import styled from "styled-components"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` display: flex; @@ -8,17 +9,17 @@ const Container = styled.div` const StyledAmountFunded = styled.div` display: flex; - margin-left: calc(8px + (44 - 8) * ((100vw - 300px) / (1250 - 300))); - margin-right: calc(8px + (44 - 8) * ((100vw - 300px) / (1250 - 300))); + ${responsiveSize("marginLeft", 8, 44, 300)} + ${responsiveSize("marginRight", 8, 44, 300)} color: ${({ theme }) => theme.secondaryText}; text-align: center; `; const StyledOptionFunded = styled.div` display: flex; - margin-bottom: calc(16px + (32 - 16) * ((100vw - 300px) / (1250 - 300))); - margin-left: calc(8px + (44 - 8) * ((100vw - 300px) / (1250 - 300))); - margin-right: calc(8px + (44 - 8) * ((100vw - 300px) / (1250 - 300))); + ${responsiveSize("marginBottom", 16, 32, 300)} + ${responsiveSize("marginLeft", 8, 44, 300)} + ${responsiveSize("marginRight", 8, 44, 300)} color: ${({ theme }) => theme.secondaryText}; text-align: center; `; diff --git a/web/src/components/Popup/Description/StakeWithdraw.tsx b/web/src/components/Popup/Description/StakeWithdraw.tsx index e781a462b..9a02d2c92 100644 --- a/web/src/components/Popup/Description/StakeWithdraw.tsx +++ b/web/src/components/Popup/Description/StakeWithdraw.tsx @@ -5,6 +5,7 @@ import { useAccount } from "wagmi"; import { isUndefined } from "utils/index"; import { useKlerosCoreGetJurorBalance } from "hooks/contracts/generated"; import KlerosLogo from "tsx:svgs/icons/kleros.svg"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` display: flex; @@ -19,9 +20,9 @@ const StyledKlerosLogo = styled(KlerosLogo)` const StyledTitle = styled.div` display: flex; - margin-bottom: calc(16px + (32 - 16) * ((100vw - 300px) / (1250 - 300))); - margin-left: calc(8px + (44 - 8) * ((100vw - 300px) / (1250 - 300))); - margin-right: calc(8px + (44 - 8) * ((100vw - 300px) / (1250 - 300))); + ${responsiveSize("marginBottom", 16, 32, 300)} + ${responsiveSize("marginLeft", 8, 44, 300)} + ${responsiveSize("marginRight", 8, 44, 300)} color: ${({ theme }) => theme.secondaryText}; text-align: center; `; @@ -30,7 +31,7 @@ const AmountStakedOrWithdrawnContainer = styled.div` font-size: 24px; font-weight: 600; color: ${({ theme }) => theme.secondaryPurple}; - margin-bottom: calc(0px + (4 - 0) * ((100vw - 300px) / (1250 - 300))); + ${responsiveSize("marginBottom", 0, 4, 300)} `; const TotalStakeContainer = styled.div` @@ -38,7 +39,7 @@ const TotalStakeContainer = styled.div` font-size: 14px; align-items: center; justify-content: center; - margin-bottom: calc(8px + (32 - 8) * ((100vw - 300px) / (1250 - 300))); + ${responsiveSize("marginBottom", 8, 32, 300)} `; const MyStakeContainer = styled.div` diff --git a/web/src/components/Popup/ExtraInfo/StakeWithdrawExtraInfo.tsx b/web/src/components/Popup/ExtraInfo/StakeWithdrawExtraInfo.tsx index 5ca4b4169..c52e4a1c5 100644 --- a/web/src/components/Popup/ExtraInfo/StakeWithdrawExtraInfo.tsx +++ b/web/src/components/Popup/ExtraInfo/StakeWithdrawExtraInfo.tsx @@ -1,13 +1,14 @@ import React from "react"; import styled from "styled-components"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` display: flex; color: ${({ theme }) => theme.secondaryText}; text-align: center; - margin-left: calc(8px + (44 - 8) * ((100vw - 300px) / (1250 - 300))); - margin-right: calc(8px + (44 - 8) * ((100vw - 300px) / (1250 - 300))); - margin-top: calc(8px + (24 - 8) * ((100vw - 300px) / (1250 - 300))); + ${responsiveSize("marginLeft", 8, 44, 300)} + ${responsiveSize("marginRight", 8, 44, 300)} + ${responsiveSize("marginTop", 8, 24, 300)} `; const StakeWithdrawExtraInfo: React.FC = () => { diff --git a/web/src/components/Popup/ExtraInfo/VoteWithCommitExtraInfo.tsx b/web/src/components/Popup/ExtraInfo/VoteWithCommitExtraInfo.tsx index df474c563..f2343c19d 100644 --- a/web/src/components/Popup/ExtraInfo/VoteWithCommitExtraInfo.tsx +++ b/web/src/components/Popup/ExtraInfo/VoteWithCommitExtraInfo.tsx @@ -1,13 +1,14 @@ import React from "react"; import styled from "styled-components"; import InfoCircle from "tsx:svgs/icons/info-circle.svg"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` display: flex; gap: 4px; text-align: center; margin: 0 calc(8px + (32 - 8) * ((100vw - 300px) / (1250 - 300))); - margin-top: calc(8px + (24 - 8) * ((100vw - 300px) / (1250 - 300))); + ${responsiveSize("marginTop", 8, 24, 300)} font-size: 14px; font-weight: 400; line-height: 19px; diff --git a/web/src/components/Popup/MiniGuides/MainStructureTemplate.tsx b/web/src/components/Popup/MiniGuides/MainStructureTemplate.tsx index 3f511fa26..4ad51e664 100644 --- a/web/src/components/Popup/MiniGuides/MainStructureTemplate.tsx +++ b/web/src/components/Popup/MiniGuides/MainStructureTemplate.tsx @@ -5,6 +5,7 @@ import { CompactPagination } from "@kleros/ui-components-library"; import { Overlay } from "components/Overlay"; import BookOpenIcon from "tsx:assets/svgs/icons/book-open.svg"; import { useFocusOutside } from "hooks/useFocusOutside"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div<{ isVisible: boolean }>` display: ${({ isVisible }) => (isVisible ? "flex" : "none")}; @@ -24,7 +25,7 @@ const Container = styled.div<{ isVisible: boolean }>` () => css` overflow-y: hidden; top: 50%; - width: calc(700px + (900 - 700) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("width", 700, 900)} flex-direction: row; height: 500px; ` @@ -35,7 +36,7 @@ const LeftContainer = styled.div` display: grid; grid-template-rows: auto 1fr auto; width: 86vw; - padding: calc(24px + (32 - 24) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("padding", 24, 32)} padding-bottom: 32px; background-color: ${({ theme }) => theme.whiteBackground}; border-top-left-radius: 3px; @@ -44,7 +45,7 @@ const LeftContainer = styled.div` ${landscapeStyle( () => css` overflow-y: hidden; - width: calc(350px + (450 - 350) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("width", 350, 450)} height: 500px; ` )} @@ -60,7 +61,7 @@ const HowItWorks = styled.div` display: flex; align-items: center; gap: 8px; - margin-bottom: calc(32px + (64 - 32) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("marginBottom", 32, 64)} label { color: ${({ theme }) => theme.secondaryPurple}; @@ -97,7 +98,7 @@ const Close = styled.label` () => css` display: flex; position: absolute; - top: calc(24px + (32 - 24) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("top", 24, 32)} right: 17px; display: flex; align-items: flex-end; @@ -129,7 +130,7 @@ const RightContainer = styled.div` ${landscapeStyle( () => css` overflow-y: hidden; - width: calc(350px + (450 - 350) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("width", 350, 450)} height: 500px; ` )} diff --git a/web/src/components/Popup/MiniGuides/Onboarding/PnkLogoAndTitle.tsx b/web/src/components/Popup/MiniGuides/Onboarding/PnkLogoAndTitle.tsx index 40e213e33..a69ddf18b 100644 --- a/web/src/components/Popup/MiniGuides/Onboarding/PnkLogoAndTitle.tsx +++ b/web/src/components/Popup/MiniGuides/Onboarding/PnkLogoAndTitle.tsx @@ -1,6 +1,7 @@ import React from "react"; import styled from "styled-components"; import PnkIcon from "tsx:assets/svgs/styled/pnk.svg"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` display: flex; @@ -11,8 +12,8 @@ const Container = styled.div` `; const StyledPnkIcon = styled(PnkIcon)` - width: calc(220px + (280 - 220) * (min(max(100vw, 375px), 1250px) - 375px) / 875); - height: calc(220px + (252 - 220) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("width", 220, 280)} + ${responsiveSize("height", 220, 252)} [class$="stop-1"] { stop-color: ${({ theme }) => theme.primaryBlue}; diff --git a/web/src/components/Popup/MiniGuides/PageContentsTemplate.tsx b/web/src/components/Popup/MiniGuides/PageContentsTemplate.tsx index d805a6a3a..e3bf070ea 100644 --- a/web/src/components/Popup/MiniGuides/PageContentsTemplate.tsx +++ b/web/src/components/Popup/MiniGuides/PageContentsTemplate.tsx @@ -2,6 +2,7 @@ import React, { useState } from "react"; import styled, { css } from "styled-components"; import { landscapeStyle } from "styles/landscapeStyle"; import MainStructureTemplate from "./MainStructureTemplate"; +import { responsiveSize } from "styles/responsiveSize"; export const ParagraphsContainer = styled.div` display: flex; @@ -20,7 +21,7 @@ export const LeftContentContainer = styled.div` `; export const StyledImage = styled.div` - width: calc(260px + (460 - 260) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("width", 260, 460)} ${landscapeStyle( () => css` diff --git a/web/src/components/Popup/index.tsx b/web/src/components/Popup/index.tsx index 0b1edfe64..32224d159 100644 --- a/web/src/components/Popup/index.tsx +++ b/web/src/components/Popup/index.tsx @@ -9,13 +9,14 @@ import VoteWithoutCommit from "./Description/VoteWithoutCommit"; import Appeal from "./Description/Appeal"; import VoteWithCommitExtraInfo from "./ExtraInfo/VoteWithCommitExtraInfo"; import StakeWithdrawExtraInfo from "./ExtraInfo/StakeWithdrawExtraInfo"; +import { responsiveSize } from "styles/responsiveSize"; const Header = styled.h1` display: flex; - margin-top: calc(12px + (32 - 12) * ((100vw - 375px) / (1250 - 375))); - margin-bottom: calc(12px + (24 - 12) * ((100vw - 375px) / (1250 - 375))); - margin-left: calc(8px + (12 - 8) * ((100vw - 375px) / (1250 - 375))); - margin-right: calc(8px + (12 - 8) * ((100vw - 375px) / (1250 - 375))); + ${responsiveSize("marginTop", 12, 32)} + ${responsiveSize("marginBottom", 12, 24)} + ${responsiveSize("marginLeft", 8, 12)} + ${responsiveSize("marginRight", 8, 12)} text-align: center; font-size: 24px; font-weight: 600; @@ -23,20 +24,21 @@ const Header = styled.h1` `; const IconContainer = styled.div` - width: calc(150px + (228 - 150) * (100vw - 375px) / (1250 - 375)); + ${responsiveSize("width", 150, 228)} + display: flex; align-items: center; justify-content: center; svg { display: inline-block; - width: calc(150px + (228 - 150) * (100vw - 375px) / (1250 - 375)); - height: calc(150px + (228 - 150) * (100vw - 375px) / (1250 - 375)); + ${responsiveSize("width", 150, 228)} + ${responsiveSize("height", 150, 228)} } `; const StyledButton = styled(Button)` - margin: calc(16px + (32 - 16) * ((100vw - 375px) / (1250 - 375))); + ${responsiveSize("margin", 16, 32)} `; const Container = styled.div` @@ -66,7 +68,7 @@ const Container = styled.div` ${landscapeStyle( () => css` overflow-y: hidden; - width: calc(300px + (600 - 300) * (100vw - 375px) / (1250 - 375)); + ${responsiveSize("width", 300, 600)} ` )} `; @@ -74,9 +76,9 @@ const Container = styled.div` const VoteDescriptionContainer = styled.div` display: flex; flex-direction: column; - margin-bottom: calc(16px + (32 - 16) * ((100vw - 375px) / (1250 - 375))); - margin-left: calc(8px + (32 - 8) * ((100vw - 375px) / (1250 - 375))); - margin-right: calc(8px + (32 - 8) * ((100vw - 375px) / (1250 - 375))); + ${responsiveSize("marginBottom", 16, 32)} + ${responsiveSize("marginLeft", 8, 32)} + ${responsiveSize("marginRight", 8, 32)} color: ${({ theme }) => theme.secondaryText}; text-align: center; line-height: 21.8px; diff --git a/web/src/components/StatDisplay.tsx b/web/src/components/StatDisplay.tsx index 79d1073c6..8d6014b1e 100644 --- a/web/src/components/StatDisplay.tsx +++ b/web/src/components/StatDisplay.tsx @@ -1,6 +1,7 @@ import React from "react"; import { landscapeStyle } from "styles/landscapeStyle"; import styled, { useTheme, css } from "styled-components"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` display: flex; @@ -10,7 +11,7 @@ const Container = styled.div` ${landscapeStyle( () => css` - margin-bottom: calc(16px + (30 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("marginBottom", 16, 30)} ` )} `; diff --git a/web/src/components/StyledSkeleton.tsx b/web/src/components/StyledSkeleton.tsx index 913a350a6..6f6ebf749 100644 --- a/web/src/components/StyledSkeleton.tsx +++ b/web/src/components/StyledSkeleton.tsx @@ -2,6 +2,7 @@ import React from "react"; import styled, { css } from "styled-components"; import { landscapeStyle } from "styles/landscapeStyle"; import Skeleton from "react-loading-skeleton"; +import { responsiveSize } from "styles/responsiveSize"; export const StyledSkeleton = styled(Skeleton)` z-index: 0; @@ -24,7 +25,7 @@ const SkeletonDisputeCardContainer = styled.div` `; const StyledSkeletonDisputeCard = styled(Skeleton)` - height: calc(272px + (296 - 270) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("height", 270, 296)} `; const StyledSkeletonDisputeListItem = styled(Skeleton)` diff --git a/web/src/components/Verdict/DisputeTimeline.tsx b/web/src/components/Verdict/DisputeTimeline.tsx index 05a24b52e..667306584 100644 --- a/web/src/components/Verdict/DisputeTimeline.tsx +++ b/web/src/components/Verdict/DisputeTimeline.tsx @@ -12,6 +12,7 @@ import { useDisputeTemplate } from "queries/useDisputeTemplate"; import { useVotingHistory } from "queries/useVotingHistory"; import { getVoteChoice } from "pages/Cases/CaseDetails/Voting/VotingHistory"; import { getLocalRounds } from "utils/getLocalRounds"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` display: flex; @@ -27,7 +28,7 @@ const StyledTimeline = styled(CustomTimeline)` const EnforcementContainer = styled.div` display: flex; gap: 8px; - margin-top: calc(12px + (24 - 12) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("marginTop", 12, 24)} fill: ${({ theme }) => theme.secondaryText}; small { diff --git a/web/src/components/Verdict/VerdictBanner.tsx b/web/src/components/Verdict/VerdictBanner.tsx index 516b0779f..d246b7882 100644 --- a/web/src/components/Verdict/VerdictBanner.tsx +++ b/web/src/components/Verdict/VerdictBanner.tsx @@ -2,11 +2,12 @@ import React from "react"; import styled from "styled-components"; import ClosedCaseIcon from "assets/svgs/icons/check-circle-outline.svg"; import HourglassIcon from "assets/svgs/icons/hourglass.svg"; +import { responsiveSize } from "styles/responsiveSize"; const BannerContainer = styled.div` display: flex; gap: 8px; - margin-bottom: calc(16px + (24 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("marginBottom", 16, 24)} svg { width: 16px; height: 16px; diff --git a/web/src/layout/Header/DesktopHeader.tsx b/web/src/layout/Header/DesktopHeader.tsx index d118fa85b..9bc8942f6 100644 --- a/web/src/layout/Header/DesktopHeader.tsx +++ b/web/src/layout/Header/DesktopHeader.tsx @@ -15,6 +15,7 @@ import Help from "./navbar/Menu/Help"; import Settings from "./navbar/Menu/Settings"; import { Overlay } from "components/Overlay"; import { PopupContainer } from "."; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` display: none; @@ -46,7 +47,8 @@ const MiddleSide = styled.div` const RightSide = styled.div` display: flex; - gap: calc(8px + (16 - 8) * ((100vw - 300px) / (1024 - 300))); + ${responsiveSize("gap", 8, 16, 300, 1024)} + margin-left: 8px; canvas { width: 20px; @@ -57,8 +59,8 @@ const LightButtonContainer = styled.div` display: flex; align-items: center; width: 16px; - margin-left: calc(4px + (8 - 4) * ((100vw - 375px) / (1250 - 375))); - margin-right: calc(12px + (16 - 12) * ((100vw - 375px) / (1250 - 375))); + ${responsiveSize("marginLeft", 4, 8)} + ${responsiveSize("marginRight", 12, 16)} `; const StyledLink = styled(Link)` diff --git a/web/src/layout/Header/navbar/DappList.tsx b/web/src/layout/Header/navbar/DappList.tsx index 9aca796d5..f11b84a84 100644 --- a/web/src/layout/Header/navbar/DappList.tsx +++ b/web/src/layout/Header/navbar/DappList.tsx @@ -12,6 +12,7 @@ import POH from "svgs/icons/poh-image.png"; import Vea from "svgs/icons/vea.svg"; import Tokens from "svgs/icons/tokens.svg"; import Product from "./Product"; +import { responsiveSize } from "styles/responsiveSize"; const Header = styled.h1` display: flex; @@ -52,7 +53,7 @@ const Container = styled.div` left: 0; right: auto; transform: none; - width: calc(300px + (480 - 300) * (100vw - 375px) / (1250 - 375)); + ${responsiveSize("width", 300, 480)} max-height: 80vh; ` )} @@ -67,7 +68,7 @@ const ItemsDiv = styled.div` justify-items: center; max-width: 480px; min-width: 300px; - width: calc(300px + (480 - 300) * (100vw - 375px) / (1250 - 375)); + ${responsiveSize("width", 300, 480)} grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); `; diff --git a/web/src/layout/Header/navbar/Explore.tsx b/web/src/layout/Header/navbar/Explore.tsx index 63733174c..4160411b4 100644 --- a/web/src/layout/Header/navbar/Explore.tsx +++ b/web/src/layout/Header/navbar/Explore.tsx @@ -3,6 +3,7 @@ import styled, { css } from "styled-components"; import { landscapeStyle } from "styles/landscapeStyle"; import { Link, useLocation } from "react-router-dom"; import { useOpenContext } from "../MobileHeader"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` display: flex; @@ -12,7 +13,7 @@ const Container = styled.div` ${landscapeStyle( () => css` flex-direction: row; - gap: calc(4px + (16 - 4) * ((100vw - 375px) / (1250 - 375))); + ${responsiveSize("gap", 4, 16)} ` )}; `; diff --git a/web/src/layout/Header/navbar/Menu/Settings/index.tsx b/web/src/layout/Header/navbar/Menu/Settings/index.tsx index 0466aead9..eedf4858a 100644 --- a/web/src/layout/Header/navbar/Menu/Settings/index.tsx +++ b/web/src/layout/Header/navbar/Menu/Settings/index.tsx @@ -7,6 +7,7 @@ import NotificationSettings from "./Notifications"; import { useFocusOutside } from "hooks/useFocusOutside"; import { Overlay } from "components/Overlay"; import { ISettings } from "../../index"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` display: flex; @@ -50,7 +51,7 @@ const StyledTabs = styled(Tabs)` ${landscapeStyle( () => css` - width: calc(300px + (424 - 300) * ((100vw - 300px) / (1250 - 300))); + ${responsiveSize("width", 300, 424, 300)} ` )} `; diff --git a/web/src/layout/Header/navbar/Product.tsx b/web/src/layout/Header/navbar/Product.tsx index 0dd5c3cf5..b5fb9d7f9 100644 --- a/web/src/layout/Header/navbar/Product.tsx +++ b/web/src/layout/Header/navbar/Product.tsx @@ -1,5 +1,6 @@ import React from "react"; import styled from "styled-components"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.a` cursor: pointer; @@ -15,7 +16,7 @@ const Container = styled.a` transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); } gap: 8px; - width: calc(100px + (130 - 100) * (100vw - 375px) / (1250 - 375)); + ${responsiveSize("width", 100, 130)} white-space: nowrap; background-color: ${({ theme }) => theme.lightBackground}; diff --git a/web/src/pages/Cases/CaseDetails/Appeal/index.tsx b/web/src/pages/Cases/CaseDetails/Appeal/index.tsx index 16a7afa49..e0f08bd99 100644 --- a/web/src/pages/Cases/CaseDetails/Appeal/index.tsx +++ b/web/src/pages/Cases/CaseDetails/Appeal/index.tsx @@ -6,9 +6,10 @@ import Classic from "./Classic"; import { Periods } from "consts/periods"; import AppealHistory from "./AppealHistory"; import { ClassicAppealProvider } from "hooks/useClassicAppealContext"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` - padding: calc(16px + (32 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("padding", 16, 32)} `; export const AppealHeader = styled.div` diff --git a/web/src/pages/Cases/CaseDetails/Evidence/index.tsx b/web/src/pages/Cases/CaseDetails/Evidence/index.tsx index 2e5cd12b1..2c0eb9a97 100644 --- a/web/src/pages/Cases/CaseDetails/Evidence/index.tsx +++ b/web/src/pages/Cases/CaseDetails/Evidence/index.tsx @@ -10,6 +10,7 @@ import { SkeletonEvidenceCard } from "components/StyledSkeleton"; import EvidenceCard from "components/EvidenceCard"; import { EnsureChain } from "components/EnsureChain"; import { isUndefined } from "utils/index"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` width: 100%; @@ -18,7 +19,7 @@ const Container = styled.div` gap: 16px; align-items: center; - padding: calc(16px + (32 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("padding", 16, 32)} `; const StyledButton = styled(Button)` diff --git a/web/src/pages/Cases/CaseDetails/Overview/Policies.tsx b/web/src/pages/Cases/CaseDetails/Overview/Policies.tsx index f9b4c35ff..7e794fed3 100644 --- a/web/src/pages/Cases/CaseDetails/Overview/Policies.tsx +++ b/web/src/pages/Cases/CaseDetails/Overview/Policies.tsx @@ -4,6 +4,7 @@ import { landscapeStyle } from "styles/landscapeStyle"; import { IPFS_GATEWAY } from "consts/index"; import PolicyIcon from "svgs/icons/policy.svg"; import { isUndefined } from "utils/index"; +import { responsiveSize } from "styles/responsiveSize"; const ShadeArea = styled.div` display: flex; @@ -48,7 +49,7 @@ const StyledPolicyIcon = styled(PolicyIcon)` const LinkContainer = styled.div` display: flex; - gap: calc(8px + (24 - 8) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("gap", 8, 24)} `; interface IPolicies { diff --git a/web/src/pages/Cases/CaseDetails/Overview/index.tsx b/web/src/pages/Cases/CaseDetails/Overview/index.tsx index 4c5154335..c2d35bda2 100644 --- a/web/src/pages/Cases/CaseDetails/Overview/index.tsx +++ b/web/src/pages/Cases/CaseDetails/Overview/index.tsx @@ -13,14 +13,15 @@ import { useVotingHistory } from "hooks/queries/useVotingHistory"; import { getLocalRounds } from "utils/getLocalRounds"; import { DisputeContext } from "./DisputeContext"; import { Policies } from "./Policies"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` width: 100%; height: auto; display: flex; flex-direction: column; - gap: calc(16px + (32 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); - padding: calc(16px + (32 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("gap", 16, 32)} + ${responsiveSize("padding", 16, 32)} `; const Divider = styled.hr` diff --git a/web/src/pages/Cases/CaseDetails/Timeline.tsx b/web/src/pages/Cases/CaseDetails/Timeline.tsx index 7f83833a1..6dc632d58 100644 --- a/web/src/pages/Cases/CaseDetails/Timeline.tsx +++ b/web/src/pages/Cases/CaseDetails/Timeline.tsx @@ -7,6 +7,7 @@ import { Box, Steps } from "@kleros/ui-components-library"; import { StyledSkeleton } from "components/StyledSkeleton"; import { useCountdown } from "hooks/useCountdown"; import { secondsToDayHourMinute } from "utils/date"; +import { responsiveSize } from "styles/responsiveSize"; const TimeLineContainer = styled(Box)` display: block; @@ -14,8 +15,8 @@ const TimeLineContainer = styled(Box)` height: 98px; border-radius: 0px; padding: 20px 8px 0px 8px; - margin-top: calc(16px + (48 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); - margin-bottom: calc(12px + (22 - 12) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("marginTop", 16, 48)} + ${responsiveSize("marginBottom", 12, 22)} background-color: ${({ theme }) => theme.whiteBackground}; ${landscapeStyle( diff --git a/web/src/pages/Cases/CaseDetails/Voting/index.tsx b/web/src/pages/Cases/CaseDetails/Voting/index.tsx index ff7209c23..3004face6 100644 --- a/web/src/pages/Cases/CaseDetails/Voting/index.tsx +++ b/web/src/pages/Cases/CaseDetails/Voting/index.tsx @@ -16,9 +16,10 @@ import { getPeriodEndTimestamp } from "components/DisputeCard"; import { useDisputeKitClassicIsVoteActive } from "hooks/contracts/generated"; import VoteIcon from "assets/svgs/icons/voted.svg"; import InfoCircle from "tsx:svgs/icons/info-circle.svg"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` - padding: calc(16px + (32 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("padding", 16, 32)} `; const InfoContainer = styled.div` @@ -26,7 +27,7 @@ const InfoContainer = styled.div` flex-direction: row; color: ${({ theme }) => theme.secondaryText}; align-items: center; - gap: calc(4px + (8 - 4) * ((100vw - 300px) / (1250 - 300))); + ${responsiveSize("gap", 4, 8, 300)} svg { min-width: 16px; diff --git a/web/src/pages/Cases/CaseDetails/index.tsx b/web/src/pages/Cases/CaseDetails/index.tsx index cb6b61a21..4cbbf9da8 100644 --- a/web/src/pages/Cases/CaseDetails/index.tsx +++ b/web/src/pages/Cases/CaseDetails/index.tsx @@ -10,6 +10,7 @@ import Overview from "./Overview"; import Tabs from "./Tabs"; import Timeline from "./Timeline"; import Voting from "./Voting"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div``; @@ -20,7 +21,7 @@ const StyledCard = styled(Card)` `; const Header = styled.h1` - margin-bottom: calc(16px + (48 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("marginBottom", 16, 48)} `; const CaseDetails: React.FC = () => { diff --git a/web/src/pages/Cases/index.tsx b/web/src/pages/Cases/index.tsx index 038358e62..7333bcfcb 100644 --- a/web/src/pages/Cases/index.tsx +++ b/web/src/pages/Cases/index.tsx @@ -3,13 +3,14 @@ import styled from "styled-components"; import { Routes, Route } from "react-router-dom"; import CaseDetails from "./CaseDetails"; import CasesFetcher from "./CasesFetcher"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` width: 100%; background-color: ${({ theme }) => theme.lightBackground}; - padding: calc(24px + (136 - 24) * (min(max(100vw, 375px), 1250px) - 375px) / 875); - padding-top: calc(32px + (80 - 32) * (min(max(100vw, 375px), 1250px) - 375px) / 875); - padding-bottom: calc(76px + (96 - 76) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("padding", 24, 136)} + ${responsiveSize("paddingTop", 32, 80)} + ${responsiveSize("paddingBottom", 76, 96)} max-width: 1780px; margin: 0 auto; `; diff --git a/web/src/pages/Courts/CourtDetails/index.tsx b/web/src/pages/Courts/CourtDetails/index.tsx index f7b3c34f8..cc46e385d 100644 --- a/web/src/pages/Courts/CourtDetails/index.tsx +++ b/web/src/pages/Courts/CourtDetails/index.tsx @@ -20,6 +20,7 @@ import StakePanel from "./StakePanel"; import HowItWorks from "components/HowItWorks"; import Staking from "components/Popup/MiniGuides/Staking"; import { usePnkFaucetWithdrewAlready, prepareWritePnkFaucet, usePnkBalanceOf } from "hooks/contracts/generated"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div``; @@ -59,10 +60,10 @@ const ButtonContainer = styled.div` `; const StyledCard = styled(Card)` - margin-top: calc(16px + (24 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("padding", 16, 32)} + ${responsiveSize("marginTop", 16, 24)} width: 100%; height: auto; - padding: calc(16px + (32 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); min-height: 100px; `; diff --git a/web/src/pages/Courts/index.tsx b/web/src/pages/Courts/index.tsx index 4461e2eff..c63d022a7 100644 --- a/web/src/pages/Courts/index.tsx +++ b/web/src/pages/Courts/index.tsx @@ -3,13 +3,15 @@ import styled from "styled-components"; import { Routes, Route, Navigate } from "react-router-dom"; import TopSearch from "./TopSearch"; import CourtDetails from "./CourtDetails"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` width: 100%; background-color: ${({ theme }) => theme.lightBackground}; - padding: calc(24px + (136 - 24) * (min(max(100vw, 375px), 1250px) - 375px) / 875); - padding-top: calc(32px + (80 - 32) * (min(max(100vw, 375px), 1250px) - 375px) / 875); - padding-bottom: calc(76px + (96 - 76) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("padding", 24, 136)} + ${responsiveSize("paddingTop", 32, 80)} + ${responsiveSize("paddingBottom", 76, 96)} + max-width: 1780px; margin: 0 auto; `; diff --git a/web/src/pages/Dashboard/Courts/Header.tsx b/web/src/pages/Dashboard/Courts/Header.tsx index 2c8902e2a..a09b5ea8b 100644 --- a/web/src/pages/Dashboard/Courts/Header.tsx +++ b/web/src/pages/Dashboard/Courts/Header.tsx @@ -4,6 +4,7 @@ import { landscapeStyle } from "styles/landscapeStyle"; import { formatUnits } from "viem"; import { isUndefined } from "utils/index"; import LockerIcon from "svgs/icons/locker.svg"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` display: flex; @@ -12,7 +13,7 @@ const Container = styled.div` gap: 12px; align-items: flex-start; justify-content: space-between; - margin-bottom: calc(32px + (48 - 32) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("marginBottom", 32, 48)} ${landscapeStyle( () => css` diff --git a/web/src/pages/Dashboard/JurorInfo/Header.tsx b/web/src/pages/Dashboard/JurorInfo/Header.tsx index 0e9942c88..beda43f69 100644 --- a/web/src/pages/Dashboard/JurorInfo/Header.tsx +++ b/web/src/pages/Dashboard/JurorInfo/Header.tsx @@ -5,12 +5,13 @@ import { useToggle } from "react-use"; import XIcon from "svgs/socialmedia/x.svg"; import HowItWorks from "components/HowItWorks"; import JurorLevels from "components/Popup/MiniGuides/JurorLevels"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` display: flex; flex-direction: column; justify-content: flex-start; - margin-bottom: calc(32px + (48 - 32) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("marginBottom", 32, 48)} gap: 12px; ${landscapeStyle( diff --git a/web/src/pages/Dashboard/JurorInfo/index.tsx b/web/src/pages/Dashboard/JurorInfo/index.tsx index 84eda39b9..746ba81f4 100644 --- a/web/src/pages/Dashboard/JurorInfo/index.tsx +++ b/web/src/pages/Dashboard/JurorInfo/index.tsx @@ -9,6 +9,7 @@ import PixelArt from "./PixelArt"; import { useAccount } from "wagmi"; import { useUserQuery } from "queries/useUser"; import { getUserLevelData } from "utils/userLevelCalculation"; +import { responsiveSize } from "styles/responsiveSize"; // import StakingRewards from "./StakingRewards"; const Container = styled.div``; @@ -27,7 +28,7 @@ const Card = styled(_Card)` ${landscapeStyle( () => css` flex-direction: row; - gap: calc(24px + (64 - 24) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("gap", 24, 64)} height: 236px; ` )} diff --git a/web/src/pages/Dashboard/index.tsx b/web/src/pages/Dashboard/index.tsx index ee8408029..1daa60677 100644 --- a/web/src/pages/Dashboard/index.tsx +++ b/web/src/pages/Dashboard/index.tsx @@ -11,13 +11,15 @@ import CasesDisplay from "components/CasesDisplay"; import ConnectWallet from "components/ConnectWallet"; import JurorInfo from "./JurorInfo"; import Courts from "./Courts"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` width: 100%; background-color: ${({ theme }) => theme.lightBackground}; - padding: calc(24px + (136 - 24) * (min(max(100vw, 375px), 1250px) - 375px) / 875); - padding-top: calc(32px + (80 - 32) * (min(max(100vw, 375px), 1250px) - 375px) / 875); - padding-bottom: calc(76px + (96 - 76) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("padding", 24, 136)} + ${responsiveSize("paddingTop", 32, 80)} + ${responsiveSize("paddingBottom", 76, 96)} + max-width: 1780px; margin: 0 auto; `; @@ -26,7 +28,7 @@ const StyledCasesDisplay = styled(CasesDisplay)` margin-top: 64px; h1 { - margin-bottom: calc(16px + (48 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("marginBottom", 16, 48)} } `; diff --git a/web/src/pages/Home/Community/index.tsx b/web/src/pages/Home/Community/index.tsx index 0fe20ba24..b9fd2ee4f 100644 --- a/web/src/pages/Home/Community/index.tsx +++ b/web/src/pages/Home/Community/index.tsx @@ -4,12 +4,13 @@ import { landscapeStyle } from "styles/landscapeStyle"; import { Card } from "@kleros/ui-components-library"; import { Element } from "./Element"; import { section } from "consts/community-elements"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` - margin-top: calc(44px + (64 - 44) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("marginTop", 44, 64)} h1 { - margin-bottom: calc(16px + (48 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("marginBottom", 16, 48)} } `; diff --git a/web/src/pages/Home/CourtOverview/Chart.tsx b/web/src/pages/Home/CourtOverview/Chart.tsx index 5e48f574c..6e29a65eb 100644 --- a/web/src/pages/Home/CourtOverview/Chart.tsx +++ b/web/src/pages/Home/CourtOverview/Chart.tsx @@ -5,9 +5,10 @@ import { DropdownSelect } from "@kleros/ui-components-library"; import { StyledSkeleton } from "components/StyledSkeleton"; import { formatUnits } from "viem"; import { useHomePageContext } from "hooks/useHomePageContext"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` - margin-bottom: calc(32px + (48 - 32) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("marginBottom", 32, 48)} display: flex; flex-direction: column; `; diff --git a/web/src/pages/Home/CourtOverview/Stats.tsx b/web/src/pages/Home/CourtOverview/Stats.tsx index 86c3df690..f7f9c6e85 100644 --- a/web/src/pages/Home/CourtOverview/Stats.tsx +++ b/web/src/pages/Home/CourtOverview/Stats.tsx @@ -15,13 +15,14 @@ import { calculateSubtextRender } from "utils/calculateSubtextRender"; import { CoinIds } from "consts/coingecko"; import { useHomePageContext, HomePageQuery, HomePageQueryDataPoints } from "hooks/useHomePageContext"; import { useCoinPrice } from "hooks/useCoinPrice"; +import { responsiveSize } from "styles/responsiveSize"; const StyledCard = styled(Card)` width: auto; height: fit-content; gap: 32px; - padding: calc(16px + (30 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); - padding-left: calc(16px + (35 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("padding", 16, 30)} + ${responsiveSize("paddingLeft", 16, 35)} padding-bottom: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); diff --git a/web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx b/web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx index 937686535..dcff93a05 100644 --- a/web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx +++ b/web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx @@ -6,6 +6,7 @@ import Rewards from "./Rewards"; import Coherency from "./Coherency"; import HowItWorks from "components/HowItWorks"; import JurorLevels from "components/Popup/MiniGuides/JurorLevels"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` display: none; @@ -24,7 +25,7 @@ const Container = styled.div` grid-template-columns: min-content repeat(3, calc(160px + (180 - 160) * (min(max(100vw, 900px), 1250px) - 900px) / 350)) auto; - column-gap: calc(12px + (28 - 12) * (min(max(100vw, 900px), 1250px) - 900px) / 350); + ${responsiveSize("columnGap", 12, 28, 900)} align-items: center; ` )} diff --git a/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx b/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx index cd8aa3ebc..d58c3f6a0 100644 --- a/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx +++ b/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx @@ -6,6 +6,7 @@ import JurorTitle from "./JurorTitle"; import Rewards from "./Rewards"; import Coherency from "./Coherency"; import JurorLevel from "./JurorLevel"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` display: none; @@ -22,7 +23,7 @@ const Container = styled.div` grid-template-columns: min-content repeat(3, calc(160px + (180 - 160) * (min(max(100vw, 900px), 1250px) - 900px) / 350)) auto; - column-gap: calc(12px + (28 - 12) * (min(max(100vw, 900px), 1250px) - 900px) / 350); + ${responsiveSize("columnGap", 12, 28, 900)} ` )} `; diff --git a/web/src/pages/Home/TopJurors/index.tsx b/web/src/pages/Home/TopJurors/index.tsx index c7b2fee4f..0251ac564 100644 --- a/web/src/pages/Home/TopJurors/index.tsx +++ b/web/src/pages/Home/TopJurors/index.tsx @@ -6,13 +6,14 @@ import JurorCard from "./JurorCard"; import { isUndefined } from "utils/index"; import { useTopUsersByCoherenceScore } from "queries/useTopUsersByCoherenceScore"; import { landscapeStyle } from "styles/landscapeStyle"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` - margin-top: calc(64px + (80 - 64) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("marginTop", 64, 80)} `; const Title = styled.h1` - margin-bottom: calc(16px + (48 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("marginBottom", 16, 48)} `; const ListContainer = styled.div` diff --git a/web/src/pages/Home/index.tsx b/web/src/pages/Home/index.tsx index 962e71467..23dbd78f3 100644 --- a/web/src/pages/Home/index.tsx +++ b/web/src/pages/Home/index.tsx @@ -7,13 +7,14 @@ import HeroImage from "./HeroImage"; import { HomePageProvider } from "hooks/useHomePageContext"; import { getOneYearAgoTimestamp } from "utils/date"; import TopJurors from "./TopJurors"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` width: 100%; background-color: ${({ theme }) => theme.lightBackground}; - padding: calc(24px + (132 - 24) * (min(max(100vw, 375px), 1250px) - 375px) / 875); - padding-top: calc(32px + (72 - 32) * (min(max(100vw, 375px), 1250px) - 375px) / 875); - padding-bottom: calc(76px + (96 - 76) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ${responsiveSize("padding", 24, 132)} + ${responsiveSize("paddingTop", 32, 72)} + ${responsiveSize("paddingBottom", 76, 96)} max-width: 1780px; margin: 0 auto; `; diff --git a/web/src/styles/responsiveSize.ts b/web/src/styles/responsiveSize.ts new file mode 100644 index 000000000..6b0a03fd9 --- /dev/null +++ b/web/src/styles/responsiveSize.ts @@ -0,0 +1,29 @@ +import { css, CSSProperties } from "styled-components"; + +//supported font types +type FontType = "px" | "rem" | "em" | "vw" | "vh" | "%" | "pt"; + +/** + * @description this func applies repsonsivenexx to a css property, the value will range from minSize to maxSize + * @param property the css property to apply responsive sizes too + * @param minSize the minimum value of the property + * @param maxSize max value of the property + * @param minScreen the min screen width at which the property will be at minSize + * @param maxScreen the max screen width at which the property will be at maxSize + * @param fontType + * @returns + * + */ +export const responsiveSize = ( + property: keyof CSSProperties, + minSize: number, + maxSize: number, + minScreen: number = 375, + maxScreen: number = 1250, + fontType: FontType = "px" +) => + css({ + [property]: `calc(${minSize}${fontType} + (${maxSize} - ${minSize}) * (min(max(100vw, ${minScreen}${fontType}), ${maxScreen}${fontType}) - ${minScreen}${fontType}) / (${ + maxScreen - minScreen + }))`, + }); From fcaf24936b416ec8b8bc565b1473c50dc5a507db Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Thu, 7 Dec 2023 11:44:19 +0530 Subject: [PATCH 07/77] feat(web): status-badge --- web/.env.devnet.public | 1 + web/.env.testnet.public | 1 + web/src/layout/Header/navbar/Menu/Help.tsx | 2 + .../layout/Header/navbar/Menu/StatusBadge.tsx | 44 +++++++++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 web/src/layout/Header/navbar/Menu/StatusBadge.tsx diff --git a/web/.env.devnet.public b/web/.env.devnet.public index acfd07542..d620fed23 100644 --- a/web/.env.devnet.public +++ b/web/.env.devnet.public @@ -2,3 +2,4 @@ export REACT_APP_DEPLOYMENT=devnet export REACT_APP_KLEROS_CORE_SUBGRAPH_DEVNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-core-devnet export REACT_APP_DISPUTE_TEMPLATE_ARBGOERLI_SUBGRAPH_DEVNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-dr-devnet +export REACT_APP_DEVNET_STATUS_URL=https://kleros-v2-devnet.betteruptime.com/badge \ No newline at end of file diff --git a/web/.env.testnet.public b/web/.env.testnet.public index 813f673d9..7b08b59a4 100644 --- a/web/.env.testnet.public +++ b/web/.env.testnet.public @@ -2,3 +2,4 @@ export REACT_APP_DEPLOYMENT=testnet export REACT_APP_KLEROS_CORE_SUBGRAPH_TESTNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-core-testnet-2 export REACT_APP_DISPUTE_TEMPLATE_ARBGOERLI_SUBGRAPH_TESTNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-dr-testnet-2 +export REACT_APP_TESTNET_STATUS_URL=https://kleros-v2.betteruptime.com/badge \ No newline at end of file diff --git a/web/src/layout/Header/navbar/Menu/Help.tsx b/web/src/layout/Header/navbar/Menu/Help.tsx index 93a9445c2..277b04932 100644 --- a/web/src/layout/Header/navbar/Menu/Help.tsx +++ b/web/src/layout/Header/navbar/Menu/Help.tsx @@ -12,6 +12,7 @@ import Telegram from "svgs/socialmedia/telegram.svg"; import { IHelp } from ".."; import Debug from "../Debug"; import Onboarding from "components/Popup/MiniGuides/Onboarding"; +import { StatusBadge } from "./StatusBadge"; const Container = styled.div` display: flex; @@ -122,6 +123,7 @@ const Help: React.FC = ({ toggleIsHelpOpen }) => { {item.text} ))} + {isOnboardingMiniGuidesOpen && } diff --git a/web/src/layout/Header/navbar/Menu/StatusBadge.tsx b/web/src/layout/Header/navbar/Menu/StatusBadge.tsx new file mode 100644 index 000000000..e51daa2c1 --- /dev/null +++ b/web/src/layout/Header/navbar/Menu/StatusBadge.tsx @@ -0,0 +1,44 @@ +import React, { useMemo } from "react"; +import styled from "styled-components"; +import { useToggleTheme } from "hooks/useToggleThemeContext"; + +const Container = styled.div` + padding: 0px 3px; + max-width: 220px; +`; + +const StyledIframe = styled.iframe` + border: none; + width: 100%; + height: 30px; + background-color: ${({ theme }) => theme.mediumPurple}; + border-radius: 300px; +`; + +export const StatusBadge: React.FC = () => { + const [theme] = useToggleTheme(); + + const deployment = process.env.REACT_APP_DEPLOYMENT ?? "testnet"; + + let statusUrl: string; + + switch (deployment) { + case "devnet": + statusUrl = process.env.REACT_APP_DEVNET_STATUS_URL!; + break; + case "testnet": + statusUrl = process.env.REACT_APP_TESTNET_STATUS_URL!; + break; + default: + statusUrl = process.env.REACT_APP_TESTNET_STATUS_URL!; + } + + //update url on theme toggle + statusUrl = useMemo(() => (theme == "light" ? statusUrl + "?theme=light" : statusUrl + "?theme=dark"), [theme]); + + return ( + + + + ); +}; From b95079c0db86a9cf1a84036efeff5ba3d84e44d6 Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Thu, 7 Dec 2023 11:52:59 +0530 Subject: [PATCH 08/77] fix(web): fix-code-smells-status-badge --- web/src/layout/Header/navbar/Menu/StatusBadge.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/layout/Header/navbar/Menu/StatusBadge.tsx b/web/src/layout/Header/navbar/Menu/StatusBadge.tsx index e51daa2c1..829086cdb 100644 --- a/web/src/layout/Header/navbar/Menu/StatusBadge.tsx +++ b/web/src/layout/Header/navbar/Menu/StatusBadge.tsx @@ -33,8 +33,8 @@ export const StatusBadge: React.FC = () => { statusUrl = process.env.REACT_APP_TESTNET_STATUS_URL!; } - //update url on theme toggle - statusUrl = useMemo(() => (theme == "light" ? statusUrl + "?theme=light" : statusUrl + "?theme=dark"), [theme]); + // update url on theme toggle + statusUrl = useMemo(() => (theme === "light" ? statusUrl + "?theme=light" : statusUrl + "?theme=dark"), [theme]); return ( From b82ac6180b0b2095c6e32b4abd4cb70830abedeb Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Thu, 7 Dec 2023 16:31:41 +0000 Subject: [PATCH 09/77] refactor: moved to Debug component, simpler env variables --- web/.env.devnet.public | 2 +- web/.env.testnet.public | 2 +- web/src/layout/Header/navbar/Debug.tsx | 33 +++++++++----- web/src/layout/Header/navbar/Menu/Help.tsx | 2 - .../layout/Header/navbar/Menu/StatusBadge.tsx | 44 ------------------- 5 files changed, 24 insertions(+), 59 deletions(-) delete mode 100644 web/src/layout/Header/navbar/Menu/StatusBadge.tsx diff --git a/web/.env.devnet.public b/web/.env.devnet.public index d620fed23..1e24ba5bb 100644 --- a/web/.env.devnet.public +++ b/web/.env.devnet.public @@ -2,4 +2,4 @@ export REACT_APP_DEPLOYMENT=devnet export REACT_APP_KLEROS_CORE_SUBGRAPH_DEVNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-core-devnet export REACT_APP_DISPUTE_TEMPLATE_ARBGOERLI_SUBGRAPH_DEVNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-dr-devnet -export REACT_APP_DEVNET_STATUS_URL=https://kleros-v2-devnet.betteruptime.com/badge \ No newline at end of file +export REACT_APP_STATUS_URL=https://kleros-v2-devnet.betteruptime.com/badge \ No newline at end of file diff --git a/web/.env.testnet.public b/web/.env.testnet.public index 7b08b59a4..a88ef5904 100644 --- a/web/.env.testnet.public +++ b/web/.env.testnet.public @@ -2,4 +2,4 @@ export REACT_APP_DEPLOYMENT=testnet export REACT_APP_KLEROS_CORE_SUBGRAPH_TESTNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-core-testnet-2 export REACT_APP_DISPUTE_TEMPLATE_ARBGOERLI_SUBGRAPH_TESTNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-dr-testnet-2 -export REACT_APP_TESTNET_STATUS_URL=https://kleros-v2.betteruptime.com/badge \ No newline at end of file +export REACT_APP_STATUS_URL=https://kleros-v2.betteruptime.com/badge \ No newline at end of file diff --git a/web/src/layout/Header/navbar/Debug.tsx b/web/src/layout/Header/navbar/Debug.tsx index a8333db56..7c1f0ec87 100644 --- a/web/src/layout/Header/navbar/Debug.tsx +++ b/web/src/layout/Header/navbar/Debug.tsx @@ -1,9 +1,14 @@ -import React from "react"; +import React, { useMemo } from "react"; import styled from "styled-components"; import { useSortitionModulePhase } from "hooks/contracts/generated"; +import { useToggleTheme } from "hooks/useToggleThemeContext"; import { GIT_BRANCH, GIT_DIRTY, GIT_HASH, GIT_TAGS, GIT_URL, RELEASE_VERSION } from "consts/index"; const Container = styled.div` + display: flex; + flex-direction: column; + gap: 12px; + label, a { font-family: "Roboto Mono", monospace; @@ -13,6 +18,13 @@ const Container = styled.div` } `; +const StyledIframe = styled.iframe` + border: none; + width: 100%; + height: 30px; + border-radius: 300px; +`; + const Version = () => ( ); +const ServicesStatus = () => { + const [theme] = useToggleTheme(); + const statusUrlParameters = useMemo(() => (theme === "light" ? "?theme=light" : "?theme=dark"), [theme]); + const statusUrl = process.env.REACT_APP_STATUS_URL; + return ; +}; + enum Phases { staking, generating, @@ -35,21 +54,13 @@ const Phase = () => { const { data: phase } = useSortitionModulePhase({ watch: true, }); - return ( - <> - {phase !== undefined && ( - - )} - - ); + return <>{phase !== undefined && }; }; const Debug: React.FC = () => { return ( + diff --git a/web/src/layout/Header/navbar/Menu/Help.tsx b/web/src/layout/Header/navbar/Menu/Help.tsx index 277b04932..93a9445c2 100644 --- a/web/src/layout/Header/navbar/Menu/Help.tsx +++ b/web/src/layout/Header/navbar/Menu/Help.tsx @@ -12,7 +12,6 @@ import Telegram from "svgs/socialmedia/telegram.svg"; import { IHelp } from ".."; import Debug from "../Debug"; import Onboarding from "components/Popup/MiniGuides/Onboarding"; -import { StatusBadge } from "./StatusBadge"; const Container = styled.div` display: flex; @@ -123,7 +122,6 @@ const Help: React.FC = ({ toggleIsHelpOpen }) => { {item.text} ))} - {isOnboardingMiniGuidesOpen && } diff --git a/web/src/layout/Header/navbar/Menu/StatusBadge.tsx b/web/src/layout/Header/navbar/Menu/StatusBadge.tsx deleted file mode 100644 index 829086cdb..000000000 --- a/web/src/layout/Header/navbar/Menu/StatusBadge.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import React, { useMemo } from "react"; -import styled from "styled-components"; -import { useToggleTheme } from "hooks/useToggleThemeContext"; - -const Container = styled.div` - padding: 0px 3px; - max-width: 220px; -`; - -const StyledIframe = styled.iframe` - border: none; - width: 100%; - height: 30px; - background-color: ${({ theme }) => theme.mediumPurple}; - border-radius: 300px; -`; - -export const StatusBadge: React.FC = () => { - const [theme] = useToggleTheme(); - - const deployment = process.env.REACT_APP_DEPLOYMENT ?? "testnet"; - - let statusUrl: string; - - switch (deployment) { - case "devnet": - statusUrl = process.env.REACT_APP_DEVNET_STATUS_URL!; - break; - case "testnet": - statusUrl = process.env.REACT_APP_TESTNET_STATUS_URL!; - break; - default: - statusUrl = process.env.REACT_APP_TESTNET_STATUS_URL!; - } - - // update url on theme toggle - statusUrl = useMemo(() => (theme === "light" ? statusUrl + "?theme=light" : statusUrl + "?theme=dark"), [theme]); - - return ( - - - - ); -}; From 68faef8ef5a6c20ef34c62819ee04c5cbec7c0f1 Mon Sep 17 00:00:00 2001 From: unknownunknown1 Date: Thu, 16 Nov 2023 02:44:02 +1000 Subject: [PATCH 10/77] feat(Escrow): add contract --- .../src/arbitration/arbitrables/Escrow.sol | 407 ++++++++++++++++++ 1 file changed, 407 insertions(+) create mode 100644 contracts/src/arbitration/arbitrables/Escrow.sol diff --git a/contracts/src/arbitration/arbitrables/Escrow.sol b/contracts/src/arbitration/arbitrables/Escrow.sol new file mode 100644 index 000000000..11585fc39 --- /dev/null +++ b/contracts/src/arbitration/arbitrables/Escrow.sol @@ -0,0 +1,407 @@ +// SPDX-License-Identifier: MIT + +/** + * @authors: [@unknownunknown1, @fnanni-0, @shalzz] + * @reviewers: [] + * @auditors: [] + * @bounties: [] + */ + +pragma solidity 0.8.18; + +import {IArbitrableV2, IArbitratorV2} from "../interfaces/IArbitrableV2.sol"; +import "../interfaces/IDisputeTemplateRegistry.sol"; + +/** + * @title Escrow + * @dev MultipleArbitrableTransaction contract that is compatible with V2. + * https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTransaction.sol + */ +contract Escrow is IArbitrableV2 { + // **************************** // + // * Contract variables * // + // **************************** // + + uint256 public constant AMOUNT_OF_CHOICES = 2; + + enum Party { + None, + Sender, + Receiver + } + + enum Status { + NoDispute, + WaitingSender, + WaitingReceiver, + DisputeCreated, + Resolved + } + + enum Resolution { + TransactionExecuted, + TimeoutBySender, + TimeoutByReceiver, + RulingEnforced + } + + struct Transaction { + address payable sender; + address payable receiver; + uint256 amount; + uint256 deadline; // Timestamp at which the transaction can be automatically executed if not disputed. + uint256 disputeID; // If dispute exists, the ID of the dispute. + uint256 senderFee; // Total fees paid by the sender. + uint256 receiverFee; // Total fees paid by the receiver. + uint256 lastInteraction; // Last interaction for the dispute procedure. + string templateData; + string templateDataMappings; + Status status; + } + + address public immutable governor; + IArbitratorV2 public arbitrator; // Address of the arbitrator contract. TRUSTED. + bytes public arbitratorExtraData; // Extra data to set up the arbitration. + IDisputeTemplateRegistry public templateRegistry; // The dispute template registry. + + uint256 public immutable feeTimeout; // Time in seconds a party can take to pay arbitration fees before being considered unresponsive and lose the dispute. + /// @dev List of all created transactions. + Transaction[] public transactions; + + mapping(uint256 => uint256) public disputeIDtoTransactionID; // Naps dispute ID to tx ID. + + // **************************** // + // * Events * // + // **************************** // + + /** @dev To be emitted when a party pays or reimburses the other. + * @param _transactionID The index of the transaction. + * @param _amount The amount paid. + * @param _party The party that paid. + */ + event Payment(uint256 indexed _transactionID, uint256 _amount, address _party); + + /** @dev Indicate that a party has to pay a fee or would otherwise be considered as losing. + * @param _transactionID The index of the transaction. + * @param _party The party who has to pay. + */ + event HasToPayFee(uint256 indexed _transactionID, Party _party); + + /** @dev Emitted when a transaction is created. + * @param _transactionID The index of the transaction. + * @param _sender The address of the sender. + * @param _receiver The address of the receiver. + * @param _amount The initial amount in the transaction. + */ + event TransactionCreated( + uint256 indexed _transactionID, + address indexed _sender, + address indexed _receiver, + uint256 _amount + ); + + /** @dev To be emitted when a transaction is resolved, either by its + * execution, a timeout or because a ruling was enforced. + * @param _transactionID The ID of the respective transaction. + * @param _resolution Short description of what caused the transaction to be solved. + */ + event TransactionResolved(uint256 indexed _transactionID, Resolution indexed _resolution); + + modifier onlyByGovernor() { + require(address(this) == msg.sender, "Only the governor allowed."); + _; + } + + /** @dev Constructor. + * @param _arbitrator The arbitrator of the contract. + * @param _arbitratorExtraData Extra data for the arbitrator. + * @param _templateRegistry The dispute template registry. + * @param _feeTimeout Arbitration fee timeout for the parties. + */ + constructor( + IArbitratorV2 _arbitrator, + bytes memory _arbitratorExtraData, + IDisputeTemplateRegistry _templateRegistry, + uint256 _feeTimeout + ) { + governor = msg.sender; + arbitrator = _arbitrator; + arbitratorExtraData = _arbitratorExtraData; + templateRegistry = _templateRegistry; + feeTimeout = _feeTimeout; + } + + // ************************************* // + // * Governance * // + // ************************************* // + + function changeArbitrator(IArbitratorV2 _arbitrator) external onlyByGovernor { + arbitrator = _arbitrator; + } + + function changeArbitratorExtraData(bytes calldata _arbitratorExtraData) external onlyByGovernor { + arbitratorExtraData = _arbitratorExtraData; + } + + function changeTemplateRegistry(IDisputeTemplateRegistry _templateRegistry) external onlyByGovernor { + templateRegistry = _templateRegistry; + } + + /** @dev Create a transaction. + * @param _timeoutPayment Time after which a party can automatically execute the arbitrable transaction. + * @param _receiver The recipient of the transaction. + * @param _templateData The dispute template data. + * @param _templateDataMappings The dispute template data mappings. + * @return transactionID The index of the transaction. + */ + function createTransaction( + uint256 _timeoutPayment, + address payable _receiver, + string memory _templateData, + string memory _templateDataMappings + ) external payable returns (uint256 transactionID) { + Transaction storage transaction = transactions.push(); + transaction.sender = payable(msg.sender); + transaction.receiver = _receiver; + transaction.amount = msg.value; + transaction.deadline = block.timestamp + _timeoutPayment; + transaction.templateData = _templateData; + transaction.templateDataMappings = _templateDataMappings; + + transactionID = transactions.length - 1; + + emit TransactionCreated(transactionID, msg.sender, _receiver, msg.value); + } + + /** @dev Pay receiver. To be called if the good or service is provided. + * @param _transactionID The index of the transaction. + * @param _amount Amount to pay in wei. + */ + function pay(uint256 _transactionID, uint256 _amount) external { + Transaction storage transaction = transactions[_transactionID]; + require(transaction.sender == msg.sender, "The caller must be the sender."); + require(transaction.status == Status.NoDispute, "The transaction must not be disputed."); + require(_amount <= transaction.amount, "Maximum amount available for payment exceeded."); + + transaction.receiver.send(_amount); // It is the user responsibility to accept ETH. + transaction.amount -= _amount; + + emit Payment(_transactionID, _amount, msg.sender); + } + + /** @dev Reimburse sender. To be called if the good or service can't be fully provided. + * @param _transactionID The index of the transaction. + * @param _amountReimbursed Amount to reimburse in wei. + */ + function reimburse(uint256 _transactionID, uint256 _amountReimbursed) external { + Transaction storage transaction = transactions[_transactionID]; + require(transaction.receiver == msg.sender, "The caller must be the receiver."); + require(transaction.status == Status.NoDispute, "The transaction must not be disputed."); + require(_amountReimbursed <= transaction.amount, "Maximum reimbursement available exceeded."); + + transaction.sender.send(_amountReimbursed); // It is the user responsibility to accept ETH. + transaction.amount -= _amountReimbursed; + + emit Payment(_transactionID, _amountReimbursed, msg.sender); + } + + /** @dev Transfer the transaction's amount to the receiver if the timeout has passed. + * @param _transactionID The index of the transaction. + */ + function executeTransaction(uint256 _transactionID) external { + Transaction storage transaction = transactions[_transactionID]; + require(block.timestamp >= transaction.deadline, "Deadline not passed."); + require(transaction.status == Status.NoDispute, "The transaction must not be disputed."); + + transaction.receiver.send(transaction.amount); // It is the user responsibility to accept ETH. + transaction.amount = 0; + + transaction.status = Status.Resolved; + + emit TransactionResolved(_transactionID, Resolution.TransactionExecuted); + } + + /** @dev Pay the arbitration fee to raise a dispute. To be called by the sender. UNTRUSTED. + * Note that the arbitrator can have createDispute throw, which will make + * this function throw and therefore lead to a party being timed-out. + * This is not a vulnerability as the arbitrator can rule in favor of one party anyway. + * @param _transactionID The index of the transaction. + */ + function payArbitrationFeeBySender(uint256 _transactionID) external payable { + Transaction storage transaction = transactions[_transactionID]; + require( + transaction.status < Status.DisputeCreated, + "Dispute has already been created or because the transaction has been executed." + ); + require(msg.sender == transaction.sender, "The caller must be the sender."); + + uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData); + transaction.senderFee += msg.value; + // Require that the total paid to be at least the arbitration cost. + require(transaction.senderFee >= arbitrationCost, "The sender fee must cover arbitration costs."); + + transaction.lastInteraction = block.timestamp; + + // The receiver still has to pay. This can also happen if he has paid, + // but arbitrationCost has increased. + if (transaction.receiverFee < arbitrationCost) { + transaction.status = Status.WaitingReceiver; + emit HasToPayFee(_transactionID, Party.Receiver); + } else { + // The receiver has also paid the fee. We create the dispute. + raiseDispute(_transactionID, arbitrationCost); + } + } + + /** @dev Pay the arbitration fee to raise a dispute. To be called by the receiver. UNTRUSTED. + * Note that this function mirrors payArbitrationFeeBySender. + * @param _transactionID The index of the transaction. + */ + function payArbitrationFeeByReceiver(uint256 _transactionID) external payable { + Transaction storage transaction = transactions[_transactionID]; + require( + transaction.status < Status.DisputeCreated, + "Dispute has already been created or because the transaction has been executed." + ); + require(msg.sender == transaction.receiver, "The caller must be the receiver."); + + uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData); + transaction.receiverFee += msg.value; + // Require that the total paid to be at least the arbitration cost. + require(transaction.receiverFee >= arbitrationCost, "The receiver fee must cover arbitration costs."); + + transaction.lastInteraction = block.timestamp; + // The sender still has to pay. This can also happen if he has paid, + // but arbitrationCost has increased. + if (transaction.senderFee < arbitrationCost) { + transaction.status = Status.WaitingSender; + emit HasToPayFee(_transactionID, Party.Sender); + } else { + // The sender has also paid the fee. We create the dispute. + raiseDispute(_transactionID, arbitrationCost); + } + } + + /** @dev Reimburse sender if receiver fails to pay the fee. + * @param _transactionID The index of the transaction. + */ + function timeOutBySender(uint256 _transactionID) external { + Transaction storage transaction = transactions[_transactionID]; + require(transaction.status == Status.WaitingReceiver, "The transaction is not waiting on the receiver."); + require(block.timestamp - transaction.lastInteraction >= feeTimeout, "Timeout time has not passed yet."); + + if (transaction.receiverFee != 0) { + transaction.receiver.send(transaction.receiverFee); // It is the user responsibility to accept ETH. + transaction.receiverFee = 0; + } + executeRuling(_transactionID, uint256(Party.Sender)); + emit TransactionResolved(_transactionID, Resolution.TimeoutBySender); + } + + /** @dev Pay receiver if sender fails to pay the fee. + * @param _transactionID The index of the transaction. + */ + function timeOutByReceiver(uint256 _transactionID) external { + Transaction storage transaction = transactions[_transactionID]; + require(transaction.status == Status.WaitingSender, "The transaction is not waiting on the sender."); + require(block.timestamp - transaction.lastInteraction >= feeTimeout, "Timeout time has not passed yet."); + + if (transaction.senderFee != 0) { + transaction.sender.send(transaction.senderFee); // It is the user responsibility to accept ETH. + transaction.senderFee = 0; + } + + executeRuling(_transactionID, uint256(Party.Receiver)); + emit TransactionResolved(_transactionID, Resolution.TimeoutByReceiver); + } + + /** @dev Create a dispute. UNTRUSTED. + * @param _transactionID The index of the transaction. + * @param _arbitrationCost Amount to pay the arbitrator. + */ + function raiseDispute(uint256 _transactionID, uint256 _arbitrationCost) internal { + Transaction storage transaction = transactions[_transactionID]; + transaction.status = Status.DisputeCreated; + transaction.disputeID = arbitrator.createDispute{value: _arbitrationCost}( + AMOUNT_OF_CHOICES, + arbitratorExtraData + ); + disputeIDtoTransactionID[transaction.disputeID] = _transactionID; + uint256 templateId = templateRegistry.setDisputeTemplate( + "", + transaction.templateData, + transaction.templateDataMappings + ); + emit DisputeRequest(arbitrator, transaction.disputeID, _transactionID, templateId, ""); + + // Refund sender if he overpaid. + if (transaction.senderFee > _arbitrationCost) { + uint256 extraFeeSender = transaction.senderFee - _arbitrationCost; + transaction.senderFee = _arbitrationCost; + transaction.sender.send(extraFeeSender); // It is the user responsibility to accept ETH. + } + + // Refund receiver if he overpaid. + if (transaction.receiverFee > _arbitrationCost) { + uint256 extraFeeReceiver = transaction.receiverFee - _arbitrationCost; + transaction.receiverFee = _arbitrationCost; + transaction.receiver.send(extraFeeReceiver); // It is the user responsibility to accept ETH. + } + } + + /** @dev Give a ruling for a dispute. Must be called by the arbitrator to + * enforce the final ruling. The purpose of this function is to ensure that + * the address calling it has the right to rule on the contract. + * @param _disputeID ID of the dispute in the Arbitrator contract. + * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved + * for "Refuse to arbitrate". + */ + function rule(uint256 _disputeID, uint256 _ruling) external override { + require(msg.sender == address(arbitrator), "The caller must be the arbitrator."); + require(_ruling <= AMOUNT_OF_CHOICES, "Invalid ruling."); + uint256 transactionID = disputeIDtoTransactionID[_disputeID]; + Transaction storage transaction = transactions[transactionID]; + + require(transaction.status == Status.DisputeCreated, "The dispute has already been resolved."); + + emit Ruling(arbitrator, _disputeID, _ruling); + executeRuling(transactionID, _ruling); + } + + /** @dev Execute a ruling of a dispute. It reimburses the fee to the winning party. + * @param _transactionID The index of the transaction. + * @param _ruling Ruling given by the arbitrator. 1 : Reimburse the receiver. 2 : Pay the sender. + */ + function executeRuling(uint256 _transactionID, uint256 _ruling) internal { + Transaction storage transaction = transactions[_transactionID]; + // Give the arbitration fee back. + // Note that we use send to prevent a party from blocking the execution. + if (_ruling == uint256(Party.Sender)) { + transaction.sender.send(transaction.senderFee + transaction.amount); + } else if (_ruling == uint256(Party.Receiver)) { + transaction.receiver.send(transaction.receiverFee + transaction.amount); + } else { + uint256 splitAmount = (transaction.senderFee + transaction.amount) / 2; + transaction.sender.send(splitAmount); + transaction.receiver.send(splitAmount); + } + + transaction.amount = 0; + transaction.senderFee = 0; + transaction.receiverFee = 0; + transaction.status = Status.Resolved; + + emit TransactionResolved(_transactionID, Resolution.RulingEnforced); + } + + // **************************** // + // * Constant getters * // + // **************************** // + + /** @dev Getter to know the count of transactions. + * @return The count of transactions. + */ + function getCountTransactions() external view returns (uint256) { + return transactions.length; + } +} From 56bb341e645a9db9d0c5dafc5fbb7be1e2a24e4e Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Thu, 7 Dec 2023 11:48:31 +0000 Subject: [PATCH 11/77] fix: style --- .../src/arbitration/arbitrables/Escrow.sol | 200 +++++++++--------- 1 file changed, 95 insertions(+), 105 deletions(-) diff --git a/contracts/src/arbitration/arbitrables/Escrow.sol b/contracts/src/arbitration/arbitrables/Escrow.sol index 11585fc39..c96b11b9e 100644 --- a/contracts/src/arbitration/arbitrables/Escrow.sol +++ b/contracts/src/arbitration/arbitrables/Escrow.sol @@ -1,28 +1,22 @@ // SPDX-License-Identifier: MIT -/** - * @authors: [@unknownunknown1, @fnanni-0, @shalzz] - * @reviewers: [] - * @auditors: [] - * @bounties: [] - */ +/// @authors: [@unknownunknown1, @fnanni-0, @shalzz] +/// @reviewers: [] +/// @auditors: [] +/// @bounties: [] pragma solidity 0.8.18; import {IArbitrableV2, IArbitratorV2} from "../interfaces/IArbitrableV2.sol"; import "../interfaces/IDisputeTemplateRegistry.sol"; -/** - * @title Escrow - * @dev MultipleArbitrableTransaction contract that is compatible with V2. - * https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTransaction.sol - */ +/// @title Escrow +/// @dev MultipleArbitrableTransaction contract that is compatible with V2. +/// Adapted from https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTransaction.sol contract Escrow is IArbitrableV2 { - // **************************** // - // * Contract variables * // - // **************************** // - - uint256 public constant AMOUNT_OF_CHOICES = 2; + // ************************************* // + // * Enums / Structs * // + // ************************************* // enum Party { None, @@ -59,40 +53,39 @@ contract Escrow is IArbitrableV2 { Status status; } + // ************************************* // + // * Storage * // + // ************************************* // + + uint256 public constant AMOUNT_OF_CHOICES = 2; address public immutable governor; - IArbitratorV2 public arbitrator; // Address of the arbitrator contract. TRUSTED. + IArbitratorV2 public arbitrator; // Address of the arbitrator contract. bytes public arbitratorExtraData; // Extra data to set up the arbitration. IDisputeTemplateRegistry public templateRegistry; // The dispute template registry. - uint256 public immutable feeTimeout; // Time in seconds a party can take to pay arbitration fees before being considered unresponsive and lose the dispute. - /// @dev List of all created transactions. - Transaction[] public transactions; - + Transaction[] public transactions; // List of all created transactions. mapping(uint256 => uint256) public disputeIDtoTransactionID; // Naps dispute ID to tx ID. - // **************************** // - // * Events * // - // **************************** // + // ************************************* // + // * Events * // + // ************************************* // - /** @dev To be emitted when a party pays or reimburses the other. - * @param _transactionID The index of the transaction. - * @param _amount The amount paid. - * @param _party The party that paid. - */ + /// @dev To be emitted when a party pays or reimburses the other. + /// @param _transactionID The index of the transaction. + /// @param _amount The amount paid. + /// @param _party The party that paid. event Payment(uint256 indexed _transactionID, uint256 _amount, address _party); - /** @dev Indicate that a party has to pay a fee or would otherwise be considered as losing. - * @param _transactionID The index of the transaction. - * @param _party The party who has to pay. - */ + /// @dev Indicate that a party has to pay a fee or would otherwise be considered as losing. + /// @param _transactionID The index of the transaction. + /// @param _party The party who has to pay. event HasToPayFee(uint256 indexed _transactionID, Party _party); - /** @dev Emitted when a transaction is created. - * @param _transactionID The index of the transaction. - * @param _sender The address of the sender. - * @param _receiver The address of the receiver. - * @param _amount The initial amount in the transaction. - */ + /// @dev Emitted when a transaction is created. + /// @param _transactionID The index of the transaction. + /// @param _sender The address of the sender. + /// @param _receiver The address of the receiver. + /// @param _amount The initial amount in the transaction. event TransactionCreated( uint256 indexed _transactionID, address indexed _sender, @@ -100,24 +93,30 @@ contract Escrow is IArbitrableV2 { uint256 _amount ); - /** @dev To be emitted when a transaction is resolved, either by its - * execution, a timeout or because a ruling was enforced. - * @param _transactionID The ID of the respective transaction. - * @param _resolution Short description of what caused the transaction to be solved. - */ + /// @dev To be emitted when a transaction is resolved, either by its + /// execution, a timeout or because a ruling was enforced. + /// @param _transactionID The ID of the respective transaction. + /// @param _resolution Short description of what caused the transaction to be solved. event TransactionResolved(uint256 indexed _transactionID, Resolution indexed _resolution); + // ************************************* // + // * Function Modifiers * // + // ************************************* // + modifier onlyByGovernor() { require(address(this) == msg.sender, "Only the governor allowed."); _; } - /** @dev Constructor. - * @param _arbitrator The arbitrator of the contract. - * @param _arbitratorExtraData Extra data for the arbitrator. - * @param _templateRegistry The dispute template registry. - * @param _feeTimeout Arbitration fee timeout for the parties. - */ + // ************************************* // + // * Constructor * // + // ************************************* // + + /// @dev Constructor. + /// @param _arbitrator The arbitrator of the contract. + /// @param _arbitratorExtraData Extra data for the arbitrator. + /// @param _templateRegistry The dispute template registry. + /// @param _feeTimeout Arbitration fee timeout for the parties. constructor( IArbitratorV2 _arbitrator, bytes memory _arbitratorExtraData, @@ -147,13 +146,16 @@ contract Escrow is IArbitrableV2 { templateRegistry = _templateRegistry; } - /** @dev Create a transaction. - * @param _timeoutPayment Time after which a party can automatically execute the arbitrable transaction. - * @param _receiver The recipient of the transaction. - * @param _templateData The dispute template data. - * @param _templateDataMappings The dispute template data mappings. - * @return transactionID The index of the transaction. - */ + // ************************************* // + // * State Modifiers * // + // ************************************* // + + /// @dev Create a transaction. + /// @param _timeoutPayment Time after which a party can automatically execute the arbitrable transaction. + /// @param _receiver The recipient of the transaction. + /// @param _templateData The dispute template data. + /// @param _templateDataMappings The dispute template data mappings. + /// @return transactionID The index of the transaction. function createTransaction( uint256 _timeoutPayment, address payable _receiver, @@ -173,10 +175,9 @@ contract Escrow is IArbitrableV2 { emit TransactionCreated(transactionID, msg.sender, _receiver, msg.value); } - /** @dev Pay receiver. To be called if the good or service is provided. - * @param _transactionID The index of the transaction. - * @param _amount Amount to pay in wei. - */ + /// @dev Pay receiver. To be called if the good or service is provided. + /// @param _transactionID The index of the transaction. + /// @param _amount Amount to pay in wei. function pay(uint256 _transactionID, uint256 _amount) external { Transaction storage transaction = transactions[_transactionID]; require(transaction.sender == msg.sender, "The caller must be the sender."); @@ -189,10 +190,9 @@ contract Escrow is IArbitrableV2 { emit Payment(_transactionID, _amount, msg.sender); } - /** @dev Reimburse sender. To be called if the good or service can't be fully provided. - * @param _transactionID The index of the transaction. - * @param _amountReimbursed Amount to reimburse in wei. - */ + /// @dev Reimburse sender. To be called if the good or service can't be fully provided. + /// @param _transactionID The index of the transaction. + /// @param _amountReimbursed Amount to reimburse in wei. function reimburse(uint256 _transactionID, uint256 _amountReimbursed) external { Transaction storage transaction = transactions[_transactionID]; require(transaction.receiver == msg.sender, "The caller must be the receiver."); @@ -205,9 +205,8 @@ contract Escrow is IArbitrableV2 { emit Payment(_transactionID, _amountReimbursed, msg.sender); } - /** @dev Transfer the transaction's amount to the receiver if the timeout has passed. - * @param _transactionID The index of the transaction. - */ + /// @dev Transfer the transaction's amount to the receiver if the timeout has passed. + /// @param _transactionID The index of the transaction. function executeTransaction(uint256 _transactionID) external { Transaction storage transaction = transactions[_transactionID]; require(block.timestamp >= transaction.deadline, "Deadline not passed."); @@ -221,12 +220,11 @@ contract Escrow is IArbitrableV2 { emit TransactionResolved(_transactionID, Resolution.TransactionExecuted); } - /** @dev Pay the arbitration fee to raise a dispute. To be called by the sender. UNTRUSTED. - * Note that the arbitrator can have createDispute throw, which will make - * this function throw and therefore lead to a party being timed-out. - * This is not a vulnerability as the arbitrator can rule in favor of one party anyway. - * @param _transactionID The index of the transaction. - */ + /// @dev Pay the arbitration fee to raise a dispute. To be called by the sender. + /// Note that the arbitrator can have createDispute throw, which will make + /// this function throw and therefore lead to a party being timed-out. + /// This is not a vulnerability as the arbitrator can rule in favor of one party anyway. + /// @param _transactionID The index of the transaction. function payArbitrationFeeBySender(uint256 _transactionID) external payable { Transaction storage transaction = transactions[_transactionID]; require( @@ -253,10 +251,9 @@ contract Escrow is IArbitrableV2 { } } - /** @dev Pay the arbitration fee to raise a dispute. To be called by the receiver. UNTRUSTED. - * Note that this function mirrors payArbitrationFeeBySender. - * @param _transactionID The index of the transaction. - */ + /// @dev Pay the arbitration fee to raise a dispute. To be called by the receiver. + /// Note that this function mirrors payArbitrationFeeBySender. + /// @param _transactionID The index of the transaction. function payArbitrationFeeByReceiver(uint256 _transactionID) external payable { Transaction storage transaction = transactions[_transactionID]; require( @@ -282,9 +279,8 @@ contract Escrow is IArbitrableV2 { } } - /** @dev Reimburse sender if receiver fails to pay the fee. - * @param _transactionID The index of the transaction. - */ + /// @dev Reimburse sender if receiver fails to pay the fee. + /// @param _transactionID The index of the transaction. function timeOutBySender(uint256 _transactionID) external { Transaction storage transaction = transactions[_transactionID]; require(transaction.status == Status.WaitingReceiver, "The transaction is not waiting on the receiver."); @@ -298,9 +294,8 @@ contract Escrow is IArbitrableV2 { emit TransactionResolved(_transactionID, Resolution.TimeoutBySender); } - /** @dev Pay receiver if sender fails to pay the fee. - * @param _transactionID The index of the transaction. - */ + /// @dev Pay receiver if sender fails to pay the fee. + /// @param _transactionID The index of the transaction. function timeOutByReceiver(uint256 _transactionID) external { Transaction storage transaction = transactions[_transactionID]; require(transaction.status == Status.WaitingSender, "The transaction is not waiting on the sender."); @@ -315,10 +310,9 @@ contract Escrow is IArbitrableV2 { emit TransactionResolved(_transactionID, Resolution.TimeoutByReceiver); } - /** @dev Create a dispute. UNTRUSTED. - * @param _transactionID The index of the transaction. - * @param _arbitrationCost Amount to pay the arbitrator. - */ + /// @dev Create a dispute. + /// @param _transactionID The index of the transaction. + /// @param _arbitrationCost Amount to pay the arbitrator. function raiseDispute(uint256 _transactionID, uint256 _arbitrationCost) internal { Transaction storage transaction = transactions[_transactionID]; transaction.status = Status.DisputeCreated; @@ -349,13 +343,11 @@ contract Escrow is IArbitrableV2 { } } - /** @dev Give a ruling for a dispute. Must be called by the arbitrator to - * enforce the final ruling. The purpose of this function is to ensure that - * the address calling it has the right to rule on the contract. - * @param _disputeID ID of the dispute in the Arbitrator contract. - * @param _ruling Ruling given by the arbitrator. Note that 0 is reserved - * for "Refuse to arbitrate". - */ + /// @dev Give a ruling for a dispute. Must be called by the arbitrator to enforce the final ruling. + /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract. + /// @param _disputeID ID of the dispute in the Arbitrator contract. + /// @param _ruling Ruling given by the arbitrator. Note that 0 is reserved + /// for "Refuse to arbitrate". function rule(uint256 _disputeID, uint256 _ruling) external override { require(msg.sender == address(arbitrator), "The caller must be the arbitrator."); require(_ruling <= AMOUNT_OF_CHOICES, "Invalid ruling."); @@ -368,10 +360,9 @@ contract Escrow is IArbitrableV2 { executeRuling(transactionID, _ruling); } - /** @dev Execute a ruling of a dispute. It reimburses the fee to the winning party. - * @param _transactionID The index of the transaction. - * @param _ruling Ruling given by the arbitrator. 1 : Reimburse the receiver. 2 : Pay the sender. - */ + /// @dev Execute a ruling of a dispute. It reimburses the fee to the winning party. + /// @param _transactionID The index of the transaction. + /// @param _ruling Ruling given by the arbitrator. 1 : Reimburse the receiver. 2 : Pay the sender. function executeRuling(uint256 _transactionID, uint256 _ruling) internal { Transaction storage transaction = transactions[_transactionID]; // Give the arbitration fee back. @@ -394,13 +385,12 @@ contract Escrow is IArbitrableV2 { emit TransactionResolved(_transactionID, Resolution.RulingEnforced); } - // **************************** // - // * Constant getters * // - // **************************** // + // ************************************* // + // * Public Views * // + // ************************************* // - /** @dev Getter to know the count of transactions. - * @return The count of transactions. - */ + /// @dev Getter to know the count of transactions. + /// @return The count of transactions. function getCountTransactions() external view returns (uint256) { return transactions.length; } From 5357d118fb7eb6e29d3502115cb27a79d2afdf44 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Thu, 7 Dec 2023 13:03:14 +0000 Subject: [PATCH 12/77] fix: templateId --- .../src/arbitration/arbitrables/Escrow.sol | 66 +++++++++++-------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/contracts/src/arbitration/arbitrables/Escrow.sol b/contracts/src/arbitration/arbitrables/Escrow.sol index c96b11b9e..8c1b2d2ce 100644 --- a/contracts/src/arbitration/arbitrables/Escrow.sol +++ b/contracts/src/arbitration/arbitrables/Escrow.sol @@ -62,6 +62,7 @@ contract Escrow is IArbitrableV2 { IArbitratorV2 public arbitrator; // Address of the arbitrator contract. bytes public arbitratorExtraData; // Extra data to set up the arbitration. IDisputeTemplateRegistry public templateRegistry; // The dispute template registry. + uint256 public templateId; // The current dispute template identifier. uint256 public immutable feeTimeout; // Time in seconds a party can take to pay arbitration fees before being considered unresponsive and lose the dispute. Transaction[] public transactions; // List of all created transactions. mapping(uint256 => uint256) public disputeIDtoTransactionID; // Naps dispute ID to tx ID. @@ -115,11 +116,15 @@ contract Escrow is IArbitrableV2 { /// @dev Constructor. /// @param _arbitrator The arbitrator of the contract. /// @param _arbitratorExtraData Extra data for the arbitrator. + /// @param _templateData The dispute template data. + /// @param _templateDataMappings The dispute template data mappings. /// @param _templateRegistry The dispute template registry. /// @param _feeTimeout Arbitration fee timeout for the parties. constructor( IArbitratorV2 _arbitrator, bytes memory _arbitratorExtraData, + string memory _templateData, + string memory _templateDataMappings, IDisputeTemplateRegistry _templateRegistry, uint256 _feeTimeout ) { @@ -128,6 +133,8 @@ contract Escrow is IArbitrableV2 { arbitratorExtraData = _arbitratorExtraData; templateRegistry = _templateRegistry; feeTimeout = _feeTimeout; + + templateId = templateRegistry.setDisputeTemplate("", _templateData, _templateDataMappings); } // ************************************* // @@ -146,6 +153,13 @@ contract Escrow is IArbitrableV2 { templateRegistry = _templateRegistry; } + function changeDisputeTemplate( + string memory _templateData, + string memory _templateDataMappings + ) external onlyByGovernor { + templateId = templateRegistry.setDisputeTemplate("", _templateData, _templateDataMappings); + } + // ************************************* // // * State Modifiers * // // ************************************* // @@ -233,15 +247,13 @@ contract Escrow is IArbitrableV2 { ); require(msg.sender == transaction.sender, "The caller must be the sender."); - uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData); transaction.senderFee += msg.value; - // Require that the total paid to be at least the arbitration cost. + uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData); require(transaction.senderFee >= arbitrationCost, "The sender fee must cover arbitration costs."); transaction.lastInteraction = block.timestamp; - // The receiver still has to pay. This can also happen if he has paid, - // but arbitrationCost has increased. + // The receiver still has to pay. This can also happen if he has paid, but arbitrationCost has increased. if (transaction.receiverFee < arbitrationCost) { transaction.status = Status.WaitingReceiver; emit HasToPayFee(_transactionID, Party.Receiver); @@ -262,9 +274,8 @@ contract Escrow is IArbitrableV2 { ); require(msg.sender == transaction.receiver, "The caller must be the receiver."); - uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData); transaction.receiverFee += msg.value; - // Require that the total paid to be at least the arbitration cost. + uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData); require(transaction.receiverFee >= arbitrationCost, "The receiver fee must cover arbitration costs."); transaction.lastInteraction = block.timestamp; @@ -310,6 +321,27 @@ contract Escrow is IArbitrableV2 { emit TransactionResolved(_transactionID, Resolution.TimeoutByReceiver); } + /// @dev Give a ruling for a dispute. Must be called by the arbitrator to enforce the final ruling. + /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract. + /// @param _disputeID ID of the dispute in the Arbitrator contract. + /// @param _ruling Ruling given by the arbitrator. Note that 0 is reserved + /// for "Refuse to arbitrate". + function rule(uint256 _disputeID, uint256 _ruling) external override { + require(msg.sender == address(arbitrator), "The caller must be the arbitrator."); + require(_ruling <= AMOUNT_OF_CHOICES, "Invalid ruling."); + uint256 transactionID = disputeIDtoTransactionID[_disputeID]; + Transaction storage transaction = transactions[transactionID]; + + require(transaction.status == Status.DisputeCreated, "The dispute has already been resolved."); + + emit Ruling(arbitrator, _disputeID, _ruling); + executeRuling(transactionID, _ruling); + } + + // ************************************* // + // * Internal * // + // ************************************* // + /// @dev Create a dispute. /// @param _transactionID The index of the transaction. /// @param _arbitrationCost Amount to pay the arbitrator. @@ -321,11 +353,6 @@ contract Escrow is IArbitrableV2 { arbitratorExtraData ); disputeIDtoTransactionID[transaction.disputeID] = _transactionID; - uint256 templateId = templateRegistry.setDisputeTemplate( - "", - transaction.templateData, - transaction.templateDataMappings - ); emit DisputeRequest(arbitrator, transaction.disputeID, _transactionID, templateId, ""); // Refund sender if he overpaid. @@ -343,23 +370,6 @@ contract Escrow is IArbitrableV2 { } } - /// @dev Give a ruling for a dispute. Must be called by the arbitrator to enforce the final ruling. - /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract. - /// @param _disputeID ID of the dispute in the Arbitrator contract. - /// @param _ruling Ruling given by the arbitrator. Note that 0 is reserved - /// for "Refuse to arbitrate". - function rule(uint256 _disputeID, uint256 _ruling) external override { - require(msg.sender == address(arbitrator), "The caller must be the arbitrator."); - require(_ruling <= AMOUNT_OF_CHOICES, "Invalid ruling."); - uint256 transactionID = disputeIDtoTransactionID[_disputeID]; - Transaction storage transaction = transactions[transactionID]; - - require(transaction.status == Status.DisputeCreated, "The dispute has already been resolved."); - - emit Ruling(arbitrator, _disputeID, _ruling); - executeRuling(transactionID, _ruling); - } - /// @dev Execute a ruling of a dispute. It reimburses the fee to the winning party. /// @param _transactionID The index of the transaction. /// @param _ruling Ruling given by the arbitrator. 1 : Reimburse the receiver. 2 : Pay the sender. From a08cc8a4d56a18f666ddb61d71ab1ee93e9a0a0e Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Thu, 7 Dec 2023 13:33:05 +0000 Subject: [PATCH 13/77] feat: custom errors --- .../src/arbitration/arbitrables/Escrow.sol | 87 +++++++++++-------- 1 file changed, 50 insertions(+), 37 deletions(-) diff --git a/contracts/src/arbitration/arbitrables/Escrow.sol b/contracts/src/arbitration/arbitrables/Escrow.sol index 8c1b2d2ce..c3110388f 100644 --- a/contracts/src/arbitration/arbitrables/Escrow.sol +++ b/contracts/src/arbitration/arbitrables/Escrow.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -/// @authors: [@unknownunknown1, @fnanni-0, @shalzz] +/// @authors: [@unknownunknown1, @fnanni-0, @shalzz, @jaybuidl] /// @reviewers: [] /// @auditors: [] /// @bounties: [] @@ -29,7 +29,7 @@ contract Escrow is IArbitrableV2 { WaitingSender, WaitingReceiver, DisputeCreated, - Resolved + TransactionResolved } enum Resolution { @@ -105,7 +105,7 @@ contract Escrow is IArbitrableV2 { // ************************************* // modifier onlyByGovernor() { - require(address(this) == msg.sender, "Only the governor allowed."); + if (governor != msg.sender) revert GovernorOnly(); _; } @@ -194,9 +194,9 @@ contract Escrow is IArbitrableV2 { /// @param _amount Amount to pay in wei. function pay(uint256 _transactionID, uint256 _amount) external { Transaction storage transaction = transactions[_transactionID]; - require(transaction.sender == msg.sender, "The caller must be the sender."); - require(transaction.status == Status.NoDispute, "The transaction must not be disputed."); - require(_amount <= transaction.amount, "Maximum amount available for payment exceeded."); + if (transaction.sender != msg.sender) revert SenderOnly(); + if (transaction.status != Status.NoDispute) revert TransactionDisputed(); + if (_amount > transaction.amount) revert MaximumPaymentAmountExceeded(); transaction.receiver.send(_amount); // It is the user responsibility to accept ETH. transaction.amount -= _amount; @@ -209,9 +209,9 @@ contract Escrow is IArbitrableV2 { /// @param _amountReimbursed Amount to reimburse in wei. function reimburse(uint256 _transactionID, uint256 _amountReimbursed) external { Transaction storage transaction = transactions[_transactionID]; - require(transaction.receiver == msg.sender, "The caller must be the receiver."); - require(transaction.status == Status.NoDispute, "The transaction must not be disputed."); - require(_amountReimbursed <= transaction.amount, "Maximum reimbursement available exceeded."); + if (transaction.receiver != msg.sender) revert ReceiverOnly(); + if (transaction.status != Status.NoDispute) revert TransactionDisputed(); + if (_amountReimbursed > transaction.amount) revert MaximumPaymentAmountExceeded(); transaction.sender.send(_amountReimbursed); // It is the user responsibility to accept ETH. transaction.amount -= _amountReimbursed; @@ -223,13 +223,12 @@ contract Escrow is IArbitrableV2 { /// @param _transactionID The index of the transaction. function executeTransaction(uint256 _transactionID) external { Transaction storage transaction = transactions[_transactionID]; - require(block.timestamp >= transaction.deadline, "Deadline not passed."); - require(transaction.status == Status.NoDispute, "The transaction must not be disputed."); + if (block.timestamp < transaction.deadline) revert DeadlineNotPassed(); + if (transaction.status != Status.NoDispute) revert TransactionDisputed(); transaction.receiver.send(transaction.amount); // It is the user responsibility to accept ETH. transaction.amount = 0; - - transaction.status = Status.Resolved; + transaction.status = Status.TransactionResolved; emit TransactionResolved(_transactionID, Resolution.TransactionExecuted); } @@ -241,20 +240,17 @@ contract Escrow is IArbitrableV2 { /// @param _transactionID The index of the transaction. function payArbitrationFeeBySender(uint256 _transactionID) external payable { Transaction storage transaction = transactions[_transactionID]; - require( - transaction.status < Status.DisputeCreated, - "Dispute has already been created or because the transaction has been executed." - ); - require(msg.sender == transaction.sender, "The caller must be the sender."); + if (transaction.status >= Status.DisputeCreated) revert DisputeAlreadyCreatedOrTransactionAlreadyExecuted(); + if (msg.sender != transaction.sender) revert SenderOnly(); transaction.senderFee += msg.value; uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData); - require(transaction.senderFee >= arbitrationCost, "The sender fee must cover arbitration costs."); + if (transaction.senderFee < arbitrationCost) revert SenderFeeNotCoverArbitrationCosts(); transaction.lastInteraction = block.timestamp; - // The receiver still has to pay. This can also happen if he has paid, but arbitrationCost has increased. if (transaction.receiverFee < arbitrationCost) { + // The receiver still has to pay. This can also happen if he has paid, but arbitrationCost has increased. transaction.status = Status.WaitingReceiver; emit HasToPayFee(_transactionID, Party.Receiver); } else { @@ -268,20 +264,17 @@ contract Escrow is IArbitrableV2 { /// @param _transactionID The index of the transaction. function payArbitrationFeeByReceiver(uint256 _transactionID) external payable { Transaction storage transaction = transactions[_transactionID]; - require( - transaction.status < Status.DisputeCreated, - "Dispute has already been created or because the transaction has been executed." - ); - require(msg.sender == transaction.receiver, "The caller must be the receiver."); + if (transaction.status >= Status.DisputeCreated) revert DisputeAlreadyCreatedOrTransactionAlreadyExecuted(); + if (msg.sender != transaction.receiver) revert ReceiverOnly(); transaction.receiverFee += msg.value; uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData); - require(transaction.receiverFee >= arbitrationCost, "The receiver fee must cover arbitration costs."); + if (transaction.receiverFee < arbitrationCost) revert ReceiverFeeNotCoverArbitrationCosts(); transaction.lastInteraction = block.timestamp; - // The sender still has to pay. This can also happen if he has paid, - // but arbitrationCost has increased. + if (transaction.senderFee < arbitrationCost) { + // The sender still has to pay. This can also happen if he has paid, but arbitrationCost has increased. transaction.status = Status.WaitingSender; emit HasToPayFee(_transactionID, Party.Sender); } else { @@ -294,8 +287,8 @@ contract Escrow is IArbitrableV2 { /// @param _transactionID The index of the transaction. function timeOutBySender(uint256 _transactionID) external { Transaction storage transaction = transactions[_transactionID]; - require(transaction.status == Status.WaitingReceiver, "The transaction is not waiting on the receiver."); - require(block.timestamp - transaction.lastInteraction >= feeTimeout, "Timeout time has not passed yet."); + if (transaction.status != Status.WaitingReceiver) revert NotWaitingForReceiverFees(); + if (block.timestamp - transaction.lastInteraction < feeTimeout) revert TimeoutNotPassed(); if (transaction.receiverFee != 0) { transaction.receiver.send(transaction.receiverFee); // It is the user responsibility to accept ETH. @@ -309,8 +302,8 @@ contract Escrow is IArbitrableV2 { /// @param _transactionID The index of the transaction. function timeOutByReceiver(uint256 _transactionID) external { Transaction storage transaction = transactions[_transactionID]; - require(transaction.status == Status.WaitingSender, "The transaction is not waiting on the sender."); - require(block.timestamp - transaction.lastInteraction >= feeTimeout, "Timeout time has not passed yet."); + if (transaction.status != Status.WaitingSender) revert NotWaitingForSenderFees(); + if (block.timestamp - transaction.lastInteraction < feeTimeout) revert TimeoutNotPassed(); if (transaction.senderFee != 0) { transaction.sender.send(transaction.senderFee); // It is the user responsibility to accept ETH. @@ -327,12 +320,12 @@ contract Escrow is IArbitrableV2 { /// @param _ruling Ruling given by the arbitrator. Note that 0 is reserved /// for "Refuse to arbitrate". function rule(uint256 _disputeID, uint256 _ruling) external override { - require(msg.sender == address(arbitrator), "The caller must be the arbitrator."); - require(_ruling <= AMOUNT_OF_CHOICES, "Invalid ruling."); + if (msg.sender != address(arbitrator)) revert ArbitratorOnly(); + if (_ruling > AMOUNT_OF_CHOICES) revert InvalidRuling(); + uint256 transactionID = disputeIDtoTransactionID[_disputeID]; Transaction storage transaction = transactions[transactionID]; - - require(transaction.status == Status.DisputeCreated, "The dispute has already been resolved."); + if (transaction.status != Status.DisputeCreated) revert DisputeAlreadyResolved(); emit Ruling(arbitrator, _disputeID, _ruling); executeRuling(transactionID, _ruling); @@ -390,7 +383,7 @@ contract Escrow is IArbitrableV2 { transaction.amount = 0; transaction.senderFee = 0; transaction.receiverFee = 0; - transaction.status = Status.Resolved; + transaction.status = Status.TransactionResolved; emit TransactionResolved(_transactionID, Resolution.RulingEnforced); } @@ -404,4 +397,24 @@ contract Escrow is IArbitrableV2 { function getCountTransactions() external view returns (uint256) { return transactions.length; } + + // ************************************* // + // * Errors * // + // ************************************* // + + error GovernorOnly(); + error SenderOnly(); + error ReceiverOnly(); + error ArbitratorOnly(); + error TransactionDisputed(); + error MaximumPaymentAmountExceeded(); + error DisputeAlreadyCreatedOrTransactionAlreadyExecuted(); + error DeadlineNotPassed(); + error SenderFeeNotCoverArbitrationCosts(); + error ReceiverFeeNotCoverArbitrationCosts(); + error NotWaitingForReceiverFees(); + error NotWaitingForSenderFees(); + error TimeoutNotPassed(); + error InvalidRuling(); + error DisputeAlreadyResolved(); } From 4c4a17e46c5d54cebcf095757d6accc95ee29cb3 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Thu, 7 Dec 2023 17:01:21 +0000 Subject: [PATCH 14/77] refactor: renamed some variables for clarity --- .../src/arbitration/arbitrables/Escrow.sol | 192 +++++++++--------- 1 file changed, 96 insertions(+), 96 deletions(-) diff --git a/contracts/src/arbitration/arbitrables/Escrow.sol b/contracts/src/arbitration/arbitrables/Escrow.sol index c3110388f..47650d247 100644 --- a/contracts/src/arbitration/arbitrables/Escrow.sol +++ b/contracts/src/arbitration/arbitrables/Escrow.sol @@ -10,7 +10,7 @@ pragma solidity 0.8.18; import {IArbitrableV2, IArbitratorV2} from "../interfaces/IArbitrableV2.sol"; import "../interfaces/IDisputeTemplateRegistry.sol"; -/// @title Escrow +/// @title Escrow for a sale paid in ETH and no fees. /// @dev MultipleArbitrableTransaction contract that is compatible with V2. /// Adapted from https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTransaction.sol contract Escrow is IArbitrableV2 { @@ -20,34 +20,34 @@ contract Escrow is IArbitrableV2 { enum Party { None, - Sender, - Receiver + Buyer, // Makes a purchase in ETH. + Seller // Provides a good or service in exchange for ETH. } enum Status { NoDispute, - WaitingSender, - WaitingReceiver, + WaitingBuyer, + WaitingSeller, DisputeCreated, TransactionResolved } enum Resolution { TransactionExecuted, - TimeoutBySender, - TimeoutByReceiver, + TimeoutByBuyer, + TimeoutBySeller, RulingEnforced } struct Transaction { - address payable sender; - address payable receiver; + address payable buyer; + address payable seller; uint256 amount; uint256 deadline; // Timestamp at which the transaction can be automatically executed if not disputed. uint256 disputeID; // If dispute exists, the ID of the dispute. - uint256 senderFee; // Total fees paid by the sender. - uint256 receiverFee; // Total fees paid by the receiver. - uint256 lastInteraction; // Last interaction for the dispute procedure. + uint256 buyerFee; // Total fees paid by the buyer. + uint256 sellerFee; // Total fees paid by the seller. + uint256 lastFeePaymentTime; // Last time the dispute fees were paid by either party. string templateData; string templateDataMappings; Status status; @@ -84,13 +84,13 @@ contract Escrow is IArbitrableV2 { /// @dev Emitted when a transaction is created. /// @param _transactionID The index of the transaction. - /// @param _sender The address of the sender. - /// @param _receiver The address of the receiver. + /// @param _buyer The address of the buyer. + /// @param _seller The address of the seller. /// @param _amount The initial amount in the transaction. event TransactionCreated( uint256 indexed _transactionID, - address indexed _sender, - address indexed _receiver, + address indexed _buyer, + address indexed _seller, uint256 _amount ); @@ -166,19 +166,19 @@ contract Escrow is IArbitrableV2 { /// @dev Create a transaction. /// @param _timeoutPayment Time after which a party can automatically execute the arbitrable transaction. - /// @param _receiver The recipient of the transaction. + /// @param _seller The recipient of the transaction. /// @param _templateData The dispute template data. /// @param _templateDataMappings The dispute template data mappings. /// @return transactionID The index of the transaction. function createTransaction( uint256 _timeoutPayment, - address payable _receiver, + address payable _seller, string memory _templateData, string memory _templateDataMappings ) external payable returns (uint256 transactionID) { Transaction storage transaction = transactions.push(); - transaction.sender = payable(msg.sender); - transaction.receiver = _receiver; + transaction.buyer = payable(msg.sender); + transaction.seller = _seller; transaction.amount = msg.value; transaction.deadline = block.timestamp + _timeoutPayment; transaction.templateData = _templateData; @@ -186,132 +186,132 @@ contract Escrow is IArbitrableV2 { transactionID = transactions.length - 1; - emit TransactionCreated(transactionID, msg.sender, _receiver, msg.value); + emit TransactionCreated(transactionID, msg.sender, _seller, msg.value); } - /// @dev Pay receiver. To be called if the good or service is provided. + /// @dev Pay seller. To be called if the good or service is provided. /// @param _transactionID The index of the transaction. /// @param _amount Amount to pay in wei. function pay(uint256 _transactionID, uint256 _amount) external { Transaction storage transaction = transactions[_transactionID]; - if (transaction.sender != msg.sender) revert SenderOnly(); + if (transaction.buyer != msg.sender) revert BuyerOnly(); if (transaction.status != Status.NoDispute) revert TransactionDisputed(); if (_amount > transaction.amount) revert MaximumPaymentAmountExceeded(); - transaction.receiver.send(_amount); // It is the user responsibility to accept ETH. + transaction.seller.send(_amount); // It is the user responsibility to accept ETH. transaction.amount -= _amount; emit Payment(_transactionID, _amount, msg.sender); } - /// @dev Reimburse sender. To be called if the good or service can't be fully provided. + /// @dev Reimburse buyer. To be called if the good or service can't be fully provided. /// @param _transactionID The index of the transaction. /// @param _amountReimbursed Amount to reimburse in wei. function reimburse(uint256 _transactionID, uint256 _amountReimbursed) external { Transaction storage transaction = transactions[_transactionID]; - if (transaction.receiver != msg.sender) revert ReceiverOnly(); + if (transaction.seller != msg.sender) revert SellerOnly(); if (transaction.status != Status.NoDispute) revert TransactionDisputed(); if (_amountReimbursed > transaction.amount) revert MaximumPaymentAmountExceeded(); - transaction.sender.send(_amountReimbursed); // It is the user responsibility to accept ETH. + transaction.buyer.send(_amountReimbursed); // It is the user responsibility to accept ETH. transaction.amount -= _amountReimbursed; emit Payment(_transactionID, _amountReimbursed, msg.sender); } - /// @dev Transfer the transaction's amount to the receiver if the timeout has passed. + /// @dev Transfer the transaction's amount to the seller if the timeout has passed. /// @param _transactionID The index of the transaction. function executeTransaction(uint256 _transactionID) external { Transaction storage transaction = transactions[_transactionID]; if (block.timestamp < transaction.deadline) revert DeadlineNotPassed(); if (transaction.status != Status.NoDispute) revert TransactionDisputed(); - transaction.receiver.send(transaction.amount); // It is the user responsibility to accept ETH. + transaction.seller.send(transaction.amount); // It is the user responsibility to accept ETH. transaction.amount = 0; transaction.status = Status.TransactionResolved; emit TransactionResolved(_transactionID, Resolution.TransactionExecuted); } - /// @dev Pay the arbitration fee to raise a dispute. To be called by the sender. + /// @dev Pay the arbitration fee to raise a dispute. To be called by the buyer. /// Note that the arbitrator can have createDispute throw, which will make /// this function throw and therefore lead to a party being timed-out. /// This is not a vulnerability as the arbitrator can rule in favor of one party anyway. /// @param _transactionID The index of the transaction. - function payArbitrationFeeBySender(uint256 _transactionID) external payable { + function payArbitrationFeeByBuyer(uint256 _transactionID) external payable { Transaction storage transaction = transactions[_transactionID]; if (transaction.status >= Status.DisputeCreated) revert DisputeAlreadyCreatedOrTransactionAlreadyExecuted(); - if (msg.sender != transaction.sender) revert SenderOnly(); + if (msg.sender != transaction.buyer) revert BuyerOnly(); - transaction.senderFee += msg.value; + transaction.buyerFee += msg.value; uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData); - if (transaction.senderFee < arbitrationCost) revert SenderFeeNotCoverArbitrationCosts(); + if (transaction.buyerFee < arbitrationCost) revert BuyerFeeNotCoverArbitrationCosts(); - transaction.lastInteraction = block.timestamp; + transaction.lastFeePaymentTime = block.timestamp; - if (transaction.receiverFee < arbitrationCost) { - // The receiver still has to pay. This can also happen if he has paid, but arbitrationCost has increased. - transaction.status = Status.WaitingReceiver; - emit HasToPayFee(_transactionID, Party.Receiver); + if (transaction.sellerFee < arbitrationCost) { + // The seller still has to pay. This can also happen if he has paid, but arbitrationCost has increased. + transaction.status = Status.WaitingSeller; + emit HasToPayFee(_transactionID, Party.Seller); } else { - // The receiver has also paid the fee. We create the dispute. + // The seller has also paid the fee. We create the dispute. raiseDispute(_transactionID, arbitrationCost); } } - /// @dev Pay the arbitration fee to raise a dispute. To be called by the receiver. - /// Note that this function mirrors payArbitrationFeeBySender. + /// @dev Pay the arbitration fee to raise a dispute. To be called by the seller. + /// Note that this function mirrors payArbitrationFeeByBuyer. /// @param _transactionID The index of the transaction. - function payArbitrationFeeByReceiver(uint256 _transactionID) external payable { + function payArbitrationFeeBySeller(uint256 _transactionID) external payable { Transaction storage transaction = transactions[_transactionID]; if (transaction.status >= Status.DisputeCreated) revert DisputeAlreadyCreatedOrTransactionAlreadyExecuted(); - if (msg.sender != transaction.receiver) revert ReceiverOnly(); + if (msg.sender != transaction.seller) revert SellerOnly(); - transaction.receiverFee += msg.value; + transaction.sellerFee += msg.value; uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData); - if (transaction.receiverFee < arbitrationCost) revert ReceiverFeeNotCoverArbitrationCosts(); + if (transaction.sellerFee < arbitrationCost) revert SellerFeeNotCoverArbitrationCosts(); - transaction.lastInteraction = block.timestamp; + transaction.lastFeePaymentTime = block.timestamp; - if (transaction.senderFee < arbitrationCost) { - // The sender still has to pay. This can also happen if he has paid, but arbitrationCost has increased. - transaction.status = Status.WaitingSender; - emit HasToPayFee(_transactionID, Party.Sender); + if (transaction.buyerFee < arbitrationCost) { + // The buyer still has to pay. This can also happen if he has paid, but arbitrationCost has increased. + transaction.status = Status.WaitingBuyer; + emit HasToPayFee(_transactionID, Party.Buyer); } else { - // The sender has also paid the fee. We create the dispute. + // The buyer has also paid the fee. We create the dispute. raiseDispute(_transactionID, arbitrationCost); } } - /// @dev Reimburse sender if receiver fails to pay the fee. + /// @dev Reimburse buyer if seller fails to pay the fee. /// @param _transactionID The index of the transaction. - function timeOutBySender(uint256 _transactionID) external { + function timeOutByBuyer(uint256 _transactionID) external { Transaction storage transaction = transactions[_transactionID]; - if (transaction.status != Status.WaitingReceiver) revert NotWaitingForReceiverFees(); - if (block.timestamp - transaction.lastInteraction < feeTimeout) revert TimeoutNotPassed(); + if (transaction.status != Status.WaitingSeller) revert NotWaitingForSellerFees(); + if (block.timestamp - transaction.lastFeePaymentTime < feeTimeout) revert TimeoutNotPassed(); - if (transaction.receiverFee != 0) { - transaction.receiver.send(transaction.receiverFee); // It is the user responsibility to accept ETH. - transaction.receiverFee = 0; + if (transaction.sellerFee != 0) { + transaction.seller.send(transaction.sellerFee); // It is the user responsibility to accept ETH. + transaction.sellerFee = 0; } - executeRuling(_transactionID, uint256(Party.Sender)); - emit TransactionResolved(_transactionID, Resolution.TimeoutBySender); + executeRuling(_transactionID, uint256(Party.Buyer)); + emit TransactionResolved(_transactionID, Resolution.TimeoutByBuyer); } - /// @dev Pay receiver if sender fails to pay the fee. + /// @dev Pay seller if buyer fails to pay the fee. /// @param _transactionID The index of the transaction. - function timeOutByReceiver(uint256 _transactionID) external { + function timeOutBySeller(uint256 _transactionID) external { Transaction storage transaction = transactions[_transactionID]; - if (transaction.status != Status.WaitingSender) revert NotWaitingForSenderFees(); - if (block.timestamp - transaction.lastInteraction < feeTimeout) revert TimeoutNotPassed(); + if (transaction.status != Status.WaitingBuyer) revert NotWaitingForBuyerFees(); + if (block.timestamp - transaction.lastFeePaymentTime < feeTimeout) revert TimeoutNotPassed(); - if (transaction.senderFee != 0) { - transaction.sender.send(transaction.senderFee); // It is the user responsibility to accept ETH. - transaction.senderFee = 0; + if (transaction.buyerFee != 0) { + transaction.buyer.send(transaction.buyerFee); // It is the user responsibility to accept ETH. + transaction.buyerFee = 0; } - executeRuling(_transactionID, uint256(Party.Receiver)); - emit TransactionResolved(_transactionID, Resolution.TimeoutByReceiver); + executeRuling(_transactionID, uint256(Party.Seller)); + emit TransactionResolved(_transactionID, Resolution.TimeoutBySeller); } /// @dev Give a ruling for a dispute. Must be called by the arbitrator to enforce the final ruling. @@ -348,41 +348,41 @@ contract Escrow is IArbitrableV2 { disputeIDtoTransactionID[transaction.disputeID] = _transactionID; emit DisputeRequest(arbitrator, transaction.disputeID, _transactionID, templateId, ""); - // Refund sender if he overpaid. - if (transaction.senderFee > _arbitrationCost) { - uint256 extraFeeSender = transaction.senderFee - _arbitrationCost; - transaction.senderFee = _arbitrationCost; - transaction.sender.send(extraFeeSender); // It is the user responsibility to accept ETH. + // Refund buyer if he overpaid. + if (transaction.buyerFee > _arbitrationCost) { + uint256 extraFeeBuyer = transaction.buyerFee - _arbitrationCost; + transaction.buyerFee = _arbitrationCost; + transaction.buyer.send(extraFeeBuyer); // It is the user responsibility to accept ETH. } - // Refund receiver if he overpaid. - if (transaction.receiverFee > _arbitrationCost) { - uint256 extraFeeReceiver = transaction.receiverFee - _arbitrationCost; - transaction.receiverFee = _arbitrationCost; - transaction.receiver.send(extraFeeReceiver); // It is the user responsibility to accept ETH. + // Refund seller if he overpaid. + if (transaction.sellerFee > _arbitrationCost) { + uint256 extraFeeSeller = transaction.sellerFee - _arbitrationCost; + transaction.sellerFee = _arbitrationCost; + transaction.seller.send(extraFeeSeller); // It is the user responsibility to accept ETH. } } /// @dev Execute a ruling of a dispute. It reimburses the fee to the winning party. /// @param _transactionID The index of the transaction. - /// @param _ruling Ruling given by the arbitrator. 1 : Reimburse the receiver. 2 : Pay the sender. + /// @param _ruling Ruling given by the arbitrator. 1 : Reimburse the seller. 2 : Pay the buyer. function executeRuling(uint256 _transactionID, uint256 _ruling) internal { Transaction storage transaction = transactions[_transactionID]; // Give the arbitration fee back. // Note that we use send to prevent a party from blocking the execution. - if (_ruling == uint256(Party.Sender)) { - transaction.sender.send(transaction.senderFee + transaction.amount); - } else if (_ruling == uint256(Party.Receiver)) { - transaction.receiver.send(transaction.receiverFee + transaction.amount); + if (_ruling == uint256(Party.Buyer)) { + transaction.buyer.send(transaction.buyerFee + transaction.amount); + } else if (_ruling == uint256(Party.Seller)) { + transaction.seller.send(transaction.sellerFee + transaction.amount); } else { - uint256 splitAmount = (transaction.senderFee + transaction.amount) / 2; - transaction.sender.send(splitAmount); - transaction.receiver.send(splitAmount); + uint256 splitAmount = (transaction.buyerFee + transaction.amount) / 2; + transaction.buyer.send(splitAmount); + transaction.seller.send(splitAmount); } transaction.amount = 0; - transaction.senderFee = 0; - transaction.receiverFee = 0; + transaction.buyerFee = 0; + transaction.sellerFee = 0; transaction.status = Status.TransactionResolved; emit TransactionResolved(_transactionID, Resolution.RulingEnforced); @@ -403,17 +403,17 @@ contract Escrow is IArbitrableV2 { // ************************************* // error GovernorOnly(); - error SenderOnly(); - error ReceiverOnly(); + error BuyerOnly(); + error SellerOnly(); error ArbitratorOnly(); error TransactionDisputed(); error MaximumPaymentAmountExceeded(); error DisputeAlreadyCreatedOrTransactionAlreadyExecuted(); error DeadlineNotPassed(); - error SenderFeeNotCoverArbitrationCosts(); - error ReceiverFeeNotCoverArbitrationCosts(); - error NotWaitingForReceiverFees(); - error NotWaitingForSenderFees(); + error BuyerFeeNotCoverArbitrationCosts(); + error SellerFeeNotCoverArbitrationCosts(); + error NotWaitingForSellerFees(); + error NotWaitingForBuyerFees(); error TimeoutNotPassed(); error InvalidRuling(); error DisputeAlreadyResolved(); From 838e7bf3a0962875df7c20c481380600095dadf9 Mon Sep 17 00:00:00 2001 From: unknownunknown1 Date: Wed, 8 Nov 2023 18:31:15 +1000 Subject: [PATCH 15/77] fix(KlerosCore): dispute kit structure fix --- contracts/src/arbitration/KlerosCore.sol | 142 ++++++----------------- contracts/test/arbitration/index.ts | 1 - 2 files changed, 37 insertions(+), 106 deletions(-) diff --git a/contracts/src/arbitration/KlerosCore.sol b/contracts/src/arbitration/KlerosCore.sol index cfee3e003..871df03c6 100644 --- a/contracts/src/arbitration/KlerosCore.sol +++ b/contracts/src/arbitration/KlerosCore.sol @@ -43,7 +43,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { uint256 feeForJuror; // Arbitration fee paid per juror. uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any. uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`. - mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court. + mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court. Note that each court must support classic dispute kit. bool disabled; // True if the court is disabled. Unused for now, will be implemented later. } @@ -77,14 +77,6 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { mapping(uint96 => uint256) stakedPnkByCourt; // The amount of PNKs the juror has staked in the court in the form `stakedPnkByCourt[courtID]`. } - struct DisputeKitNode { - uint256 parent; // Index of the parent dispute kit. If it's 0 then this DK is a root. - uint256[] children; // List of child dispute kits. - IDisputeKit disputeKit; // The dispute kit implementation. - uint256 depthLevel; // How far this DK is from the root. 0 for root DK. - bool disabled; // True if the dispute kit is disabled and can't be used. This parameter is added preemptively to avoid storage changes in the future. - } - // Workaround "stack too deep" errors struct ExecuteParams { uint256 disputeID; // The ID of the dispute to execute. @@ -107,14 +99,13 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { uint256 private constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by. uint256 private constant NON_PAYABLE_AMOUNT = (2 ** 256 - 2) / 2; // An amount higher than the supply of ETH. - uint256 private constant SEARCH_ITERATIONS = 10; // Number of iterations to search for suitable parent court before jumping to the top court. address public governor; // The governor of the contract. IERC20 public pinakion; // The Pinakion token contract. address public jurorProsecutionModule; // The module for juror's prosecution. ISortitionModule public sortitionModule; // Sortition module for drawing. Court[] public courts; // The courts. - DisputeKitNode[] public disputeKitNodes; // The list of DisputeKitNode, indexed by DisputeKitID. + IDisputeKit[] public disputeKits; // Array of dispute kits. Dispute[] public disputes; // The disputes. mapping(address => Juror) internal jurors; // The jurors. mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH. @@ -149,11 +140,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { uint256 _jurorsForCourtJump, uint256[4] _timesPerPeriod ); - event DisputeKitCreated( - uint256 indexed _disputeKitID, - IDisputeKit indexed _disputeKitAddress, - uint256 indexed _parent - ); + event DisputeKitCreated(uint256 indexed _disputeKitID, IDisputeKit indexed _disputeKitAddress); event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable); event CourtJump( uint256 indexed _disputeID, @@ -228,20 +215,13 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { jurorProsecutionModule = _jurorProsecutionModule; sortitionModule = _sortitionModuleAddress; - // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a node has no parent. - disputeKitNodes.push(); + // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a dispute kit is not supported. + disputeKits.push(); // DISPUTE_KIT_CLASSIC - disputeKitNodes.push( - DisputeKitNode({ - parent: Constants.NULL_DISPUTE_KIT, - children: new uint256[](0), - disputeKit: _disputeKit, - depthLevel: 0, - disabled: false - }) - ); - emit DisputeKitCreated(Constants.DISPUTE_KIT_CLASSIC, _disputeKit, Constants.NULL_DISPUTE_KIT); + disputeKits.push(_disputeKit); + + emit DisputeKitCreated(Constants.DISPUTE_KIT_CLASSIC, _disputeKit); // FORKING_COURT // TODO: Fill the properties for the Forking court, emit CourtCreated. @@ -326,33 +306,10 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { /// @dev Add a new supported dispute kit module to the court. /// @param _disputeKitAddress The address of the dispute kit contract. - /// @param _parent The ID of the parent dispute kit. It is left empty when root DK is created. - /// Note that the root DK must be supported by the general court. - function addNewDisputeKit(IDisputeKit _disputeKitAddress, uint256 _parent) external onlyByGovernor { - uint256 disputeKitID = disputeKitNodes.length; - if (_parent >= disputeKitID) revert InvalidDisputKitParent(); - uint256 depthLevel; - if (_parent != Constants.NULL_DISPUTE_KIT) { - depthLevel = disputeKitNodes[_parent].depthLevel + 1; - // It should be always possible to reach the root from the leaf with the defined number of search iterations. - if (depthLevel >= SEARCH_ITERATIONS) revert DepthLevelMax(); - } - disputeKitNodes.push( - DisputeKitNode({ - parent: _parent, - children: new uint256[](0), - disputeKit: _disputeKitAddress, - depthLevel: depthLevel, - disabled: false - }) - ); - - disputeKitNodes[_parent].children.push(disputeKitID); - emit DisputeKitCreated(disputeKitID, _disputeKitAddress, _parent); - if (_parent == Constants.NULL_DISPUTE_KIT) { - // A new dispute kit tree root should always be supported by the General court. - _enableDisputeKit(Constants.GENERAL_COURT, disputeKitID, true); - } + function addNewDisputeKit(IDisputeKit _disputeKitAddress) external onlyByGovernor { + uint256 disputeKitID = disputeKits.length; + disputeKits.push(_disputeKitAddress); + emit DisputeKitCreated(disputeKitID, _disputeKitAddress); } /// @dev Creates a court under a specified parent court. @@ -384,11 +341,13 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { Court storage court = courts.push(); for (uint256 i = 0; i < _supportedDisputeKits.length; i++) { - if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKitNodes.length) { + if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKits.length) { revert WrongDisputeKitIndex(); } court.supportedDisputeKits[_supportedDisputeKits[i]] = true; } + // Check that Classic DK support was added. + if (!court.supportedDisputeKits[Constants.DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic(); court.parent = _parent; court.children = new uint256[](0); @@ -458,16 +417,14 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor { for (uint256 i = 0; i < _disputeKitIDs.length; i++) { if (_enable) { - if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKitNodes.length) { + if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKits.length) { revert WrongDisputeKitIndex(); } _enableDisputeKit(_courtID, _disputeKitIDs[i], true); } else { - if ( - _courtID == Constants.GENERAL_COURT && - disputeKitNodes[_disputeKitIDs[i]].parent == Constants.NULL_DISPUTE_KIT - ) { - revert CannotDisableRootDKInGeneral(); + // Classic dispute kit must be supported by all courts. + if (_disputeKitIDs[i] == Constants.DISPUTE_KIT_CLASSIC) { + revert CannotDisableClassicDK(); } _enableDisputeKit(_courtID, _disputeKitIDs[i], false); } @@ -547,7 +504,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { dispute.arbitrated = IArbitrableV2(msg.sender); dispute.lastPeriodChange = block.timestamp; - IDisputeKit disputeKit = disputeKitNodes[disputeKitID].disputeKit; + IDisputeKit disputeKit = disputeKits[disputeKitID]; Court storage court = courts[dispute.courtID]; Round storage round = dispute.rounds.push(); @@ -587,7 +544,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { } else if (dispute.period == Period.commit) { if ( block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] && - !disputeKitNodes[round.disputeKitID].disputeKit.areCommitsAllCast(_disputeID) + !disputeKits[round.disputeKitID].areCommitsAllCast(_disputeID) ) { revert CommitPeriodNotPassed(); } @@ -595,7 +552,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { } else if (dispute.period == Period.vote) { if ( block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] && - !disputeKitNodes[round.disputeKitID].disputeKit.areVotesAllCast(_disputeID) + !disputeKits[round.disputeKitID].areVotesAllCast(_disputeID) ) { revert VotePeriodNotPassed(); } @@ -623,7 +580,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { Round storage round = dispute.rounds[currentRound]; if (dispute.period != Period.evidence) revert NotEvidencePeriod(); - IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit; + IDisputeKit disputeKit = disputeKits[round.disputeKitID]; uint256 startIndex = round.drawIterations; // for gas: less storage reads uint256 i; @@ -654,7 +611,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { if (dispute.period != Period.appeal) revert DisputeNotAppealable(); Round storage round = dispute.rounds[dispute.rounds.length - 1]; - if (msg.sender != address(disputeKitNodes[round.disputeKitID].disputeKit)) revert DisputeKitOnly(); + if (msg.sender != address(disputeKits[round.disputeKitID])) revert DisputeKitOnly(); uint96 newCourtID = dispute.courtID; uint256 newDisputeKitID = round.disputeKitID; @@ -666,22 +623,9 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { // Jump to parent court. newCourtID = courts[newCourtID].parent; - for (uint256 i = 0; i < SEARCH_ITERATIONS; i++) { - if (courts[newCourtID].supportedDisputeKits[newDisputeKitID]) { - break; - } else if (disputeKitNodes[newDisputeKitID].parent != Constants.NULL_DISPUTE_KIT) { - newDisputeKitID = disputeKitNodes[newDisputeKitID].parent; - } else { - // DK's parent has 0 index, that means we reached the root DK (0 depth level). - // Jump to the next parent court if the current court doesn't support any DK from this tree. - // Note that we don't reset newDisputeKitID in this case as, a precaution. - newCourtID = courts[newCourtID].parent; - } - } - // We didn't find a court that is compatible with DK from this tree, so we jump directly to the top court. - // Note that this can only happen when disputeKitID is at its root, and each root DK is supported by the top court by default. if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) { - newCourtID = Constants.GENERAL_COURT; + // Switch to classic dispute kit if parent court doesn't support the current one. + newDisputeKitID = Constants.DISPUTE_KIT_CLASSIC; } if (newCourtID != dispute.courtID) { @@ -704,7 +648,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { // Dispute kit was changed, so create a dispute in the new DK contract. if (extraRound.disputeKitID != round.disputeKitID) { emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID); - disputeKitNodes[extraRound.disputeKitID].disputeKit.createDispute( + disputeKits[extraRound.disputeKitID].createDispute( _disputeID, _numberOfChoices, _extraData, @@ -725,7 +669,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { if (dispute.period != Period.execution) revert NotExecutionPeriod(); Round storage round = dispute.rounds[_round]; - IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit; + IDisputeKit disputeKit = disputeKits[round.disputeKitID]; uint256 start = round.repartitions; uint256 end = round.repartitions + _iterations; @@ -765,7 +709,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { function _executePenalties(ExecuteParams memory _params) internal returns (uint256) { Dispute storage dispute = disputes[_params.disputeID]; Round storage round = dispute.rounds[_params.round]; - IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit; + IDisputeKit disputeKit = disputeKits[round.disputeKitID]; // [0, 1] value that determines how coherent the juror was in this round, in basis points. uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence( @@ -833,7 +777,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { function _executeRewards(ExecuteParams memory _params) internal { Dispute storage dispute = disputes[_params.disputeID]; Round storage round = dispute.rounds[_params.round]; - IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit; + IDisputeKit disputeKit = disputeKits[round.disputeKitID]; // [0, 1] value that determines how coherent the juror was in this round, in basis points. uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence( @@ -988,7 +932,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) { Dispute storage dispute = disputes[_disputeID]; Round storage round = dispute.rounds[dispute.rounds.length - 1]; - IDisputeKit disputeKit = disputeKitNodes[round.disputeKitID].disputeKit; + IDisputeKit disputeKit = disputeKits[round.disputeKitID]; (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID); } @@ -1015,13 +959,6 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { return courts[_courtID].supportedDisputeKits[_disputeKitID]; } - /// @dev Gets non-primitive properties of a specified dispute kit node. - /// @param _disputeKitID The ID of the dispute kit. - /// @return children Indexes of children of this DK. - function getDisputeKitChildren(uint256 _disputeKitID) external view returns (uint256[] memory) { - return disputeKitNodes[_disputeKitID].children; - } - /// @dev Gets the timesPerPeriod array for a given court. /// @param _courtID The ID of the court to get the times from. /// @return timesPerPeriod The timesPerPeriod array for the given court. @@ -1056,14 +993,8 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { return !courts[court.parent].supportedDisputeKits[round.disputeKitID]; } - function getDisputeKitNodesLength() external view returns (uint256) { - return disputeKitNodes.length; - } - - /// @dev Gets the dispute kit for a specific `_disputeKitID`. - /// @param _disputeKitID The ID of the dispute kit. - function getDisputeKit(uint256 _disputeKitID) external view returns (IDisputeKit) { - return disputeKitNodes[_disputeKitID].disputeKit; + function getDisputeKitsLength() external view returns (uint256) { + return disputeKits.length; } /// @dev Gets the court identifiers where a specific `_juror` has staked. @@ -1083,7 +1014,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { /// @dev Toggles the dispute kit support for a given court. /// @param _courtID The ID of the court to toggle the support for. /// @param _disputeKitID The ID of the dispute kit to toggle the support for. - /// @param _enable Whether to enable or disable the support. + /// @param _enable Whether to enable or disable the support. Note that classic dispute kit should always be enabled. function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal { courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable; emit DisputeKitEnabled(_courtID, _disputeKitID, _enable); @@ -1197,7 +1128,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { if (minJurors == 0) { minJurors = Constants.DEFAULT_NB_OF_JURORS; } - if (disputeKitID == Constants.NULL_DISPUTE_KIT || disputeKitID >= disputeKitNodes.length) { + if (disputeKitID == Constants.NULL_DISPUTE_KIT || disputeKitID >= disputeKits.length) { disputeKitID = Constants.DISPUTE_KIT_CLASSIC; // 0 index is not used. } } else { @@ -1219,12 +1150,13 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { error UnsupportedDisputeKit(); error InvalidForkingCourtAsParent(); error WrongDisputeKitIndex(); - error CannotDisableRootDKInGeneral(); + error CannotDisableClassicDK(); error ArraysLengthMismatch(); error StakingFailed(); error WrongCaller(); error ArbitrationFeesNotEnough(); error DisputeKitNotSupportedByCourt(); + error MustSupportDisputeKitClassic(); error TokenNotAccepted(); error EvidenceNotPassedAndNotAppeal(); error DisputeStillDrawing(); diff --git a/contracts/test/arbitration/index.ts b/contracts/test/arbitration/index.ts index f3530437b..bf8b4bb02 100644 --- a/contracts/test/arbitration/index.ts +++ b/contracts/test/arbitration/index.ts @@ -18,7 +18,6 @@ describe("DisputeKitClassic", async () => { expect(events.length).to.equal(1); expect(events[0].args._disputeKitID).to.equal(1); expect(events[0].args._disputeKitAddress).to.equal(disputeKit.address); - expect(events[0].args._parent).to.equal(0); // Reminder: the Forking court will be added which will break these expectations. events = await core.queryFilter(core.filters.CourtCreated()); From 4a007e39e8be5e078f361f15950ebc42b12b9a70 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Thu, 7 Dec 2023 18:03:18 +0000 Subject: [PATCH 16/77] feat: supporting the simplified DK structure --- subgraph/schema.graphql | 3 --- subgraph/src/entities/DisputeKit.ts | 11 ++--------- subgraph/subgraph.yaml | 2 +- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/subgraph/schema.graphql b/subgraph/schema.graphql index e0826be6e..e8715ab2d 100644 --- a/subgraph/schema.graphql +++ b/subgraph/schema.graphql @@ -198,10 +198,7 @@ type Draw @entity(immutable: true) { type DisputeKit @entity { id: ID! address: Bytes - parent: DisputeKit - children: [DisputeKit!]! @derivedFrom(field: "parent") needsFreezing: Boolean! - depthLevel: BigInt! rounds: [Round!]! @derivedFrom(field: "disputeKit") courts: [Court!]! @derivedFrom(field: "supportedDisputeKits") } diff --git a/subgraph/src/entities/DisputeKit.ts b/subgraph/src/entities/DisputeKit.ts index f10a975b1..150aaed0b 100644 --- a/subgraph/src/entities/DisputeKit.ts +++ b/subgraph/src/entities/DisputeKit.ts @@ -4,21 +4,14 @@ import { ZERO, ONE } from "../utils"; export function createDisputeKitFromEvent(event: DisputeKitCreated): void { const disputeKit = new DisputeKit(event.params._disputeKitID.toString()); - disputeKit.parent = event.params._parent.toString(); disputeKit.address = event.params._disputeKitAddress; disputeKit.needsFreezing = false; - const parent = DisputeKit.load(event.params._parent.toString()); - disputeKit.depthLevel = parent ? parent.depthLevel.plus(ONE) : ZERO; disputeKit.save(); } -export function filterSupportedDisputeKits( - supportedDisputeKits: string[], - disputeKitID: string -): string[] { +export function filterSupportedDisputeKits(supportedDisputeKits: string[], disputeKitID: string): string[] { let result: string[] = []; for (let i = 0; i < supportedDisputeKits.length; i++) - if (supportedDisputeKits[i] !== disputeKitID) - result = result.concat([supportedDisputeKits[i]]); + if (supportedDisputeKits[i] !== disputeKitID) result = result.concat([supportedDisputeKits[i]]); return result; } diff --git a/subgraph/subgraph.yaml b/subgraph/subgraph.yaml index 801616467..0fd7441f9 100644 --- a/subgraph/subgraph.yaml +++ b/subgraph/subgraph.yaml @@ -42,7 +42,7 @@ dataSources: handler: handleCourtCreated - event: CourtModified(indexed uint96,bool,uint256,uint256,uint256,uint256,uint256[4]) handler: handleCourtModified - - event: DisputeKitCreated(indexed uint256,indexed address,indexed uint256) + - event: DisputeKitCreated(indexed uint256,indexed address) handler: handleDisputeKitCreated - event: DisputeKitEnabled(indexed uint96,indexed uint256,indexed bool) handler: handleDisputeKitEnabled From fbf915b1f66bae978f9533a917ffb137171d34c6 Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Thu, 7 Dec 2023 23:44:47 +0530 Subject: [PATCH 17/77] refactor(web): align-debug-component-content --- web/src/layout/Header/navbar/Debug.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/web/src/layout/Header/navbar/Debug.tsx b/web/src/layout/Header/navbar/Debug.tsx index 7c1f0ec87..e1d2bcb44 100644 --- a/web/src/layout/Header/navbar/Debug.tsx +++ b/web/src/layout/Header/navbar/Debug.tsx @@ -8,6 +8,7 @@ const Container = styled.div` display: flex; flex-direction: column; gap: 12px; + padding: 0px 3px; label, a { @@ -22,11 +23,15 @@ const StyledIframe = styled.iframe` border: none; width: 100%; height: 30px; - border-radius: 300px; + border-radius: 3px; +`; + +const StyledLabel = styled.label` + padding-left: 8px; `; const Version = () => ( - + ); const ServicesStatus = () => { @@ -54,7 +59,7 @@ const Phase = () => { const { data: phase } = useSortitionModulePhase({ watch: true, }); - return <>{phase !== undefined && }; + return <>{phase !== undefined && Phase: {Phases[phase]}}; }; const Debug: React.FC = () => { From 055ddd1b15d2c403abfb492b57ec5f224cdcaf12 Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Sat, 9 Dec 2023 12:08:23 +0530 Subject: [PATCH 18/77] chore(web): add-testnet-banner --- web/src/layout/Header/Banner.tsx | 40 ++++++++++++++++++++++++++++++++ web/src/layout/Header/index.tsx | 16 +++++++++---- 2 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 web/src/layout/Header/Banner.tsx diff --git a/web/src/layout/Header/Banner.tsx b/web/src/layout/Header/Banner.tsx new file mode 100644 index 000000000..3fed10426 --- /dev/null +++ b/web/src/layout/Header/Banner.tsx @@ -0,0 +1,40 @@ +import React from "react"; +import styled, { css } from "styled-components"; +import { landscapeStyle } from "styles/landscapeStyle"; + +const Container = styled.div` + width: 100%; + position: sticky; + top: 0; + background-color: ${({ theme }) => theme.tintPurple}; + color: ${({ theme }) => theme.primaryText}; + + padding: 6px 2px; + + ${landscapeStyle( + () => css` + padding: 8px 10px; + ` + )} +`; + +const StyledP = styled.p` + font-size: 14px; + text-align: center; + margin: 0; +`; + +export const Banner: React.FC = () => { + return ( + + + Thanks for trying Kleros V2! This a testnet release: work is still in progress and some features are missing. + More info{" "} + + here + + . + + + ); +}; diff --git a/web/src/layout/Header/index.tsx b/web/src/layout/Header/index.tsx index 6287381e6..8f7a23e12 100644 --- a/web/src/layout/Header/index.tsx +++ b/web/src/layout/Header/index.tsx @@ -2,17 +2,22 @@ import React from "react"; import styled from "styled-components"; import MobileHeader from "./MobileHeader"; import DesktopHeader from "./DesktopHeader"; +import { Banner } from "./Banner"; const Container = styled.div` position: sticky; z-index: 1; top: 0; width: 100%; - height: 64px; background-color: ${({ theme }) => theme.primaryPurple}; - padding: 0 24px; display: flex; + flex-wrap: wrap; +`; + +const HeaderContainer = styled.div` + width: 100%; + padding: 4px 24px 8px; `; export const PopupContainer = styled.div` @@ -27,8 +32,11 @@ export const PopupContainer = styled.div` const Header: React.FC = () => { return ( - - + {process.env.REACT_APP_DEPLOYMENT === "testnet" && } + + + + ); }; From 609c49aa2afbc29847f65973f5fd01f14df738ed Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Tue, 12 Dec 2023 15:32:42 +0530 Subject: [PATCH 19/77] refactor(web): update-responsiveSize-func --- .../CasesDisplay/CasesListHeader.tsx | 8 +++--- web/src/components/CasesDisplay/Search.tsx | 2 +- web/src/components/CasesDisplay/index.tsx | 4 +-- .../components/DisputeCard/DisputeInfo.tsx | 2 +- web/src/components/DisputeCard/index.tsx | 6 ++--- web/src/components/EvidenceCard.tsx | 7 +++-- web/src/components/LatestCases.tsx | 4 +-- .../components/Popup/Description/Appeal.tsx | 10 +++---- .../Popup/Description/StakeWithdraw.tsx | 12 ++++----- .../ExtraInfo/StakeWithdrawExtraInfo.tsx | 6 ++--- .../ExtraInfo/VoteWithCommitExtraInfo.tsx | 3 +-- .../MiniGuides/MainStructureTemplate.tsx | 14 +++++----- .../MiniGuides/Onboarding/PnkLogoAndTitle.tsx | 5 ++-- .../Popup/MiniGuides/PageContentsTemplate.tsx | 3 +-- web/src/components/Popup/index.tsx | 22 +++++++-------- web/src/components/StatDisplay.tsx | 2 +- web/src/components/StyledSkeleton.tsx | 2 +- .../components/Verdict/DisputeTimeline.tsx | 2 +- web/src/components/Verdict/FinalDecision.tsx | 3 ++- web/src/components/Verdict/VerdictBanner.tsx | 2 +- web/src/layout/Header/DesktopHeader.tsx | 6 ++--- web/src/layout/Header/navbar/DappList.tsx | 6 ++--- web/src/layout/Header/navbar/Explore.tsx | 2 +- .../FormContactDetails/index.tsx | 3 ++- .../Header/navbar/Menu/Settings/index.tsx | 4 +-- web/src/layout/Header/navbar/Product.tsx | 2 +- .../pages/Cases/CaseDetails/Appeal/index.tsx | 2 +- .../Cases/CaseDetails/Evidence/index.tsx | 2 +- .../Cases/CaseDetails/Overview/Policies.tsx | 5 ++-- .../Cases/CaseDetails/Overview/index.tsx | 4 +-- web/src/pages/Cases/CaseDetails/Timeline.tsx | 6 ++--- .../pages/Cases/CaseDetails/Voting/index.tsx | 4 +-- web/src/pages/Cases/CaseDetails/index.tsx | 2 +- web/src/pages/Cases/index.tsx | 4 +-- web/src/pages/Courts/CourtDetails/Stats.tsx | 3 ++- web/src/pages/Courts/CourtDetails/index.tsx | 4 +-- web/src/pages/Courts/index.tsx | 5 +--- web/src/pages/Dashboard/Courts/Header.tsx | 2 +- web/src/pages/Dashboard/JurorInfo/Header.tsx | 2 +- web/src/pages/Dashboard/JurorInfo/index.tsx | 2 +- web/src/pages/Dashboard/index.tsx | 7 ++--- web/src/pages/Home/Community/index.tsx | 4 +-- web/src/pages/Home/CourtOverview/Chart.tsx | 2 +- web/src/pages/Home/CourtOverview/Stats.tsx | 4 +-- .../Home/TopJurors/Header/DesktopHeader.tsx | 4 +-- .../Home/TopJurors/JurorCard/DesktopCard.tsx | 4 +-- web/src/pages/Home/TopJurors/index.tsx | 4 +-- web/src/pages/Home/index.tsx | 4 +-- web/src/styles/responsiveSize.ts | 27 ++++--------------- 49 files changed, 107 insertions(+), 142 deletions(-) diff --git a/web/src/components/CasesDisplay/CasesListHeader.tsx b/web/src/components/CasesDisplay/CasesListHeader.tsx index b19347953..ad19963b2 100644 --- a/web/src/components/CasesDisplay/CasesListHeader.tsx +++ b/web/src/components/CasesDisplay/CasesListHeader.tsx @@ -7,7 +7,7 @@ import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` display: flex; justify-content: space-between; - ${responsiveSize("gap", 15, 40, 300, 1250, "vw")} + gap: calc(15vw + (40 - 15) * (min(max(100vw, 375px), 1250px) - 375px) / 875); width: 100%; height: 100%; `; @@ -17,10 +17,10 @@ const CasesData = styled.div` align-items: center; justify-content: space-around; width: 100%; - ${responsiveSize("marginLeft", 0, 33, 370)} + margin-left: ${responsiveSize(0, 33)}; flex-wrap: wrap; padding: 0 3%; - ${responsiveSize("gap", 24, 48, 300)} + gap: ${responsiveSize(24, 48, 300)}; `; const CaseTitle = styled.div` @@ -43,7 +43,7 @@ const CaseTitle = styled.div` `; const StyledLabel = styled.label` - ${responsiveSize("marginLeft", 4, 8, 300, 900)} + margin-left: ${responsiveSize(4, 8, 300, 900)}; `; const tooltipMsg = diff --git a/web/src/components/CasesDisplay/Search.tsx b/web/src/components/CasesDisplay/Search.tsx index 393430bd8..edafa0361 100644 --- a/web/src/components/CasesDisplay/Search.tsx +++ b/web/src/components/CasesDisplay/Search.tsx @@ -19,7 +19,7 @@ const Container = styled.div` () => css` flex-direction: row; - ${responsiveSize("gap", 4, 22)} + gap: ${responsiveSize(4, 22)}; ` )} `; diff --git a/web/src/components/CasesDisplay/index.tsx b/web/src/components/CasesDisplay/index.tsx index 94361961f..51a610ff1 100644 --- a/web/src/components/CasesDisplay/index.tsx +++ b/web/src/components/CasesDisplay/index.tsx @@ -10,11 +10,11 @@ const Divider = styled.hr` border: none; height: 1px; background-color: ${({ theme }) => theme.stroke}; - ${responsiveSize("margin", 20, 24)} + margin: ${responsiveSize(20, 24)}; `; const StyledTitle = styled.h1` - ${responsiveSize("marginBottom", 32, 48)} + margin-bottom: ${responsiveSize(32, 48)}; `; interface ICasesDisplay extends ICasesGrid { diff --git a/web/src/components/DisputeCard/DisputeInfo.tsx b/web/src/components/DisputeCard/DisputeInfo.tsx index f5e806b63..b37550f04 100644 --- a/web/src/components/DisputeCard/DisputeInfo.tsx +++ b/web/src/components/DisputeCard/DisputeInfo.tsx @@ -57,7 +57,7 @@ const RestOfFieldsContainer = styled.div<{ isList?: boolean; isOverview?: boolea ${landscapeStyle( () => css` flex-direction: row; - ${responsiveSize("gap", 4, 24, 300, 900)} + gap: ${responsiveSize(4, 24, 300, 900)}; justify-content: space-around; ` )} diff --git a/web/src/components/DisputeCard/index.tsx b/web/src/components/DisputeCard/index.tsx index e9bbbfc4a..1d51d99a6 100644 --- a/web/src/components/DisputeCard/index.tsx +++ b/web/src/components/DisputeCard/index.tsx @@ -19,7 +19,7 @@ import { responsiveSize } from "styles/responsiveSize"; const StyledCard = styled(Card)` width: 100%; - ${responsiveSize("height", 280, 296)} + height: ${responsiveSize(280, 296)}; ${landscapeStyle( () => @@ -43,7 +43,7 @@ const StyledListItem = styled(Card)` const CardContainer = styled.div` height: calc(100% - 45px); - ${responsiveSize("padding", 20, 24)} + padding: ${responsiveSize(20, 24)}; display: flex; flex-direction: column; justify-content: space-between; @@ -68,7 +68,7 @@ const ListTitle = styled.div` height: 100%; justify-content: start; align-items: center; - ${responsiveSize("width", 30, 40, 300, 1250, "vw")} + width: calc(30vw + (40 - 30) * (min(max(100vw, 300px), 1250px)- 300px) / 950); `; export const getPeriodEndTimestamp = ( diff --git a/web/src/components/EvidenceCard.tsx b/web/src/components/EvidenceCard.tsx index 9ba922bca..6c94196f8 100644 --- a/web/src/components/EvidenceCard.tsx +++ b/web/src/components/EvidenceCard.tsx @@ -15,7 +15,7 @@ const StyledCard = styled(Card)` `; const TextContainer = styled.div` - ${responsiveSize("padding", 8, 24)} + padding: ${responsiveSize(8, 24)}; > * { overflow-wrap: break-word; margin: 0; @@ -35,7 +35,7 @@ const BottomShade = styled.div` display: flex; align-items: center; gap: 16px; - padding: 12px calc(8px + (24 - 8) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + padding: 12px ${responsiveSize(8, 24)}; > * { flex-basis: 1; flex-shrink: 0; @@ -46,8 +46,7 @@ const BottomShade = styled.div` const StyledA = styled.a` display: flex; margin-left: auto; - ${responsiveSize("gap", 5, 6)} - + gap: ${responsiveSize(5, 6)}; ${landscapeStyle( () => css` > svg { diff --git a/web/src/components/LatestCases.tsx b/web/src/components/LatestCases.tsx index b0d2492e1..0b800a135 100644 --- a/web/src/components/LatestCases.tsx +++ b/web/src/components/LatestCases.tsx @@ -8,11 +8,11 @@ import { isUndefined } from "utils/index"; import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` - ${responsiveSize("marginTop", 48, 80)} + margin-top: ${responsiveSize(48, 80)}; `; const Title = styled.h1` - ${responsiveSize("marginBottom", 16, 48)} + margin-bottom: ${responsiveSize(16, 48)}; `; const DisputeContainer = styled.div` diff --git a/web/src/components/Popup/Description/Appeal.tsx b/web/src/components/Popup/Description/Appeal.tsx index 3c1d0aca0..f8f750e45 100644 --- a/web/src/components/Popup/Description/Appeal.tsx +++ b/web/src/components/Popup/Description/Appeal.tsx @@ -9,17 +9,17 @@ const Container = styled.div` const StyledAmountFunded = styled.div` display: flex; - ${responsiveSize("marginLeft", 8, 44, 300)} - ${responsiveSize("marginRight", 8, 44, 300)} + margin-left: ${responsiveSize(8, 44, 300)}; + margin-right: ${responsiveSize(8, 44, 300)}; color: ${({ theme }) => theme.secondaryText}; text-align: center; `; const StyledOptionFunded = styled.div` display: flex; - ${responsiveSize("marginBottom", 16, 32, 300)} - ${responsiveSize("marginLeft", 8, 44, 300)} - ${responsiveSize("marginRight", 8, 44, 300)} + margin-bottom: ${responsiveSize(16, 32, 300)}; + margin-left: ${responsiveSize(8, 44, 300)}; + margin-right: ${responsiveSize(8, 44, 300)}; color: ${({ theme }) => theme.secondaryText}; text-align: center; `; diff --git a/web/src/components/Popup/Description/StakeWithdraw.tsx b/web/src/components/Popup/Description/StakeWithdraw.tsx index 9a02d2c92..d6b042a86 100644 --- a/web/src/components/Popup/Description/StakeWithdraw.tsx +++ b/web/src/components/Popup/Description/StakeWithdraw.tsx @@ -20,9 +20,9 @@ const StyledKlerosLogo = styled(KlerosLogo)` const StyledTitle = styled.div` display: flex; - ${responsiveSize("marginBottom", 16, 32, 300)} - ${responsiveSize("marginLeft", 8, 44, 300)} - ${responsiveSize("marginRight", 8, 44, 300)} + margin-bottom: ${responsiveSize(16, 32, 300)}; + margin-left: ${responsiveSize(8, 44, 300)}; + margin-right: ${responsiveSize(8, 44, 300)}; color: ${({ theme }) => theme.secondaryText}; text-align: center; `; @@ -31,7 +31,7 @@ const AmountStakedOrWithdrawnContainer = styled.div` font-size: 24px; font-weight: 600; color: ${({ theme }) => theme.secondaryPurple}; - ${responsiveSize("marginBottom", 0, 4, 300)} + margin-bottom: ${responsiveSize(0, 4, 300)}; `; const TotalStakeContainer = styled.div` @@ -39,12 +39,12 @@ const TotalStakeContainer = styled.div` font-size: 14px; align-items: center; justify-content: center; - ${responsiveSize("marginBottom", 8, 32, 300)} + margin-bottom: ${responsiveSize(8, 32, 300)}; `; const MyStakeContainer = styled.div` display: flex; - margin: 0px calc(4px + (8 - 4) * ((100vw - 300px) / (1250 - 300))); + margin: 0px ${responsiveSize(4, 8, 300)}; color: ${({ theme }) => theme.secondaryText}; `; diff --git a/web/src/components/Popup/ExtraInfo/StakeWithdrawExtraInfo.tsx b/web/src/components/Popup/ExtraInfo/StakeWithdrawExtraInfo.tsx index c52e4a1c5..aaf7d4675 100644 --- a/web/src/components/Popup/ExtraInfo/StakeWithdrawExtraInfo.tsx +++ b/web/src/components/Popup/ExtraInfo/StakeWithdrawExtraInfo.tsx @@ -6,9 +6,9 @@ const Container = styled.div` display: flex; color: ${({ theme }) => theme.secondaryText}; text-align: center; - ${responsiveSize("marginLeft", 8, 44, 300)} - ${responsiveSize("marginRight", 8, 44, 300)} - ${responsiveSize("marginTop", 8, 24, 300)} + margin-top: ${responsiveSize(8, 24, 300)}; + margin-right: ${responsiveSize(8, 44, 300)}; + margin-left: ${responsiveSize(8, 44, 300)}; `; const StakeWithdrawExtraInfo: React.FC = () => { diff --git a/web/src/components/Popup/ExtraInfo/VoteWithCommitExtraInfo.tsx b/web/src/components/Popup/ExtraInfo/VoteWithCommitExtraInfo.tsx index f2343c19d..11003f32a 100644 --- a/web/src/components/Popup/ExtraInfo/VoteWithCommitExtraInfo.tsx +++ b/web/src/components/Popup/ExtraInfo/VoteWithCommitExtraInfo.tsx @@ -7,8 +7,7 @@ const Container = styled.div` display: flex; gap: 4px; text-align: center; - margin: 0 calc(8px + (32 - 8) * ((100vw - 300px) / (1250 - 300))); - ${responsiveSize("marginTop", 8, 24, 300)} + margin: ${responsiveSize(8, 24, 300)} ${responsiveSize(8, 32, 300)} 0; font-size: 14px; font-weight: 400; line-height: 19px; diff --git a/web/src/components/Popup/MiniGuides/MainStructureTemplate.tsx b/web/src/components/Popup/MiniGuides/MainStructureTemplate.tsx index 4ad51e664..e8571a0f3 100644 --- a/web/src/components/Popup/MiniGuides/MainStructureTemplate.tsx +++ b/web/src/components/Popup/MiniGuides/MainStructureTemplate.tsx @@ -25,7 +25,7 @@ const Container = styled.div<{ isVisible: boolean }>` () => css` overflow-y: hidden; top: 50%; - ${responsiveSize("width", 700, 900)} + width: ${responsiveSize(700, 900)}; flex-direction: row; height: 500px; ` @@ -36,7 +36,7 @@ const LeftContainer = styled.div` display: grid; grid-template-rows: auto 1fr auto; width: 86vw; - ${responsiveSize("padding", 24, 32)} + padding: ${responsiveSize(24, 32)}; padding-bottom: 32px; background-color: ${({ theme }) => theme.whiteBackground}; border-top-left-radius: 3px; @@ -45,7 +45,7 @@ const LeftContainer = styled.div` ${landscapeStyle( () => css` overflow-y: hidden; - ${responsiveSize("width", 350, 450)} + width: ${responsiveSize(350, 450)}; height: 500px; ` )} @@ -61,7 +61,7 @@ const HowItWorks = styled.div` display: flex; align-items: center; gap: 8px; - ${responsiveSize("marginBottom", 32, 64)} + margin-bottom: ${responsiveSize(32, 64)}; label { color: ${({ theme }) => theme.secondaryPurple}; @@ -98,7 +98,7 @@ const Close = styled.label` () => css` display: flex; position: absolute; - ${responsiveSize("top", 24, 32)} + top: ${responsiveSize(24, 32)}; right: 17px; display: flex; align-items: flex-end; @@ -122,7 +122,7 @@ const RightContainer = styled.div` flex-direction: column; align-items: center; justify-content: center; - padding: calc(24px + (32 - 24) * (min(max(100vw, 375px), 1250px) - 375px) / 875) 17px; + padding: ${responsiveSize(24, 32)} 17px; background-color: ${({ theme }) => theme.mediumBlue}; border-top-right-radius: 3px; border-bottom-right-radius: 3px; @@ -130,7 +130,7 @@ const RightContainer = styled.div` ${landscapeStyle( () => css` overflow-y: hidden; - ${responsiveSize("width", 350, 450)} + width: ${responsiveSize(350, 450)}; height: 500px; ` )} diff --git a/web/src/components/Popup/MiniGuides/Onboarding/PnkLogoAndTitle.tsx b/web/src/components/Popup/MiniGuides/Onboarding/PnkLogoAndTitle.tsx index a69ddf18b..614de6b9a 100644 --- a/web/src/components/Popup/MiniGuides/Onboarding/PnkLogoAndTitle.tsx +++ b/web/src/components/Popup/MiniGuides/Onboarding/PnkLogoAndTitle.tsx @@ -12,9 +12,8 @@ const Container = styled.div` `; const StyledPnkIcon = styled(PnkIcon)` - ${responsiveSize("width", 220, 280)} - ${responsiveSize("height", 220, 252)} - + width: ${responsiveSize(220, 280)}; + height: ${responsiveSize(220, 252)}; [class$="stop-1"] { stop-color: ${({ theme }) => theme.primaryBlue}; } diff --git a/web/src/components/Popup/MiniGuides/PageContentsTemplate.tsx b/web/src/components/Popup/MiniGuides/PageContentsTemplate.tsx index e3bf070ea..81f7d1b7e 100644 --- a/web/src/components/Popup/MiniGuides/PageContentsTemplate.tsx +++ b/web/src/components/Popup/MiniGuides/PageContentsTemplate.tsx @@ -21,8 +21,7 @@ export const LeftContentContainer = styled.div` `; export const StyledImage = styled.div` - ${responsiveSize("width", 260, 460)} - + width: ${responsiveSize(260, 460)}; ${landscapeStyle( () => css` width: 389px; diff --git a/web/src/components/Popup/index.tsx b/web/src/components/Popup/index.tsx index 32224d159..1e3d58396 100644 --- a/web/src/components/Popup/index.tsx +++ b/web/src/components/Popup/index.tsx @@ -13,10 +13,7 @@ import { responsiveSize } from "styles/responsiveSize"; const Header = styled.h1` display: flex; - ${responsiveSize("marginTop", 12, 32)} - ${responsiveSize("marginBottom", 12, 24)} - ${responsiveSize("marginLeft", 8, 12)} - ${responsiveSize("marginRight", 8, 12)} + margin: ${responsiveSize(12, 32)} ${responsiveSize(8, 12)} ${responsiveSize(12, 24)}; text-align: center; font-size: 24px; font-weight: 600; @@ -24,21 +21,20 @@ const Header = styled.h1` `; const IconContainer = styled.div` - ${responsiveSize("width", 150, 228)} - + width: ${responsiveSize(150, 228)}; display: flex; align-items: center; justify-content: center; svg { display: inline-block; - ${responsiveSize("width", 150, 228)} - ${responsiveSize("height", 150, 228)} + width: ${responsiveSize(150, 228)}; + height: ${responsiveSize(150, 228)}; } `; const StyledButton = styled(Button)` - ${responsiveSize("margin", 16, 32)} + margin: ${responsiveSize(16, 32)}; `; const Container = styled.div` @@ -68,7 +64,7 @@ const Container = styled.div` ${landscapeStyle( () => css` overflow-y: hidden; - ${responsiveSize("width", 300, 600)} + width: ${responsiveSize(300, 600)}; ` )} `; @@ -76,9 +72,9 @@ const Container = styled.div` const VoteDescriptionContainer = styled.div` display: flex; flex-direction: column; - ${responsiveSize("marginBottom", 16, 32)} - ${responsiveSize("marginLeft", 8, 32)} - ${responsiveSize("marginRight", 8, 32)} + margin-bottom: ${responsiveSize(16, 32)}; + margin-left: ${responsiveSize(8, 12)}; + margin-right: ${responsiveSize(8, 12)}; color: ${({ theme }) => theme.secondaryText}; text-align: center; line-height: 21.8px; diff --git a/web/src/components/StatDisplay.tsx b/web/src/components/StatDisplay.tsx index 8d6014b1e..23a1d9ba7 100644 --- a/web/src/components/StatDisplay.tsx +++ b/web/src/components/StatDisplay.tsx @@ -11,7 +11,7 @@ const Container = styled.div` ${landscapeStyle( () => css` - ${responsiveSize("marginBottom", 16, 30)} + margin-bottom: ${responsiveSize(16, 30)}; ` )} `; diff --git a/web/src/components/StyledSkeleton.tsx b/web/src/components/StyledSkeleton.tsx index 6f6ebf749..a38cb6906 100644 --- a/web/src/components/StyledSkeleton.tsx +++ b/web/src/components/StyledSkeleton.tsx @@ -25,7 +25,7 @@ const SkeletonDisputeCardContainer = styled.div` `; const StyledSkeletonDisputeCard = styled(Skeleton)` - ${responsiveSize("height", 270, 296)} + height: ${responsiveSize(270, 296)}; `; const StyledSkeletonDisputeListItem = styled(Skeleton)` diff --git a/web/src/components/Verdict/DisputeTimeline.tsx b/web/src/components/Verdict/DisputeTimeline.tsx index 667306584..ec085ce2a 100644 --- a/web/src/components/Verdict/DisputeTimeline.tsx +++ b/web/src/components/Verdict/DisputeTimeline.tsx @@ -28,7 +28,7 @@ const StyledTimeline = styled(CustomTimeline)` const EnforcementContainer = styled.div` display: flex; gap: 8px; - ${responsiveSize("marginTop", 12, 24)} + margin-top: ${responsiveSize(12, 24)}; fill: ${({ theme }) => theme.secondaryText}; small { diff --git a/web/src/components/Verdict/FinalDecision.tsx b/web/src/components/Verdict/FinalDecision.tsx index d3b0eec95..da988eb78 100644 --- a/web/src/components/Verdict/FinalDecision.tsx +++ b/web/src/components/Verdict/FinalDecision.tsx @@ -8,6 +8,7 @@ import { useDisputeDetailsQuery } from "queries/useDisputeDetailsQuery"; import { useDisputeTemplate } from "queries/useDisputeTemplate"; import LightButton from "../LightButton"; import VerdictBanner from "./VerdictBanner"; +import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` width: 100%; @@ -74,7 +75,7 @@ const Divider = styled.hr` border: none; height: 1px; background-color: ${({ theme }) => theme.stroke}; - margin: calc(16px + (32 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875) 0px; + margin: ${responsiveSize(16, 32)} 0px; `; interface IFinalDecision { diff --git a/web/src/components/Verdict/VerdictBanner.tsx b/web/src/components/Verdict/VerdictBanner.tsx index d246b7882..4e9456687 100644 --- a/web/src/components/Verdict/VerdictBanner.tsx +++ b/web/src/components/Verdict/VerdictBanner.tsx @@ -7,7 +7,7 @@ import { responsiveSize } from "styles/responsiveSize"; const BannerContainer = styled.div` display: flex; gap: 8px; - ${responsiveSize("marginBottom", 16, 24)} + margin-bottom: ${responsiveSize(16, 24)}; svg { width: 16px; height: 16px; diff --git a/web/src/layout/Header/DesktopHeader.tsx b/web/src/layout/Header/DesktopHeader.tsx index 9bc8942f6..6ee5dfd5a 100644 --- a/web/src/layout/Header/DesktopHeader.tsx +++ b/web/src/layout/Header/DesktopHeader.tsx @@ -47,7 +47,7 @@ const MiddleSide = styled.div` const RightSide = styled.div` display: flex; - ${responsiveSize("gap", 8, 16, 300, 1024)} + gap: ${responsiveSize(8, 16, 300, 1024)}; margin-left: 8px; canvas { @@ -59,8 +59,8 @@ const LightButtonContainer = styled.div` display: flex; align-items: center; width: 16px; - ${responsiveSize("marginLeft", 4, 8)} - ${responsiveSize("marginRight", 12, 16)} + margin-left: ${responsiveSize(4, 8)}; + margin-right: ${responsiveSize(12, 16)}; `; const StyledLink = styled(Link)` diff --git a/web/src/layout/Header/navbar/DappList.tsx b/web/src/layout/Header/navbar/DappList.tsx index f11b84a84..eead0d5dd 100644 --- a/web/src/layout/Header/navbar/DappList.tsx +++ b/web/src/layout/Header/navbar/DappList.tsx @@ -53,7 +53,7 @@ const Container = styled.div` left: 0; right: auto; transform: none; - ${responsiveSize("width", 300, 480)} + width: ${responsiveSize(300, 480)}; max-height: 80vh; ` )} @@ -62,13 +62,13 @@ const Container = styled.div` const ItemsDiv = styled.div` display: grid; overflow-y: auto; - padding: 16px calc(8px + (24 - 8) * ((100vw - 480px) / (1250 - 480))); + padding: 16px ${responsiveSize(8, 24, 480)}; row-gap: 8px; column-gap: 2px; justify-items: center; max-width: 480px; min-width: 300px; - ${responsiveSize("width", 300, 480)} + width: ${responsiveSize(300, 480)}; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); `; diff --git a/web/src/layout/Header/navbar/Explore.tsx b/web/src/layout/Header/navbar/Explore.tsx index 4160411b4..2d7a2788f 100644 --- a/web/src/layout/Header/navbar/Explore.tsx +++ b/web/src/layout/Header/navbar/Explore.tsx @@ -13,7 +13,7 @@ const Container = styled.div` ${landscapeStyle( () => css` flex-direction: row; - ${responsiveSize("gap", 4, 16)} + gap: ${responsiveSize(4, 16)}; ` )}; `; diff --git a/web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/index.tsx b/web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/index.tsx index 7bed3fa07..aa9c16750 100644 --- a/web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/index.tsx +++ b/web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/index.tsx @@ -7,12 +7,13 @@ import FormContact from "./FormContact"; import messages from "../../../../../../../consts/eip712-messages"; import { EMAIL_REGEX, TELEGRAM_REGEX } from "../../../../../../../consts/index"; import { ISettings } from "../../../index"; +import { responsiveSize } from "styles/responsiveSize"; const FormContainer = styled.form` position: relative; display: flex; flex-direction: column; - padding: 0 calc(12px + (32 - 12) * ((100vw - 300px) / (1250 - 300))); + padding: 0 ${responsiveSize(12, 32, 300)}; padding-bottom: 16px; `; diff --git a/web/src/layout/Header/navbar/Menu/Settings/index.tsx b/web/src/layout/Header/navbar/Menu/Settings/index.tsx index eedf4858a..d9b5d688f 100644 --- a/web/src/layout/Header/navbar/Menu/Settings/index.tsx +++ b/web/src/layout/Header/navbar/Menu/Settings/index.tsx @@ -45,13 +45,13 @@ const StyledSettingsText = styled.div` `; const StyledTabs = styled(Tabs)` - padding: 0 calc(8px + (32 - 8) * ((100vw - 300px) / (1250 - 300))); + padding: 0 ${responsiveSize(8, 32, 300)}; width: 86vw; max-width: 660px; ${landscapeStyle( () => css` - ${responsiveSize("width", 300, 424, 300)} + width: ${responsiveSize(300, 424, 300)}; ` )} `; diff --git a/web/src/layout/Header/navbar/Product.tsx b/web/src/layout/Header/navbar/Product.tsx index b5fb9d7f9..a4ad9e43e 100644 --- a/web/src/layout/Header/navbar/Product.tsx +++ b/web/src/layout/Header/navbar/Product.tsx @@ -16,7 +16,7 @@ const Container = styled.a` transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); } gap: 8px; - ${responsiveSize("width", 100, 130)} + width: ${responsiveSize(100, 130)}; white-space: nowrap; background-color: ${({ theme }) => theme.lightBackground}; diff --git a/web/src/pages/Cases/CaseDetails/Appeal/index.tsx b/web/src/pages/Cases/CaseDetails/Appeal/index.tsx index e0f08bd99..df5269829 100644 --- a/web/src/pages/Cases/CaseDetails/Appeal/index.tsx +++ b/web/src/pages/Cases/CaseDetails/Appeal/index.tsx @@ -9,7 +9,7 @@ import { ClassicAppealProvider } from "hooks/useClassicAppealContext"; import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` - ${responsiveSize("padding", 16, 32)} + padding: ${responsiveSize(16, 32)}; `; export const AppealHeader = styled.div` diff --git a/web/src/pages/Cases/CaseDetails/Evidence/index.tsx b/web/src/pages/Cases/CaseDetails/Evidence/index.tsx index 2c0eb9a97..b409a9b17 100644 --- a/web/src/pages/Cases/CaseDetails/Evidence/index.tsx +++ b/web/src/pages/Cases/CaseDetails/Evidence/index.tsx @@ -19,7 +19,7 @@ const Container = styled.div` gap: 16px; align-items: center; - ${responsiveSize("padding", 16, 32)} + padding: ${responsiveSize(16, 32)}; `; const StyledButton = styled(Button)` diff --git a/web/src/pages/Cases/CaseDetails/Overview/Policies.tsx b/web/src/pages/Cases/CaseDetails/Overview/Policies.tsx index 7e794fed3..460dcee41 100644 --- a/web/src/pages/Cases/CaseDetails/Overview/Policies.tsx +++ b/web/src/pages/Cases/CaseDetails/Overview/Policies.tsx @@ -11,8 +11,7 @@ const ShadeArea = styled.div` flex-direction: column; justify-content: center; width: 100%; - padding: calc(16px + (20 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875) - calc(16px + (32 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + padding: ${responsiveSize(16, 20)} ${responsiveSize(16, 32)}; margin-top: 16px; background-color: ${({ theme }) => theme.mediumBlue}; @@ -49,7 +48,7 @@ const StyledPolicyIcon = styled(PolicyIcon)` const LinkContainer = styled.div` display: flex; - ${responsiveSize("gap", 8, 24)} + gap: ${responsiveSize(8, 24)}; `; interface IPolicies { diff --git a/web/src/pages/Cases/CaseDetails/Overview/index.tsx b/web/src/pages/Cases/CaseDetails/Overview/index.tsx index c2d35bda2..ef9a003d5 100644 --- a/web/src/pages/Cases/CaseDetails/Overview/index.tsx +++ b/web/src/pages/Cases/CaseDetails/Overview/index.tsx @@ -20,8 +20,8 @@ const Container = styled.div` height: auto; display: flex; flex-direction: column; - ${responsiveSize("gap", 16, 32)} - ${responsiveSize("padding", 16, 32)} + gap: ${responsiveSize(16, 32)}; + padding: ${responsiveSize(16, 32)}; `; const Divider = styled.hr` diff --git a/web/src/pages/Cases/CaseDetails/Timeline.tsx b/web/src/pages/Cases/CaseDetails/Timeline.tsx index 6dc632d58..a2e04429e 100644 --- a/web/src/pages/Cases/CaseDetails/Timeline.tsx +++ b/web/src/pages/Cases/CaseDetails/Timeline.tsx @@ -14,9 +14,7 @@ const TimeLineContainer = styled(Box)` width: 100%; height: 98px; border-radius: 0px; - padding: 20px 8px 0px 8px; - ${responsiveSize("marginTop", 16, 48)} - ${responsiveSize("marginBottom", 12, 22)} + padding: ${responsiveSize(16, 48)} 8px 0px ${responsiveSize(12, 22)}; background-color: ${({ theme }) => theme.whiteBackground}; ${landscapeStyle( @@ -27,7 +25,7 @@ const TimeLineContainer = styled(Box)` )} `; -const StyledSteps = styled(Steps)`d +const StyledSteps = styled(Steps)` display: flex; justify-content: space-between; width: 85%; diff --git a/web/src/pages/Cases/CaseDetails/Voting/index.tsx b/web/src/pages/Cases/CaseDetails/Voting/index.tsx index 3004face6..087ad4199 100644 --- a/web/src/pages/Cases/CaseDetails/Voting/index.tsx +++ b/web/src/pages/Cases/CaseDetails/Voting/index.tsx @@ -19,7 +19,7 @@ import InfoCircle from "tsx:svgs/icons/info-circle.svg"; import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` - ${responsiveSize("padding", 16, 32)} + padding: ${responsiveSize(16, 32)}; `; const InfoContainer = styled.div` @@ -27,7 +27,7 @@ const InfoContainer = styled.div` flex-direction: row; color: ${({ theme }) => theme.secondaryText}; align-items: center; - ${responsiveSize("gap", 4, 8, 300)} + gap: ${responsiveSize(4, 8, 300)}; svg { min-width: 16px; diff --git a/web/src/pages/Cases/CaseDetails/index.tsx b/web/src/pages/Cases/CaseDetails/index.tsx index 4cbbf9da8..cb01e10de 100644 --- a/web/src/pages/Cases/CaseDetails/index.tsx +++ b/web/src/pages/Cases/CaseDetails/index.tsx @@ -21,7 +21,7 @@ const StyledCard = styled(Card)` `; const Header = styled.h1` - ${responsiveSize("marginBottom", 16, 48)} + margin-bottom: ${responsiveSize(16, 48)}; `; const CaseDetails: React.FC = () => { diff --git a/web/src/pages/Cases/index.tsx b/web/src/pages/Cases/index.tsx index 7333bcfcb..dcaef535a 100644 --- a/web/src/pages/Cases/index.tsx +++ b/web/src/pages/Cases/index.tsx @@ -8,9 +8,7 @@ import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` width: 100%; background-color: ${({ theme }) => theme.lightBackground}; - ${responsiveSize("padding", 24, 136)} - ${responsiveSize("paddingTop", 32, 80)} - ${responsiveSize("paddingBottom", 76, 96)} + padding: ${responsiveSize(32, 80)} ${responsiveSize(24, 136)} ${responsiveSize(76, 96)}; max-width: 1780px; margin: 0 auto; `; diff --git a/web/src/pages/Courts/CourtDetails/Stats.tsx b/web/src/pages/Courts/CourtDetails/Stats.tsx index 532f8a1be..58c36f39e 100644 --- a/web/src/pages/Courts/CourtDetails/Stats.tsx +++ b/web/src/pages/Courts/CourtDetails/Stats.tsx @@ -16,6 +16,7 @@ import VoteStake from "svgs/icons/vote-stake.svg"; import PNKIcon from "svgs/icons/pnk.svg"; import PNKRedistributedIcon from "svgs/icons/redistributed-pnk.svg"; import EthereumIcon from "svgs/icons/ethereum.svg"; +import { responsiveSize } from "styles/responsiveSize"; const StyledCard = styled.div` width: auto; @@ -23,7 +24,7 @@ const StyledCard = styled.div` display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); - padding: calc(0px + (32 - 0) * (min(max(100vw, 375px), 1250px) - 375px) / 875) 0; + padding: ${responsiveSize(0, 32)} 0; padding-bottom: 0px; ${landscapeStyle( diff --git a/web/src/pages/Courts/CourtDetails/index.tsx b/web/src/pages/Courts/CourtDetails/index.tsx index cc46e385d..0a8074cf1 100644 --- a/web/src/pages/Courts/CourtDetails/index.tsx +++ b/web/src/pages/Courts/CourtDetails/index.tsx @@ -60,8 +60,8 @@ const ButtonContainer = styled.div` `; const StyledCard = styled(Card)` - ${responsiveSize("padding", 16, 32)} - ${responsiveSize("marginTop", 16, 24)} + padding: ${responsiveSize(16, 32)}; + margin-top: ${responsiveSize(16, 24)}; width: 100%; height: auto; min-height: 100px; diff --git a/web/src/pages/Courts/index.tsx b/web/src/pages/Courts/index.tsx index c63d022a7..019c22ee9 100644 --- a/web/src/pages/Courts/index.tsx +++ b/web/src/pages/Courts/index.tsx @@ -8,10 +8,7 @@ import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` width: 100%; background-color: ${({ theme }) => theme.lightBackground}; - ${responsiveSize("padding", 24, 136)} - ${responsiveSize("paddingTop", 32, 80)} - ${responsiveSize("paddingBottom", 76, 96)} - + padding: ${responsiveSize(32, 80)} ${responsiveSize(24, 136)} ${responsiveSize(76, 96)}; max-width: 1780px; margin: 0 auto; `; diff --git a/web/src/pages/Dashboard/Courts/Header.tsx b/web/src/pages/Dashboard/Courts/Header.tsx index a09b5ea8b..32fc30759 100644 --- a/web/src/pages/Dashboard/Courts/Header.tsx +++ b/web/src/pages/Dashboard/Courts/Header.tsx @@ -13,7 +13,7 @@ const Container = styled.div` gap: 12px; align-items: flex-start; justify-content: space-between; - ${responsiveSize("marginBottom", 32, 48)} + margin-bottom: ${responsiveSize(32, 48)}; ${landscapeStyle( () => css` diff --git a/web/src/pages/Dashboard/JurorInfo/Header.tsx b/web/src/pages/Dashboard/JurorInfo/Header.tsx index beda43f69..9b5532faa 100644 --- a/web/src/pages/Dashboard/JurorInfo/Header.tsx +++ b/web/src/pages/Dashboard/JurorInfo/Header.tsx @@ -11,7 +11,7 @@ const Container = styled.div` display: flex; flex-direction: column; justify-content: flex-start; - ${responsiveSize("marginBottom", 32, 48)} + margin-bottom: ${responsiveSize(32, 48)}; gap: 12px; ${landscapeStyle( diff --git a/web/src/pages/Dashboard/JurorInfo/index.tsx b/web/src/pages/Dashboard/JurorInfo/index.tsx index 746ba81f4..b8044e543 100644 --- a/web/src/pages/Dashboard/JurorInfo/index.tsx +++ b/web/src/pages/Dashboard/JurorInfo/index.tsx @@ -28,7 +28,7 @@ const Card = styled(_Card)` ${landscapeStyle( () => css` flex-direction: row; - ${responsiveSize("gap", 24, 64)} + gap: ${responsiveSize(24, 64)}; height: 236px; ` )} diff --git a/web/src/pages/Dashboard/index.tsx b/web/src/pages/Dashboard/index.tsx index 1daa60677..e66876de7 100644 --- a/web/src/pages/Dashboard/index.tsx +++ b/web/src/pages/Dashboard/index.tsx @@ -16,10 +16,7 @@ import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` width: 100%; background-color: ${({ theme }) => theme.lightBackground}; - ${responsiveSize("padding", 24, 136)} - ${responsiveSize("paddingTop", 32, 80)} - ${responsiveSize("paddingBottom", 76, 96)} - + padding: ${responsiveSize(32, 80)} ${responsiveSize(24, 136)} ${responsiveSize(76, 96)}; max-width: 1780px; margin: 0 auto; `; @@ -28,7 +25,7 @@ const StyledCasesDisplay = styled(CasesDisplay)` margin-top: 64px; h1 { - ${responsiveSize("marginBottom", 16, 48)} + margin-bottom: ${responsiveSize(16, 48)}; } `; diff --git a/web/src/pages/Home/Community/index.tsx b/web/src/pages/Home/Community/index.tsx index b9fd2ee4f..aaf0ab380 100644 --- a/web/src/pages/Home/Community/index.tsx +++ b/web/src/pages/Home/Community/index.tsx @@ -7,10 +7,10 @@ import { section } from "consts/community-elements"; import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` - ${responsiveSize("marginTop", 44, 64)} + margin-top: ${responsiveSize(44, 64)}; h1 { - ${responsiveSize("marginBottom", 16, 48)} + margin-bottom: ${responsiveSize(16, 48)}; } `; diff --git a/web/src/pages/Home/CourtOverview/Chart.tsx b/web/src/pages/Home/CourtOverview/Chart.tsx index 6e29a65eb..c4a403284 100644 --- a/web/src/pages/Home/CourtOverview/Chart.tsx +++ b/web/src/pages/Home/CourtOverview/Chart.tsx @@ -8,7 +8,7 @@ import { useHomePageContext } from "hooks/useHomePageContext"; import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` - ${responsiveSize("marginBottom", 32, 48)} + margin-bottom: ${responsiveSize(32, 48)}; display: flex; flex-direction: column; `; diff --git a/web/src/pages/Home/CourtOverview/Stats.tsx b/web/src/pages/Home/CourtOverview/Stats.tsx index f7f9c6e85..2aaa686f9 100644 --- a/web/src/pages/Home/CourtOverview/Stats.tsx +++ b/web/src/pages/Home/CourtOverview/Stats.tsx @@ -21,8 +21,8 @@ const StyledCard = styled(Card)` width: auto; height: fit-content; gap: 32px; - ${responsiveSize("padding", 16, 30)} - ${responsiveSize("paddingLeft", 16, 35)} + padding: ${responsiveSize(16, 30)}; + padding-left: ${responsiveSize(16, 35)}; padding-bottom: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); diff --git a/web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx b/web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx index dcff93a05..f2102ba20 100644 --- a/web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx +++ b/web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx @@ -23,9 +23,9 @@ const Container = styled.div` css` display: grid; grid-template-columns: - min-content repeat(3, calc(160px + (180 - 160) * (min(max(100vw, 900px), 1250px) - 900px) / 350)) + min-content repeat(3, ${responsiveSize(160, 180, 900)}) auto; - ${responsiveSize("columnGap", 12, 28, 900)} + column-gap: ${responsiveSize(12, 28, 900)}; align-items: center; ` )} diff --git a/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx b/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx index d58c3f6a0..5c560a0cb 100644 --- a/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx +++ b/web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx @@ -21,9 +21,9 @@ const Container = styled.div` () => css` display: grid; grid-template-columns: - min-content repeat(3, calc(160px + (180 - 160) * (min(max(100vw, 900px), 1250px) - 900px) / 350)) + min-content repeat(3, ${responsiveSize(160, 180, 900)}) auto; - ${responsiveSize("columnGap", 12, 28, 900)} + column-gap: ${responsiveSize(12, 28, 900)}; ` )} `; diff --git a/web/src/pages/Home/TopJurors/index.tsx b/web/src/pages/Home/TopJurors/index.tsx index 0251ac564..ea66d657e 100644 --- a/web/src/pages/Home/TopJurors/index.tsx +++ b/web/src/pages/Home/TopJurors/index.tsx @@ -9,11 +9,11 @@ import { landscapeStyle } from "styles/landscapeStyle"; import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` - ${responsiveSize("marginTop", 64, 80)} + margin-top: ${responsiveSize(64, 80)}; `; const Title = styled.h1` - ${responsiveSize("marginBottom", 16, 48)} + margin-bottom: ${responsiveSize(16, 48)}; `; const ListContainer = styled.div` diff --git a/web/src/pages/Home/index.tsx b/web/src/pages/Home/index.tsx index 23dbd78f3..5f8909920 100644 --- a/web/src/pages/Home/index.tsx +++ b/web/src/pages/Home/index.tsx @@ -12,9 +12,7 @@ import { responsiveSize } from "styles/responsiveSize"; const Container = styled.div` width: 100%; background-color: ${({ theme }) => theme.lightBackground}; - ${responsiveSize("padding", 24, 132)} - ${responsiveSize("paddingTop", 32, 72)} - ${responsiveSize("paddingBottom", 76, 96)} + padding: ${responsiveSize(32, 72)} ${responsiveSize(24, 132)} ${responsiveSize(76, 96)}; max-width: 1780px; margin: 0 auto; `; diff --git a/web/src/styles/responsiveSize.ts b/web/src/styles/responsiveSize.ts index 6b0a03fd9..0af044d8c 100644 --- a/web/src/styles/responsiveSize.ts +++ b/web/src/styles/responsiveSize.ts @@ -1,29 +1,12 @@ -import { css, CSSProperties } from "styled-components"; - -//supported font types -type FontType = "px" | "rem" | "em" | "vw" | "vh" | "%" | "pt"; - /** - * @description this func applies repsonsivenexx to a css property, the value will range from minSize to maxSize - * @param property the css property to apply responsive sizes too + * @description this func applies repsonsiveness to a css property, the value will range from minSize to maxSize * @param minSize the minimum value of the property * @param maxSize max value of the property * @param minScreen the min screen width at which the property will be at minSize * @param maxScreen the max screen width at which the property will be at maxSize - * @param fontType - * @returns * */ -export const responsiveSize = ( - property: keyof CSSProperties, - minSize: number, - maxSize: number, - minScreen: number = 375, - maxScreen: number = 1250, - fontType: FontType = "px" -) => - css({ - [property]: `calc(${minSize}${fontType} + (${maxSize} - ${minSize}) * (min(max(100vw, ${minScreen}${fontType}), ${maxScreen}${fontType}) - ${minScreen}${fontType}) / (${ - maxScreen - minScreen - }))`, - }); +export const responsiveSize = (minSize: number, maxSize: number, minScreen: number = 375, maxScreen: number = 1250) => + `calc(${minSize}px + (${maxSize} - ${minSize}) * (min(max(100vw, ${minScreen}px), ${maxScreen}px) - ${minScreen}px) / (${ + maxScreen - minScreen + }))`; From ad4fd6861904e01f12f37f71698ad900869fabb3 Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Tue, 12 Dec 2023 20:49:47 +0530 Subject: [PATCH 20/77] refactor(web): update-Banner-name-to-TestnetBanner --- web/src/layout/Header/{Banner.tsx => TestnetBanner.tsx} | 2 +- web/src/layout/Header/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename web/src/layout/Header/{Banner.tsx => TestnetBanner.tsx} (94%) diff --git a/web/src/layout/Header/Banner.tsx b/web/src/layout/Header/TestnetBanner.tsx similarity index 94% rename from web/src/layout/Header/Banner.tsx rename to web/src/layout/Header/TestnetBanner.tsx index 3fed10426..e0ed68e3a 100644 --- a/web/src/layout/Header/Banner.tsx +++ b/web/src/layout/Header/TestnetBanner.tsx @@ -24,7 +24,7 @@ const StyledP = styled.p` margin: 0; `; -export const Banner: React.FC = () => { +export const TestnetBanner: React.FC = () => { return ( diff --git a/web/src/layout/Header/index.tsx b/web/src/layout/Header/index.tsx index 8f7a23e12..b4b5255be 100644 --- a/web/src/layout/Header/index.tsx +++ b/web/src/layout/Header/index.tsx @@ -2,7 +2,7 @@ import React from "react"; import styled from "styled-components"; import MobileHeader from "./MobileHeader"; import DesktopHeader from "./DesktopHeader"; -import { Banner } from "./Banner"; +import { TestnetBanner } from "./TestnetBanner"; const Container = styled.div` position: sticky; @@ -32,7 +32,7 @@ export const PopupContainer = styled.div` const Header: React.FC = () => { return ( - {process.env.REACT_APP_DEPLOYMENT === "testnet" && } + {process.env.REACT_APP_DEPLOYMENT === "testnet" && } From 27e7fd235f09996b0a3960a24ad1b72c853f3a6f Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Tue, 12 Dec 2023 21:14:15 +0530 Subject: [PATCH 21/77] refactor(web): use-better-conditional-rendering-syntax --- web/src/layout/Header/navbar/Debug.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/layout/Header/navbar/Debug.tsx b/web/src/layout/Header/navbar/Debug.tsx index e1d2bcb44..0e6b91402 100644 --- a/web/src/layout/Header/navbar/Debug.tsx +++ b/web/src/layout/Header/navbar/Debug.tsx @@ -3,6 +3,7 @@ import styled from "styled-components"; import { useSortitionModulePhase } from "hooks/contracts/generated"; import { useToggleTheme } from "hooks/useToggleThemeContext"; import { GIT_BRANCH, GIT_DIRTY, GIT_HASH, GIT_TAGS, GIT_URL, RELEASE_VERSION } from "consts/index"; +import { isUndefined } from "utils/index"; const Container = styled.div` display: flex; @@ -46,7 +47,7 @@ const ServicesStatus = () => { const [theme] = useToggleTheme(); const statusUrlParameters = useMemo(() => (theme === "light" ? "?theme=light" : "?theme=dark"), [theme]); const statusUrl = process.env.REACT_APP_STATUS_URL; - return ; + return ; }; enum Phases { @@ -59,7 +60,7 @@ const Phase = () => { const { data: phase } = useSortitionModulePhase({ watch: true, }); - return <>{phase !== undefined && Phase: {Phases[phase]}}; + return <>{isUndefined(phase) ? null : Phase: {Phases[phase]}}; }; const Debug: React.FC = () => { From a946cdaeb8c5ed020f534e5fee829499d905f18a Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Tue, 12 Dec 2023 22:51:12 +0530 Subject: [PATCH 22/77] refactor(web): use-ternary-operator --- web/src/layout/Header/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/layout/Header/index.tsx b/web/src/layout/Header/index.tsx index b4b5255be..affc3815d 100644 --- a/web/src/layout/Header/index.tsx +++ b/web/src/layout/Header/index.tsx @@ -32,7 +32,7 @@ export const PopupContainer = styled.div` const Header: React.FC = () => { return ( - {process.env.REACT_APP_DEPLOYMENT === "testnet" && } + {process.env.REACT_APP_DEPLOYMENT === "testnet" ? : null} From 7451435fdb700055da0791fcef92b42be35685ba Mon Sep 17 00:00:00 2001 From: alcercu <333aleix333@gmail.com> Date: Wed, 13 Dec 2023 10:06:28 +0100 Subject: [PATCH 23/77] fix(web): add overlay to mobile navbar and generalize top position for testnet banner --- web/src/layout/Header/navbar/index.tsx | 67 ++++++++++++++++---------- 1 file changed, 42 insertions(+), 25 deletions(-) diff --git a/web/src/layout/Header/navbar/index.tsx b/web/src/layout/Header/navbar/index.tsx index fc7205d52..b3c6e3d16 100644 --- a/web/src/layout/Header/navbar/index.tsx +++ b/web/src/layout/Header/navbar/index.tsx @@ -16,12 +16,26 @@ import Settings from "./Menu/Settings"; import { DisconnectWalletButton } from "./Menu/Settings/General"; import { PopupContainer } from ".."; +const Wrapper = styled.div<{ isOpen: boolean }>` + visibility: ${({ isOpen }) => (isOpen ? "visible" : "hidden")}; + position: absolute; + top: 100%; + left: 0; + width: 100vw; + height: 100vh; + z-index: 30; +`; + +const StyledOverlay = styled(Overlay)` + top: unset; +`; + const Container = styled.div<{ isOpen: boolean }>` position: absolute; - top: 64px; + top: 0; left: 0; right: 0; - max-height: calc(100vh - 64px); + max-height: calc(100vh - 160px); overflow-y: auto; z-index: 1; background-color: ${({ theme }) => theme.whiteBackground}; @@ -74,29 +88,32 @@ const NavBar: React.FC = () => { return ( <> - - { - toggleIsDappListOpen(); - }} - Icon={KlerosSolutionsIcon} - /> -
- -
- - - {isConnected && ( - - - - )} - -
- -
- + + + + { + toggleIsDappListOpen(); + }} + Icon={KlerosSolutionsIcon} + /> +
+ +
+ + + {isConnected && ( + + + + )} + +
+ +
+ + {(isDappListOpen || isHelpOpen || isSettingsOpen) && ( From 60a156d77149008f61ea519d44510125ea572b9a Mon Sep 17 00:00:00 2001 From: unknownunknown1 Date: Tue, 29 Aug 2023 17:56:39 +1000 Subject: [PATCH 24/77] feat(KC): instant staking --- contracts/src/arbitration/KlerosCore.sol | 94 +++++++++++++++---- contracts/src/arbitration/SortitionModule.sol | 62 ++++++++++-- .../interfaces/ISortitionModule.sol | 9 +- 3 files changed, 136 insertions(+), 29 deletions(-) diff --git a/contracts/src/arbitration/KlerosCore.sol b/contracts/src/arbitration/KlerosCore.sol index 871df03c6..6fca182a2 100644 --- a/contracts/src/arbitration/KlerosCore.sol +++ b/contracts/src/arbitration/KlerosCore.sol @@ -116,6 +116,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { event StakeSet(address indexed _address, uint256 _courtID, uint256 _amount); event StakeDelayed(address indexed _address, uint256 _courtID, uint256 _amount); + event StakePartiallyDelayed(address indexed _address, uint256 _courtID, uint256 _amount); event NewPeriod(uint256 indexed _disputeID, Period _period); event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable); event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable); @@ -170,6 +171,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { uint256 _feeAmount, IERC20 _feeToken ); + event PartiallyDelayedStakeWithdrawn(uint96 indexed _courtID, address indexed _account, uint256 _withdrawnAmount); // ************************************* // // * Function Modifiers * // @@ -456,13 +458,54 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { /// @dev Sets the caller's stake in a court. /// @param _courtID The ID of the court. /// @param _newStake The new stake. + /// Note that the existing delayed stake will be nullified as non-relevant. function setStake(uint96 _courtID, uint256 _newStake) external { - if (!_setStakeForAccount(msg.sender, _courtID, _newStake)) revert StakingFailed(); + removeDelayedStake(_courtID); + if (!_setStakeForAccount(msg.sender, _courtID, _newStake, false)) revert StakingFailed(); } - function setStakeBySortitionModule(address _account, uint96 _courtID, uint256 _newStake) external { + /// @dev Removes the latest delayed stake if there is any. + /// @param _courtID The ID of the court. + function removeDelayedStake(uint96 _courtID) public { + sortitionModule.checkExistingDelayedStake(_courtID, msg.sender); + } + + function withdrawPartiallyDelayedStake(uint96 _courtID, address _juror, uint256 _amountToWithdraw) external { if (msg.sender != address(sortitionModule)) revert WrongCaller(); - _setStakeForAccount(_account, _courtID, _newStake); + uint256 actualAmount = _amountToWithdraw; + Juror storage juror = jurors[_juror]; + if (juror.stakedPnk <= actualAmount) { + actualAmount = juror.stakedPnk; + } + require(pinakion.safeTransfer(_juror, actualAmount)); + // StakePnk can become lower because of penalty, thus we adjust the amount for it. stakedPnkByCourt can't be penalized so subtract the default amount. + juror.stakedPnk -= actualAmount; + juror.stakedPnkByCourt[_courtID] -= _amountToWithdraw; + emit PartiallyDelayedStakeWithdrawn(_courtID, _juror, _amountToWithdraw); + // Note that if we don't delete court here it'll be duplicated after staking. + if (juror.stakedPnkByCourt[_courtID] == 0) { + for (uint256 i = juror.courtIDs.length; i > 0; i--) { + if (juror.courtIDs[i - 1] == _courtID) { + juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1]; + juror.courtIDs.pop(); + break; + } + } + } + } + + function setStakeBySortitionModule( + address _account, + uint96 _courtID, + uint256 _stake, + bool _alreadyTransferred + ) external { + if (msg.sender != address(sortitionModule)) revert WrongCaller(); + // Always nullify the latest delayed stake before setting a new value. + // Note that we check the delayed stake here too because the check in `setStake` can be bypassed + // if the stake was updated automatically during `execute` (e.g. when unstaking inactive juror). + removeDelayedStake(_courtID); + _setStakeForAccount(_account, _courtID, _newStake, _alreadyTransferred); } /// @inheritdoc IArbitratorV2 @@ -1029,11 +1072,17 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { /// @param _account The address of the juror. /// @param _courtID The ID of the court. /// @param _newStake The new stake. + /// @param _alreadyTransferred True if the tokens were already transferred from juror. Only relevant for delayed stakes. /// @return succeeded True if the call succeeded, false otherwise. function _setStakeForAccount( + address _account, + uint96 _courtID, + uint256 _newStake + , + bool _alreadyTransferred ) internal returns (bool succeeded) { if (_courtID == Constants.FORKING_COURT || _courtID > courts.length) return false; @@ -1056,22 +1105,24 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { uint256 transferredAmount; if (_newStake >= currentStake) { - // Stake increase + if (!_alreadyTransferred) { + // Stake increase // When stakedPnk becomes lower than lockedPnk count the locked tokens in when transferring tokens from juror. - // (E.g. stakedPnk = 0, lockedPnk = 150) which can happen if the juror unstaked fully while having some tokens locked. - uint256 previouslyLocked = (juror.lockedPnk >= juror.stakedPnk) ? juror.lockedPnk - juror.stakedPnk : 0; // underflow guard - transferredAmount = (_newStake >= currentStake + previouslyLocked) // underflow guard - ? _newStake - currentStake - previouslyLocked - : 0; - if (transferredAmount > 0) { - if (!pinakion.safeTransferFrom(_account, address(this), transferredAmount)) { - return false; + // (E.g. stakedPnk = 0, lockedPnk = 150) which can happen if the juror unstaked fully while having some tokens locked. + uint256 previouslyLocked = (juror.lockedPnk >= juror.stakedPnk) ? juror.lockedPnk - juror.stakedPnk : 0; // underflow guard + transferredAmount = (_newStake >= currentStake + previouslyLocked) // underflow guard + ? _newStake - currentStake - previouslyLocked + : 0; + if (transferredAmount > 0) { + // Note we don't return false after incorrect transfer because when stake is increased the transfer is done immediately, thus it can't disrupt delayed stakes' queue. + pinakion.safeTransferFrom(_account, address(this), transferredAmount); + } + if (currentStake == 0) { + juror.courtIDs.push(_courtID); } - } - if (currentStake == 0) { - juror.courtIDs.push(_courtID); } } else { + // Note that stakes can be partially delayed only when stake is increased. // Stake decrease: make sure locked tokens always stay in the contract. They can only be released during Execution. if (juror.stakedPnk >= currentStake - _newStake + juror.lockedPnk) { // We have enough pnk staked to afford withdrawal while keeping locked tokens. @@ -1097,8 +1148,17 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { } // Note that stakedPnk can become async with currentStake (e.g. after penalty). - juror.stakedPnk = (juror.stakedPnk >= currentStake) ? juror.stakedPnk - currentStake + _newStake : _newStake; - juror.stakedPnkByCourt[_courtID] = _newStake; + // Also note that these values were already updated if the stake was only partially delayed. + if (!_alreadyTransferred) { + juror.stakedPnk = (juror.stakedPnk >= currentStake) ? juror.stakedPnk - currentStake + _newStake : _newStake; + juror.stakedPnkByCourt[_courtID] = _newStake; + } + + // Transfer the tokens but don't update sortition module. + if (result == ISortitionModule.preStakeHookResult.partiallyDelayed) { + emit StakePartiallyDelayed(_account, _courtID, _stake); + return true; + } sortitionModule.setStake(_account, _courtID, _newStake); emit StakeSet(_account, _courtID, _newStake); diff --git a/contracts/src/arbitration/SortitionModule.sol b/contracts/src/arbitration/SortitionModule.sol index 67c787aff..55bcdf594 100644 --- a/contracts/src/arbitration/SortitionModule.sol +++ b/contracts/src/arbitration/SortitionModule.sol @@ -39,6 +39,7 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { address account; // The address of the juror. uint96 courtID; // The ID of the court. uint256 stake; // The new stake. + bool alreadyTransferred; // True if tokens were already transferred before delayed stake's execution. } // ************************************* // @@ -63,6 +64,7 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { uint256 public delayedStakeReadIndex; // The index of the next `delayedStake` item that should be processed. Starts at 1 because 0 index is skipped. mapping(bytes32 => SortitionSumTree) sortitionSumTrees; // The mapping trees by keys. mapping(uint256 => DelayedStake) public delayedStakes; // Stores the stakes that were changed during Drawing phase, to update them when the phase is switched to Staking. + mapping(address => mapping(uint96 => uint256)) public latestDelayedStakeIndex; // Maps the juror to its latest delayed stake. If there is already a delayed stake for this juror then it'll be replaced. latestDelayedStakeIndex[juror][courtID]. // ************************************* // // * Function Modifiers * // @@ -201,12 +203,40 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { for (uint256 i = delayedStakeReadIndex; i < newDelayedStakeReadIndex; i++) { DelayedStake storage delayedStake = delayedStakes[i]; - core.setStakeBySortitionModule(delayedStake.account, delayedStake.courtID, delayedStake.stake); - delete delayedStakes[i]; + // Delayed stake could've been manually removed already. In this case simply move on to the next item. + if (delayedStake.account != address(0)) { + core.setStakeBySortitionModule( + delayedStake.account, + delayedStake.courtID, + delayedStake.stake, + delayedStake.alreadyTransferred + ); + delete latestDelayedStakeIndex[delayedStake.account][delayedStake.courtID]; + delete delayedStakes[i]; + } } delayedStakeReadIndex = newDelayedStakeReadIndex; } + /// @dev Checks if there is already a delayed stake. In this case consider it irrelevant and remove it. + /// @param _courtID ID of the court. + /// @param _juror Juror whose stake to check. + function checkExistingDelayedStake(uint96 _courtID, address _juror) external override onlyByCore { + uint256 latestIndex = latestDelayedStakeIndex[_juror][_courtID]; + if (latestIndex != 0) { + DelayedStake storage delayedStake = delayedStakes[latestIndex]; + if (delayedStake.alreadyTransferred) { + bytes32 stakePathID = _accountAndCourtIDToStakePathID(_juror, _courtID); + // Sortition stake represents the stake value that was last updated during Staking phase. + uint256 sortitionStake = stakeOf(bytes32(uint256(_courtID)), stakePathID); + // Withdraw the tokens that were added with the latest delayed stake. + core.withdrawPartiallyDelayedStake(_courtID, _juror, delayedStake.stake - sortitionStake); + } + delete delayedStakes[latestIndex]; + delete latestDelayedStakeIndex[_juror][_courtID]; + } + } + function preStakeHook( address _account, uint96 _courtID, @@ -218,12 +248,18 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { return preStakeHookResult.failed; } else { if (phase != Phase.staking) { - delayedStakes[++delayedStakeWriteIndex] = DelayedStake({ - account: _account, - courtID: _courtID, - stake: _stake - }); - return preStakeHookResult.delayed; + DelayedStake storage delayedStake = delayedStakes[++delayedStakeWriteIndex]; + delayedStake.account = _account; + delayedStake.courtID = _courtID; + delayedStake.stake = _stake; + latestDelayedStakeIndex[_account][_courtID] = delayedStakeWriteIndex; + if (_stake > currentStake) { + // Actual token transfer is done right after this hook. + delayedStake.alreadyTransferred = true; + return preStakeHookResult.partiallyDelayed; + } else { + return preStakeHookResult.delayed; + } } } return preStakeHookResult.ok; @@ -273,7 +309,7 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { function setJurorInactive(address _account) external override onlyByCore { uint96[] memory courtIDs = core.getJurorCourtIDs(_account); for (uint256 j = courtIDs.length; j > 0; j--) { - core.setStakeBySortitionModule(_account, courtIDs[j - 1], 0); + core.setStakeBySortitionModule(_account, courtIDs[j - 1], 0, false); } } @@ -486,4 +522,12 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { stakePathID := mload(ptr) } } + + function stakeOf(bytes32 _key, bytes32 _ID) public view returns (uint256 value) { + SortitionSumTree storage tree = sortitionSumTrees[_key]; + uint treeIndex = tree.IDsToNodeIndexes[_ID]; + + if (treeIndex == 0) value = 0; + else value = tree.nodes[treeIndex]; + } } diff --git a/contracts/src/arbitration/interfaces/ISortitionModule.sol b/contracts/src/arbitration/interfaces/ISortitionModule.sol index 3bee0e270..c9553fb61 100644 --- a/contracts/src/arbitration/interfaces/ISortitionModule.sol +++ b/contracts/src/arbitration/interfaces/ISortitionModule.sol @@ -9,9 +9,10 @@ interface ISortitionModule { } enum preStakeHookResult { - ok, - delayed, - failed + ok, // Correct phase. All checks are passed. + partiallyDelayed, // Wrong phase but stake is increased, so transfer the tokens without updating the drawing chance. + delayed, // Wrong phase and stake is decreased. Delay the token transfer and drawing chance update. + failed // Checks didn't pass. Do no changes. } event NewPhase(Phase _phase); @@ -31,4 +32,6 @@ interface ISortitionModule { function createDisputeHook(uint256 _disputeID, uint256 _roundID) external; function postDrawHook(uint256 _disputeID, uint256 _roundID) external; + + function checkExistingDelayedStake(uint96 _courtID, address _juror) external; } From d0dc7dd83bc08c3d38ee51085dea058e41c79379 Mon Sep 17 00:00:00 2001 From: unknownunknown1 Date: Wed, 13 Sep 2023 05:34:40 +1000 Subject: [PATCH 25/77] fix(KC): compiler error --- contracts/src/arbitration/KlerosCore.sol | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/contracts/src/arbitration/KlerosCore.sol b/contracts/src/arbitration/KlerosCore.sol index 6fca182a2..7a4518e6a 100644 --- a/contracts/src/arbitration/KlerosCore.sol +++ b/contracts/src/arbitration/KlerosCore.sol @@ -497,7 +497,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { function setStakeBySortitionModule( address _account, uint96 _courtID, - uint256 _stake, + uint256 _newStake, bool _alreadyTransferred ) external { if (msg.sender != address(sortitionModule)) revert WrongCaller(); @@ -1075,13 +1075,9 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { /// @param _alreadyTransferred True if the tokens were already transferred from juror. Only relevant for delayed stakes. /// @return succeeded True if the call succeeded, false otherwise. function _setStakeForAccount( - address _account, - uint96 _courtID, - - uint256 _newStake - , + uint256 _newStake, bool _alreadyTransferred ) internal returns (bool succeeded) { if (_courtID == Constants.FORKING_COURT || _courtID > courts.length) return false; @@ -1107,7 +1103,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { if (_newStake >= currentStake) { if (!_alreadyTransferred) { // Stake increase - // When stakedPnk becomes lower than lockedPnk count the locked tokens in when transferring tokens from juror. + // When stakedPnk becomes lower than lockedPnk count the locked tokens in when transferring tokens from juror. // (E.g. stakedPnk = 0, lockedPnk = 150) which can happen if the juror unstaked fully while having some tokens locked. uint256 previouslyLocked = (juror.lockedPnk >= juror.stakedPnk) ? juror.lockedPnk - juror.stakedPnk : 0; // underflow guard transferredAmount = (_newStake >= currentStake + previouslyLocked) // underflow guard @@ -1150,13 +1146,15 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { // Note that stakedPnk can become async with currentStake (e.g. after penalty). // Also note that these values were already updated if the stake was only partially delayed. if (!_alreadyTransferred) { - juror.stakedPnk = (juror.stakedPnk >= currentStake) ? juror.stakedPnk - currentStake + _newStake : _newStake; + juror.stakedPnk = (juror.stakedPnk >= currentStake) + ? juror.stakedPnk - currentStake + _newStake + : _newStake; juror.stakedPnkByCourt[_courtID] = _newStake; } // Transfer the tokens but don't update sortition module. if (result == ISortitionModule.preStakeHookResult.partiallyDelayed) { - emit StakePartiallyDelayed(_account, _courtID, _stake); + emit StakePartiallyDelayed(_account, _courtID, _newStake); return true; } From 3adabf57144898523732abd015356af197f954b8 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Fri, 8 Dec 2023 23:41:16 +0000 Subject: [PATCH 26/77] test: delayed stakes --- contracts/.mocharc.json | 4 - contracts/hardhat.config.ts | 3 + contracts/test/arbitration/staking.ts | 236 ++++++++++++++++++++++++++ contracts/test/arbitration/unstake.ts | 84 --------- 4 files changed, 239 insertions(+), 88 deletions(-) delete mode 100644 contracts/.mocharc.json create mode 100644 contracts/test/arbitration/staking.ts delete mode 100644 contracts/test/arbitration/unstake.ts diff --git a/contracts/.mocharc.json b/contracts/.mocharc.json deleted file mode 100644 index c119ef460..000000000 --- a/contracts/.mocharc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "require": "ts-node/register/files", - "timeout": 20000 -} diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index fb3dd48ce..9ab5e2f03 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -302,6 +302,9 @@ const config: HardhatUserConfig = { clear: true, runOnCompile: false, }, + mocha: { + timeout: 20000, + }, tenderly: { project: process.env.TENDERLY_PROJECT !== undefined ? process.env.TENDERLY_PROJECT : "kleros-v2", username: process.env.TENDERLY_USERNAME !== undefined ? process.env.TENDERLY_USERNAME : "", diff --git a/contracts/test/arbitration/staking.ts b/contracts/test/arbitration/staking.ts new file mode 100644 index 000000000..bde6b99bb --- /dev/null +++ b/contracts/test/arbitration/staking.ts @@ -0,0 +1,236 @@ +import { ethers, getNamedAccounts, network, deployments } from "hardhat"; +import { BigNumber } from "ethers"; +import { + PNK, + KlerosCore, + DisputeKitClassic, + SortitionModule, + RandomizerRNG, + RandomizerMock, +} from "../../typechain-types"; +import { expect } from "chai"; +import exp from "constants"; + +/* eslint-disable no-unused-vars */ +/* eslint-disable no-unused-expressions */ + +describe("Staking", async () => { + const ONE_TENTH_ETH = BigNumber.from(10).pow(17); + const ONE_THOUSAND_PNK = BigNumber.from(10).pow(21); + + // 2nd court, 3 jurors, 1 dispute kit + const extraData = + "0x000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000001"; + + let deployer; + let disputeKit; + let pnk; + let core; + let sortition; + let rng; + let randomizer; + + const deploy = async () => { + ({ deployer } = await getNamedAccounts()); + await deployments.fixture(["Arbitration"], { + fallbackToGlobal: true, + keepExistingDeployments: false, + }); + disputeKit = (await ethers.getContract("DisputeKitClassic")) as DisputeKitClassic; + pnk = (await ethers.getContract("PNK")) as PNK; + core = (await ethers.getContract("KlerosCore")) as KlerosCore; + sortition = (await ethers.getContract("SortitionModule")) as SortitionModule; + rng = (await ethers.getContract("RandomizerRNG")) as RandomizerRNG; + randomizer = (await ethers.getContract("RandomizerMock")) as RandomizerMock; + }; + + describe("When outside the Staking phase", async () => { + let balanceBefore; + + const reachDrawingPhase = async () => { + expect(await sortition.phase()).to.be.equal(0); // Staking + const arbitrationCost = ONE_TENTH_ETH.mul(3); + + await core.createCourt(1, false, ONE_THOUSAND_PNK, 1000, ONE_TENTH_ETH, 3, [0, 0, 0, 0], 3, [1]); // Parent - general court, Classic dispute kit + + await pnk.approve(core.address, ONE_THOUSAND_PNK.mul(4)); + await core.setStake(1, ONE_THOUSAND_PNK.mul(2)); + await core.setStake(2, ONE_THOUSAND_PNK.mul(2)); + + expect(await core.getJurorCourtIDs(deployer)).to.be.deep.equal([BigNumber.from("1"), BigNumber.from("2")]); + + await core.functions["createDispute(uint256,bytes)"](2, extraData, { value: arbitrationCost }); + + await network.provider.send("evm_increaseTime", [2000]); // Wait for minStakingTime + await network.provider.send("evm_mine"); + + const lookahead = await sortition.rngLookahead(); + await sortition.passPhase(); // Staking -> Generating + for (let index = 0; index < lookahead; index++) { + await network.provider.send("evm_mine"); + } + + balanceBefore = await pnk.balanceOf(deployer); + }; + + describe("When decreasing then increasing back stake", async () => { + before("Setup", async () => { + await deploy(); + await reachDrawingPhase(); + }); + + it("Should be outside the Staking phase", async () => { + expect(await sortition.phase()).to.be.equal(1); // Drawing + expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ + ONE_THOUSAND_PNK.mul(4), + BigNumber.from(0), + ONE_THOUSAND_PNK.mul(2), + BigNumber.from(2), + ]); + }); + + it("Should delay the stake decrease", async () => { + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(0); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); + await expect(core.setStake(2, ONE_THOUSAND_PNK.mul(1))) + .to.emit(core, "StakeDelayed") + .withArgs(deployer, 2, ONE_THOUSAND_PNK.mul(1)); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); + expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ + ONE_THOUSAND_PNK.mul(4), + BigNumber.from(0), + ONE_THOUSAND_PNK.mul(2), + BigNumber.from(2), + ]); // stake unchanged, delayed + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(1); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([deployer, 2, ONE_THOUSAND_PNK.mul(1), false]); + }); + + it("Should delay the stake increase back to the previous amount", async () => { + balanceBefore = await pnk.balanceOf(deployer); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); + await expect(core.setStake(2, ONE_THOUSAND_PNK.mul(2))) + .to.emit(core, "StakeDelayed") + .withArgs(deployer, 2, ONE_THOUSAND_PNK.mul(2)); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(2); + expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ + ONE_THOUSAND_PNK.mul(4), + BigNumber.from(0), + ONE_THOUSAND_PNK.mul(2), + BigNumber.from(2), + ]); // stake unchanged, delayed + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(2); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted + expect(await sortition.delayedStakes(2)).to.be.deep.equal([deployer, 2, ONE_THOUSAND_PNK.mul(2), false]); + }); + }); + + describe("When increasing then decreasing back stake", async () => { + before("Setup", async () => { + await deploy(); + await reachDrawingPhase(); + }); + + it("Should be outside the Staking phase", async () => { + expect(await sortition.phase()).to.be.equal(1); // Drawing + expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ + ONE_THOUSAND_PNK.mul(4), + BigNumber.from(0), + ONE_THOUSAND_PNK.mul(2), + BigNumber.from(2), + ]); + }); + + it("Should transfer PNK but delay the stake increase", async () => { + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(0); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + await pnk.approve(core.address, ONE_THOUSAND_PNK.mul(1)); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); + await expect(core.setStake(2, ONE_THOUSAND_PNK.mul(3))) + .to.emit(core, "StakePartiallyDelayed") + .withArgs(deployer, 2, ONE_THOUSAND_PNK.mul(3)); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); + expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ + ONE_THOUSAND_PNK.mul(5), + BigNumber.from(0), + ONE_THOUSAND_PNK.mul(3), + BigNumber.from(2), + ]); // stake has changed immediately, WARNING: this is misleading because it's not actually added to the SortitionSumTree + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore.sub(ONE_THOUSAND_PNK)); // PNK is transferred out of the juror's account + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(1); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([deployer, 2, ONE_THOUSAND_PNK.mul(3), true]); + }); + + it("Should cancel out the stake decrease back", async () => { + balanceBefore = await pnk.balanceOf(deployer); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); + await expect(core.setStake(2, ONE_THOUSAND_PNK.mul(2))) + .to.emit(core, "StakeDelayed") + .withArgs(deployer, 2, ONE_THOUSAND_PNK.mul(2)); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(2); + expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ + ONE_THOUSAND_PNK.mul(4), + BigNumber.from(0), + ONE_THOUSAND_PNK.mul(2), + BigNumber.from(2), + ]); // stake has changed immediately + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore.add(ONE_THOUSAND_PNK)); // PNK is sent back to the juror + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(2); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted + expect(await sortition.delayedStakes(2)).to.be.deep.equal([deployer, 2, ONE_THOUSAND_PNK.mul(2), false]); + }); + }); + }); + + describe("When a juror is inactive", async () => { + before("Setup", async () => { + await deploy(); + }); + + it("Should unstake from all courts", async () => { + const arbitrationCost = ONE_TENTH_ETH.mul(3); + + await core.createCourt(1, false, ONE_THOUSAND_PNK, 1000, ONE_TENTH_ETH, 3, [0, 0, 0, 0], 3, [1]); // Parent - general court, Classic dispute kit + + await pnk.approve(core.address, ONE_THOUSAND_PNK.mul(4)); + await core.setStake(1, ONE_THOUSAND_PNK.mul(2)); + await core.setStake(2, ONE_THOUSAND_PNK.mul(2)); + + expect(await core.getJurorCourtIDs(deployer)).to.be.deep.equal([BigNumber.from("1"), BigNumber.from("2")]); + + await core.functions["createDispute(uint256,bytes)"](2, extraData, { value: arbitrationCost }); + + await network.provider.send("evm_increaseTime", [2000]); // Wait for minStakingTime + await network.provider.send("evm_mine"); + + const lookahead = await sortition.rngLookahead(); + await sortition.passPhase(); // Staking -> Generating + for (let index = 0; index < lookahead; index++) { + await network.provider.send("evm_mine"); + } + await randomizer.relay(rng.address, 0, ethers.utils.randomBytes(32)); + await sortition.passPhase(); // Generating -> Drawing + + await core.draw(0, 5000); + + await core.passPeriod(0); // Evidence -> Voting + await core.passPeriod(0); // Voting -> Appeal + await core.passPeriod(0); // Appeal -> Execution + + await sortition.passPhase(); // Freezing -> Staking. Change so we don't deal with delayed stakes + + expect(await core.getJurorCourtIDs(deployer)).to.be.deep.equal([BigNumber.from("1"), BigNumber.from("2")]); + + await core.execute(0, 0, 1); // 1 iteration should unstake from both courts + + expect(await core.getJurorCourtIDs(deployer)).to.be.deep.equal([]); + }); + }); +}); diff --git a/contracts/test/arbitration/unstake.ts b/contracts/test/arbitration/unstake.ts deleted file mode 100644 index 671fe3c80..000000000 --- a/contracts/test/arbitration/unstake.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { ethers, getNamedAccounts, network, deployments } from "hardhat"; -import { BigNumber } from "ethers"; -import { - PNK, - KlerosCore, - DisputeKitClassic, - SortitionModule, - RandomizerRNG, - RandomizerMock, -} from "../../typechain-types"; -import { expect } from "chai"; - -/* eslint-disable no-unused-vars */ -/* eslint-disable no-unused-expressions */ - -describe("Unstake juror", async () => { - const ONE_TENTH_ETH = BigNumber.from(10).pow(17); - const ONE_THOUSAND_PNK = BigNumber.from(10).pow(21); - - // 2nd court, 3 jurors, 1 dispute kit - const extraData = - "0x000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000001"; - - let deployer; - let disputeKit; - let pnk; - let core; - let sortitionModule; - let rng; - let randomizer; - - beforeEach("Setup", async () => { - ({ deployer } = await getNamedAccounts()); - await deployments.fixture(["Arbitration"], { - fallbackToGlobal: true, - keepExistingDeployments: false, - }); - disputeKit = (await ethers.getContract("DisputeKitClassic")) as DisputeKitClassic; - pnk = (await ethers.getContract("PNK")) as PNK; - core = (await ethers.getContract("KlerosCore")) as KlerosCore; - sortitionModule = (await ethers.getContract("SortitionModule")) as SortitionModule; - rng = (await ethers.getContract("RandomizerRNG")) as RandomizerRNG; - randomizer = (await ethers.getContract("RandomizerMock")) as RandomizerMock; - }); - - it("Unstake inactive juror", async () => { - const arbitrationCost = ONE_TENTH_ETH.mul(3); - - await core.createCourt(1, false, ONE_THOUSAND_PNK, 1000, ONE_TENTH_ETH, 3, [0, 0, 0, 0], 3, [1]); // Parent - general court, Classic dispute kit - - await pnk.approve(core.address, ONE_THOUSAND_PNK.mul(4)); - await core.setStake(1, ONE_THOUSAND_PNK.mul(2)); - await core.setStake(2, ONE_THOUSAND_PNK.mul(2)); - - expect(await core.getJurorCourtIDs(deployer)).to.be.deep.equal([BigNumber.from("1"), BigNumber.from("2")]); - - await core.functions["createDispute(uint256,bytes)"](2, extraData, { value: arbitrationCost }); - - await network.provider.send("evm_increaseTime", [2000]); // Wait for minStakingTime - await network.provider.send("evm_mine"); - - const lookahead = await sortitionModule.rngLookahead(); - await sortitionModule.passPhase(); // Staking -> Generating - for (let index = 0; index < lookahead; index++) { - await network.provider.send("evm_mine"); - } - await randomizer.relay(rng.address, 0, ethers.utils.randomBytes(32)); - await sortitionModule.passPhase(); // Generating -> Drawing - - await core.draw(0, 5000); - - await core.passPeriod(0); // Evidence -> Voting - await core.passPeriod(0); // Voting -> Appeal - await core.passPeriod(0); // Appeal -> Execution - - await sortitionModule.passPhase(); // Freezing -> Staking. Change so we don't deal with delayed stakes - - expect(await core.getJurorCourtIDs(deployer)).to.be.deep.equal([BigNumber.from("1"), BigNumber.from("2")]); - - await core.execute(0, 0, 1); // 1 iteration should unstake from both courts - - expect(await core.getJurorCourtIDs(deployer)).to.be.deep.equal([]); - }); -}); From 03ad590cce924ac0c07012366b8597f4d7a41785 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Sat, 9 Dec 2023 00:09:12 +0000 Subject: [PATCH 27/77] refactor: naming things --- contracts/src/arbitration/KlerosCore.sol | 68 ++++++++++--------- contracts/src/arbitration/SortitionModule.sol | 37 ++++++---- .../interfaces/ISortitionModule.sol | 10 +-- contracts/test/arbitration/staking.ts | 8 +-- subgraph/src/KlerosCore.ts | 4 +- subgraph/subgraph.yaml | 4 +- 6 files changed, 71 insertions(+), 60 deletions(-) diff --git a/contracts/src/arbitration/KlerosCore.sol b/contracts/src/arbitration/KlerosCore.sol index 7a4518e6a..13a1e9104 100644 --- a/contracts/src/arbitration/KlerosCore.sol +++ b/contracts/src/arbitration/KlerosCore.sol @@ -115,8 +115,13 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { // ************************************* // event StakeSet(address indexed _address, uint256 _courtID, uint256 _amount); - event StakeDelayed(address indexed _address, uint256 _courtID, uint256 _amount); - event StakePartiallyDelayed(address indexed _address, uint256 _courtID, uint256 _amount); + event StakeDelayedNotTransferred(address indexed _address, uint256 _courtID, uint256 _amount); + event StakeDelayedAlreadyTransferred(address indexed _address, uint256 _courtID, uint256 _amount); + event StakeDelayedAlreadyTransferredWithdrawn( + uint96 indexed _courtID, + address indexed _account, + uint256 _withdrawnAmount + ); event NewPeriod(uint256 indexed _disputeID, Period _period); event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable); event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable); @@ -171,7 +176,6 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { uint256 _feeAmount, IERC20 _feeToken ); - event PartiallyDelayedStakeWithdrawn(uint96 indexed _courtID, address indexed _account, uint256 _withdrawnAmount); // ************************************* // // * Function Modifiers * // @@ -460,18 +464,26 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { /// @param _newStake The new stake. /// Note that the existing delayed stake will be nullified as non-relevant. function setStake(uint96 _courtID, uint256 _newStake) external { - removeDelayedStake(_courtID); + _deleteDelayedStake(_courtID); if (!_setStakeForAccount(msg.sender, _courtID, _newStake, false)) revert StakingFailed(); } - /// @dev Removes the latest delayed stake if there is any. - /// @param _courtID The ID of the court. - function removeDelayedStake(uint96 _courtID) public { - sortitionModule.checkExistingDelayedStake(_courtID, msg.sender); + function setStakeBySortitionModule( + address _account, + uint96 _courtID, + uint256 _newStake, + bool _alreadyTransferred + ) external { + if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly(); + // Always nullify the latest delayed stake before setting a new value. + // Note that we check the delayed stake here too because the check in `setStake` can be bypassed + // if the stake was updated automatically during `execute` (e.g. when unstaking inactive juror). + _deleteDelayedStake(_courtID); + _setStakeForAccount(_account, _courtID, _newStake, _alreadyTransferred); } function withdrawPartiallyDelayedStake(uint96 _courtID, address _juror, uint256 _amountToWithdraw) external { - if (msg.sender != address(sortitionModule)) revert WrongCaller(); + if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly(); uint256 actualAmount = _amountToWithdraw; Juror storage juror = jurors[_juror]; if (juror.stakedPnk <= actualAmount) { @@ -481,7 +493,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { // StakePnk can become lower because of penalty, thus we adjust the amount for it. stakedPnkByCourt can't be penalized so subtract the default amount. juror.stakedPnk -= actualAmount; juror.stakedPnkByCourt[_courtID] -= _amountToWithdraw; - emit PartiallyDelayedStakeWithdrawn(_courtID, _juror, _amountToWithdraw); + emit StakeDelayedAlreadyTransferredWithdrawn(_courtID, _juror, _amountToWithdraw); // Note that if we don't delete court here it'll be duplicated after staking. if (juror.stakedPnkByCourt[_courtID] == 0) { for (uint256 i = juror.courtIDs.length; i > 0; i--) { @@ -494,20 +506,6 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { } } - function setStakeBySortitionModule( - address _account, - uint96 _courtID, - uint256 _newStake, - bool _alreadyTransferred - ) external { - if (msg.sender != address(sortitionModule)) revert WrongCaller(); - // Always nullify the latest delayed stake before setting a new value. - // Note that we check the delayed stake here too because the check in `setStake` can be bypassed - // if the stake was updated automatically during `execute` (e.g. when unstaking inactive juror). - removeDelayedStake(_courtID); - _setStakeForAccount(_account, _courtID, _newStake, _alreadyTransferred); - } - /// @inheritdoc IArbitratorV2 function createDispute( uint256 _numberOfChoices, @@ -1063,6 +1061,12 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { emit DisputeKitEnabled(_courtID, _disputeKitID, _enable); } + /// @dev Removes the latest delayed stake if there is any. + /// @param _courtID The ID of the court. + function _deleteDelayedStake(uint96 _courtID) private { + sortitionModule.deleteDelayedStake(_courtID, msg.sender); + } + /// @dev Sets the specified juror's stake in a court. /// `O(n + p * log_k(j))` where /// `n` is the number of courts the juror has staked in, @@ -1091,11 +1095,11 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { return false; } - ISortitionModule.preStakeHookResult result = sortitionModule.preStakeHook(_account, _courtID, _newStake); - if (result == ISortitionModule.preStakeHookResult.failed) { + ISortitionModule.PreStakeHookResult result = sortitionModule.preStakeHook(_account, _courtID, _newStake); + if (result == ISortitionModule.PreStakeHookResult.failed) { return false; - } else if (result == ISortitionModule.preStakeHookResult.delayed) { - emit StakeDelayed(_account, _courtID, _newStake); + } else if (result == ISortitionModule.PreStakeHookResult.stakeDelayedNotTransferred) { + emit StakeDelayedNotTransferred(_account, _courtID, _newStake); return true; } @@ -1153,8 +1157,8 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { } // Transfer the tokens but don't update sortition module. - if (result == ISortitionModule.preStakeHookResult.partiallyDelayed) { - emit StakePartiallyDelayed(_account, _courtID, _newStake); + if (result == ISortitionModule.PreStakeHookResult.stakeDelayedAlreadyTransferred) { + emit StakeDelayedAlreadyTransferred(_account, _courtID, _newStake); return true; } @@ -1201,6 +1205,8 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { // ************************************* // error GovernorOnly(); + error DisputeKitOnly(); + error SortitionModuleOnly(); error UnsuccessfulCall(); error InvalidDisputKitParent(); error DepthLevelMax(); @@ -1211,7 +1217,6 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { error CannotDisableClassicDK(); error ArraysLengthMismatch(); error StakingFailed(); - error WrongCaller(); error ArbitrationFeesNotEnough(); error DisputeKitNotSupportedByCourt(); error MustSupportDisputeKitClassic(); @@ -1224,7 +1229,6 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { error NotEvidencePeriod(); error AppealFeesNotEnough(); error DisputeNotAppealable(); - error DisputeKitOnly(); error NotExecutionPeriod(); error RulingAlreadyExecuted(); error DisputePeriodIsFinal(); diff --git a/contracts/src/arbitration/SortitionModule.sol b/contracts/src/arbitration/SortitionModule.sol index 55bcdf594..ea50851aa 100644 --- a/contracts/src/arbitration/SortitionModule.sol +++ b/contracts/src/arbitration/SortitionModule.sol @@ -221,7 +221,7 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { /// @dev Checks if there is already a delayed stake. In this case consider it irrelevant and remove it. /// @param _courtID ID of the court. /// @param _juror Juror whose stake to check. - function checkExistingDelayedStake(uint96 _courtID, address _juror) external override onlyByCore { + function deleteDelayedStake(uint96 _courtID, address _juror) external override onlyByCore { uint256 latestIndex = latestDelayedStakeIndex[_juror][_courtID]; if (latestIndex != 0) { DelayedStake storage delayedStake = delayedStakes[latestIndex]; @@ -241,28 +241,31 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { address _account, uint96 _courtID, uint256 _stake - ) external override onlyByCore returns (preStakeHookResult) { + ) external override onlyByCore returns (PreStakeHookResult) { (, , uint256 currentStake, uint256 nbCourts) = core.getJurorBalance(_account, _courtID); if (currentStake == 0 && nbCourts >= MAX_STAKE_PATHS) { // Prevent staking beyond MAX_STAKE_PATHS but unstaking is always allowed. - return preStakeHookResult.failed; + return PreStakeHookResult.failed; } else { if (phase != Phase.staking) { + // Store the stake change as delayed, to be applied when the phase switches back to Staking. DelayedStake storage delayedStake = delayedStakes[++delayedStakeWriteIndex]; delayedStake.account = _account; delayedStake.courtID = _courtID; delayedStake.stake = _stake; latestDelayedStakeIndex[_account][_courtID] = delayedStakeWriteIndex; if (_stake > currentStake) { - // Actual token transfer is done right after this hook. + // PNK deposit: tokens to be transferred now (right after this hook), + // but the stake will be added to the sortition sum tree later. delayedStake.alreadyTransferred = true; - return preStakeHookResult.partiallyDelayed; + return PreStakeHookResult.stakeDelayedAlreadyTransferred; } else { - return preStakeHookResult.delayed; + // PNK withdrawal: tokens are not transferred yet. + return PreStakeHookResult.stakeDelayedNotTransferred; } } } - return preStakeHookResult.ok; + return PreStakeHookResult.ok; } function createDisputeHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore { @@ -362,6 +365,18 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { drawnAddress = _stakePathIDToAccount(tree.nodeIndexesToIDs[treeIndex]); } + /// @dev Get the stake of a juror in a court. + /// @param _key The key of the tree, corresponding to a court. + /// @param _ID The stake path ID, corresponding to a juror. + /// @return value The stake of the juror in the court. + function stakeOf(bytes32 _key, bytes32 _ID) public view returns (uint256 value) { + SortitionSumTree storage tree = sortitionSumTrees[_key]; + uint treeIndex = tree.IDsToNodeIndexes[_ID]; + + if (treeIndex == 0) value = 0; + else value = tree.nodes[treeIndex]; + } + // ************************************* // // * Internal * // // ************************************* // @@ -522,12 +537,4 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { stakePathID := mload(ptr) } } - - function stakeOf(bytes32 _key, bytes32 _ID) public view returns (uint256 value) { - SortitionSumTree storage tree = sortitionSumTrees[_key]; - uint treeIndex = tree.IDsToNodeIndexes[_ID]; - - if (treeIndex == 0) value = 0; - else value = tree.nodes[treeIndex]; - } } diff --git a/contracts/src/arbitration/interfaces/ISortitionModule.sol b/contracts/src/arbitration/interfaces/ISortitionModule.sol index c9553fb61..42eb2a4c0 100644 --- a/contracts/src/arbitration/interfaces/ISortitionModule.sol +++ b/contracts/src/arbitration/interfaces/ISortitionModule.sol @@ -8,10 +8,10 @@ interface ISortitionModule { drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes. } - enum preStakeHookResult { + enum PreStakeHookResult { ok, // Correct phase. All checks are passed. - partiallyDelayed, // Wrong phase but stake is increased, so transfer the tokens without updating the drawing chance. - delayed, // Wrong phase and stake is decreased. Delay the token transfer and drawing chance update. + stakeDelayedAlreadyTransferred, // Wrong phase but stake is increased, so transfer the tokens without updating the drawing chance. + stakeDelayedNotTransferred, // Wrong phase and stake is decreased. Delay the token transfer and drawing chance update. failed // Checks didn't pass. Do no changes. } @@ -27,11 +27,11 @@ interface ISortitionModule { function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _nonce) external view returns (address); - function preStakeHook(address _account, uint96 _courtID, uint256 _stake) external returns (preStakeHookResult); + function preStakeHook(address _account, uint96 _courtID, uint256 _stake) external returns (PreStakeHookResult); function createDisputeHook(uint256 _disputeID, uint256 _roundID) external; function postDrawHook(uint256 _disputeID, uint256 _roundID) external; - function checkExistingDelayedStake(uint96 _courtID, address _juror) external; + function deleteDelayedStake(uint96 _courtID, address _juror) external; } diff --git a/contracts/test/arbitration/staking.ts b/contracts/test/arbitration/staking.ts index bde6b99bb..e761779a6 100644 --- a/contracts/test/arbitration/staking.ts +++ b/contracts/test/arbitration/staking.ts @@ -94,7 +94,7 @@ describe("Staking", async () => { expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); await expect(core.setStake(2, ONE_THOUSAND_PNK.mul(1))) - .to.emit(core, "StakeDelayed") + .to.emit(core, "StakeDelayedNotTransferred") .withArgs(deployer, 2, ONE_THOUSAND_PNK.mul(1)); expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ @@ -113,7 +113,7 @@ describe("Staking", async () => { balanceBefore = await pnk.balanceOf(deployer); expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); await expect(core.setStake(2, ONE_THOUSAND_PNK.mul(2))) - .to.emit(core, "StakeDelayed") + .to.emit(core, "StakeDelayedNotTransferred") .withArgs(deployer, 2, ONE_THOUSAND_PNK.mul(2)); expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(2); expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ @@ -152,7 +152,7 @@ describe("Staking", async () => { await pnk.approve(core.address, ONE_THOUSAND_PNK.mul(1)); expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); await expect(core.setStake(2, ONE_THOUSAND_PNK.mul(3))) - .to.emit(core, "StakePartiallyDelayed") + .to.emit(core, "StakeDelayedAlreadyTransferred") .withArgs(deployer, 2, ONE_THOUSAND_PNK.mul(3)); expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ @@ -171,7 +171,7 @@ describe("Staking", async () => { balanceBefore = await pnk.balanceOf(deployer); expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); await expect(core.setStake(2, ONE_THOUSAND_PNK.mul(2))) - .to.emit(core, "StakeDelayed") + .to.emit(core, "StakeDelayedNotTransferred") .withArgs(deployer, 2, ONE_THOUSAND_PNK.mul(2)); expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(2); expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ diff --git a/subgraph/src/KlerosCore.ts b/subgraph/src/KlerosCore.ts index deb9fbba8..2c7983733 100644 --- a/subgraph/src/KlerosCore.ts +++ b/subgraph/src/KlerosCore.ts @@ -12,7 +12,7 @@ import { TokenAndETHShift as TokenAndETHShiftEvent, CourtJump, Ruling, - StakeDelayed, + StakeDelayedNotTransferred, AcceptedFeeToken, } from "../generated/KlerosCore/KlerosCore"; import { ZERO, ONE } from "./utils"; @@ -198,7 +198,7 @@ export function handleStakeSet(event: StakeSet): void { } } -export function handleStakeDelayed(event: StakeDelayed): void { +export function handleStakeDelayedNotTransferred(event: StakeDelayedNotTransferred): void { updateJurorDelayedStake(event.params._address.toHexString(), event.params._courtID.toString(), event.params._amount); } diff --git a/subgraph/subgraph.yaml b/subgraph/subgraph.yaml index 0fd7441f9..e4d86d63d 100644 --- a/subgraph/subgraph.yaml +++ b/subgraph/subgraph.yaml @@ -48,8 +48,8 @@ dataSources: handler: handleDisputeKitEnabled - event: StakeSet(indexed address,uint256,uint256) handler: handleStakeSet - - event: StakeDelayed(indexed address,uint256,uint256) - handler: handleStakeDelayed + - event: StakeDelayedNotTransferred(indexed address,uint256,uint256) + handler: handleStakeDelayedNotTransferred - event: TokenAndETHShift(indexed address,indexed uint256,indexed uint256,uint256,int256,int256,address) handler: handleTokenAndETHShift - event: Ruling(indexed address,indexed uint256,uint256) From 3d7a80e968442c0f3cda17b4b27df38029b8f163 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Sat, 9 Dec 2023 00:56:02 +0000 Subject: [PATCH 28/77] test: coverage of delayed stakes --- contracts/test/arbitration/staking.ts | 132 +++++++++++++++++--------- 1 file changed, 88 insertions(+), 44 deletions(-) diff --git a/contracts/test/arbitration/staking.ts b/contracts/test/arbitration/staking.ts index e761779a6..d9afe1672 100644 --- a/contracts/test/arbitration/staking.ts +++ b/contracts/test/arbitration/staking.ts @@ -1,4 +1,5 @@ import { ethers, getNamedAccounts, network, deployments } from "hardhat"; +const { anyValue } = require("@nomicfoundation/hardhat-chai-matchers/withArgs"); import { BigNumber } from "ethers"; import { PNK, @@ -15,8 +16,8 @@ import exp from "constants"; /* eslint-disable no-unused-expressions */ describe("Staking", async () => { - const ONE_TENTH_ETH = BigNumber.from(10).pow(17); - const ONE_THOUSAND_PNK = BigNumber.from(10).pow(21); + const ETH = (amount: number) => ethers.utils.parseUnits(amount.toString()); + const PNK = ETH; // 2nd court, 3 jurors, 1 dispute kit const extraData = @@ -49,13 +50,13 @@ describe("Staking", async () => { const reachDrawingPhase = async () => { expect(await sortition.phase()).to.be.equal(0); // Staking - const arbitrationCost = ONE_TENTH_ETH.mul(3); + const arbitrationCost = ETH(0.1).mul(3); - await core.createCourt(1, false, ONE_THOUSAND_PNK, 1000, ONE_TENTH_ETH, 3, [0, 0, 0, 0], 3, [1]); // Parent - general court, Classic dispute kit + await core.createCourt(1, false, PNK(1000), 1000, ETH(0.1), 3, [0, 0, 0, 0], 3, [1]); // Parent - general court, Classic dispute kit - await pnk.approve(core.address, ONE_THOUSAND_PNK.mul(4)); - await core.setStake(1, ONE_THOUSAND_PNK.mul(2)); - await core.setStake(2, ONE_THOUSAND_PNK.mul(2)); + await pnk.approve(core.address, PNK(4000)); + await core.setStake(1, PNK(2000)); + await core.setStake(2, PNK(2000)); expect(await core.getJurorCourtIDs(deployer)).to.be.deep.equal([BigNumber.from("1"), BigNumber.from("2")]); @@ -73,6 +74,13 @@ describe("Staking", async () => { balanceBefore = await pnk.balanceOf(deployer); }; + const reachStakingPhaseAfterDrawing = async () => { + await randomizer.relay(rng.address, 0, ethers.utils.randomBytes(32)); + await sortition.passPhase(); // Generating -> Drawing + await core.draw(0, 5000); + await sortition.passPhase(); // Drawing -> Staking + }; + describe("When decreasing then increasing back stake", async () => { before("Setup", async () => { await deploy(); @@ -82,9 +90,9 @@ describe("Staking", async () => { it("Should be outside the Staking phase", async () => { expect(await sortition.phase()).to.be.equal(1); // Drawing expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ - ONE_THOUSAND_PNK.mul(4), + PNK(4000), BigNumber.from(0), - ONE_THOUSAND_PNK.mul(2), + PNK(2000), BigNumber.from(2), ]); }); @@ -93,40 +101,58 @@ describe("Staking", async () => { expect(await sortition.delayedStakeWriteIndex()).to.be.equal(0); expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); - await expect(core.setStake(2, ONE_THOUSAND_PNK.mul(1))) + await expect(core.setStake(2, PNK(1000))) .to.emit(core, "StakeDelayedNotTransferred") - .withArgs(deployer, 2, ONE_THOUSAND_PNK.mul(1)); - expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); + .withArgs(deployer, 2, PNK(1000)); expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ - ONE_THOUSAND_PNK.mul(4), + PNK(4000), BigNumber.from(0), - ONE_THOUSAND_PNK.mul(2), + PNK(2000), BigNumber.from(2), ]); // stake unchanged, delayed expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); expect(await sortition.delayedStakeWriteIndex()).to.be.equal(1); expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); - expect(await sortition.delayedStakes(1)).to.be.deep.equal([deployer, 2, ONE_THOUSAND_PNK.mul(1), false]); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([deployer, 2, PNK(1000), false]); }); it("Should delay the stake increase back to the previous amount", async () => { balanceBefore = await pnk.balanceOf(deployer); expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); - await expect(core.setStake(2, ONE_THOUSAND_PNK.mul(2))) + await expect(core.setStake(2, PNK(2000))) .to.emit(core, "StakeDelayedNotTransferred") - .withArgs(deployer, 2, ONE_THOUSAND_PNK.mul(2)); - expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(2); + .withArgs(deployer, 2, PNK(2000)); expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ - ONE_THOUSAND_PNK.mul(4), + PNK(4000), BigNumber.from(0), - ONE_THOUSAND_PNK.mul(2), + PNK(2000), BigNumber.from(2), ]); // stake unchanged, delayed expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(2); expect(await sortition.delayedStakeWriteIndex()).to.be.equal(2); expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted - expect(await sortition.delayedStakes(2)).to.be.deep.equal([deployer, 2, ONE_THOUSAND_PNK.mul(2), false]); + expect(await sortition.delayedStakes(2)).to.be.deep.equal([deployer, 2, PNK(2000), false]); + }); + + it("Should execute the delayed stakes but the stakes should remain the same", async () => { + await reachStakingPhaseAfterDrawing(); + balanceBefore = await pnk.balanceOf(deployer); + await expect(sortition.executeDelayedStakes(10)).to.emit(core, "StakeSet").withArgs(deployer, 2, PNK(2000)); + expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ + PNK(4000), + PNK(300), // we're the only juror so we are drawn 3 times + PNK(2000), + BigNumber.from(2), + ]); // stake unchanged, delayed + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(2); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(3); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted + expect(await sortition.delayedStakes(2)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 2nd delayed stake got deleted + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); // no delayed stakes left }); }); @@ -139,9 +165,9 @@ describe("Staking", async () => { it("Should be outside the Staking phase", async () => { expect(await sortition.phase()).to.be.equal(1); // Drawing expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ - ONE_THOUSAND_PNK.mul(4), + PNK(4000), BigNumber.from(0), - ONE_THOUSAND_PNK.mul(2), + PNK(2000), BigNumber.from(2), ]); }); @@ -149,42 +175,60 @@ describe("Staking", async () => { it("Should transfer PNK but delay the stake increase", async () => { expect(await sortition.delayedStakeWriteIndex()).to.be.equal(0); expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); - await pnk.approve(core.address, ONE_THOUSAND_PNK.mul(1)); + await pnk.approve(core.address, PNK(1000)); expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); - await expect(core.setStake(2, ONE_THOUSAND_PNK.mul(3))) + await expect(core.setStake(2, PNK(3000))) .to.emit(core, "StakeDelayedAlreadyTransferred") - .withArgs(deployer, 2, ONE_THOUSAND_PNK.mul(3)); - expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); + .withArgs(deployer, 2, PNK(3000)); expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ - ONE_THOUSAND_PNK.mul(5), + PNK(5000), BigNumber.from(0), - ONE_THOUSAND_PNK.mul(3), + PNK(3000), BigNumber.from(2), ]); // stake has changed immediately, WARNING: this is misleading because it's not actually added to the SortitionSumTree - expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore.sub(ONE_THOUSAND_PNK)); // PNK is transferred out of the juror's account + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore.sub(PNK(1000))); // PNK is transferred out of the juror's account + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); expect(await sortition.delayedStakeWriteIndex()).to.be.equal(1); expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); - expect(await sortition.delayedStakes(1)).to.be.deep.equal([deployer, 2, ONE_THOUSAND_PNK.mul(3), true]); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([deployer, 2, PNK(3000), true]); }); it("Should cancel out the stake decrease back", async () => { balanceBefore = await pnk.balanceOf(deployer); expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); - await expect(core.setStake(2, ONE_THOUSAND_PNK.mul(2))) + await expect(core.setStake(2, PNK(2000))) .to.emit(core, "StakeDelayedNotTransferred") - .withArgs(deployer, 2, ONE_THOUSAND_PNK.mul(2)); - expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(2); + .withArgs(deployer, 2, PNK(2000)); expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ - ONE_THOUSAND_PNK.mul(4), + PNK(4000), BigNumber.from(0), - ONE_THOUSAND_PNK.mul(2), + PNK(2000), BigNumber.from(2), ]); // stake has changed immediately - expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore.add(ONE_THOUSAND_PNK)); // PNK is sent back to the juror + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore.add(PNK(1000))); // PNK is sent back to the juror + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(2); expect(await sortition.delayedStakeWriteIndex()).to.be.equal(2); expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted - expect(await sortition.delayedStakes(2)).to.be.deep.equal([deployer, 2, ONE_THOUSAND_PNK.mul(2), false]); + expect(await sortition.delayedStakes(2)).to.be.deep.equal([deployer, 2, PNK(2000), false]); + }); + + it("Should execute the delayed stakes but the stakes should remain the same", async () => { + await reachStakingPhaseAfterDrawing(); + balanceBefore = await pnk.balanceOf(deployer); + await expect(sortition.executeDelayedStakes(10)).to.emit(core, "StakeSet").withArgs(deployer, 2, PNK(2000)); + expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ + PNK(4000), + PNK(300), // we're the only juror so we are drawn 3 times + PNK(2000), + BigNumber.from(2), + ]); // stake unchanged, delayed + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(2); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(3); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted + expect(await sortition.delayedStakes(2)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 2nd delayed stake got deleted + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); // no delayed stakes left }); }); }); @@ -195,13 +239,13 @@ describe("Staking", async () => { }); it("Should unstake from all courts", async () => { - const arbitrationCost = ONE_TENTH_ETH.mul(3); + const arbitrationCost = ETH(0.1).mul(3); - await core.createCourt(1, false, ONE_THOUSAND_PNK, 1000, ONE_TENTH_ETH, 3, [0, 0, 0, 0], 3, [1]); // Parent - general court, Classic dispute kit + await core.createCourt(1, false, PNK(1000), 1000, ETH(0.1), 3, [0, 0, 0, 0], 3, [1]); // Parent - general court, Classic dispute kit - await pnk.approve(core.address, ONE_THOUSAND_PNK.mul(4)); - await core.setStake(1, ONE_THOUSAND_PNK.mul(2)); - await core.setStake(2, ONE_THOUSAND_PNK.mul(2)); + await pnk.approve(core.address, PNK(4000)); + await core.setStake(1, PNK(2000)); + await core.setStake(2, PNK(2000)); expect(await core.getJurorCourtIDs(deployer)).to.be.deep.equal([BigNumber.from("1"), BigNumber.from("2")]); @@ -224,7 +268,7 @@ describe("Staking", async () => { await core.passPeriod(0); // Voting -> Appeal await core.passPeriod(0); // Appeal -> Execution - await sortition.passPhase(); // Freezing -> Staking. Change so we don't deal with delayed stakes + await sortition.passPhase(); // Drawing -> Staking. Change so we don't deal with delayed stakes expect(await core.getJurorCourtIDs(deployer)).to.be.deep.equal([BigNumber.from("1"), BigNumber.from("2")]); From 6dcc035985c409bb4e4db76f2607f28cb1ae8e85 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Sat, 9 Dec 2023 01:42:59 +0000 Subject: [PATCH 29/77] test: refactored and improved --- contracts/test/arbitration/staking.ts | 227 ++++++++++++++------------ 1 file changed, 120 insertions(+), 107 deletions(-) diff --git a/contracts/test/arbitration/staking.ts b/contracts/test/arbitration/staking.ts index d9afe1672..171b7e67c 100644 --- a/contracts/test/arbitration/staking.ts +++ b/contracts/test/arbitration/staking.ts @@ -11,6 +11,7 @@ import { } from "../../typechain-types"; import { expect } from "chai"; import exp from "constants"; +import { it } from "mocha"; /* eslint-disable no-unused-vars */ /* eslint-disable no-unused-expressions */ @@ -81,7 +82,7 @@ describe("Staking", async () => { await sortition.passPhase(); // Drawing -> Staking }; - describe("When decreasing then increasing back stake", async () => { + describe("When stake is decreased then increased back", async () => { before("Setup", async () => { await deploy(); await reachDrawingPhase(); @@ -89,74 +90,80 @@ describe("Staking", async () => { it("Should be outside the Staking phase", async () => { expect(await sortition.phase()).to.be.equal(1); // Drawing - expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ - PNK(4000), - BigNumber.from(0), - PNK(2000), - BigNumber.from(2), - ]); + expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); }); - it("Should delay the stake decrease", async () => { - expect(await sortition.delayedStakeWriteIndex()).to.be.equal(0); - expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); - expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); - await expect(core.setStake(2, PNK(1000))) - .to.emit(core, "StakeDelayedNotTransferred") - .withArgs(deployer, 2, PNK(1000)); - expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ - PNK(4000), - BigNumber.from(0), - PNK(2000), - BigNumber.from(2), - ]); // stake unchanged, delayed - expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet - expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); - expect(await sortition.delayedStakeWriteIndex()).to.be.equal(1); - expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); - expect(await sortition.delayedStakes(1)).to.be.deep.equal([deployer, 2, PNK(1000), false]); + describe("When stake is decreased", async () => { + it("Should delay the stake decrease", async () => { + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(0); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); + await expect(core.setStake(2, PNK(1000))) + .to.emit(core, "StakeDelayedNotTransferred") + .withArgs(deployer, 2, PNK(1000)); + expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); // stake unchanged, delayed + }); + + it("Should not transfer any PNK", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet + }); + + it("Should store the delayed stake for later", async () => { + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(1); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([deployer, 2, PNK(1000), false]); + }); }); - it("Should delay the stake increase back to the previous amount", async () => { - balanceBefore = await pnk.balanceOf(deployer); - expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); - await expect(core.setStake(2, PNK(2000))) - .to.emit(core, "StakeDelayedNotTransferred") - .withArgs(deployer, 2, PNK(2000)); - expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ - PNK(4000), - BigNumber.from(0), - PNK(2000), - BigNumber.from(2), - ]); // stake unchanged, delayed - expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet - expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(2); - expect(await sortition.delayedStakeWriteIndex()).to.be.equal(2); - expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); - expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted - expect(await sortition.delayedStakes(2)).to.be.deep.equal([deployer, 2, PNK(2000), false]); + describe("When stake is increased back to the previous amount", () => { + it("Should delay the stake increase", async () => { + balanceBefore = await pnk.balanceOf(deployer); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); + await expect(core.setStake(2, PNK(2000))) + .to.emit(core, "StakeDelayedNotTransferred") + .withArgs(deployer, 2, PNK(2000)); + expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); // stake unchanged, delayed + }); + + it("Should not transfer any PNK", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet + }); + + it("Should store the delayed stake for later", async () => { + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(2); + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(2); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted + expect(await sortition.delayedStakes(2)).to.be.deep.equal([deployer, 2, PNK(2000), false]); + }); }); - it("Should execute the delayed stakes but the stakes should remain the same", async () => { - await reachStakingPhaseAfterDrawing(); - balanceBefore = await pnk.balanceOf(deployer); - await expect(sortition.executeDelayedStakes(10)).to.emit(core, "StakeSet").withArgs(deployer, 2, PNK(2000)); - expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ - PNK(4000), - PNK(300), // we're the only juror so we are drawn 3 times - PNK(2000), - BigNumber.from(2), - ]); // stake unchanged, delayed - expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet - expect(await sortition.delayedStakeWriteIndex()).to.be.equal(2); - expect(await sortition.delayedStakeReadIndex()).to.be.equal(3); - expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted - expect(await sortition.delayedStakes(2)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 2nd delayed stake got deleted - expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); // no delayed stakes left + describe("When the Phase passes back to Staking", () => { + it("Should execute the delayed stakes but the stakes should remain the same", async () => { + await reachStakingPhaseAfterDrawing(); + balanceBefore = await pnk.balanceOf(deployer); + await expect(sortition.executeDelayedStakes(10)).to.emit(core, "StakeSet").withArgs(deployer, 2, PNK(2000)); + expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ + PNK(4000), + PNK(300), // we're the only juror so we are drawn 3 times + PNK(2000), + 2, + ]); // stake unchanged, delayed + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(2); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(3); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted + expect(await sortition.delayedStakes(2)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 2nd delayed stake got deleted + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); // no delayed stakes left + }); + + it("Should not transfer any PNK", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet + }); }); }); - describe("When increasing then decreasing back stake", async () => { + describe("When stake is increased then decreased back", async () => { before("Setup", async () => { await deploy(); await reachDrawingPhase(); @@ -164,55 +171,58 @@ describe("Staking", async () => { it("Should be outside the Staking phase", async () => { expect(await sortition.phase()).to.be.equal(1); // Drawing - expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ - PNK(4000), - BigNumber.from(0), - PNK(2000), - BigNumber.from(2), - ]); + expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); }); - it("Should transfer PNK but delay the stake increase", async () => { - expect(await sortition.delayedStakeWriteIndex()).to.be.equal(0); - expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); - await pnk.approve(core.address, PNK(1000)); - expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); - await expect(core.setStake(2, PNK(3000))) - .to.emit(core, "StakeDelayedAlreadyTransferred") - .withArgs(deployer, 2, PNK(3000)); - expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ - PNK(5000), - BigNumber.from(0), - PNK(3000), - BigNumber.from(2), - ]); // stake has changed immediately, WARNING: this is misleading because it's not actually added to the SortitionSumTree - expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore.sub(PNK(1000))); // PNK is transferred out of the juror's account - expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); - expect(await sortition.delayedStakeWriteIndex()).to.be.equal(1); - expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); - expect(await sortition.delayedStakes(1)).to.be.deep.equal([deployer, 2, PNK(3000), true]); + describe("When stake is increased", () => { + it("Should transfer PNK but delay the stake increase", async () => { + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(0); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + await pnk.approve(core.address, PNK(1000)); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); + await expect(core.setStake(2, PNK(3000))) + .to.emit(core, "StakeDelayedAlreadyTransferred") + .withArgs(deployer, 2, PNK(3000)); + expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(5000), 0, PNK(3000), 2]); // stake has changed immediately, WARNING: this is misleading because it's not actually added to the SortitionSumTree + }); + + it("Should transfer some PNK out of the juror's account", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore.sub(PNK(1000))); // PNK is transferred out of the juror's account + }); + + it("Should store the delayed stake for later", async () => { + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(1); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([deployer, 2, PNK(3000), true]); + }); }); - it("Should cancel out the stake decrease back", async () => { - balanceBefore = await pnk.balanceOf(deployer); - expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); - await expect(core.setStake(2, PNK(2000))) - .to.emit(core, "StakeDelayedNotTransferred") - .withArgs(deployer, 2, PNK(2000)); - expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ - PNK(4000), - BigNumber.from(0), - PNK(2000), - BigNumber.from(2), - ]); // stake has changed immediately - expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore.add(PNK(1000))); // PNK is sent back to the juror - expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(2); - expect(await sortition.delayedStakeWriteIndex()).to.be.equal(2); - expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); - expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted - expect(await sortition.delayedStakes(2)).to.be.deep.equal([deployer, 2, PNK(2000), false]); + describe("When stake is decreased back to the previous amount", () => { + it("Should cancel out the stake decrease back", async () => { + balanceBefore = await pnk.balanceOf(deployer); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); + await expect(core.setStake(2, PNK(2000))) + .to.emit(core, "StakeDelayedNotTransferred") + .withArgs(deployer, 2, PNK(2000)); + expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); // stake has changed immediately + }); + + it("Should transfer back some PNK to the juror", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore.add(PNK(1000))); // PNK is sent back to the juror + }); + + it("Should store the delayed stake for later", async () => { + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(2); + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(2); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted + expect(await sortition.delayedStakes(2)).to.be.deep.equal([deployer, 2, PNK(2000), false]); + }); }); + }); + describe("When the Phase passes back to Staking", () => { it("Should execute the delayed stakes but the stakes should remain the same", async () => { await reachStakingPhaseAfterDrawing(); balanceBefore = await pnk.balanceOf(deployer); @@ -221,15 +231,18 @@ describe("Staking", async () => { PNK(4000), PNK(300), // we're the only juror so we are drawn 3 times PNK(2000), - BigNumber.from(2), + 2, ]); // stake unchanged, delayed - expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet expect(await sortition.delayedStakeWriteIndex()).to.be.equal(2); expect(await sortition.delayedStakeReadIndex()).to.be.equal(3); expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted expect(await sortition.delayedStakes(2)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 2nd delayed stake got deleted expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); // no delayed stakes left }); + + it("Should not transfer any PNK", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet + }); }); }); @@ -247,7 +260,7 @@ describe("Staking", async () => { await core.setStake(1, PNK(2000)); await core.setStake(2, PNK(2000)); - expect(await core.getJurorCourtIDs(deployer)).to.be.deep.equal([BigNumber.from("1"), BigNumber.from("2")]); + expect(await core.getJurorCourtIDs(deployer)).to.be.deep.equal([1, 2]); await core.functions["createDispute(uint256,bytes)"](2, extraData, { value: arbitrationCost }); @@ -270,7 +283,7 @@ describe("Staking", async () => { await sortition.passPhase(); // Drawing -> Staking. Change so we don't deal with delayed stakes - expect(await core.getJurorCourtIDs(deployer)).to.be.deep.equal([BigNumber.from("1"), BigNumber.from("2")]); + expect(await core.getJurorCourtIDs(deployer)).to.be.deep.equal([1, 2]); await core.execute(0, 0, 1); // 1 iteration should unstake from both courts From 4328a5f9aab75ded6ec35bf736e64ae60bbfcf05 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Tue, 12 Dec 2023 13:00:05 +0000 Subject: [PATCH 30/77] docs: comment --- contracts/src/arbitration/KlerosCore.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/src/arbitration/KlerosCore.sol b/contracts/src/arbitration/KlerosCore.sol index 13a1e9104..0b1cf6f8b 100644 --- a/contracts/src/arbitration/KlerosCore.sol +++ b/contracts/src/arbitration/KlerosCore.sol @@ -476,7 +476,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { ) external { if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly(); // Always nullify the latest delayed stake before setting a new value. - // Note that we check the delayed stake here too because the check in `setStake` can be bypassed + // Note that we call _deleteDelayedStake() here too because the one in `setStake` can be bypassed // if the stake was updated automatically during `execute` (e.g. when unstaking inactive juror). _deleteDelayedStake(_courtID); _setStakeForAccount(_account, _courtID, _newStake, _alreadyTransferred); From 7e0d1bd0f66c13146158479ac4863343601ad896 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Tue, 12 Dec 2023 13:14:47 +0000 Subject: [PATCH 31/77] refactor: simplification by moving KC._deleteDelayedStake() inside SM.preStakeHook() --- contracts/src/arbitration/KlerosCore.sol | 11 ----- contracts/src/arbitration/SortitionModule.sol | 40 ++++++++++--------- .../interfaces/ISortitionModule.sol | 2 - 3 files changed, 21 insertions(+), 32 deletions(-) diff --git a/contracts/src/arbitration/KlerosCore.sol b/contracts/src/arbitration/KlerosCore.sol index 0b1cf6f8b..52ab49669 100644 --- a/contracts/src/arbitration/KlerosCore.sol +++ b/contracts/src/arbitration/KlerosCore.sol @@ -464,7 +464,6 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { /// @param _newStake The new stake. /// Note that the existing delayed stake will be nullified as non-relevant. function setStake(uint96 _courtID, uint256 _newStake) external { - _deleteDelayedStake(_courtID); if (!_setStakeForAccount(msg.sender, _courtID, _newStake, false)) revert StakingFailed(); } @@ -475,10 +474,6 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { bool _alreadyTransferred ) external { if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly(); - // Always nullify the latest delayed stake before setting a new value. - // Note that we call _deleteDelayedStake() here too because the one in `setStake` can be bypassed - // if the stake was updated automatically during `execute` (e.g. when unstaking inactive juror). - _deleteDelayedStake(_courtID); _setStakeForAccount(_account, _courtID, _newStake, _alreadyTransferred); } @@ -1061,12 +1056,6 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { emit DisputeKitEnabled(_courtID, _disputeKitID, _enable); } - /// @dev Removes the latest delayed stake if there is any. - /// @param _courtID The ID of the court. - function _deleteDelayedStake(uint96 _courtID) private { - sortitionModule.deleteDelayedStake(_courtID, msg.sender); - } - /// @dev Sets the specified juror's stake in a court. /// `O(n + p * log_k(j))` where /// `n` is the number of courts the juror has staked in, diff --git a/contracts/src/arbitration/SortitionModule.sol b/contracts/src/arbitration/SortitionModule.sol index ea50851aa..355121224 100644 --- a/contracts/src/arbitration/SortitionModule.sol +++ b/contracts/src/arbitration/SortitionModule.sol @@ -218,30 +218,13 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { delayedStakeReadIndex = newDelayedStakeReadIndex; } - /// @dev Checks if there is already a delayed stake. In this case consider it irrelevant and remove it. - /// @param _courtID ID of the court. - /// @param _juror Juror whose stake to check. - function deleteDelayedStake(uint96 _courtID, address _juror) external override onlyByCore { - uint256 latestIndex = latestDelayedStakeIndex[_juror][_courtID]; - if (latestIndex != 0) { - DelayedStake storage delayedStake = delayedStakes[latestIndex]; - if (delayedStake.alreadyTransferred) { - bytes32 stakePathID = _accountAndCourtIDToStakePathID(_juror, _courtID); - // Sortition stake represents the stake value that was last updated during Staking phase. - uint256 sortitionStake = stakeOf(bytes32(uint256(_courtID)), stakePathID); - // Withdraw the tokens that were added with the latest delayed stake. - core.withdrawPartiallyDelayedStake(_courtID, _juror, delayedStake.stake - sortitionStake); - } - delete delayedStakes[latestIndex]; - delete latestDelayedStakeIndex[_juror][_courtID]; - } - } - function preStakeHook( address _account, uint96 _courtID, uint256 _stake ) external override onlyByCore returns (PreStakeHookResult) { + _deleteDelayedStake(_courtID, _account); + (, , uint256 currentStake, uint256 nbCourts) = core.getJurorBalance(_account, _courtID); if (currentStake == 0 && nbCourts >= MAX_STAKE_PATHS) { // Prevent staking beyond MAX_STAKE_PATHS but unstaking is always allowed. @@ -268,6 +251,25 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { return PreStakeHookResult.ok; } + /// @dev Checks if there is already a delayed stake. In this case consider it irrelevant and remove it. + /// @param _courtID ID of the court. + /// @param _juror Juror whose stake to check. + function _deleteDelayedStake(uint96 _courtID, address _juror) internal { + uint256 latestIndex = latestDelayedStakeIndex[_juror][_courtID]; + if (latestIndex != 0) { + DelayedStake storage delayedStake = delayedStakes[latestIndex]; + if (delayedStake.alreadyTransferred) { + bytes32 stakePathID = _accountAndCourtIDToStakePathID(_juror, _courtID); + // Sortition stake represents the stake value that was last updated during Staking phase. + uint256 sortitionStake = stakeOf(bytes32(uint256(_courtID)), stakePathID); + // Withdraw the tokens that were added with the latest delayed stake. + core.withdrawPartiallyDelayedStake(_courtID, _juror, delayedStake.stake - sortitionStake); + } + delete delayedStakes[latestIndex]; + delete latestDelayedStakeIndex[_juror][_courtID]; + } + } + function createDisputeHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore { disputesWithoutJurors++; } diff --git a/contracts/src/arbitration/interfaces/ISortitionModule.sol b/contracts/src/arbitration/interfaces/ISortitionModule.sol index 42eb2a4c0..611118be3 100644 --- a/contracts/src/arbitration/interfaces/ISortitionModule.sol +++ b/contracts/src/arbitration/interfaces/ISortitionModule.sol @@ -32,6 +32,4 @@ interface ISortitionModule { function createDisputeHook(uint256 _disputeID, uint256 _roundID) external; function postDrawHook(uint256 _disputeID, uint256 _roundID) external; - - function deleteDelayedStake(uint96 _courtID, address _juror) external; } From f0f2d1e57f483310702dafb70e0fae7750b84680 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Tue, 12 Dec 2023 23:20:25 +0000 Subject: [PATCH 32/77] refactor: moved the juror stakes accounting from KlerosCore to SortitionModule --- contracts/src/arbitration/KlerosCore.sol | 186 ++---------- contracts/src/arbitration/SortitionModule.sol | 267 ++++++++++++++---- .../dispute-kits/DisputeKitClassic.sol | 2 +- .../dispute-kits/DisputeKitSybilResistant.sol | 2 +- .../interfaces/ISortitionModule.sol | 29 +- contracts/test/arbitration/draw.ts | 30 +- contracts/test/arbitration/staking.ts | 45 +-- contracts/test/integration/index.ts | 8 +- 8 files changed, 306 insertions(+), 263 deletions(-) diff --git a/contracts/src/arbitration/KlerosCore.sol b/contracts/src/arbitration/KlerosCore.sol index 52ab49669..941990e6a 100644 --- a/contracts/src/arbitration/KlerosCore.sol +++ b/contracts/src/arbitration/KlerosCore.sol @@ -70,13 +70,6 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { uint256 drawIterations; // The number of iterations passed drawing the jurors for this round. } - struct Juror { - uint96[] courtIDs; // The IDs of courts where the juror's stake path ends. A stake path is a path from the general court to a court the juror directly staked in using `_setStake`. - uint256 stakedPnk; // The juror's total amount of tokens staked in subcourts. Reflects actual pnk balance. - uint256 lockedPnk; // The juror's total amount of tokens locked in disputes. Can reflect actual pnk balance when stakedPnk are fully withdrawn. - mapping(uint96 => uint256) stakedPnkByCourt; // The amount of PNKs the juror has staked in the court in the form `stakedPnkByCourt[courtID]`. - } - // Workaround "stack too deep" errors struct ExecuteParams { uint256 disputeID; // The ID of the dispute to execute. @@ -107,21 +100,12 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { Court[] public courts; // The courts. IDisputeKit[] public disputeKits; // Array of dispute kits. Dispute[] public disputes; // The disputes. - mapping(address => Juror) internal jurors; // The jurors. mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH. // ************************************* // // * Events * // // ************************************* // - event StakeSet(address indexed _address, uint256 _courtID, uint256 _amount); - event StakeDelayedNotTransferred(address indexed _address, uint256 _courtID, uint256 _amount); - event StakeDelayedAlreadyTransferred(address indexed _address, uint256 _courtID, uint256 _amount); - event StakeDelayedAlreadyTransferredWithdrawn( - uint96 indexed _courtID, - address indexed _account, - uint256 _withdrawnAmount - ); event NewPeriod(uint256 indexed _disputeID, Period _period); event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable); event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable); @@ -464,7 +448,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { /// @param _newStake The new stake. /// Note that the existing delayed stake will be nullified as non-relevant. function setStake(uint96 _courtID, uint256 _newStake) external { - if (!_setStakeForAccount(msg.sender, _courtID, _newStake, false)) revert StakingFailed(); + _setStake(msg.sender, _courtID, _newStake, false); } function setStakeBySortitionModule( @@ -474,31 +458,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { bool _alreadyTransferred ) external { if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly(); - _setStakeForAccount(_account, _courtID, _newStake, _alreadyTransferred); - } - - function withdrawPartiallyDelayedStake(uint96 _courtID, address _juror, uint256 _amountToWithdraw) external { - if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly(); - uint256 actualAmount = _amountToWithdraw; - Juror storage juror = jurors[_juror]; - if (juror.stakedPnk <= actualAmount) { - actualAmount = juror.stakedPnk; - } - require(pinakion.safeTransfer(_juror, actualAmount)); - // StakePnk can become lower because of penalty, thus we adjust the amount for it. stakedPnkByCourt can't be penalized so subtract the default amount. - juror.stakedPnk -= actualAmount; - juror.stakedPnkByCourt[_courtID] -= _amountToWithdraw; - emit StakeDelayedAlreadyTransferredWithdrawn(_courtID, _juror, _amountToWithdraw); - // Note that if we don't delete court here it'll be duplicated after staking. - if (juror.stakedPnkByCourt[_courtID] == 0) { - for (uint256 i = juror.courtIDs.length; i > 0; i--) { - if (juror.courtIDs[i - 1] == _courtID) { - juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1]; - juror.courtIDs.pop(); - break; - } - } - } + _setStake(_account, _courtID, _newStake, _alreadyTransferred); } /// @inheritdoc IArbitratorV2 @@ -625,7 +585,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { if (drawnAddress == address(0)) { continue; } - jurors[drawnAddress].lockedPnk += round.pnkAtStakePerJuror; + sortitionModule.lockStake(drawnAddress, round.pnkAtStakePerJuror); emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length); round.drawnJurors.push(drawnAddress); if (round.drawnJurors.length == round.nbVotes) { @@ -764,15 +724,10 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { // Unlock the PNKs affected by the penalty address account = round.drawnJurors[_params.repartition]; - jurors[account].lockedPnk -= penalty; + sortitionModule.unlockStake(account, penalty); // Apply the penalty to the staked PNKs. - // Note that lockedPnk will always cover penalty while stakedPnk can become lower after manual unstaking. - if (jurors[account].stakedPnk >= penalty) { - jurors[account].stakedPnk -= penalty; - } else { - jurors[account].stakedPnk = 0; - } + sortitionModule.penalizeStake(account, penalty); emit TokenAndETHShift( account, _params.disputeID, @@ -831,10 +786,10 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR; // Release the rest of the PNKs of the juror for this round. - jurors[account].lockedPnk -= pnkLocked; + sortitionModule.unlockStake(account, pnkLocked); // Give back the locked PNKs in case the juror fully unstaked earlier. - if (jurors[account].stakedPnk == 0) { + if (!sortitionModule.isJurorStaked(account)) { pinakion.safeTransfer(account, pnkLocked); } @@ -980,17 +935,6 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { return disputes[_disputeID].rounds.length; } - function getJurorBalance( - address _juror, - uint96 _courtID - ) external view returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts) { - Juror storage juror = jurors[_juror]; - totalStaked = juror.stakedPnk; - totalLocked = juror.lockedPnk; - stakedInCourt = juror.stakedPnkByCourt[_courtID]; - nbCourts = juror.courtIDs.length; - } - function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) { return courts[_courtID].supportedDisputeKits[_disputeKitID]; } @@ -1033,12 +977,6 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { return disputeKits.length; } - /// @dev Gets the court identifiers where a specific `_juror` has staked. - /// @param _juror The address of the juror. - function getJurorCourtIDs(address _juror) public view returns (uint96[] memory) { - return jurors[_juror].courtIDs; - } - function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) { return (_amountInEth * 10 ** currencyRates[_toToken].rateDecimals) / currencyRates[_toToken].rateInEth; } @@ -1056,104 +994,34 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { emit DisputeKitEnabled(_courtID, _disputeKitID, _enable); } - /// @dev Sets the specified juror's stake in a court. - /// `O(n + p * log_k(j))` where - /// `n` is the number of courts the juror has staked in, - /// `p` is the depth of the court tree, - /// `k` is the minimum number of children per node of one of these courts' sortition sum tree, - /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously. - /// @param _account The address of the juror. - /// @param _courtID The ID of the court. - /// @param _newStake The new stake. - /// @param _alreadyTransferred True if the tokens were already transferred from juror. Only relevant for delayed stakes. - /// @return succeeded True if the call succeeded, false otherwise. - function _setStakeForAccount( + function _setStake( address _account, uint96 _courtID, uint256 _newStake, bool _alreadyTransferred - ) internal returns (bool succeeded) { - if (_courtID == Constants.FORKING_COURT || _courtID > courts.length) return false; - - Juror storage juror = jurors[_account]; - uint256 currentStake = juror.stakedPnkByCourt[_courtID]; - - if (_newStake != 0) { - if (_newStake < courts[_courtID].minStake) return false; - } else if (currentStake == 0) { - return false; + ) internal returns (bool success) { + if (_courtID == Constants.FORKING_COURT || _courtID > courts.length) { + return false; // Staking directly into the forking court is not allowed. } - - ISortitionModule.PreStakeHookResult result = sortitionModule.preStakeHook(_account, _courtID, _newStake); - if (result == ISortitionModule.PreStakeHookResult.failed) { - return false; - } else if (result == ISortitionModule.PreStakeHookResult.stakeDelayedNotTransferred) { - emit StakeDelayedNotTransferred(_account, _courtID, _newStake); - return true; + if (_newStake != 0 && _newStake < courts[_courtID].minStake) { + return false; // Staking less than the minimum stake is not allowed. } - - uint256 transferredAmount; - if (_newStake >= currentStake) { - if (!_alreadyTransferred) { - // Stake increase - // When stakedPnk becomes lower than lockedPnk count the locked tokens in when transferring tokens from juror. - // (E.g. stakedPnk = 0, lockedPnk = 150) which can happen if the juror unstaked fully while having some tokens locked. - uint256 previouslyLocked = (juror.lockedPnk >= juror.stakedPnk) ? juror.lockedPnk - juror.stakedPnk : 0; // underflow guard - transferredAmount = (_newStake >= currentStake + previouslyLocked) // underflow guard - ? _newStake - currentStake - previouslyLocked - : 0; - if (transferredAmount > 0) { - // Note we don't return false after incorrect transfer because when stake is increased the transfer is done immediately, thus it can't disrupt delayed stakes' queue. - pinakion.safeTransferFrom(_account, address(this), transferredAmount); - } - if (currentStake == 0) { - juror.courtIDs.push(_courtID); - } - } - } else { - // Note that stakes can be partially delayed only when stake is increased. - // Stake decrease: make sure locked tokens always stay in the contract. They can only be released during Execution. - if (juror.stakedPnk >= currentStake - _newStake + juror.lockedPnk) { - // We have enough pnk staked to afford withdrawal while keeping locked tokens. - transferredAmount = currentStake - _newStake; - } else if (juror.stakedPnk >= juror.lockedPnk) { - // Can't afford withdrawing the current stake fully. Take whatever is available while keeping locked tokens. - transferredAmount = juror.stakedPnk - juror.lockedPnk; - } - if (transferredAmount > 0) { - if (!pinakion.safeTransfer(_account, transferredAmount)) { - return false; - } - } - if (_newStake == 0) { - for (uint256 i = juror.courtIDs.length; i > 0; i--) { - if (juror.courtIDs[i - 1] == _courtID) { - juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1]; - juror.courtIDs.pop(); - break; - } - } + (uint256 pnkDeposit, uint256 pnkWithdrawal, bool sortitionSuccess) = sortitionModule.setStake( + _account, + _courtID, + _newStake, + _alreadyTransferred + ); + if (pnkDeposit > 0 && pnkWithdrawal > 0) revert StakingFailed(); + if (pnkDeposit > 0) { + // Note we don't return false after incorrect transfer because when stake is increased the transfer is done immediately, thus it can't disrupt delayed stakes' queue. + pinakion.safeTransferFrom(_account, address(this), pnkDeposit); + } else if (pnkWithdrawal > 0) { + if (!pinakion.safeTransfer(_account, pnkWithdrawal)) { + return false; } } - - // Note that stakedPnk can become async with currentStake (e.g. after penalty). - // Also note that these values were already updated if the stake was only partially delayed. - if (!_alreadyTransferred) { - juror.stakedPnk = (juror.stakedPnk >= currentStake) - ? juror.stakedPnk - currentStake + _newStake - : _newStake; - juror.stakedPnkByCourt[_courtID] = _newStake; - } - - // Transfer the tokens but don't update sortition module. - if (result == ISortitionModule.PreStakeHookResult.stakeDelayedAlreadyTransferred) { - emit StakeDelayedAlreadyTransferred(_account, _courtID, _newStake); - return true; - } - - sortitionModule.setStake(_account, _courtID, _newStake); - emit StakeSet(_account, _courtID, _newStake); - return true; + return sortitionSuccess; } /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array. diff --git a/contracts/src/arbitration/SortitionModule.sol b/contracts/src/arbitration/SortitionModule.sol index 355121224..1ef0f4306 100644 --- a/contracts/src/arbitration/SortitionModule.sol +++ b/contracts/src/arbitration/SortitionModule.sol @@ -25,6 +25,13 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { // * Enums / Structs * // // ************************************* // + enum PreStakeHookResult { + ok, // Correct phase. All checks are passed. + stakeDelayedAlreadyTransferred, // Wrong phase but stake is increased, so transfer the tokens without updating the drawing chance. + stakeDelayedNotTransferred, // Wrong phase and stake is decreased. Delay the token transfer and drawing chance update. + failed // Checks didn't pass. Do no changes. + } + struct SortitionSumTree { uint256 K; // The maximum number of children per node. // We use this to keep track of vacant positions in the tree after removing a leaf. This is for keeping the tree as balanced as possible without spending gas on moving nodes around. @@ -42,6 +49,13 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { bool alreadyTransferred; // True if tokens were already transferred before delayed stake's execution. } + struct Juror { + uint96[] courtIDs; // The IDs of courts where the juror's stake path ends. A stake path is a path from the general court to a court the juror directly staked in using `_setStake`. + uint256 stakedPnk; // The juror's total amount of tokens staked in subcourts. Reflects actual pnk balance. + uint256 lockedPnk; // The juror's total amount of tokens locked in disputes. Can reflect actual pnk balance when stakedPnk are fully withdrawn. + mapping(uint96 => uint256) stakedPnkByCourt; // The amount of PNKs the juror has staked in the court in the form `stakedPnkByCourt[courtID]`. + } + // ************************************* // // * Storage * // // ************************************* // @@ -63,9 +77,20 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { uint256 public delayedStakeWriteIndex; // The index of the last `delayedStake` item that was written to the array. 0 index is skipped. uint256 public delayedStakeReadIndex; // The index of the next `delayedStake` item that should be processed. Starts at 1 because 0 index is skipped. mapping(bytes32 => SortitionSumTree) sortitionSumTrees; // The mapping trees by keys. + mapping(address => Juror) public jurors; // The jurors. mapping(uint256 => DelayedStake) public delayedStakes; // Stores the stakes that were changed during Drawing phase, to update them when the phase is switched to Staking. mapping(address => mapping(uint96 => uint256)) public latestDelayedStakeIndex; // Maps the juror to its latest delayed stake. If there is already a delayed stake for this juror then it'll be replaced. latestDelayedStakeIndex[juror][courtID]. + // ************************************* // + // * Events * // + // ************************************* // + + event StakeSet(address indexed _address, uint256 _courtID, uint256 _amount); + event StakeDelayedNotTransferred(address indexed _address, uint256 _courtID, uint256 _amount); + event StakeDelayedAlreadyTransferred(address indexed _address, uint256 _courtID, uint256 _amount); + event StakeDelayedAlreadyTransferredWithdrawn(address indexed _address, uint96 indexed _courtID, uint256 _amount); + event StakeLocked(address indexed _address, uint256 _relativeAmount, bool _unlock); + // ************************************* // // * Function Modifiers * // // ************************************* // @@ -218,43 +243,95 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { delayedStakeReadIndex = newDelayedStakeReadIndex; } - function preStakeHook( + function createDisputeHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore { + disputesWithoutJurors++; + } + + function postDrawHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore { + disputesWithoutJurors--; + } + + /// @dev Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase(). + /// @param _randomNumber Random number returned by RNG contract. + function notifyRandomNumber(uint256 _randomNumber) public override {} + + /// @dev Sets the specified juror's stake in a court. + /// `O(n + p * log_k(j))` where + /// `n` is the number of courts the juror has staked in, + /// `p` is the depth of the court tree, + /// `k` is the minimum number of children per node of one of these courts' sortition sum tree, + /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously. + /// @param _account The address of the juror. + /// @param _courtID The ID of the court. + /// @param _newStake The new stake. + /// @param _alreadyTransferred True if the tokens were already transferred from juror. Only relevant for delayed stakes. + /// @return pnkDeposit The amount of PNK to be deposited. + /// @return pnkWithdrawal The amount of PNK to be withdrawn. + /// @return succeeded True if the call succeeded, false otherwise. + function setStake( address _account, uint96 _courtID, - uint256 _stake - ) external override onlyByCore returns (PreStakeHookResult) { - _deleteDelayedStake(_courtID, _account); - - (, , uint256 currentStake, uint256 nbCourts) = core.getJurorBalance(_account, _courtID); - if (currentStake == 0 && nbCourts >= MAX_STAKE_PATHS) { - // Prevent staking beyond MAX_STAKE_PATHS but unstaking is always allowed. - return PreStakeHookResult.failed; + uint256 _newStake, + bool _alreadyTransferred + ) external override onlyByCore returns (uint256 pnkDeposit, uint256 pnkWithdrawal, bool succeeded) { + Juror storage juror = jurors[_account]; + uint256 currentStake = juror.stakedPnkByCourt[_courtID]; + + uint256 nbCourts = juror.courtIDs.length; + if (_newStake == 0 && (nbCourts >= MAX_STAKE_PATHS || currentStake == 0)) { + return (0, 0, false); // Prevent staking beyond MAX_STAKE_PATHS but unstaking is always allowed. + } + + pnkWithdrawal = _deleteDelayedStake(_courtID, _account); + + if (phase != Phase.staking) { + // Store the stake change as delayed, to be applied when the phase switches back to Staking. + DelayedStake storage delayedStake = delayedStakes[++delayedStakeWriteIndex]; + delayedStake.account = _account; + delayedStake.courtID = _courtID; + delayedStake.stake = _newStake; + latestDelayedStakeIndex[_account][_courtID] = delayedStakeWriteIndex; + if (_newStake > currentStake) { + // PNK deposit: tokens are transferred now. + delayedStake.alreadyTransferred = true; + pnkDeposit = _increaseStake(juror, _courtID, _newStake, currentStake); + emit StakeDelayedAlreadyTransferred(_account, _courtID, _newStake); + } else { + // PNK withdrawal: tokens are not transferred yet. + emit StakeDelayedNotTransferred(_account, _courtID, _newStake); + } + return (pnkDeposit, pnkWithdrawal, true); + } + + // Staking phase: set normal stakes or delayed stakes (which may have been already transferred). + if (_newStake >= currentStake) { + if (!_alreadyTransferred) { + pnkDeposit = _increaseStake(juror, _courtID, _newStake, currentStake); + } } else { - if (phase != Phase.staking) { - // Store the stake change as delayed, to be applied when the phase switches back to Staking. - DelayedStake storage delayedStake = delayedStakes[++delayedStakeWriteIndex]; - delayedStake.account = _account; - delayedStake.courtID = _courtID; - delayedStake.stake = _stake; - latestDelayedStakeIndex[_account][_courtID] = delayedStakeWriteIndex; - if (_stake > currentStake) { - // PNK deposit: tokens to be transferred now (right after this hook), - // but the stake will be added to the sortition sum tree later. - delayedStake.alreadyTransferred = true; - return PreStakeHookResult.stakeDelayedAlreadyTransferred; - } else { - // PNK withdrawal: tokens are not transferred yet. - return PreStakeHookResult.stakeDelayedNotTransferred; - } + pnkWithdrawal += _decreaseStake(juror, _courtID, _newStake, currentStake); + } + + bytes32 stakePathID = _accountAndCourtIDToStakePathID(_account, _courtID); + bool finished = false; + uint96 currenCourtID = _courtID; + while (!finished) { + // Tokens are also implicitly staked in parent courts through sortition module to increase the chance of being drawn. + _set(bytes32(uint256(currenCourtID)), _newStake, stakePathID); + if (currenCourtID == Constants.GENERAL_COURT) { + finished = true; + } else { + (currenCourtID, , , , , , ) = core.courts(currenCourtID); } } - return PreStakeHookResult.ok; + emit StakeSet(_account, _courtID, _newStake); + return (pnkDeposit, pnkWithdrawal, true); } /// @dev Checks if there is already a delayed stake. In this case consider it irrelevant and remove it. /// @param _courtID ID of the court. /// @param _juror Juror whose stake to check. - function _deleteDelayedStake(uint96 _courtID, address _juror) internal { + function _deleteDelayedStake(uint96 _courtID, address _juror) internal returns (uint256 actualAmountToWithdraw) { uint256 latestIndex = latestDelayedStakeIndex[_juror][_courtID]; if (latestIndex != 0) { DelayedStake storage delayedStake = delayedStakes[latestIndex]; @@ -263,44 +340,98 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { // Sortition stake represents the stake value that was last updated during Staking phase. uint256 sortitionStake = stakeOf(bytes32(uint256(_courtID)), stakePathID); // Withdraw the tokens that were added with the latest delayed stake. - core.withdrawPartiallyDelayedStake(_courtID, _juror, delayedStake.stake - sortitionStake); + uint256 amountToWithdraw = delayedStake.stake - sortitionStake; + actualAmountToWithdraw = amountToWithdraw; + Juror storage juror = jurors[_juror]; + if (juror.stakedPnk <= actualAmountToWithdraw) { + actualAmountToWithdraw = juror.stakedPnk; + } + // StakePnk can become lower because of penalty, thus we adjust the amount for it. stakedPnkByCourt can't be penalized so subtract the default amount. + juror.stakedPnk -= actualAmountToWithdraw; + juror.stakedPnkByCourt[_courtID] -= amountToWithdraw; + emit StakeDelayedAlreadyTransferredWithdrawn(_juror, _courtID, amountToWithdraw); + // Note that if we don't delete court here it'll be duplicated after staking. + if (juror.stakedPnkByCourt[_courtID] == 0) { + for (uint256 i = juror.courtIDs.length; i > 0; i--) { + if (juror.courtIDs[i - 1] == _courtID) { + juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1]; + juror.courtIDs.pop(); + break; + } + } + } } delete delayedStakes[latestIndex]; delete latestDelayedStakeIndex[_juror][_courtID]; } } - function createDisputeHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore { - disputesWithoutJurors++; + function _increaseStake( + Juror storage juror, + uint96 _courtID, + uint256 _newStake, + uint256 _currentStake + ) internal returns (uint256 transferredAmount) { + // Stake increase + // When stakedPnk becomes lower than lockedPnk count the locked tokens in when transferring tokens from juror. + // (E.g. stakedPnk = 0, lockedPnk = 150) which can happen if the juror unstaked fully while having some tokens locked. + uint256 previouslyLocked = (juror.lockedPnk >= juror.stakedPnk) ? juror.lockedPnk - juror.stakedPnk : 0; // underflow guard + transferredAmount = (_newStake >= _currentStake + previouslyLocked) // underflow guard + ? _newStake - _currentStake - previouslyLocked + : 0; + if (_currentStake == 0) { + juror.courtIDs.push(_courtID); + } + // stakedPnk can become async with _currentStake (e.g. after penalty). + juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake; + juror.stakedPnkByCourt[_courtID] = _newStake; } - function postDrawHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore { - disputesWithoutJurors--; + function _decreaseStake( + Juror storage juror, + uint96 _courtID, + uint256 _newStake, + uint256 _currentStake + ) internal returns (uint256 transferredAmount) { + // Stakes can be partially delayed only when stake is increased. + // Stake decrease: make sure locked tokens always stay in the contract. They can only be released during Execution. + if (juror.stakedPnk >= _currentStake - _newStake + juror.lockedPnk) { + // We have enough pnk staked to afford withdrawal while keeping locked tokens. + transferredAmount = _currentStake - _newStake; + } else if (juror.stakedPnk >= juror.lockedPnk) { + // Can't afford withdrawing the current stake fully. Take whatever is available while keeping locked tokens. + transferredAmount = juror.stakedPnk - juror.lockedPnk; + } + if (_newStake == 0) { + for (uint256 i = juror.courtIDs.length; i > 0; i--) { + if (juror.courtIDs[i - 1] == _courtID) { + juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1]; + juror.courtIDs.pop(); + break; + } + } + } + // stakedPnk can become async with _currentStake (e.g. after penalty). + juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake; + juror.stakedPnkByCourt[_courtID] = _newStake; } - /// @dev Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase(). - /// @param _randomNumber Random number returned by RNG contract. - function notifyRandomNumber(uint256 _randomNumber) public override {} + function lockStake(address _account, uint256 _relativeAmount) external override onlyByCore { + jurors[_account].lockedPnk += _relativeAmount; + emit StakeLocked(_account, _relativeAmount, false); + } - /// @dev Sets the value for a particular court and its parent courts. - /// @param _courtID ID of the court. - /// @param _value The new value. - /// @param _account Address of the juror. - /// `O(log_k(n))` where - /// `k` is the maximum number of children per node in the tree, - /// and `n` is the maximum number of nodes ever appended. - function setStake(address _account, uint96 _courtID, uint256 _value) external override onlyByCore { - bytes32 stakePathID = _accountAndCourtIDToStakePathID(_account, _courtID); - bool finished = false; - uint96 currenCourtID = _courtID; - while (!finished) { - // Tokens are also implicitly staked in parent courts through sortition module to increase the chance of being drawn. - _set(bytes32(uint256(currenCourtID)), _value, stakePathID); - if (currenCourtID == Constants.GENERAL_COURT) { - finished = true; - } else { - (currenCourtID, , , , , , ) = core.courts(currenCourtID); - } + function unlockStake(address _account, uint256 _relativeAmount) external override onlyByCore { + jurors[_account].lockedPnk -= _relativeAmount; + emit StakeLocked(_account, _relativeAmount, true); + } + + function penalizeStake(address _account, uint256 _relativeAmount) external override onlyByCore { + Juror storage juror = jurors[_account]; + if (juror.stakedPnk >= _relativeAmount) { + juror.stakedPnk -= _relativeAmount; + } else { + juror.stakedPnk = 0; // stakedPnk might become lower after manual unstaking, but lockedPnk will always cover the difference. } } @@ -312,7 +443,7 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously. /// @param _account The juror to unstake. function setJurorInactive(address _account) external override onlyByCore { - uint96[] memory courtIDs = core.getJurorCourtIDs(_account); + uint96[] memory courtIDs = getJurorCourtIDs(_account); for (uint256 j = courtIDs.length; j > 0; j--) { core.setStakeBySortitionModule(_account, courtIDs[j - 1], 0, false); } @@ -379,6 +510,32 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { else value = tree.nodes[treeIndex]; } + function getJurorBalance( + address _juror, + uint96 _courtID + ) + external + view + override + returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts) + { + Juror storage juror = jurors[_juror]; + totalStaked = juror.stakedPnk; + totalLocked = juror.lockedPnk; + stakedInCourt = juror.stakedPnkByCourt[_courtID]; + nbCourts = juror.courtIDs.length; + } + + /// @dev Gets the court identifiers where a specific `_juror` has staked. + /// @param _juror The address of the juror. + function getJurorCourtIDs(address _juror) public view override returns (uint96[] memory) { + return jurors[_juror].courtIDs; + } + + function isJurorStaked(address _juror) external view override returns (bool) { + return jurors[_juror].stakedPnk > 0; + } + // ************************************* // // * Internal * // // ************************************* // diff --git a/contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol b/contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol index 1912633c3..968c46ae9 100644 --- a/contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol +++ b/contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol @@ -606,7 +606,7 @@ contract DisputeKitClassic is IDisputeKit, Initializable, UUPSProxiable { uint256 lockedAmountPerJuror = core .getRoundInfo(_coreDisputeID, core.getNumberOfRounds(_coreDisputeID) - 1) .pnkAtStakePerJuror; - (uint256 totalStaked, uint256 totalLocked, , ) = core.getJurorBalance(_juror, courtID); + (uint256 totalStaked, uint256 totalLocked, , ) = core.sortitionModule().getJurorBalance(_juror, courtID); return totalStaked >= totalLocked + lockedAmountPerJuror; } } diff --git a/contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol b/contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol index 54bafb40c..ec3835ce4 100644 --- a/contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol +++ b/contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol @@ -624,7 +624,7 @@ contract DisputeKitSybilResistant is IDisputeKit, Initializable, UUPSProxiable { uint256 lockedAmountPerJuror = core .getRoundInfo(_coreDisputeID, core.getNumberOfRounds(_coreDisputeID) - 1) .pnkAtStakePerJuror; - (uint256 totalStaked, uint256 totalLocked, , ) = core.getJurorBalance(_juror, courtID); + (uint256 totalStaked, uint256 totalLocked, , ) = core.sortitionModule().getJurorBalance(_juror, courtID); if (totalStaked < totalLocked + lockedAmountPerJuror) { return false; } else { diff --git a/contracts/src/arbitration/interfaces/ISortitionModule.sol b/contracts/src/arbitration/interfaces/ISortitionModule.sol index 611118be3..4474f646e 100644 --- a/contracts/src/arbitration/interfaces/ISortitionModule.sol +++ b/contracts/src/arbitration/interfaces/ISortitionModule.sol @@ -8,26 +8,37 @@ interface ISortitionModule { drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes. } - enum PreStakeHookResult { - ok, // Correct phase. All checks are passed. - stakeDelayedAlreadyTransferred, // Wrong phase but stake is increased, so transfer the tokens without updating the drawing chance. - stakeDelayedNotTransferred, // Wrong phase and stake is decreased. Delay the token transfer and drawing chance update. - failed // Checks didn't pass. Do no changes. - } - event NewPhase(Phase _phase); function createTree(bytes32 _key, bytes memory _extraData) external; - function setStake(address _account, uint96 _courtID, uint256 _value) external; + function setStake( + address _account, + uint96 _courtID, + uint256 _newStake, + bool _alreadyTransferred + ) external returns (uint256 pnkDeposit, uint256 pnkWithdrawal, bool succeeded); function setJurorInactive(address _account) external; + function lockStake(address _account, uint256 _relativeAmount) external; + + function unlockStake(address _account, uint256 _relativeAmount) external; + + function penalizeStake(address _account, uint256 _relativeAmount) external; + function notifyRandomNumber(uint256 _drawnNumber) external; function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _nonce) external view returns (address); - function preStakeHook(address _account, uint96 _courtID, uint256 _stake) external returns (PreStakeHookResult); + function getJurorBalance( + address _juror, + uint96 _courtID + ) external view returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts); + + function getJurorCourtIDs(address _juror) external view returns (uint96[] memory); + + function isJurorStaked(address _juror) external view returns (bool); function createDisputeHook(uint256 _disputeID, uint256 _roundID) external; diff --git a/contracts/test/arbitration/draw.ts b/contracts/test/arbitration/draw.ts index 47be1689f..d5fd3b965 100644 --- a/contracts/test/arbitration/draw.ts +++ b/contracts/test/arbitration/draw.ts @@ -192,7 +192,7 @@ describe("Draw Benchmark", async () => { const stake = async (wallet: Wallet) => { await core.connect(wallet).setStake(PARENT_COURT, ONE_THOUSAND_PNK.mul(5), { gasLimit: 5000000 }); - expect(await core.getJurorBalance(wallet.address, 1)).to.deep.equal([ + expect(await sortitionModule.getJurorBalance(wallet.address, 1)).to.deep.equal([ ONE_THOUSAND_PNK.mul(5), // totalStaked 0, // totalLocked ONE_THOUSAND_PNK.mul(5), // stakedInCourt @@ -214,13 +214,13 @@ describe("Draw Benchmark", async () => { countedDraws = await countDraws(tx.blockNumber); for (const [address, draws] of Object.entries(countedDraws)) { - expect(await core.getJurorBalance(address, PARENT_COURT)).to.deep.equal([ + expect(await sortitionModule.getJurorBalance(address, PARENT_COURT)).to.deep.equal([ ONE_THOUSAND_PNK.mul(5), // totalStaked parentCourtMinStake.mul(draws), // totalLocked ONE_THOUSAND_PNK.mul(5), // stakedInCourt 1, // nbOfCourts ]); - expect(await core.getJurorBalance(address, CHILD_COURT)).to.deep.equal([ + expect(await sortitionModule.getJurorBalance(address, CHILD_COURT)).to.deep.equal([ ONE_THOUSAND_PNK.mul(5), // totalStaked parentCourtMinStake.mul(draws), // totalLocked 0, // stakedInCourt @@ -233,7 +233,7 @@ describe("Draw Benchmark", async () => { await core.connect(wallet).setStake(PARENT_COURT, 0, { gasLimit: 5000000 }); const locked = parentCourtMinStake.mul(countedDraws[wallet.address] ?? 0); expect( - await core.getJurorBalance(wallet.address, PARENT_COURT), + await sortitionModule.getJurorBalance(wallet.address, PARENT_COURT), "Drawn jurors have a locked stake in the parent court" ).to.deep.equal([ 0, // totalStaked @@ -242,7 +242,7 @@ describe("Draw Benchmark", async () => { 0, // nbOfCourts ]); expect( - await core.getJurorBalance(wallet.address, CHILD_COURT), + await sortitionModule.getJurorBalance(wallet.address, CHILD_COURT), "No locked stake in the child court" ).to.deep.equal([ 0, // totalStaked @@ -268,7 +268,7 @@ describe("Draw Benchmark", async () => { const unstake = async (wallet: Wallet) => { await core.connect(wallet).setStake(PARENT_COURT, 0, { gasLimit: 5000000 }); expect( - await core.getJurorBalance(wallet.address, PARENT_COURT), + await sortitionModule.getJurorBalance(wallet.address, PARENT_COURT), "No locked stake in the parent court" ).to.deep.equal([ 0, // totalStaked @@ -277,7 +277,7 @@ describe("Draw Benchmark", async () => { 0, // nbOfCourts ]); expect( - await core.getJurorBalance(wallet.address, CHILD_COURT), + await sortitionModule.getJurorBalance(wallet.address, CHILD_COURT), "No locked stake in the child court" ).to.deep.equal([ 0, // totalStaked @@ -309,13 +309,13 @@ describe("Draw Benchmark", async () => { countedDraws = await countDraws(tx.blockNumber); for (const [address, draws] of Object.entries(countedDraws)) { - expect(await core.getJurorBalance(address, PARENT_COURT)).to.deep.equal([ + expect(await sortitionModule.getJurorBalance(address, PARENT_COURT)).to.deep.equal([ ONE_THOUSAND_PNK.mul(5), // totalStaked parentCourtMinStake.mul(draws), // totalLocked 0, // stakedInCourt 1, // nbOfCourts ]); - expect(await core.getJurorBalance(address, CHILD_COURT)).to.deep.equal([ + expect(await sortitionModule.getJurorBalance(address, CHILD_COURT)).to.deep.equal([ ONE_THOUSAND_PNK.mul(5), // totalStaked parentCourtMinStake.mul(draws), // totalLocked ONE_THOUSAND_PNK.mul(5), // stakedInCourt @@ -328,7 +328,7 @@ describe("Draw Benchmark", async () => { await core.connect(wallet).setStake(CHILD_COURT, 0, { gasLimit: 5000000 }); const locked = parentCourtMinStake.mul(countedDraws[wallet.address] ?? 0); expect( - await core.getJurorBalance(wallet.address, PARENT_COURT), + await sortitionModule.getJurorBalance(wallet.address, PARENT_COURT), "No locked stake in the parent court" ).to.deep.equal([ 0, // totalStaked @@ -337,7 +337,7 @@ describe("Draw Benchmark", async () => { 0, // nbOfCourts ]); expect( - await core.getJurorBalance(wallet.address, CHILD_COURT), + await sortitionModule.getJurorBalance(wallet.address, CHILD_COURT), "Drawn jurors have a locked stake in the child court" ).to.deep.equal([ 0, // totalStaked @@ -369,13 +369,13 @@ describe("Draw Benchmark", async () => { countedDraws = await countDraws(tx.blockNumber); for (const [address, draws] of Object.entries(countedDraws)) { - expect(await core.getJurorBalance(address, PARENT_COURT)).to.deep.equal([ + expect(await sortitionModule.getJurorBalance(address, PARENT_COURT)).to.deep.equal([ ONE_THOUSAND_PNK.mul(5), // totalStaked childCourtMinStake.mul(draws), // totalLocked 0, // stakedInCourt 1, // nbOfCourts ]); - expect(await core.getJurorBalance(address, CHILD_COURT)).to.deep.equal([ + expect(await sortitionModule.getJurorBalance(address, CHILD_COURT)).to.deep.equal([ ONE_THOUSAND_PNK.mul(5), // totalStaked childCourtMinStake.mul(draws), // totalLocked ONE_THOUSAND_PNK.mul(5), // stakedInCourt @@ -388,7 +388,7 @@ describe("Draw Benchmark", async () => { await core.connect(wallet).setStake(CHILD_COURT, 0, { gasLimit: 5000000 }); const locked = childCourtMinStake.mul(countedDraws[wallet.address] ?? 0); expect( - await core.getJurorBalance(wallet.address, PARENT_COURT), + await sortitionModule.getJurorBalance(wallet.address, PARENT_COURT), "No locked stake in the parent court" ).to.deep.equal([ 0, // totalStaked @@ -397,7 +397,7 @@ describe("Draw Benchmark", async () => { 0, // nbOfCourts ]); expect( - await core.getJurorBalance(wallet.address, CHILD_COURT), + await sortitionModule.getJurorBalance(wallet.address, CHILD_COURT), "Drawn jurors have a locked stake in the child court" ).to.deep.equal([ 0, // totalStaked diff --git a/contracts/test/arbitration/staking.ts b/contracts/test/arbitration/staking.ts index 171b7e67c..1e0c9580f 100644 --- a/contracts/test/arbitration/staking.ts +++ b/contracts/test/arbitration/staking.ts @@ -59,7 +59,7 @@ describe("Staking", async () => { await core.setStake(1, PNK(2000)); await core.setStake(2, PNK(2000)); - expect(await core.getJurorCourtIDs(deployer)).to.be.deep.equal([BigNumber.from("1"), BigNumber.from("2")]); + expect(await sortition.getJurorCourtIDs(deployer)).to.be.deep.equal([BigNumber.from("1"), BigNumber.from("2")]); await core.functions["createDispute(uint256,bytes)"](2, extraData, { value: arbitrationCost }); @@ -90,7 +90,7 @@ describe("Staking", async () => { it("Should be outside the Staking phase", async () => { expect(await sortition.phase()).to.be.equal(1); // Drawing - expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); }); describe("When stake is decreased", async () => { @@ -99,9 +99,9 @@ describe("Staking", async () => { expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); await expect(core.setStake(2, PNK(1000))) - .to.emit(core, "StakeDelayedNotTransferred") + .to.emit(sortition, "StakeDelayedNotTransferred") .withArgs(deployer, 2, PNK(1000)); - expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); // stake unchanged, delayed + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); // stake unchanged, delayed }); it("Should not transfer any PNK", async () => { @@ -121,9 +121,10 @@ describe("Staking", async () => { balanceBefore = await pnk.balanceOf(deployer); expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); await expect(core.setStake(2, PNK(2000))) - .to.emit(core, "StakeDelayedNotTransferred") - .withArgs(deployer, 2, PNK(2000)); - expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); // stake unchanged, delayed + .to.emit(sortition, "StakeDelayedNotTransferred") + .withArgs(deployer, 2, PNK(2000)) + .to.not.emit(sortition, "StakeDelayedAlreadyTransferredWithdrawn"); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); // stake unchanged, delayed }); it("Should not transfer any PNK", async () => { @@ -143,8 +144,10 @@ describe("Staking", async () => { it("Should execute the delayed stakes but the stakes should remain the same", async () => { await reachStakingPhaseAfterDrawing(); balanceBefore = await pnk.balanceOf(deployer); - await expect(sortition.executeDelayedStakes(10)).to.emit(core, "StakeSet").withArgs(deployer, 2, PNK(2000)); - expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ + await expect(sortition.executeDelayedStakes(10)) + .to.emit(sortition, "StakeSet") + .withArgs(deployer, 2, PNK(2000)); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([ PNK(4000), PNK(300), // we're the only juror so we are drawn 3 times PNK(2000), @@ -171,7 +174,7 @@ describe("Staking", async () => { it("Should be outside the Staking phase", async () => { expect(await sortition.phase()).to.be.equal(1); // Drawing - expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); }); describe("When stake is increased", () => { @@ -181,9 +184,9 @@ describe("Staking", async () => { await pnk.approve(core.address, PNK(1000)); expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); await expect(core.setStake(2, PNK(3000))) - .to.emit(core, "StakeDelayedAlreadyTransferred") + .to.emit(sortition, "StakeDelayedAlreadyTransferred") .withArgs(deployer, 2, PNK(3000)); - expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(5000), 0, PNK(3000), 2]); // stake has changed immediately, WARNING: this is misleading because it's not actually added to the SortitionSumTree + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(5000), 0, PNK(3000), 2]); // stake has changed immediately, WARNING: this is misleading because it's not actually added to the SortitionSumTree }); it("Should transfer some PNK out of the juror's account", async () => { @@ -203,9 +206,11 @@ describe("Staking", async () => { balanceBefore = await pnk.balanceOf(deployer); expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); await expect(core.setStake(2, PNK(2000))) - .to.emit(core, "StakeDelayedNotTransferred") + .to.emit(sortition, "StakeDelayedAlreadyTransferredWithdrawn") + .withArgs(deployer, 2, PNK(1000)) + .to.emit(sortition, "StakeDelayedNotTransferred") .withArgs(deployer, 2, PNK(2000)); - expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); // stake has changed immediately + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); // stake has changed immediately }); it("Should transfer back some PNK to the juror", async () => { @@ -226,8 +231,10 @@ describe("Staking", async () => { it("Should execute the delayed stakes but the stakes should remain the same", async () => { await reachStakingPhaseAfterDrawing(); balanceBefore = await pnk.balanceOf(deployer); - await expect(sortition.executeDelayedStakes(10)).to.emit(core, "StakeSet").withArgs(deployer, 2, PNK(2000)); - expect(await core.getJurorBalance(deployer, 2)).to.be.deep.equal([ + await expect(sortition.executeDelayedStakes(10)) + .to.emit(sortition, "StakeSet") + .withArgs(deployer, 2, PNK(2000)); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([ PNK(4000), PNK(300), // we're the only juror so we are drawn 3 times PNK(2000), @@ -260,7 +267,7 @@ describe("Staking", async () => { await core.setStake(1, PNK(2000)); await core.setStake(2, PNK(2000)); - expect(await core.getJurorCourtIDs(deployer)).to.be.deep.equal([1, 2]); + expect(await sortition.getJurorCourtIDs(deployer)).to.be.deep.equal([1, 2]); await core.functions["createDispute(uint256,bytes)"](2, extraData, { value: arbitrationCost }); @@ -283,11 +290,11 @@ describe("Staking", async () => { await sortition.passPhase(); // Drawing -> Staking. Change so we don't deal with delayed stakes - expect(await core.getJurorCourtIDs(deployer)).to.be.deep.equal([1, 2]); + expect(await sortition.getJurorCourtIDs(deployer)).to.be.deep.equal([1, 2]); await core.execute(0, 0, 1); // 1 iteration should unstake from both courts - expect(await core.getJurorCourtIDs(deployer)).to.be.deep.equal([]); + expect(await sortition.getJurorCourtIDs(deployer)).to.be.deep.equal([]); }); }); }); diff --git a/contracts/test/integration/index.ts b/contracts/test/integration/index.ts index fecfe54f2..d226e279d 100644 --- a/contracts/test/integration/index.ts +++ b/contracts/test/integration/index.ts @@ -66,28 +66,28 @@ describe("Integration tests", async () => { await pnk.approve(core.address, ONE_THOUSAND_PNK.mul(100)); await core.setStake(1, ONE_THOUSAND_PNK); - await core.getJurorBalance(deployer, 1).then((result) => { + await sortitionModule.getJurorBalance(deployer, 1).then((result) => { expect(result.totalStaked).to.equal(ONE_THOUSAND_PNK); expect(result.totalLocked).to.equal(0); logJurorBalance(result); }); await core.setStake(1, ONE_HUNDRED_PNK.mul(5)); - await core.getJurorBalance(deployer, 1).then((result) => { + await sortitionModule.getJurorBalance(deployer, 1).then((result) => { expect(result.totalStaked).to.equal(ONE_HUNDRED_PNK.mul(5)); expect(result.totalLocked).to.equal(0); logJurorBalance(result); }); await core.setStake(1, 0); - await core.getJurorBalance(deployer, 1).then((result) => { + await sortitionModule.getJurorBalance(deployer, 1).then((result) => { expect(result.totalStaked).to.equal(0); expect(result.totalLocked).to.equal(0); logJurorBalance(result); }); await core.setStake(1, ONE_THOUSAND_PNK.mul(4)); - await core.getJurorBalance(deployer, 1).then((result) => { + await sortitionModule.getJurorBalance(deployer, 1).then((result) => { expect(result.totalStaked).to.equal(ONE_THOUSAND_PNK.mul(4)); expect(result.totalLocked).to.equal(0); logJurorBalance(result); From 6cbe8c43d720c83220ab6e5b2d1069bfdb0124e6 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Wed, 13 Dec 2023 12:25:43 +0000 Subject: [PATCH 33/77] test(staking): added expects() --- contracts/test/arbitration/staking.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contracts/test/arbitration/staking.ts b/contracts/test/arbitration/staking.ts index 1e0c9580f..e55d7775d 100644 --- a/contracts/test/arbitration/staking.ts +++ b/contracts/test/arbitration/staking.ts @@ -233,7 +233,10 @@ describe("Staking", async () => { balanceBefore = await pnk.balanceOf(deployer); await expect(sortition.executeDelayedStakes(10)) .to.emit(sortition, "StakeSet") - .withArgs(deployer, 2, PNK(2000)); + .withArgs(deployer, 2, PNK(2000)) + .to.not.emit(sortition, "StakeDelayedNotTransferred") + .to.not.emit(sortition, "StakeDelayedAlreadyTransferred") + .to.not.emit(sortition, "StakeDelayedAlreadyTransferredWithdrawn"); expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([ PNK(4000), PNK(300), // we're the only juror so we are drawn 3 times From 03312a0a1fce18d1fe4304cc08db0bd9874b352e Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Tue, 19 Dec 2023 17:30:11 +0000 Subject: [PATCH 34/77] fix: improvements on the instant staking implementation (#1228) with feedback from @unknownunknown1 --- contracts/src/arbitration/KlerosCore.sol | 63 ++++++++++++++----- contracts/src/arbitration/SortitionModule.sol | 40 +++++++----- contracts/src/libraries/Types.sol | 8 +++ contracts/test/arbitration/staking.ts | 2 +- 4 files changed, 79 insertions(+), 34 deletions(-) create mode 100644 contracts/src/libraries/Types.sol diff --git a/contracts/src/arbitration/KlerosCore.sol b/contracts/src/arbitration/KlerosCore.sol index 941990e6a..c5e5bc914 100644 --- a/contracts/src/arbitration/KlerosCore.sol +++ b/contracts/src/arbitration/KlerosCore.sol @@ -9,12 +9,13 @@ pragma solidity 0.8.18; import {IArbitrableV2, IArbitratorV2} from "./interfaces/IArbitratorV2.sol"; -import "./interfaces/IDisputeKit.sol"; -import "./interfaces/ISortitionModule.sol"; -import "../libraries/SafeERC20.sol"; -import "../libraries/Constants.sol"; -import "../proxy/UUPSProxiable.sol"; -import "../proxy/Initializable.sol"; +import {IDisputeKit} from "./interfaces/IDisputeKit.sol"; +import {ISortitionModule} from "./interfaces/ISortitionModule.sol"; +import {SafeERC20, IERC20} from "../libraries/SafeERC20.sol"; +import {Constants} from "../libraries/Constants.sol"; +import {OnError} from "../libraries/Types.sol"; +import {UUPSProxiable} from "../proxy/UUPSProxiable.sol"; +import {Initializable} from "../proxy/Initializable.sol"; /// @title KlerosCore /// Core arbitrator contract for Kleros v2. @@ -448,9 +449,14 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { /// @param _newStake The new stake. /// Note that the existing delayed stake will be nullified as non-relevant. function setStake(uint96 _courtID, uint256 _newStake) external { - _setStake(msg.sender, _courtID, _newStake, false); + _setStake(msg.sender, _courtID, _newStake, false, OnError.Revert); } + /// @dev Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors. + /// @param _account The account whose stake is being set. + /// @param _courtID The ID of the court. + /// @param _newStake The new stake. + /// @param _alreadyTransferred Whether the PNKs have already been transferred to the contract. function setStakeBySortitionModule( address _account, uint96 _courtID, @@ -458,7 +464,7 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { bool _alreadyTransferred ) external { if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly(); - _setStake(_account, _courtID, _newStake, _alreadyTransferred); + _setStake(_account, _courtID, _newStake, _alreadyTransferred, OnError.Return); } /// @inheritdoc IArbitratorV2 @@ -994,17 +1000,27 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { emit DisputeKitEnabled(_courtID, _disputeKitID, _enable); } + /// @dev If called only once then set _onError to Revert, otherwise set it to Return + /// @param _account The account to set the stake for. + /// @param _courtID The ID of the court to set the stake for. + /// @param _newStake The new stake. + /// @param _alreadyTransferred Whether the PNKs were already transferred to/from the staking contract. + /// @param _onError Whether to revert or return false on error. + /// @return Whether the stake was successfully set or not. function _setStake( address _account, uint96 _courtID, uint256 _newStake, - bool _alreadyTransferred - ) internal returns (bool success) { + bool _alreadyTransferred, + OnError _onError + ) internal returns (bool) { if (_courtID == Constants.FORKING_COURT || _courtID > courts.length) { - return false; // Staking directly into the forking court is not allowed. + _stakingFailed(_onError); // Staking directly into the forking court is not allowed. + return false; } if (_newStake != 0 && _newStake < courts[_courtID].minStake) { - return false; // Staking less than the minimum stake is not allowed. + _stakingFailed(_onError); // Staking less than the minimum stake is not allowed. + return false; } (uint256 pnkDeposit, uint256 pnkWithdrawal, bool sortitionSuccess) = sortitionModule.setStake( _account, @@ -1012,16 +1028,29 @@ contract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable { _newStake, _alreadyTransferred ); - if (pnkDeposit > 0 && pnkWithdrawal > 0) revert StakingFailed(); + if (!sortitionSuccess) { + _stakingFailed(_onError); + return false; + } if (pnkDeposit > 0) { - // Note we don't return false after incorrect transfer because when stake is increased the transfer is done immediately, thus it can't disrupt delayed stakes' queue. - pinakion.safeTransferFrom(_account, address(this), pnkDeposit); - } else if (pnkWithdrawal > 0) { + if (!pinakion.safeTransferFrom(_account, address(this), pnkDeposit)) { + _stakingFailed(_onError); + return false; + } + } + if (pnkWithdrawal > 0) { if (!pinakion.safeTransfer(_account, pnkWithdrawal)) { + _stakingFailed(_onError); return false; } } - return sortitionSuccess; + return true; + } + + /// @dev It may revert depending on the _onError parameter. + function _stakingFailed(OnError _onError) internal pure { + if (_onError == OnError.Return) return; + revert StakingFailed(); } /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array. diff --git a/contracts/src/arbitration/SortitionModule.sol b/contracts/src/arbitration/SortitionModule.sol index 1ef0f4306..72b5b8e4f 100644 --- a/contracts/src/arbitration/SortitionModule.sol +++ b/contracts/src/arbitration/SortitionModule.sol @@ -53,7 +53,6 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { uint96[] courtIDs; // The IDs of courts where the juror's stake path ends. A stake path is a path from the general court to a court the juror directly staked in using `_setStake`. uint256 stakedPnk; // The juror's total amount of tokens staked in subcourts. Reflects actual pnk balance. uint256 lockedPnk; // The juror's total amount of tokens locked in disputes. Can reflect actual pnk balance when stakedPnk are fully withdrawn. - mapping(uint96 => uint256) stakedPnkByCourt; // The amount of PNKs the juror has staked in the court in the form `stakedPnkByCourt[courtID]`. } // ************************************* // @@ -275,7 +274,7 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { bool _alreadyTransferred ) external override onlyByCore returns (uint256 pnkDeposit, uint256 pnkWithdrawal, bool succeeded) { Juror storage juror = jurors[_account]; - uint256 currentStake = juror.stakedPnkByCourt[_courtID]; + uint256 currentStake = stakeOf(_account, _courtID); uint256 nbCourts = juror.courtIDs.length; if (_newStake == 0 && (nbCourts >= MAX_STAKE_PATHS || currentStake == 0)) { @@ -336,9 +335,9 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { if (latestIndex != 0) { DelayedStake storage delayedStake = delayedStakes[latestIndex]; if (delayedStake.alreadyTransferred) { - bytes32 stakePathID = _accountAndCourtIDToStakePathID(_juror, _courtID); // Sortition stake represents the stake value that was last updated during Staking phase. - uint256 sortitionStake = stakeOf(bytes32(uint256(_courtID)), stakePathID); + uint256 sortitionStake = stakeOf(_juror, _courtID); + // Withdraw the tokens that were added with the latest delayed stake. uint256 amountToWithdraw = delayedStake.stake - sortitionStake; actualAmountToWithdraw = amountToWithdraw; @@ -346,12 +345,13 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { if (juror.stakedPnk <= actualAmountToWithdraw) { actualAmountToWithdraw = juror.stakedPnk; } - // StakePnk can become lower because of penalty, thus we adjust the amount for it. stakedPnkByCourt can't be penalized so subtract the default amount. + + // StakePnk can become lower because of penalty. juror.stakedPnk -= actualAmountToWithdraw; - juror.stakedPnkByCourt[_courtID] -= amountToWithdraw; emit StakeDelayedAlreadyTransferredWithdrawn(_juror, _courtID, amountToWithdraw); - // Note that if we don't delete court here it'll be duplicated after staking. - if (juror.stakedPnkByCourt[_courtID] == 0) { + + if (sortitionStake == 0) { + // Delete the court otherwise it will be duplicated after staking. for (uint256 i = juror.courtIDs.length; i > 0; i--) { if (juror.courtIDs[i - 1] == _courtID) { juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1]; @@ -384,7 +384,6 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { } // stakedPnk can become async with _currentStake (e.g. after penalty). juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake; - juror.stakedPnkByCourt[_courtID] = _newStake; } function _decreaseStake( @@ -413,7 +412,6 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { } // stakedPnk can become async with _currentStake (e.g. after penalty). juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake; - juror.stakedPnkByCourt[_courtID] = _newStake; } function lockStake(address _account, uint256 _relativeAmount) external override onlyByCore { @@ -498,16 +496,26 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { drawnAddress = _stakePathIDToAccount(tree.nodeIndexesToIDs[treeIndex]); } + /// @dev Get the stake of a juror in a court. + /// @param _juror The address of the juror. + /// @param _courtID The ID of the court. + /// @return value The stake of the juror in the court. + function stakeOf(address _juror, uint96 _courtID) public view returns (uint256) { + bytes32 stakePathID = _accountAndCourtIDToStakePathID(_juror, _courtID); + return stakeOf(bytes32(uint256(_courtID)), stakePathID); + } + /// @dev Get the stake of a juror in a court. /// @param _key The key of the tree, corresponding to a court. /// @param _ID The stake path ID, corresponding to a juror. - /// @return value The stake of the juror in the court. - function stakeOf(bytes32 _key, bytes32 _ID) public view returns (uint256 value) { + /// @return The stake of the juror in the court. + function stakeOf(bytes32 _key, bytes32 _ID) public view returns (uint256) { SortitionSumTree storage tree = sortitionSumTrees[_key]; uint treeIndex = tree.IDsToNodeIndexes[_ID]; - - if (treeIndex == 0) value = 0; - else value = tree.nodes[treeIndex]; + if (treeIndex == 0) { + return 0; + } + return tree.nodes[treeIndex]; } function getJurorBalance( @@ -522,7 +530,7 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { Juror storage juror = jurors[_juror]; totalStaked = juror.stakedPnk; totalLocked = juror.lockedPnk; - stakedInCourt = juror.stakedPnkByCourt[_courtID]; + stakedInCourt = stakeOf(_juror, _courtID); nbCourts = juror.courtIDs.length; } diff --git a/contracts/src/libraries/Types.sol b/contracts/src/libraries/Types.sol new file mode 100644 index 000000000..f575ca129 --- /dev/null +++ b/contracts/src/libraries/Types.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: MIT + +pragma solidity 0.8.18; + +enum OnError { + Revert, + Return +} diff --git a/contracts/test/arbitration/staking.ts b/contracts/test/arbitration/staking.ts index e55d7775d..b4c5eb756 100644 --- a/contracts/test/arbitration/staking.ts +++ b/contracts/test/arbitration/staking.ts @@ -186,7 +186,7 @@ describe("Staking", async () => { await expect(core.setStake(2, PNK(3000))) .to.emit(sortition, "StakeDelayedAlreadyTransferred") .withArgs(deployer, 2, PNK(3000)); - expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(5000), 0, PNK(3000), 2]); // stake has changed immediately, WARNING: this is misleading because it's not actually added to the SortitionSumTree + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(5000), 0, PNK(2000), 2]); // stake has changed immediately, WARNING: this is misleading because it's not actually added to the SortitionSumTree }); it("Should transfer some PNK out of the juror's account", async () => { From 40b7874a5d3695c56f89d4a054501a23fc178707 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Tue, 19 Dec 2023 17:45:12 +0000 Subject: [PATCH 35/77] chore: sonarcloud ci for multiple long-lived branches --- .github/workflows/sonarcloud.yml | 23 +++++++++++++++++++++++ sonar-project.properties | 3 +++ 2 files changed, 26 insertions(+) create mode 100644 .github/workflows/sonarcloud.yml create mode 100644 sonar-project.properties diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml new file mode 100644 index 000000000..e5464f7b1 --- /dev/null +++ b/.github/workflows/sonarcloud.yml @@ -0,0 +1,23 @@ +name: Build +on: + push: + branches: + - master + - dev + pull_request: + types: [opened, synchronize, reopened] + +jobs: + sonarcloud: + name: SonarCloud + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 000000000..5ae6e9cbc --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,3 @@ +sonar.organization=kleros +sonar.projectKey=kleros_kleros-v2 +sonar.projectName=kleros-v2 From cbe85e18b74dbf9e7192995dddf2896b9e8d25ae Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Tue, 19 Dec 2023 18:48:57 +0000 Subject: [PATCH 36/77] chore: worked around a failing test with hardhat coverage which passes with hardhat test --- contracts/.solcover.js | 6 +++++- contracts/test/arbitration/draw.ts | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/contracts/.solcover.js b/contracts/.solcover.js index 43bd929a3..460f8400c 100644 --- a/contracts/.solcover.js +++ b/contracts/.solcover.js @@ -14,6 +14,10 @@ module.exports = { shell.rm("-rf", "./artifacts"); shell.rm("-rf", "./typechain"); }, - providerOptions: {}, skipFiles: ["mocks", "test"], + mocha: { + timeout: 20000, + grep: "@skip-on-coverage", // Find everything with this tag + invert: true, // Run the grep's inverse set. + }, }; diff --git a/contracts/test/arbitration/draw.ts b/contracts/test/arbitration/draw.ts index d5fd3b965..d8de54169 100644 --- a/contracts/test/arbitration/draw.ts +++ b/contracts/test/arbitration/draw.ts @@ -255,7 +255,8 @@ describe("Draw Benchmark", async () => { await draw(stake, PARENT_COURT, expectFromDraw, unstake); }); - it("Stakes in parent court and should draw nobody in subcourt", async () => { + // Warning: we are skipping this during `hardhat coverage` because it fails, although it passes with `hardhat test` + it("Stakes in parent court and should draw nobody in subcourt [ @skip-on-coverage ]", async () => { const stake = async (wallet: Wallet) => { await core.connect(wallet).setStake(PARENT_COURT, ONE_THOUSAND_PNK.mul(5), { gasLimit: 5000000 }); }; From d26ef8bd7a88f56eedde244b0e88fed11e769074 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Tue, 19 Dec 2023 19:23:18 +0000 Subject: [PATCH 37/77] chore(web): small tweak on the testnet banner --- web/src/consts/index.ts | 2 ++ web/src/layout/Header/index.tsx | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/web/src/consts/index.ts b/web/src/consts/index.ts index 2f4f110fb..305fca577 100644 --- a/web/src/consts/index.ts +++ b/web/src/consts/index.ts @@ -17,3 +17,5 @@ export const EMAIL_REGEX = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\. export const TELEGRAM_REGEX = /^@\w{5,32}$/; export const ETH_ADDRESS_REGEX = /^0x[a-fA-F0-9]{40}$/; export const ETH_SIGNATURE_REGEX = /^0x[a-fA-F0-9]{130}$/; + +export const isProductionDeployment = () => process.env.REACT_APP_DEPLOYMENT !== "mainnet"; diff --git a/web/src/layout/Header/index.tsx b/web/src/layout/Header/index.tsx index affc3815d..d0a681f85 100644 --- a/web/src/layout/Header/index.tsx +++ b/web/src/layout/Header/index.tsx @@ -3,6 +3,7 @@ import styled from "styled-components"; import MobileHeader from "./MobileHeader"; import DesktopHeader from "./DesktopHeader"; import { TestnetBanner } from "./TestnetBanner"; +import { isProductionDeployment } from "consts/index"; const Container = styled.div` position: sticky; @@ -32,7 +33,7 @@ export const PopupContainer = styled.div` const Header: React.FC = () => { return ( - {process.env.REACT_APP_DEPLOYMENT === "testnet" ? : null} + {isProductionDeployment() ? : null} From 7153a8402632d361ecfd971e532bba52864ab0e5 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Tue, 19 Dec 2023 19:23:39 +0000 Subject: [PATCH 38/77] chore: small imports fix --- .../Settings/Notifications/FormContactDetails/index.tsx | 6 +++--- web/src/utils/sentry.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/index.tsx b/web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/index.tsx index aa9c16750..795b78add 100644 --- a/web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/index.tsx +++ b/web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/index.tsx @@ -4,9 +4,9 @@ import { useWalletClient, useAccount } from "wagmi"; import { Button } from "@kleros/ui-components-library"; import { uploadSettingsToSupabase } from "utils/uploadSettingsToSupabase"; import FormContact from "./FormContact"; -import messages from "../../../../../../../consts/eip712-messages"; -import { EMAIL_REGEX, TELEGRAM_REGEX } from "../../../../../../../consts/index"; -import { ISettings } from "../../../index"; +import messages from "src/consts/eip712-messages"; +import { EMAIL_REGEX, TELEGRAM_REGEX } from "consts/index"; +import { ISettings } from "../../../../index"; import { responsiveSize } from "styles/responsiveSize"; const FormContainer = styled.form` diff --git a/web/src/utils/sentry.ts b/web/src/utils/sentry.ts index ef0472d54..bd384d67d 100644 --- a/web/src/utils/sentry.ts +++ b/web/src/utils/sentry.ts @@ -1,7 +1,7 @@ import React from "react"; import * as Sentry from "@sentry/react"; import { Routes, createRoutesFromChildren, matchRoutes, useLocation, useNavigationType } from "react-router-dom"; -import { GIT_DIRTY, GIT_HASH, RELEASE_VERSION } from "../consts"; +import { GIT_DIRTY, GIT_HASH, RELEASE_VERSION } from "consts/index"; Sentry.init({ dsn: process.env.REACT_APP_SENTRY_ENDPOINT, From f21f6894498d9e0c45c2256292f3f17b7141a2b4 Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Wed, 20 Dec 2023 17:40:02 +0530 Subject: [PATCH 39/77] refactor(web): add-no-juror-staked-notification-in-top-juror --- web/src/pages/Home/TopJurors/index.tsx | 28 ++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/web/src/pages/Home/TopJurors/index.tsx b/web/src/pages/Home/TopJurors/index.tsx index ea66d657e..e38ca2422 100644 --- a/web/src/pages/Home/TopJurors/index.tsx +++ b/web/src/pages/Home/TopJurors/index.tsx @@ -29,6 +29,10 @@ const ListContainer = styled.div` )} `; +const StyledLabel = styled.label` + font-size: 16px; +`; + const TopJurors: React.FC = () => { const { data: queryJurors } = useTopUsersByCoherenceScore(); @@ -40,12 +44,24 @@ const TopJurors: React.FC = () => { return ( Top Jurors - -
- {!isUndefined(topJurors) - ? topJurors.map((juror) => ) - : [...Array(5)].map((_, i) => )} - + + {!isUndefined(topJurors) && topJurors.length > 0 ? ( + +
+ {topJurors.map((juror) => ( + + ))} + + ) : !isUndefined(topJurors) && topJurors.length === 0 ? ( + There are no jurors staked yet. + ) : ( + +
+ {[...Array(5)].map((_, i) => ( + + ))} + + )} ); }; From a0e368ce954389b2b19e0184ad68a62957a355bc Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Wed, 20 Dec 2023 17:56:21 +0530 Subject: [PATCH 40/77] fix(web): tag-component-accessibility-issue-fix --- web/src/components/Tag.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/web/src/components/Tag.tsx b/web/src/components/Tag.tsx index c7c3942fb..47f71f79c 100644 --- a/web/src/components/Tag.tsx +++ b/web/src/components/Tag.tsx @@ -1,16 +1,24 @@ import React from "react"; import { Tag as BaseTag } from "@kleros/ui-components-library"; +import styled from "styled-components"; interface ITag { text: string; active: boolean; onClick: () => void; } + +const TagContainer = styled.button` + padding: 0; + border: none; + background-color: transparent; +`; + const Tag: React.FC = ({ text, active, onClick }) => { return ( -
+ -
+ ); }; From 8bd7d55746c401ae3572c0282262b78576f74c2f Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Wed, 20 Dec 2023 18:15:10 +0530 Subject: [PATCH 41/77] fix(web): fix-code-smell --- web/src/pages/Home/TopJurors/index.tsx | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/web/src/pages/Home/TopJurors/index.tsx b/web/src/pages/Home/TopJurors/index.tsx index e38ca2422..ef41231da 100644 --- a/web/src/pages/Home/TopJurors/index.tsx +++ b/web/src/pages/Home/TopJurors/index.tsx @@ -44,22 +44,14 @@ const TopJurors: React.FC = () => { return ( Top Jurors - - {!isUndefined(topJurors) && topJurors.length > 0 ? ( - -
- {topJurors.map((juror) => ( - - ))} - - ) : !isUndefined(topJurors) && topJurors.length === 0 ? ( + {!isUndefined(topJurors) && topJurors.length === 0 ? ( There are no jurors staked yet. ) : (
- {[...Array(5)].map((_, i) => ( - - ))} + {!isUndefined(topJurors) + ? topJurors.map((juror) => ) + : [...Array(5)].map((_, i) => )} )} From 3ccc3cd8ab1e02e1aae06293aabe492fdc15d400 Mon Sep 17 00:00:00 2001 From: marino <102478601+kemuru@users.noreply.github.com> Date: Fri, 17 Nov 2023 11:33:46 +0100 Subject: [PATCH 42/77] chore(web,subgraph): migration-to-arb-sepolia --- contracts/deploy/00-ethereum-pnk.ts | 2 +- contracts/deploy/00-home-chain-arbitration.ts | 4 +- contracts/deploy/00-home-chain-pnk-faucet.ts | 2 +- contracts/deploy/00-rng.ts | 4 +- .../deploy/02-home-gateway-to-ethereum.ts | 6 +-- contracts/deploy/04-foreign-arbitrable.ts | 2 +- .../deploy/05-arbitrable-dispute-template.ts | 2 +- contracts/deploy/fix1148.ts | 2 +- contracts/deploy/upgrade-kleros-core.ts | 2 +- contracts/deploy/upgrade-sortition-module.ts | 2 +- contracts/deploy/utils/index.ts | 4 +- .../deployments/chiado/ArbitrableExample.json | 2 +- .../chiadoDevnet/ArbitrableExample.json | 2 +- contracts/hardhat.config.ts | 52 +++++++++---------- contracts/package.json | 2 +- contracts/scripts/changeRng.ts | 2 +- .../scripts/console-init-chiado-resolver.ts | 4 +- contracts/scripts/disputeCreatorBot.ts | 8 +-- .../scripts/disputeRelayerBotFromGoerli.ts | 4 +- contracts/scripts/exportDeployments.sh | 8 +-- .../scripts/generateDeploymentArtifact.sh | 14 ++--- contracts/scripts/populateCourts.ts | 2 +- contracts/scripts/populatePolicyRegistry.ts | 2 +- contracts/scripts/simulations/README.md | 34 ++++++------ contracts/scripts/verifyProxies.sh | 4 +- .../fixtures/DisputeTemplate.resolver.jsonc | 2 +- .../test/fixtures/DisputeTemplate.schema.json | 2 +- .../test/fixtures/DisputeTemplate.simple.json | 2 +- .../DisputeDetails.default.jsonc | 2 +- .../NewDisputeTemplate.schema.json | 2 +- .../curate/NewDisputeTemplate.curate.jsonc | 2 +- .../example/DisputeDetails.curate.jsonc | 2 +- .../linguo/NewDisputeTemplate.linguo.jsonc | 2 +- .../example/DisputeDetails.linguo.jsonc | 2 +- .../poh/NewDisputeTemplate.poh1.jsonc | 2 +- .../poh/NewDisputeTemplate.poh2.jsonc | 2 +- .../DisputeDetails.poh1.jsonc | 2 +- .../DisputeDetails.poh2.jsonc | 2 +- .../reality/NewDisputeTemplate.reality.jsonc | 2 +- .../example1/DisputeDetails.reality1.jsonc | 2 +- .../example2/DisputeDetails.reality2.jsonc | 2 +- .../simple/NewDisputeTemplate.simple.json | 2 +- .../example/DisputeDetails.simple.jsonc | 2 +- scripts/act-subgraph.yml | 2 +- services/bots/devnet/compose.yml | 8 +-- .../devnet/pm2.config.keeper-bot.devnet.js | 2 +- ...2.config.relayer-bot-from-chiado.devnet.js | 2 +- ...2.config.relayer-bot-from-goerli.devnet.js | 4 +- services/bots/testnet/compose.yml | 8 +-- .../pm2.config.disputor-bot.testnet.js | 2 +- .../testnet/pm2.config.keeper-bot.testnet.js | 2 +- ....config.relayer-bot-from-chiado.testnet.js | 2 +- ....config.relayer-bot-from-goerli.testnet.js | 4 +- .../DisputeTemplateRegistry/subgraph.yaml | 4 +- subgraph/README.md | 10 ++-- subgraph/package.json | 8 +-- subgraph/scripts/update.sh | 4 +- subgraph/subgraph.yaml | 20 +++---- web/.env.devnet.public | 4 +- web/.env.local.public | 2 +- web/.env.testnet.public | 6 +-- web/src/consts/chains.ts | 6 +-- web/src/context/Web3Provider.tsx | 4 +- web/src/utils/graphqlQueryFnHelper.ts | 16 +++--- web/wagmi.config.ts | 8 +-- 65 files changed, 168 insertions(+), 168 deletions(-) diff --git a/contracts/deploy/00-ethereum-pnk.ts b/contracts/deploy/00-ethereum-pnk.ts index 002237ef8..c35a6be67 100644 --- a/contracts/deploy/00-ethereum-pnk.ts +++ b/contracts/deploy/00-ethereum-pnk.ts @@ -4,7 +4,7 @@ import disputeTemplate from "../test/fixtures/DisputeTemplate.simple.json"; import { isSkipped } from "./utils"; enum Chains { - GOERLI = 5, + SEPOLIA = 11155111, HARDHAT = 31337, } diff --git a/contracts/deploy/00-home-chain-arbitration.ts b/contracts/deploy/00-home-chain-arbitration.ts index bf5b961bb..1cef0c47e 100644 --- a/contracts/deploy/00-home-chain-arbitration.ts +++ b/contracts/deploy/00-home-chain-arbitration.ts @@ -7,13 +7,13 @@ import { HomeChains, isSkipped, isDevnet } from "./utils"; const pnkByChain = new Map([ [HomeChains.ARBITRUM_ONE, "0x330bD769382cFc6d50175903434CCC8D206DCAE5"], - [HomeChains.ARBITRUM_GOERLI, "0x3483FA1b87792cd5BE4100822C4eCEC8D3E531ee"], + [HomeChains.ARBITRUM_SEPOLIA, "INSERT ARBITRUM SEPOLIA PNK TOKEN ADDRESS HERE"], ]); // https://randomizer.ai/docs#addresses const randomizerByChain = new Map([ [HomeChains.ARBITRUM_ONE, "0x5b8bB80f2d72D0C85caB8fB169e8170A05C94bAF"], - [HomeChains.ARBITRUM_GOERLI, "0x923096Da90a3b60eb7E12723fA2E1547BA9236Bc"], + [HomeChains.ARBITRUM_SEPOLIA, "INSERT ARBITRUM SEPOLIA RANDOMIZER ADDRESS HERE"], ]); const daiByChain = new Map([[HomeChains.ARBITRUM_ONE, "??"]]); diff --git a/contracts/deploy/00-home-chain-pnk-faucet.ts b/contracts/deploy/00-home-chain-pnk-faucet.ts index 044e5f23e..224ddc612 100644 --- a/contracts/deploy/00-home-chain-pnk-faucet.ts +++ b/contracts/deploy/00-home-chain-pnk-faucet.ts @@ -4,7 +4,7 @@ import { HomeChains, isSkipped } from "./utils"; const pnkByChain = new Map([ [HomeChains.ARBITRUM_ONE, "0x330bD769382cFc6d50175903434CCC8D206DCAE5"], - [HomeChains.ARBITRUM_GOERLI, "0x3483FA1b87792cd5BE4100822C4eCEC8D3E531ee"], + [HomeChains.ARBITRUM_SEPOLIA, "INSERT ARBITRUM SEPOLIA PNK TOKEN ADDRESS HERE"], ]); const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { diff --git a/contracts/deploy/00-rng.ts b/contracts/deploy/00-rng.ts index 30289b50d..fe6472e5a 100644 --- a/contracts/deploy/00-rng.ts +++ b/contracts/deploy/00-rng.ts @@ -6,12 +6,12 @@ import { deployUpgradable } from "./utils/deployUpgradable"; const pnkByChain = new Map([ [HomeChains.ARBITRUM_ONE, "0x330bD769382cFc6d50175903434CCC8D206DCAE5"], - [HomeChains.ARBITRUM_GOERLI, "0x3483FA1b87792cd5BE4100822C4eCEC8D3E531ee"], + [HomeChains.ARBITRUM_SEPOLIA, "INSERT ARBITRUM SEPOLIA PNK TOKEN ADDRESS HERE"], ]); const randomizerByChain = new Map([ [HomeChains.ARBITRUM_ONE, "0x5b8bB80f2d72D0C85caB8fB169e8170A05C94bAF"], - [HomeChains.ARBITRUM_GOERLI, "0x923096Da90a3b60eb7E12723fA2E1547BA9236Bc"], + [HomeChains.ARBITRUM_SEPOLIA, "INSERT ARBITRUM SEPOLIA RANDOMIZER ADDRESS HERE"], ]); const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { diff --git a/contracts/deploy/02-home-gateway-to-ethereum.ts b/contracts/deploy/02-home-gateway-to-ethereum.ts index fd1b2cb33..459d18756 100644 --- a/contracts/deploy/02-home-gateway-to-ethereum.ts +++ b/contracts/deploy/02-home-gateway-to-ethereum.ts @@ -18,9 +18,9 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) const veaInbox = await deployments.get("VeaInboxArbToEthDevnet"); const klerosCore = await deployments.get("KlerosCore"); - const foreignGateway = await hre.companionNetworks.foreignGoerli.deployments.get("ForeignGatewayOnEthereum"); - const foreignChainId = Number(await hre.companionNetworks.foreignGoerli.getChainId()); - const foreignChainName = await hre.companionNetworks.foreignGoerli.deployments.getNetworkName(); + const foreignGateway = await hre.companionNetworks.foreignSepolia.deployments.get("ForeignGatewayOnEthereum"); + const foreignChainId = Number(await hre.companionNetworks.foreignSepolia.getChainId()); + const foreignChainName = await hre.companionNetworks.foreignSepolia.deployments.getNetworkName(); console.log("Using ForeignGateway %s on chainId %s (%s)", foreignGateway.address, foreignChainId, foreignChainName); await deployUpgradable(deployments, "HomeGatewayToEthereum", { diff --git a/contracts/deploy/04-foreign-arbitrable.ts b/contracts/deploy/04-foreign-arbitrable.ts index 801c507af..cdfeabff0 100644 --- a/contracts/deploy/04-foreign-arbitrable.ts +++ b/contracts/deploy/04-foreign-arbitrable.ts @@ -6,7 +6,7 @@ import { ForeignChains, isSkipped } from "./utils"; const foreignGatewayArtifactByChain = new Map([ [ForeignChains.ETHEREUM_MAINNET, "ForeignGatewayOnEthereum"], - [ForeignChains.ETHEREUM_GOERLI, "ForeignGatewayOnEthereum"], + [ForeignChains.ETHEREUM_SEPOLIA, "ForeignGatewayOnEthereum"], [ForeignChains.GNOSIS_MAINNET, "ForeignGatewayOnGnosis"], [ForeignChains.GNOSIS_CHIADO, "ForeignGatewayOnGnosis"], ]); diff --git a/contracts/deploy/05-arbitrable-dispute-template.ts b/contracts/deploy/05-arbitrable-dispute-template.ts index 83783ba48..032d57ea8 100644 --- a/contracts/deploy/05-arbitrable-dispute-template.ts +++ b/contracts/deploy/05-arbitrable-dispute-template.ts @@ -24,7 +24,7 @@ const deployResolver: DeployFunction = async (hre: HardhatRuntimeEnvironment) => "frontendUrl": "https://app.proofofhumanity.id/profile/%s", "arbitrableChainID": "1", "arbitrableAddress": "0xc5e9ddebb09cd64dfacab4011a0d5cedaf7c9bdb", - "arbitratorChainID": "421613", + "arbitratorChainID": "421614", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", "category": "Curated Lists", "specification": "KIP88" diff --git a/contracts/deploy/fix1148.ts b/contracts/deploy/fix1148.ts index 446464398..917c8edb0 100644 --- a/contracts/deploy/fix1148.ts +++ b/contracts/deploy/fix1148.ts @@ -6,7 +6,7 @@ import { isSkipped } from "./utils"; enum HomeChains { ARBITRUM_ONE = 42161, - ARBITRUM_GOERLI = 421613, + ARBITRUM_SEPOLIA = 421614, HARDHAT = 31337, } diff --git a/contracts/deploy/upgrade-kleros-core.ts b/contracts/deploy/upgrade-kleros-core.ts index 329514237..566898ba0 100644 --- a/contracts/deploy/upgrade-kleros-core.ts +++ b/contracts/deploy/upgrade-kleros-core.ts @@ -6,7 +6,7 @@ import { isSkipped } from "./utils"; enum HomeChains { ARBITRUM_ONE = 42161, - ARBITRUM_GOERLI = 421613, + ARBITRUM_SEPOLIA = 421614, HARDHAT = 31337, } diff --git a/contracts/deploy/upgrade-sortition-module.ts b/contracts/deploy/upgrade-sortition-module.ts index 64962a449..7ae999bd0 100644 --- a/contracts/deploy/upgrade-sortition-module.ts +++ b/contracts/deploy/upgrade-sortition-module.ts @@ -5,7 +5,7 @@ import { isSkipped } from "./utils"; enum HomeChains { ARBITRUM_ONE = 42161, - ARBITRUM_GOERLI = 421613, + ARBITRUM_SEPOLIA = 421614, HARDHAT = 31337, } diff --git a/contracts/deploy/utils/index.ts b/contracts/deploy/utils/index.ts index 0089f2a8e..2354a203f 100644 --- a/contracts/deploy/utils/index.ts +++ b/contracts/deploy/utils/index.ts @@ -8,13 +8,13 @@ export enum HardhatChain { export enum HomeChains { ARBITRUM_ONE = 42161, - ARBITRUM_GOERLI = 421613, + ARBITRUM_SEPOLIA = 421614, HARDHAT = HardhatChain.HARDHAT, } export enum ForeignChains { ETHEREUM_MAINNET = 1, - ETHEREUM_GOERLI = 5, + ETHEREUM_SEPOLIA = 11155111, GNOSIS_MAINNET = 100, GNOSIS_CHIADO = 10200, HARDHAT = HardhatChain.HARDHAT, diff --git a/contracts/deployments/chiado/ArbitrableExample.json b/contracts/deployments/chiado/ArbitrableExample.json index 76e24b60d..229acec50 100644 --- a/contracts/deployments/chiado/ArbitrableExample.json +++ b/contracts/deployments/chiado/ArbitrableExample.json @@ -407,7 +407,7 @@ ], "policyURI": "/ipfs/Qmdvk...rSD6cE/policy.pdf", "frontendUrl": "https://kleros-v2.netlify.app/#/cases/%s/overview", - "arbitratorChainID": "421613", + "arbitratorChainID": "421614", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", "category": "Others", "specification": "KIP001", diff --git a/contracts/deployments/chiadoDevnet/ArbitrableExample.json b/contracts/deployments/chiadoDevnet/ArbitrableExample.json index ea0a63770..32b7428ea 100644 --- a/contracts/deployments/chiadoDevnet/ArbitrableExample.json +++ b/contracts/deployments/chiadoDevnet/ArbitrableExample.json @@ -407,7 +407,7 @@ ], "policyURI": "/ipfs/Qmdvk...rSD6cE/policy.pdf", "frontendUrl": "https://kleros-v2.netlify.app/#/cases/%s/overview", - "arbitratorChainID": "421613", + "arbitratorChainID": "421614", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", "category": "Others", "specification": "KIP001", diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index 9ab5e2f03..d43a73c7d 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -75,25 +75,25 @@ const config: HardhatUserConfig = { home: "arbitrum", }, }, - arbitrumGoerliFork: { - chainId: 421613, + arbitrumSepoliaFork: { + chainId: 421614, url: `http://127.0.0.1:8545`, forking: { - url: `https://goerli-rollup.arbitrum.io/rpc`, + url: `https://sepolia-rollup.arbitrum.io/rpc`, }, accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], live: false, saveDeployments: true, tags: ["test", "local"], companionNetworks: { - foreign: "goerli", + foreign: "sepolia", }, }, // Home chain --------------------------------------------------------------------------------- - arbitrumGoerli: { - chainId: 421613, - url: "https://goerli-rollup.arbitrum.io/rpc", + arbitrumSepolia: { + chainId: 421614, + url: "https://sepolia-rollup.arbitrum.io/rpc", accounts: (process.env.ARB_GOERLI_PRIVATE_KEY_WALLET_1 && [ process.env.ARB_GOERLI_PRIVATE_KEY_WALLET_1 as string, @@ -108,7 +108,7 @@ const config: HardhatUserConfig = { tags: ["staging", "home", "layer2"], companionNetworks: { foreignChiado: "chiado", - foreignGoerli: "goerli", + foreignSepolia: "sepolia", }, verify: { etherscan: { @@ -116,9 +116,9 @@ const config: HardhatUserConfig = { }, }, }, - arbitrumGoerliDevnet: { - chainId: 421613, - url: "https://goerli-rollup.arbitrum.io/rpc", + arbitrumSepoliaDevnet: { + chainId: 421614, + url: "https://sepolia-rollup.arbitrum.io/rpc", accounts: (process.env.ARB_GOERLI_PRIVATE_KEY_WALLET_1 && [ process.env.ARB_GOERLI_PRIVATE_KEY_WALLET_1 as string, @@ -133,7 +133,7 @@ const config: HardhatUserConfig = { tags: ["staging", "home", "layer2"], companionNetworks: { foreignChiado: "chiadoDevnet", - foreignGoerli: "goerliDevnet", + foreignSepolia: "sepoliaDevnet", }, verify: { etherscan: { @@ -158,26 +158,26 @@ const config: HardhatUserConfig = { }, }, // Foreign chain --------------------------------------------------------------------------------- - goerli: { - chainId: 5, - url: `https://goerli.infura.io/v3/${process.env.INFURA_API_KEY}`, + sepolia: { + chainId: 11155111, + url: `https://sepolia.infura.io/v3/${process.env.INFURA_API_KEY}`, accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], live: true, saveDeployments: true, tags: ["staging", "foreign", "layer1"], companionNetworks: { - home: "arbitrumGoerli", + home: "arbitrumSepolia", }, }, - goerliDevnet: { - chainId: 5, - url: `https://goerli.infura.io/v3/${process.env.INFURA_API_KEY}`, + sepoliaDevnet: { + chainId: 11155111, + url: `https://sepolia.infura.io/v3/${process.env.INFURA_API_KEY}`, accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], live: true, saveDeployments: true, tags: ["staging", "foreign", "layer1"], companionNetworks: { - home: "arbitrumGoerliDevnet", + home: "arbitrumSepoliaDevnet", }, }, mainnet: { @@ -199,7 +199,7 @@ const config: HardhatUserConfig = { saveDeployments: true, tags: ["staging", "foreign", "layer1"], companionNetworks: { - home: "arbitrumGoerli", + home: "arbitrumSepolia", }, verify: { etherscan: { @@ -216,7 +216,7 @@ const config: HardhatUserConfig = { saveDeployments: true, tags: ["staging", "foreign", "layer1"], companionNetworks: { - home: "arbitrumGoerliDevnet", + home: "arbitrumSepoliaDevnet", }, verify: { etherscan: { @@ -312,14 +312,14 @@ const config: HardhatUserConfig = { external: { // https://github.com/wighawag/hardhat-deploy#importing-deployment-from-other-projects-with-truffle-support deployments: { - arbitrumGoerli: ["../node_modules/@kleros/vea-contracts/deployments/arbitrumGoerli"], - arbitrumGoerliDevnet: ["../node_modules/@kleros/vea-contracts/deployments/arbitrumGoerli"], + arbitrumSepolia: ["../node_modules/@kleros/vea-contracts/deployments/arbitrumSepolia"], + arbitrumSepoliaDevnet: ["../node_modules/@kleros/vea-contracts/deployments/arbitrumSepolia"], arbitrum: ["../node_modules/@kleros/vea-contracts/deployments/arbitrum"], chiado: ["../node_modules/@kleros/vea-contracts/deployments/chiado"], chiadoDevnet: ["../node_modules/@kleros/vea-contracts/deployments/chiado"], gnosischain: ["../node_modules/@kleros/vea-contracts/deployments/gnosischain"], - goerli: ["../node_modules/@kleros/vea-contracts/deployments/goerli"], - goerliDevnet: ["../node_modules/@kleros/vea-contracts/deployments/goerli"], + sepolia: ["../node_modules/@kleros/vea-contracts/deployments/sepolia"], + sepoliaDevnet: ["../node_modules/@kleros/vea-contracts/deployments/sepolia"], mainnet: ["../node_modules/@kleros/vea-contracts/deployments/mainnet"], }, }, diff --git a/contracts/package.json b/contracts/package.json index fec51ef60..a0d2a3915 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -27,7 +27,7 @@ "simulate-local": "hardhat simulate:all --network localhost", "bot:keeper": "NODE_NO_WARNINGS=1 NODE_OPTIONS=--experimental-fetch hardhat run ./scripts/keeperBot.ts", "bot:relayer-from-chiado": "NODE_NO_WARNINGS=1 NODE_OPTIONS=--experimental-fetch hardhat run ./scripts/disputeRelayerBotFromChiado.ts", - "bot:relayer-from-goerli": "NODE_NO_WARNINGS=1 NODE_OPTIONS=--experimental-fetch hardhat run ./scripts/disputeRelayerBotFromGoerli.ts", + "bot:relayer-from-sepolia": "NODE_NO_WARNINGS=1 NODE_OPTIONS=--experimental-fetch hardhat run ./scripts/disputeRelayerBotFromSepolia.ts", "bot:relayer-from-hardhat": "NODE_NO_WARNINGS=1 NODE_OPTIONS=--experimental-fetch hardhat run ./scripts/disputeRelayerBotFromHardhat.ts", "bot:disputor": "NODE_NO_WARNINGS=1 yarn hardhat run ./scripts/disputeCreatorBot.ts", "etherscan-verify": "hardhat etherscan-verify", diff --git a/contracts/scripts/changeRng.ts b/contracts/scripts/changeRng.ts index 80b03788c..5394d2340 100644 --- a/contracts/scripts/changeRng.ts +++ b/contracts/scripts/changeRng.ts @@ -4,7 +4,7 @@ const { deploy, execute } = deployments; enum HomeChains { ARBITRUM_ONE = 42161, ARBITRUM_RINKEBY = 421611, - ARBITRUM_GOERLI = 421613, + ARBITRUM_SEPOLIA = 421614, HARDHAT = 31337, } diff --git a/contracts/scripts/console-init-chiado-resolver.ts b/contracts/scripts/console-init-chiado-resolver.ts index d4ae0284e..daedb3ccc 100644 --- a/contracts/scripts/console-init-chiado-resolver.ts +++ b/contracts/scripts/console-init-chiado-resolver.ts @@ -4,7 +4,7 @@ // On the foreign chain const extraData = "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003"; -const template = `{"$schema":"../NewDisputeTemplate.schema.json","title":"Add an entry to Ledger Contract Domain Name registry v2","description":"Someone requested to add an entry to Ledger Contract Domain Name registry v2","question":"Does the entry comply with the required criteria?","answers":[{"title":"Yes, Add It","description":"Select this if you think the entry complies with the required criteria and should be added."},{"title":"No, Don't Add It","description":"Select this if you think the entry does not comply with the required criteria and should not be added."}],"policyURI":"/ipfs/QmdvkC5Djgk8MfX5ijJR3NJzmvGugUqvui7bKuTErSD6cE/contract-domain-name-registry-for-ledger-policy-3-.pdf","frontendUrl":"https://curate.kleros.io/tcr/%s/%s/%s","arbitrableChainID":"100","arbitrableAddress":"0x957A53A994860BE4750810131d9c876b2f52d6E1","arbitratorChainID":"421613","arbitratorAddress":"0xD08Ab99480d02bf9C092828043f611BcDFEA917b","category":"Curated Lists","specification":"KIP88"}`; +const template = `{"$schema":"../NewDisputeTemplate.schema.json","title":"Add an entry to Ledger Contract Domain Name registry v2","description":"Someone requested to add an entry to Ledger Contract Domain Name registry v2","question":"Does the entry comply with the required criteria?","answers":[{"title":"Yes, Add It","description":"Select this if you think the entry complies with the required criteria and should be added."},{"title":"No, Don't Add It","description":"Select this if you think the entry does not comply with the required criteria and should not be added."}],"policyURI":"/ipfs/QmdvkC5Djgk8MfX5ijJR3NJzmvGugUqvui7bKuTErSD6cE/contract-domain-name-registry-for-ledger-policy-3-.pdf","frontendUrl":"https://curate.kleros.io/tcr/%s/%s/%s","arbitrableChainID":"100","arbitrableAddress":"0x957A53A994860BE4750810131d9c876b2f52d6E1","arbitratorChainID":"421614","arbitratorAddress":"0xD08Ab99480d02bf9C092828043f611BcDFEA917b","category":"Curated Lists","specification":"KIP88"}`; const nbOfChoices = 2; const cost = await foreignGateway.arbitrationCost(extraData); const tx = await resolver.createDisputeForTemplate(extraData, template, "disputeTemplateMapping: TODO", nbOfChoices, { @@ -21,7 +21,7 @@ core = await ethers.getContract("KlerosCore"); resolver = await ethers.getContract("DisputeResolver"); extraData = "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003"; -template = `{"$schema":"../NewDisputeTemplate.schema.json","title":"Add an entry to Ledger Contract Domain Name registry v2","description":"Someone requested to add an entry to Ledger Contract Domain Name registry v2","question":"Does the entry comply with the required criteria?","answers":[{"title":"Yes, Add It","description":"Select this if you think the entry complies with the required criteria and should be added."},{"title":"No, Don't Add It","description":"Select this if you think the entry does not comply with the required criteria and should not be added."}],"policyURI":"/ipfs/QmdvkC5Djgk8MfX5ijJR3NJzmvGugUqvui7bKuTErSD6cE/contract-domain-name-registry-for-ledger-policy-3-.pdf","frontendUrl":"https://curate.kleros.io/tcr/%s/%s/%s","arbitrableChainID":"100","arbitrableAddress":"0x957A53A994860BE4750810131d9c876b2f52d6E1","arbitratorChainID":"421613","arbitratorAddress":"0xD08Ab99480d02bf9C092828043f611BcDFEA917b","category":"Curated Lists","specification":"KIP88"}`; +template = `{"$schema":"../NewDisputeTemplate.schema.json","title":"Add an entry to Ledger Contract Domain Name registry v2","description":"Someone requested to add an entry to Ledger Contract Domain Name registry v2","question":"Does the entry comply with the required criteria?","answers":[{"title":"Yes, Add It","description":"Select this if you think the entry complies with the required criteria and should be added."},{"title":"No, Don't Add It","description":"Select this if you think the entry does not comply with the required criteria and should not be added."}],"policyURI":"/ipfs/QmdvkC5Djgk8MfX5ijJR3NJzmvGugUqvui7bKuTErSD6cE/contract-domain-name-registry-for-ledger-policy-3-.pdf","frontendUrl":"https://curate.kleros.io/tcr/%s/%s/%s","arbitrableChainID":"100","arbitrableAddress":"0x957A53A994860BE4750810131d9c876b2f52d6E1","arbitratorChainID":"421614","arbitratorAddress":"0xD08Ab99480d02bf9C092828043f611BcDFEA917b","category":"Curated Lists","specification":"KIP88"}`; nbOfChoices = 2; cost = await core.arbitrationCost(extraData); tx = await resolver.createDisputeForTemplate(extraData, template, "disputeTemplateMapping: TODO", nbOfChoices, { diff --git a/contracts/scripts/disputeCreatorBot.ts b/contracts/scripts/disputeCreatorBot.ts index d487a2267..f77686c4e 100644 --- a/contracts/scripts/disputeCreatorBot.ts +++ b/contracts/scripts/disputeCreatorBot.ts @@ -36,10 +36,10 @@ export default async function main() { "000000000000000000000000000000000000000000000000000000000000000B" + // minJurors 11 "0000000000000000000000000000000000000000000000000000000000000002"; // disputeKitId 2 const templates = [ - `{"title":"A reality.eth question","description":"A reality.eth question has been raised to arbitration.","question":"**Kleros Moderate:** Did the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://ipfs.kleros.io/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://ipfs.kleros.io/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)?","answers":[{"id":"0x01","title":"Yes","reserved":false},{"id":"0x02","title":"No","reserved":false},{"id":"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","title":"Answered Too Soon","reserved":true}],"policyURI":"/ipfs/QmZ5XaV2RVgBADq5qMpbuEwgCuPZdRgCeu8rhGtJWLV6yz","frontendUrl":"https://reality.eth.limo/app/#!/question/0xe78996a233895be74a66f451f1019ca9734205cc-0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39","arbitrableChainID":"100","arbitrableAddress":"0x2e39b8f43d0870ba896f516f78f57cde773cf805","arbitratorChainID":"421613","arbitratorAddress":"0xD08Ab99480d02bf9C092828043f611BcDFEA917b","category":"Oracle","lang":"en_US","specification":"KIP99"}`, - `{"title":"Add an entry to Ledger Contract Domain Name registry v2","description":"Someone requested to add an entry to Ledger Contract Domain Name registry v2","question":"Does the entry comply with the required criteria?","answers":[{"title":"Yes, Add It","description":"Select this if you think the entry complies with the required criteria and should be added."},{"title":"No, Don't Add It","description":"Select this if you think the entry does not comply with the required criteria and should not be added."}],"policyURI":"/ipfs/QmW3nQcMW2adyqe6TujRTYkyq26PiDqcmmTjdgKiz9ynPV","frontendUrl":"https://curate.kleros.io/tcr/100/0x957a53a994860be4750810131d9c876b2f52d6e1/0xc2c1aa705632f53051f22a9f65967c0944370020a7489aba608bd0d755ca1234","arbitratorChainID":"421613","arbitratorAddress":"0x791812B0B9f2ba260B2DA432BB02Ee23BC1bB509","category":"Curation","specification":"KIP0X","lang":"en_US"}`, - `{"title":"Omen Question: News & Politics","description":"This reality dispute has been created by Omen, we advise you to read [the Omen Rules](https://cdn.kleros.link/ipfs/QmU1oZzsduGwtC7vCUQPw1QcBP6BDNDkg4t6zkowPucVcx) and consult the evidence provided in [the Market Comments](https://omen.eth.limo/#/0x95b2271039b020aba31b933039e042b60b063800).","question":"**Assuming that today is December 20th 2020, will Joe Biden win the 2020 United States presidential election?**","answers":[{"title":"Yes"},{"title":"No"}],"policyURI":"/ipfs/QmU1oZzsduGwtC7vCUQPw1QcBP6BDNDkg4t6zkowPucVcx","frontendUrl":"https://omen.eth.limo/#/0x95b2271039b020aba31b933039e042b60b063800","arbitratorChainID":"421613","arbitratorAddress":"0x791812B0B9f2ba260B2DA432BB02Ee23BC1bB509","category":"Oracle","specification":"KIP0X","lang":"en_US"}`, - `{"title":"Proof of Humanity Registration Request","description":"A request to register the specified entry to a list of provable humans.","question":"Should the request to register be accepted?","answers":[{"title":"Yes","description":"Accept the request to register the entry."},{"title":"No","description":"Deny the request."}],"policyURI":"/ipfs/QmYPf2fdSyr9BiSy6pJFUmB1oTUPwg6dhEuFqL1n4ZosgH","frontendUrl":"https://app.proofofhumanity.id/profile/0x00de4b13153673bcae2616b67bf822500d325fc3?network=mainnet","arbitratorChainID":"421613","arbitratorAddress":"0x791812B0B9f2ba260B2DA432BB02Ee23BC1bB509","category":"Curated List","specification":"KIP0X","lang":"en_US"}`, + `{"title":"A reality.eth question","description":"A reality.eth question has been raised to arbitration.","question":"**Kleros Moderate:** Did the user, **degenape6** (ID: 1554345080), break the Telegram group, ***[Kleros Trading Group]()*** (ID: -1001151472172), ***[rules](https://ipfs.kleros.io/ipfs/Qme3Qbj9rKUNHUe9vj9rqCLnTVUCWKy2YfveQF8HiuWQSu/Kleros%20Moderate%20Community%20Rules.pdf)*** due to conduct related to the ***[message](https://t.me/c/1151472172/116662)*** (***[backup](https://ipfs.kleros.io/ipfs/QmVbFrZR1bcyQzZjvLyXwL9ekDxrqHERykdreRxXrw4nqg/animations_file_23.mp4)***)?","answers":[{"id":"0x01","title":"Yes","reserved":false},{"id":"0x02","title":"No","reserved":false},{"id":"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","title":"Answered Too Soon","reserved":true}],"policyURI":"/ipfs/QmZ5XaV2RVgBADq5qMpbuEwgCuPZdRgCeu8rhGtJWLV6yz","frontendUrl":"https://reality.eth.limo/app/#!/question/0xe78996a233895be74a66f451f1019ca9734205cc-0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39","arbitrableChainID":"100","arbitrableAddress":"0x2e39b8f43d0870ba896f516f78f57cde773cf805","arbitratorChainID":"421614","arbitratorAddress":"0xD08Ab99480d02bf9C092828043f611BcDFEA917b","category":"Oracle","lang":"en_US","specification":"KIP99"}`, + `{"title":"Add an entry to Ledger Contract Domain Name registry v2","description":"Someone requested to add an entry to Ledger Contract Domain Name registry v2","question":"Does the entry comply with the required criteria?","answers":[{"title":"Yes, Add It","description":"Select this if you think the entry complies with the required criteria and should be added."},{"title":"No, Don't Add It","description":"Select this if you think the entry does not comply with the required criteria and should not be added."}],"policyURI":"/ipfs/QmW3nQcMW2adyqe6TujRTYkyq26PiDqcmmTjdgKiz9ynPV","frontendUrl":"https://curate.kleros.io/tcr/100/0x957a53a994860be4750810131d9c876b2f52d6e1/0xc2c1aa705632f53051f22a9f65967c0944370020a7489aba608bd0d755ca1234","arbitratorChainID":"421614","arbitratorAddress":"0x791812B0B9f2ba260B2DA432BB02Ee23BC1bB509","category":"Curation","specification":"KIP0X","lang":"en_US"}`, + `{"title":"Omen Question: News & Politics","description":"This reality dispute has been created by Omen, we advise you to read [the Omen Rules](https://cdn.kleros.link/ipfs/QmU1oZzsduGwtC7vCUQPw1QcBP6BDNDkg4t6zkowPucVcx) and consult the evidence provided in [the Market Comments](https://omen.eth.limo/#/0x95b2271039b020aba31b933039e042b60b063800).","question":"**Assuming that today is December 20th 2020, will Joe Biden win the 2020 United States presidential election?**","answers":[{"title":"Yes"},{"title":"No"}],"policyURI":"/ipfs/QmU1oZzsduGwtC7vCUQPw1QcBP6BDNDkg4t6zkowPucVcx","frontendUrl":"https://omen.eth.limo/#/0x95b2271039b020aba31b933039e042b60b063800","arbitratorChainID":"421614","arbitratorAddress":"0x791812B0B9f2ba260B2DA432BB02Ee23BC1bB509","category":"Oracle","specification":"KIP0X","lang":"en_US"}`, + `{"title":"Proof of Humanity Registration Request","description":"A request to register the specified entry to a list of provable humans.","question":"Should the request to register be accepted?","answers":[{"title":"Yes","description":"Accept the request to register the entry."},{"title":"No","description":"Deny the request."}],"policyURI":"/ipfs/QmYPf2fdSyr9BiSy6pJFUmB1oTUPwg6dhEuFqL1n4ZosgH","frontendUrl":"https://app.proofofhumanity.id/profile/0x00de4b13153673bcae2616b67bf822500d325fc3?network=mainnet","arbitratorChainID":"421614","arbitratorAddress":"0x791812B0B9f2ba260B2DA432BB02Ee23BC1bB509","category":"Curated List","specification":"KIP0X","lang":"en_US"}`, ]; const randomTemplate = templates[Math.floor(Math.random() * templates.length)]; const nbOfChoices = 2; diff --git a/contracts/scripts/disputeRelayerBotFromGoerli.ts b/contracts/scripts/disputeRelayerBotFromGoerli.ts index b9191a578..12df907c8 100644 --- a/contracts/scripts/disputeRelayerBotFromGoerli.ts +++ b/contracts/scripts/disputeRelayerBotFromGoerli.ts @@ -4,8 +4,8 @@ import { HttpNetworkConfig } from "hardhat/types"; async function main() { await relayer( - hre.config.networks.goerli as HttpNetworkConfig, - hre.companionNetworks.foreignGoerli.deployments, + hre.config.networks.sepolia as HttpNetworkConfig, + hre.companionNetworks.foreignSepolia.deployments, "ForeignGatewayOnEthereum", "HomeGatewayToEthereum" ); diff --git a/contracts/scripts/exportDeployments.sh b/contracts/scripts/exportDeployments.sh index accb15624..27c47f070 100755 --- a/contracts/scripts/exportDeployments.sh +++ b/contracts/scripts/exportDeployments.sh @@ -8,10 +8,10 @@ function exportJson() { #network yarn deploy --tags nop --network $network --export deployments/deployments.${network}.json --no-compile } -exportJson arbitrumGoerli -exportJson arbitrumGoerliDevnet -exportJson goerli -exportJson goerliDevnet +exportJson arbitrumSepolia +exportJson arbitrumSepoliaDevnet +exportJson sepolia +exportJson sepoliaDevnet exportJson chiado exportJson chiadoDevnet exportJson arbitrum diff --git a/contracts/scripts/generateDeploymentArtifact.sh b/contracts/scripts/generateDeploymentArtifact.sh index 6812de6c2..ba6bf7c81 100755 --- a/contracts/scripts/generateDeploymentArtifact.sh +++ b/contracts/scripts/generateDeploymentArtifact.sh @@ -18,7 +18,7 @@ address=$2 case $network in gnosischain) - url="https://api.gnosisscan.io" + url="https://api.gnosisscan.io/api" apiKey="$GNOSISSCAN_API_KEY" ;; chiado) @@ -29,19 +29,19 @@ chiado) apiKey="" ;; arbitrum) - url="https://api.arbiscan.io" + url="https://api.arbiscan.io/api" apiKey="$ARBISCAN_API_KEY" ;; -arbitrumGoerli) - url="https://api-goerli.arbiscan.io" +arbitrumSepolia) + url="https://api-sepolia.arbiscan.io/api" apiKey="$ARBISCAN_API_KEY" ;; mainnet) - url="https://api.etherscan.io" + url="https://api.etherscan.io/api" apiKey="$ETHERSCAN_API_KEY" ;; -goerli) - url="https://api-goerli.etherscan.io" +sepolia) + url="https://api-sepolia.etherscan.io/api" apiKey="$ETHERSCAN_API_KEY" ;; *) diff --git a/contracts/scripts/populateCourts.ts b/contracts/scripts/populateCourts.ts index 942260308..26639f39c 100644 --- a/contracts/scripts/populateCourts.ts +++ b/contracts/scripts/populateCourts.ts @@ -10,7 +10,7 @@ import { isDevnet } from "../deploy/utils"; enum HomeChains { ARBITRUM_ONE = 42161, ARBITRUM_RINKEBY = 421611, - ARBITRUM_GOERLI = 421613, + ARBITRUM_SEPOLIA = 421614, HARDHAT = 31337, } diff --git a/contracts/scripts/populatePolicyRegistry.ts b/contracts/scripts/populatePolicyRegistry.ts index 313f9bb9d..43fb1b38f 100644 --- a/contracts/scripts/populatePolicyRegistry.ts +++ b/contracts/scripts/populatePolicyRegistry.ts @@ -9,7 +9,7 @@ import { isDevnet } from "../deploy/utils"; enum HomeChains { ARBITRUM_ONE = 42161, ARBITRUM_RINKEBY = 421611, - ARBITRUM_GOERLI = 421613, + ARBITRUM_SEPOLIA = 421614, HARDHAT = 31337, } diff --git a/contracts/scripts/simulations/README.md b/contracts/scripts/simulations/README.md index 7165abeb6..989f29edf 100644 --- a/contracts/scripts/simulations/README.md +++ b/contracts/scripts/simulations/README.md @@ -34,14 +34,14 @@ $ yarn hardhat simulate:all --network localhost ```bash # This script quickly sends PNK from one wallet to other 4 wallets (the ones declared on the "hardhat.config.ts" as private keys, private key 1 matches walletindex 0, and so on). ENSURE that the five wallets from `.env` are correctly funded with ETH and PNK. Otherwise you will get a lot of nasty errors. In this example, you will need 800 PNK to perform this transaction, because will send 200 PNK to each wallet, watch out. -$ yarn hardhat simulate:split-pnk --walletindex 0 --pnkperwallet 200 --network arbitrumGoerli +$ yarn hardhat simulate:split-pnk --walletindex 0 --pnkperwallet 200 --network arbitrumSepolia ``` #### Stake PNK ```bash # approve KlerosCore to use your PNK tokens on 5 different wallets, then stake them on the court "1" (specify courtid in parameter) -$ yarn hardhat simulate:stake-five-jurors --walletindexes 0,1,2,3,4 --pnkamounts 200,200,200,200,200 --courtid 1 --network arbitrumGoerli +$ yarn hardhat simulate:stake-five-jurors --walletindexes 0,1,2,3,4 --pnkamounts 200,200,200,200,200 --courtid 1 --network arbitrumSepolia ``` #### (optional) Create Court @@ -55,103 +55,103 @@ $ yarn hardhat simulate:create-court --walletindex 0 --network localhost ```bash # create a new dispute (you need some ETH on the calling wallet) -$ yarn hardhat simulate:create-dispute --walletindex 0 --courtid 1 --nbofchoices 2 --nbofjurors 3n --feeforjuror 100000000000000000n --network arbitrumGoerli +$ yarn hardhat simulate:create-dispute --walletindex 0 --courtid 1 --nbofchoices 2 --nbofjurors 3n --feeforjuror 100000000000000000n --network arbitrumSepolia ``` #### To Freezing and Generating phase ```bash # pass Core and DK 1 phase each, core to 'freezing' and DK to 'generating' -$ yarn hardhat simulate:to-freezing-and-generating-phase --walletindex 0 --network arbitrumGoerli +$ yarn hardhat simulate:to-freezing-and-generating-phase --walletindex 0 --network arbitrumSepolia ``` #### Waits for Rng ```bash # waits for the random number to be generated and lets you know, we can not continue until this is done -$ yarn hardhat simulate:wait-for-rng --network arbitrumGoerli +$ yarn hardhat simulate:wait-for-rng --network arbitrumSepolia ``` #### Pass DK phase, draw, unfreeze ```bash # once the number is generated, this function will move DK to the phase 'drawing', it also draws the jurors for the dispute, then returns the DK and Core phases to 'resolving' and 'staking', respectively -$ yarn hardhat simulate:pass-phase-draw-unfreeze --walletindex 0 --disputeid 0 --network arbitrumGoerli +$ yarn hardhat simulate:pass-phase-draw-unfreeze --walletindex 0 --disputeid 0 --network arbitrumSepolia ``` #### (if you created multiple disputes you can use Draw individually) ```bash # draw jurors for a dispute -$ yarn hardhat simulate:draw --walletindex 0 --disputeid 5 --network arbitrumGoerli +$ yarn hardhat simulate:draw --walletindex 0 --disputeid 5 --network arbitrumSepolia ``` #### Submit Evidence ```bash # submits evidence -$ yarn hardhat simulate:submit-evidence --walletindex 0 --evidencegroupid 35485348662853211036000747072835336201257659261269148469720238392298048238137 --network arbitrumGoerli +$ yarn hardhat simulate:submit-evidence --walletindex 0 --evidencegroupid 35485348662853211036000747072835336201257659261269148469720238392298048238137 --network arbitrumSepolia ``` #### Dispute period to Commit ```bash # passes the dispute period to commit -$ yarn hardhat simulate:pass-period --walletindex 0 --disputeid 0 --network arbitrumGoerli +$ yarn hardhat simulate:pass-period --walletindex 0 --disputeid 0 --network arbitrumSepolia ``` #### Cast Commit ```bash # a juror commits its vote -$ yarn hardhat simulate:cast-commit --walletindex 1 --disputeid 0 --choice 1 --justification because --network arbitrumGoerli +$ yarn hardhat simulate:cast-commit --walletindex 1 --disputeid 0 --choice 1 --justification because --network arbitrumSepolia ``` #### Dispute period to Vote ```bash # passes the dispute period to voting -$ yarn hardhat simulate:pass-period --walletindex 0 --disputeid 0 --network arbitrumGoerli +$ yarn hardhat simulate:pass-period --walletindex 0 --disputeid 0 --network arbitrumSepolia ``` #### Cast Vote ```bash # a juror votes. In case there wasn't a commit period, omit the --salt parameter. In case there was a commit period, the commit and vote parameters have to match, and you must include the salt which for testing purposes we will use "123" -$ yarn hardhat simulate:cast-vote --walletindex 1 --disputeid 0 --choice 1 --justification because --salt 123 --network arbitrumGoerli +$ yarn hardhat simulate:cast-vote --walletindex 1 --disputeid 0 --choice 1 --justification because --salt 123 --network arbitrumSepolia ``` #### Dispute period to Appeal ```bash # passes the dispute period to appeal -$ yarn hardhat simulate:pass-period --walletindex 0 --disputeid 0 --network arbitrumGoerli +$ yarn hardhat simulate:pass-period --walletindex 0 --disputeid 0 --network arbitrumSepolia ``` #### Fund Appeal ```bash # appeal a choice -$ yarn hardhat simulate:fund-appeal --walletindex 0 --disputeid 0 --appealchoice 1 --network arbitrumGoerli +$ yarn hardhat simulate:fund-appeal --walletindex 0 --disputeid 0 --appealchoice 1 --network arbitrumSepolia ``` #### Dispute period to Execution ```bash # passes the dispute period to execution -$ yarn hardhat simulate:pass-period --walletindex 0 --disputeid 0 --network arbitrumGoerli +$ yarn hardhat simulate:pass-period --walletindex 0 --disputeid 0 --network arbitrumSepolia ``` #### Execute Ruling ```bash # execute the ruling and end the dispute -$ yarn hardhat simulate:execute-ruling --walletindex 0 --disputeid 0 --network arbitrumGoerli +$ yarn hardhat simulate:execute-ruling --walletindex 0 --disputeid 0 --network arbitrumSepolia ``` #### Withdraw Fees And Rewards ```bash # withdraws fees and rewards for the people that won appeals. modify parameters accordingly. -$ yarn hardhat simulate:withdraw-fees-and-rewards --beneficiary 0x1cC9304B31F05d27470ccD855b05310543b70f17 --roundId 0 --choice 1 --walletindex 0 --disputeid 0 --network arbitrumGoerli +$ yarn hardhat simulate:withdraw-fees-and-rewards --beneficiary 0x1cC9304B31F05d27470ccD855b05310543b70f17 --roundId 0 --choice 1 --walletindex 0 --disputeid 0 --network arbitrumSepolia ``` diff --git a/contracts/scripts/verifyProxies.sh b/contracts/scripts/verifyProxies.sh index 8f37b057b..58efcae50 100755 --- a/contracts/scripts/verifyProxies.sh +++ b/contracts/scripts/verifyProxies.sh @@ -22,8 +22,8 @@ function verify() { #deploymentDir #explorerApiUrl #apiKey . $SCRIPT_DIR/../.env -verify "$SCRIPT_DIR/../deployments/arbitrumGoerliDevnet" "https://api-testnet.arbiscan.io/api" $ARBISCAN_API_KEY +verify "$SCRIPT_DIR/../deployments/arbitrumSepoliaDevnet" "https://api-testnet.arbiscan.io/api" $ARBISCAN_API_KEY echo -verify "$SCRIPT_DIR/../deployments/arbitrumGoerli" "https://api-testnet.arbiscan.io/api" $ARBISCAN_API_KEY +verify "$SCRIPT_DIR/../deployments/arbitrumSepolia" "https://api-testnet.arbiscan.io/api" $ARBISCAN_API_KEY echo verify "$SCRIPT_DIR/../deployments/arbitrum" "https://api.arbiscan.io/api" $ARBISCAN_API_KEY diff --git a/contracts/test/fixtures/DisputeTemplate.resolver.jsonc b/contracts/test/fixtures/DisputeTemplate.resolver.jsonc index 03e753551..c40794660 100644 --- a/contracts/test/fixtures/DisputeTemplate.resolver.jsonc +++ b/contracts/test/fixtures/DisputeTemplate.resolver.jsonc @@ -21,7 +21,7 @@ "frontendUrl": "https://resolve.kleros.io/cases/%s", "arbitrableChainID": "10200", "arbitrableAddress": "0x433eD78895df1df7668C40b3e82d54410331F942", // DisputeResolver - "arbitratorChainID": "421613", + "arbitratorChainID": "421614", "arbitratorAddress": "0xA429667Abb1A6c530BAd1083df4C69FBce86D696", // KlerosCore "category": "Curated Lists", "specification": "KIP88" // not yet for the dispute resolver diff --git a/contracts/test/fixtures/DisputeTemplate.schema.json b/contracts/test/fixtures/DisputeTemplate.schema.json index cf1d71485..a637188fd 100644 --- a/contracts/test/fixtures/DisputeTemplate.schema.json +++ b/contracts/test/fixtures/DisputeTemplate.schema.json @@ -324,7 +324,7 @@ "default": "", "title": "The arbitratorChainID Schema", "examples": [ - "421613" + "421614" ] }, "arbitratorAddress": { diff --git a/contracts/test/fixtures/DisputeTemplate.simple.json b/contracts/test/fixtures/DisputeTemplate.simple.json index 50b3760dc..4406a9b37 100644 --- a/contracts/test/fixtures/DisputeTemplate.simple.json +++ b/contracts/test/fixtures/DisputeTemplate.simple.json @@ -15,7 +15,7 @@ ], "policyURI": "/ipfs/Qmdvk...rSD6cE/policy.pdf", "frontendUrl": "https://kleros-v2.netlify.app/#/cases/%s/overview", - "arbitratorChainID": "421613", + "arbitratorChainID": "421614", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", "category": "Others", "specification": "KIP001", diff --git a/kleros-sdk/config/v2-disputetemplate/DisputeDetails.default.jsonc b/kleros-sdk/config/v2-disputetemplate/DisputeDetails.default.jsonc index 32decb39f..6106c901a 100644 --- a/kleros-sdk/config/v2-disputetemplate/DisputeDetails.default.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/DisputeDetails.default.jsonc @@ -16,7 +16,7 @@ "reserved": false } ], - "arbitratorChainID": "421613", + "arbitratorChainID": "421614", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore "lang": "en_US", "specification": "KIP000" diff --git a/kleros-sdk/config/v2-disputetemplate/NewDisputeTemplate.schema.json b/kleros-sdk/config/v2-disputetemplate/NewDisputeTemplate.schema.json index bb94f67b2..e71f7782e 100644 --- a/kleros-sdk/config/v2-disputetemplate/NewDisputeTemplate.schema.json +++ b/kleros-sdk/config/v2-disputetemplate/NewDisputeTemplate.schema.json @@ -324,7 +324,7 @@ "default": "", "title": "The arbitratorChainID Schema", "examples": [ - "421613" + "421614" ] }, "arbitratorAddress": { diff --git a/kleros-sdk/config/v2-disputetemplate/curate/NewDisputeTemplate.curate.jsonc b/kleros-sdk/config/v2-disputetemplate/curate/NewDisputeTemplate.curate.jsonc index bb99c033a..d5226c03e 100644 --- a/kleros-sdk/config/v2-disputetemplate/curate/NewDisputeTemplate.curate.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/curate/NewDisputeTemplate.curate.jsonc @@ -17,7 +17,7 @@ "frontendUrl": "https://curate.kleros.io/tcr/%s/%s/%s", "arbitrableChainID": "100", "arbitrableAddress": "0x957A53A994860BE4750810131d9c876b2f52d6E1", - "arbitratorChainID": "421613", + "arbitratorChainID": "421614", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore "category": "Curated Lists", "specification": "KIP88" diff --git a/kleros-sdk/config/v2-disputetemplate/curate/example/DisputeDetails.curate.jsonc b/kleros-sdk/config/v2-disputetemplate/curate/example/DisputeDetails.curate.jsonc index e00b87af4..379eccf03 100644 --- a/kleros-sdk/config/v2-disputetemplate/curate/example/DisputeDetails.curate.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/curate/example/DisputeDetails.curate.jsonc @@ -27,7 +27,7 @@ "frontendUrl": "https://curate.kleros.io/tcr/100/0x957A53A994860BE4750810131d9c876b2f52d6E1/0xc2c1aa705632f53051f22a9f65967c0944370020a7489aba608bd0d755ca1234", "arbitrableChainID": "100", "arbitrableAddress": "0x957A53A994860BE4750810131d9c876b2f52d6E1", - "arbitratorChainID": "421613", + "arbitratorChainID": "421614", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore "category": "Curated Lists", "lang": "en_US", diff --git a/kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc b/kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc index e97ee3b0b..e6f110d5b 100644 --- a/kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc @@ -17,7 +17,7 @@ "frontendUrl": "https://linguo.kleros.io/translation/%s/%s", "arbitrableChainID": "100", "arbitrableAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", - "arbitratorChainID": "421613", + "arbitratorChainID": "421614", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore "category": "Translation", "specification": "KIP999" diff --git a/kleros-sdk/config/v2-disputetemplate/linguo/example/DisputeDetails.linguo.jsonc b/kleros-sdk/config/v2-disputetemplate/linguo/example/DisputeDetails.linguo.jsonc index e8119f2d8..3ecab16d7 100644 --- a/kleros-sdk/config/v2-disputetemplate/linguo/example/DisputeDetails.linguo.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/linguo/example/DisputeDetails.linguo.jsonc @@ -27,7 +27,7 @@ "frontendUrl": "https://linguo.kleros.io/translation/0xe78996a233895be74a66f451f1019ca9734205cc/13", "arbitrableChainID": "100", "arbitrableAddress": "0xe78996a233895be74a66f451f1019ca9734205cc", - "arbitratorChainID": "421613", + "arbitratorChainID": "421614", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore "category": "Translation", "lang": "en_US", diff --git a/kleros-sdk/config/v2-disputetemplate/poh/NewDisputeTemplate.poh1.jsonc b/kleros-sdk/config/v2-disputetemplate/poh/NewDisputeTemplate.poh1.jsonc index aa644fb1e..4a7eb2352 100644 --- a/kleros-sdk/config/v2-disputetemplate/poh/NewDisputeTemplate.poh1.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/poh/NewDisputeTemplate.poh1.jsonc @@ -17,7 +17,7 @@ "frontendUrl": "https://app.proofofhumanity.id/profile/%s", "arbitrableChainID": "1", "arbitrableAddress": "0xc5e9ddebb09cd64dfacab4011a0d5cedaf7c9bdb", - "arbitratorChainID": "421613", + "arbitratorChainID": "421614", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore "category": "Curated Lists", "specification": "KIP88" diff --git a/kleros-sdk/config/v2-disputetemplate/poh/NewDisputeTemplate.poh2.jsonc b/kleros-sdk/config/v2-disputetemplate/poh/NewDisputeTemplate.poh2.jsonc index f9225b917..f95dae97f 100644 --- a/kleros-sdk/config/v2-disputetemplate/poh/NewDisputeTemplate.poh2.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/poh/NewDisputeTemplate.poh2.jsonc @@ -17,7 +17,7 @@ "frontendUrl": "https://app.proofofhumanity.id/profile/%s", "arbitrableChainID": "1", "arbitrableAddress": "0xc5e9ddebb09cd64dfacab4011a0d5cedaf7c9bdb", - "arbitratorChainID": "421613", + "arbitratorChainID": "421614", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore "category": "Curated Lists", "specification": "KIP88" diff --git a/kleros-sdk/config/v2-disputetemplate/poh/example1-registration/DisputeDetails.poh1.jsonc b/kleros-sdk/config/v2-disputetemplate/poh/example1-registration/DisputeDetails.poh1.jsonc index 373f72556..5e2bcd73b 100644 --- a/kleros-sdk/config/v2-disputetemplate/poh/example1-registration/DisputeDetails.poh1.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/poh/example1-registration/DisputeDetails.poh1.jsonc @@ -27,7 +27,7 @@ "frontendUrl": "https://app.proofofhumanity.id/profile/0x35998E80B3fa93cFD957D616e6f09cd830e9787c", "arbitrableChainID": "1", "arbitrableAddress": "0xc5e9ddebb09cd64dfacab4011a0d5cedaf7c9bdb", - "arbitratorChainID": "421613", + "arbitratorChainID": "421614", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore "category": "Curated Lists", "lang": "en_US", diff --git a/kleros-sdk/config/v2-disputetemplate/poh/example2-removal/DisputeDetails.poh2.jsonc b/kleros-sdk/config/v2-disputetemplate/poh/example2-removal/DisputeDetails.poh2.jsonc index d60c90757..21c56d01b 100644 --- a/kleros-sdk/config/v2-disputetemplate/poh/example2-removal/DisputeDetails.poh2.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/poh/example2-removal/DisputeDetails.poh2.jsonc @@ -27,7 +27,7 @@ "frontendUrl": "https://app.proofofhumanity.id/profile/0x35998E80B3fa93cFD957D616e6f09cd830e9787c", "arbitrableChainID": "1", "arbitrableAddress": "0xc5e9ddebb09cd64dfacab4011a0d5cedaf7c9bdb", - "arbitratorChainID": "421613", + "arbitratorChainID": "421614", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore "category": "Curated Lists", "lang": "en_US", diff --git a/kleros-sdk/config/v2-disputetemplate/reality/NewDisputeTemplate.reality.jsonc b/kleros-sdk/config/v2-disputetemplate/reality/NewDisputeTemplate.reality.jsonc index ac9495234..679b4691e 100644 --- a/kleros-sdk/config/v2-disputetemplate/reality/NewDisputeTemplate.reality.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/reality/NewDisputeTemplate.reality.jsonc @@ -16,7 +16,7 @@ "frontendUrl": "https://reality.eth.link/app/#!/question/%s-%s", "arbitrableChainID": "100", "arbitrableAddress": "0x2e39b8f43d0870ba896f516f78f57cde773cf805", // Realitio_v2_1_ArbitratorWithAppeals - "arbitratorChainID": "421613", + "arbitratorChainID": "421614", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore "category": "Oracle", "specification": "KIP99" diff --git a/kleros-sdk/config/v2-disputetemplate/reality/example1/DisputeDetails.reality1.jsonc b/kleros-sdk/config/v2-disputetemplate/reality/example1/DisputeDetails.reality1.jsonc index a70e1e928..4bc8268db 100644 --- a/kleros-sdk/config/v2-disputetemplate/reality/example1/DisputeDetails.reality1.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/reality/example1/DisputeDetails.reality1.jsonc @@ -29,7 +29,7 @@ "frontendUrl": "https://reality.eth.link/app/#!/question/0xe78996a233895be74a66f451f1019ca9734205cc-0xe2a3bd38e3ad4e22336ac35b221bbbdd808d716209f84014c7bc3bf62f8e3b39", "arbitrableChainID": "100", "arbitrableAddress": "0x2e39b8f43d0870ba896f516f78f57cde773cf805", // Realitio_v2_1_ArbitratorWithAppeals - "arbitratorChainID": "421613", + "arbitratorChainID": "421614", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore "category": "Oracle", "lang": "en_US", diff --git a/kleros-sdk/config/v2-disputetemplate/reality/example2/DisputeDetails.reality2.jsonc b/kleros-sdk/config/v2-disputetemplate/reality/example2/DisputeDetails.reality2.jsonc index 669c28d1e..be18b9ac4 100644 --- a/kleros-sdk/config/v2-disputetemplate/reality/example2/DisputeDetails.reality2.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/reality/example2/DisputeDetails.reality2.jsonc @@ -35,7 +35,7 @@ "frontendUrl": "https://reality.eth.link/app/#!/question/", // SDK should not change it "arbitrableChainID": "100", "arbitrableAddress": "0x2e39b8f43d0870ba896f516f78f57cde773cf805", // Realitio_v2_1_ArbitratorWithAppeals - "arbitratorChainID": "421613", + "arbitratorChainID": "421614", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore "category": "Oracle", "lang": "en_US", diff --git a/kleros-sdk/config/v2-disputetemplate/simple/NewDisputeTemplate.simple.json b/kleros-sdk/config/v2-disputetemplate/simple/NewDisputeTemplate.simple.json index 50b3760dc..4406a9b37 100644 --- a/kleros-sdk/config/v2-disputetemplate/simple/NewDisputeTemplate.simple.json +++ b/kleros-sdk/config/v2-disputetemplate/simple/NewDisputeTemplate.simple.json @@ -15,7 +15,7 @@ ], "policyURI": "/ipfs/Qmdvk...rSD6cE/policy.pdf", "frontendUrl": "https://kleros-v2.netlify.app/#/cases/%s/overview", - "arbitratorChainID": "421613", + "arbitratorChainID": "421614", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", "category": "Others", "specification": "KIP001", diff --git a/kleros-sdk/config/v2-disputetemplate/simple/example/DisputeDetails.simple.jsonc b/kleros-sdk/config/v2-disputetemplate/simple/example/DisputeDetails.simple.jsonc index a7e189e79..9bfb40556 100644 --- a/kleros-sdk/config/v2-disputetemplate/simple/example/DisputeDetails.simple.jsonc +++ b/kleros-sdk/config/v2-disputetemplate/simple/example/DisputeDetails.simple.jsonc @@ -26,7 +26,7 @@ "frontendUrl": "https://kleros-v2.netlify.app/#/cases/4564/overview", "arbitrableChainID": "10200", // Chiado "arbitrableAddress": "0x22f40371b1d1bd7e6229e33b832cbe00d0b991b2", - "arbitratorChainID": "421613", // ArbitrumGoerli + "arbitratorChainID": "421614", // ArbitrumSepolia "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", // KlerosCore "category": "Others", "specification": "KIP001", diff --git a/scripts/act-subgraph.yml b/scripts/act-subgraph.yml index 75f3bfd85..08b4c4d6d 100755 --- a/scripts/act-subgraph.yml +++ b/scripts/act-subgraph.yml @@ -1,3 +1,3 @@ #!/usr/bin/env bash -act workflow_dispatch -j buildAndDeploy --input network=arbitrum-goerli,update=true +act workflow_dispatch -j buildAndDeploy --input network=arbitrum-sepolia,update=true diff --git a/services/bots/devnet/compose.yml b/services/bots/devnet/compose.yml index af311a0ca..e8da805d6 100644 --- a/services/bots/devnet/compose.yml +++ b/services/bots/devnet/compose.yml @@ -22,17 +22,17 @@ services: profiles: - chiado - relayer-bot-from-goerli: - container_name: relayer-bot-from-goerli-${DEPLOYMENT:?error} + relayer-bot-from-sepolia: + container_name: relayer-bot-from-sepolia-${DEPLOYMENT:?error} extends: file: ../base/bot-pm2.yml service: bot-pm2 volumes: - type: bind - source: ./pm2.config.relayer-bot-from-goerli.${DEPLOYMENT}.js + source: ./pm2.config.relayer-bot-from-sepolia.${DEPLOYMENT}.js target: /usr/src/app/contracts/ecosystem.config.js profiles: - - goerli + - sepolia relayer-bot-from-hardhat-host: container_name: relayer-bot-from-hardhat-host-${DEPLOYMENT:?error} diff --git a/services/bots/devnet/pm2.config.keeper-bot.devnet.js b/services/bots/devnet/pm2.config.keeper-bot.devnet.js index a56b150be..92f6e8162 100644 --- a/services/bots/devnet/pm2.config.keeper-bot.devnet.js +++ b/services/bots/devnet/pm2.config.keeper-bot.devnet.js @@ -4,7 +4,7 @@ module.exports = { name: "keeper-bot-devnet", interpreter: "sh", script: "yarn", - args: "bot:keeper --network arbitrumGoerliDevnet", + args: "bot:keeper --network arbitrumSepoliaDevnet", restart_delay: 600000, autorestart: true, }, diff --git a/services/bots/devnet/pm2.config.relayer-bot-from-chiado.devnet.js b/services/bots/devnet/pm2.config.relayer-bot-from-chiado.devnet.js index a2a209d26..4ac329193 100644 --- a/services/bots/devnet/pm2.config.relayer-bot-from-chiado.devnet.js +++ b/services/bots/devnet/pm2.config.relayer-bot-from-chiado.devnet.js @@ -4,7 +4,7 @@ module.exports = { name: "relayer-bot-from-chiado-devnet", interpreter: "sh", script: "yarn", - args: "bot:relayer-from-chiado --network arbitrumGoerliDevnet", + args: "bot:relayer-from-chiado --network arbitrumSepoliaDevnet", restart_delay: 5000, autorestart: true, }, diff --git a/services/bots/devnet/pm2.config.relayer-bot-from-goerli.devnet.js b/services/bots/devnet/pm2.config.relayer-bot-from-goerli.devnet.js index afbfdd312..b75599c69 100644 --- a/services/bots/devnet/pm2.config.relayer-bot-from-goerli.devnet.js +++ b/services/bots/devnet/pm2.config.relayer-bot-from-goerli.devnet.js @@ -1,10 +1,10 @@ module.exports = { apps: [ { - name: "relayer-bot-from-goerli-devnet", + name: "relayer-bot-from-sepolia-devnet", interpreter: "sh", script: "yarn", - args: "bot:relayer-from-goerli --network arbitrumGoerliDevnet", + args: "bot:relayer-from-sepolia --network arbitrumSepoliaDevnet", restart_delay: 5000, autorestart: true, }, diff --git a/services/bots/testnet/compose.yml b/services/bots/testnet/compose.yml index c7241a899..807e8b4bd 100644 --- a/services/bots/testnet/compose.yml +++ b/services/bots/testnet/compose.yml @@ -32,17 +32,17 @@ services: profiles: - chiado - relayer-bot-from-goerli: - container_name: relayer-bot-from-goerli-${DEPLOYMENT:?error} + relayer-bot-from-sepolia: + container_name: relayer-bot-from-sepolia-${DEPLOYMENT:?error} extends: file: ../base/bot-pm2.yml service: bot-pm2 volumes: - type: bind - source: ./pm2.config.relayer-bot-from-goerli.${DEPLOYMENT}.js + source: ./pm2.config.relayer-bot-from-sepolia.${DEPLOYMENT}.js target: /usr/src/app/contracts/ecosystem.config.js profiles: - - goerli + - sepolia relayer-bot-from-hardhat-host: container_name: relayer-bot-from-hardhat-host-${DEPLOYMENT:?error} diff --git a/services/bots/testnet/pm2.config.disputor-bot.testnet.js b/services/bots/testnet/pm2.config.disputor-bot.testnet.js index 185db5777..146f4e7ff 100644 --- a/services/bots/testnet/pm2.config.disputor-bot.testnet.js +++ b/services/bots/testnet/pm2.config.disputor-bot.testnet.js @@ -4,7 +4,7 @@ module.exports = { name: "disputor-bot-testnet", interpreter: "sh", script: "yarn", - args: "bot:disputor --network arbitrumGoerli", + args: "bot:disputor --network arbitrumSepolia", restart_delay: 43200000, // 12 hours autorestart: true, }, diff --git a/services/bots/testnet/pm2.config.keeper-bot.testnet.js b/services/bots/testnet/pm2.config.keeper-bot.testnet.js index afba42b5a..21c308dcb 100644 --- a/services/bots/testnet/pm2.config.keeper-bot.testnet.js +++ b/services/bots/testnet/pm2.config.keeper-bot.testnet.js @@ -4,7 +4,7 @@ module.exports = { name: "keeper-bot-testnet", interpreter: "sh", script: "yarn", - args: "bot:keeper --network arbitrumGoerli", + args: "bot:keeper --network arbitrumSepolia", restart_delay: 600000, autorestart: true, }, diff --git a/services/bots/testnet/pm2.config.relayer-bot-from-chiado.testnet.js b/services/bots/testnet/pm2.config.relayer-bot-from-chiado.testnet.js index 5788a180d..efa24d648 100644 --- a/services/bots/testnet/pm2.config.relayer-bot-from-chiado.testnet.js +++ b/services/bots/testnet/pm2.config.relayer-bot-from-chiado.testnet.js @@ -4,7 +4,7 @@ module.exports = { name: "relayer-bot-from-chiado-testnet", interpreter: "sh", script: "yarn", - args: "bot:relayer-from-chiado --network arbitrumGoerli", + args: "bot:relayer-from-chiado --network arbitrumSepolia", restart_delay: 5000, autorestart: true, }, diff --git a/services/bots/testnet/pm2.config.relayer-bot-from-goerli.testnet.js b/services/bots/testnet/pm2.config.relayer-bot-from-goerli.testnet.js index 75419c741..3a9b173af 100644 --- a/services/bots/testnet/pm2.config.relayer-bot-from-goerli.testnet.js +++ b/services/bots/testnet/pm2.config.relayer-bot-from-goerli.testnet.js @@ -1,10 +1,10 @@ module.exports = { apps: [ { - name: "relayer-bot-from-goerli-testnet", + name: "relayer-bot-from-sepolia-testnet", interpreter: "sh", script: "yarn", - args: "bot:relayer-from-goerli --network arbitrumGoerli", + args: "bot:relayer-from-sepolia --network arbitrumSepolia", restart_delay: 5000, autorestart: true, }, diff --git a/subgraph/DisputeTemplateRegistry/subgraph.yaml b/subgraph/DisputeTemplateRegistry/subgraph.yaml index 91c9ef82a..c5ea24264 100644 --- a/subgraph/DisputeTemplateRegistry/subgraph.yaml +++ b/subgraph/DisputeTemplateRegistry/subgraph.yaml @@ -4,7 +4,7 @@ schema: dataSources: - kind: ethereum name: DisputeTemplateRegistry - network: arbitrum-goerli + network: arbitrum-sepolia source: address: "0x8d17Ed667512412D9c194d178699f68159f250A2" abi: DisputeTemplateRegistry @@ -17,7 +17,7 @@ dataSources: - DisputeTemplate abis: - name: DisputeTemplateRegistry - file: ../../contracts/deployments/arbitrumGoerli/DisputeTemplateRegistry.json + file: ../../contracts/deployments/arbitrumSepolia/DisputeTemplateRegistry.json eventHandlers: - event: DisputeTemplate(indexed uint256,indexed string,string,string) handler: handleDisputeTemplate diff --git a/subgraph/README.md b/subgraph/README.md index 6221dcaed..ff5b4a4f2 100644 --- a/subgraph/README.md +++ b/subgraph/README.md @@ -2,16 +2,16 @@ ## Deployments -### Arbitrum Goerli (hosted service) +### Arbitrum Sepolia (hosted service) -- [Subgraph explorer](https://thegraph.com/explorer/subgraph/kleros/kleros-v2-core-arbitrum-goerli) -- [Subgraph endpoints](https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-core-arbitrum-goerli) +- [Subgraph explorer](https://thegraph.com/explorer/subgraph/kleros/kleros-v2-core-arbitrum-sepolia) +- [Subgraph endpoints](https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-core-arbitrum-sepolia) ## Build ```bash # update subgraph.yml using the contract deployment artifacts -$ yarn update:arbitrum-goerli +$ yarn update:arbitrum-sepolia $ yarn codegen @@ -33,7 +33,7 @@ $ yarn run graph auth --product hosted-service #### Deployment ```bash -yarn deploy:arbitrum-goerli +yarn deploy:arbitrum-sepolia ``` ### Using the Kleros organization account diff --git a/subgraph/package.json b/subgraph/package.json index dcb15a5df..57f9e81f3 100644 --- a/subgraph/package.json +++ b/subgraph/package.json @@ -2,16 +2,16 @@ "name": "@kleros/kleros-v2-subgraph", "license": "MIT", "scripts": { - "update:arbitrum-goerli": "./scripts/update.sh arbitrumGoerli arbitrum-goerli", - "update:arbitrum-goerli-devnet": "./scripts/update.sh arbitrumGoerliDevnet arbitrum-goerli", + "update:arbitrum-sepolia": "./scripts/update.sh arbitrumSepolia arbitrum-sepolia", + "update:arbitrum-sepolia-devnet": "./scripts/update.sh arbitrumSepoliaDevnet arbitrum-sepolia", "update:arbitrum": "./scripts/update.sh arbitrum arbitrum", "update:local": "./scripts/update.sh localhost mainnet", "codegen": "graph codegen", "build": "graph build", "test": "graph test", "clean": "graph clean && rm subgraph.yaml.bak.*", - "deploy:arbitrum-goerli": "graph deploy --product hosted-service kleros/kleros-v2-core-testnet-2", - "deploy:arbitrum-goerli-devnet": "graph deploy --product hosted-service kleros/kleros-v2-core-devnet", + "deploy:arbitrum-sepolia": "graph deploy --product hosted-service kleros/kleros-v2-core-testnet-2", + "deploy:arbitrum-sepolia-devnet": "graph deploy --product hosted-service kleros/kleros-v2-core-devnet", "deploy:arbitrum": "graph deploy --product hosted-service kleros/kleros-v2-core-arbitrum", "create-local": "graph create --node http://localhost:8020/ kleros/kleros-v2-core-local", "remove-local": "graph remove --node http://localhost:8020/ kleros/kleros-v2-core-local", diff --git a/subgraph/scripts/update.sh b/subgraph/scripts/update.sh index b36e7ed0b..87c7ce85d 100755 --- a/subgraph/scripts/update.sh +++ b/subgraph/scripts/update.sh @@ -32,10 +32,10 @@ function update() #hardhatNetwork #graphNetwork #dataSourceIndex #contract } # as per ../contracts/hardhat.config.js -hardhatNetwork=${1:-arbitrumGoerli} +hardhatNetwork=${1:-arbitrumSepolia} # as per https://thegraph.com/docs/en/developing/supported-networks/ -graphNetwork=${2:-arbitrum\-goerli} +graphNetwork=${2:-arbitrum\-sepolia} i=0 # backup diff --git a/subgraph/subgraph.yaml b/subgraph/subgraph.yaml index e4d86d63d..7139f7628 100644 --- a/subgraph/subgraph.yaml +++ b/subgraph/subgraph.yaml @@ -4,7 +4,7 @@ schema: dataSources: - kind: ethereum name: KlerosCore - network: arbitrum-goerli + network: arbitrum-sepolia source: address: "0xB88643fd1e4351dAF9eA7292db126207FDE42e45" abi: KlerosCore @@ -26,9 +26,9 @@ dataSources: - Counter abis: - name: DisputeKitClassic - file: ../contracts/deployments/arbitrumGoerliDevnet/DisputeKitClassic.json + file: ../contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json - name: KlerosCore - file: ../contracts/deployments/arbitrumGoerliDevnet/KlerosCore.json + file: ../contracts/deployments/arbitrumSepoliaDevnet/KlerosCore.json eventHandlers: - event: AppealDecision(indexed uint256,indexed address) handler: handleAppealDecision @@ -61,7 +61,7 @@ dataSources: file: ./src/KlerosCore.ts - kind: ethereum name: PolicyRegistry - network: arbitrum-goerli + network: arbitrum-sepolia source: address: "0x37FFaF5506BB16327B4a32191Bb39d739fCE55a3" abi: PolicyRegistry @@ -74,14 +74,14 @@ dataSources: - Court abis: - name: PolicyRegistry - file: ../contracts/deployments/arbitrumGoerliDevnet/PolicyRegistry.json + file: ../contracts/deployments/arbitrumSepoliaDevnet/PolicyRegistry.json eventHandlers: - event: PolicyUpdate(indexed uint256,string,string) handler: handlePolicyUpdate file: ./src/PolicyRegistry.ts - kind: ethereum name: DisputeKitClassic - network: arbitrum-goerli + network: arbitrum-sepolia source: address: "0x67f3b472F345119692d575E59190400E371946f6" abi: DisputeKitClassic @@ -97,9 +97,9 @@ dataSources: - ClassicContribution abis: - name: DisputeKitClassic - file: ../contracts/deployments/arbitrumGoerliDevnet/DisputeKitClassic.json + file: ../contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json - name: KlerosCore - file: ../contracts/deployments/arbitrumGoerliDevnet/KlerosCore.json + file: ../contracts/deployments/arbitrumSepoliaDevnet/KlerosCore.json eventHandlers: - event: DisputeCreation(indexed uint256,uint256,bytes) handler: handleDisputeCreation @@ -116,7 +116,7 @@ dataSources: file: ./src/DisputeKitClassic.ts - kind: ethereum name: EvidenceModule - network: arbitrum-goerli + network: arbitrum-sepolia source: address: "0xF679E4a92AE843fd5cD0717A7417C3A773Dfd55F" abi: EvidenceModule @@ -130,7 +130,7 @@ dataSources: - ClassicEvidence abis: - name: EvidenceModule - file: ../contracts/deployments/arbitrumGoerliDevnet/EvidenceModule.json + file: ../contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule.json eventHandlers: - event: Evidence(indexed uint256,indexed address,string) handler: handleEvidenceEvent diff --git a/web/.env.devnet.public b/web/.env.devnet.public index 1e24ba5bb..22f53b41f 100644 --- a/web/.env.devnet.public +++ b/web/.env.devnet.public @@ -1,5 +1,5 @@ # Do not enter sensitive information here. export REACT_APP_DEPLOYMENT=devnet -export REACT_APP_KLEROS_CORE_SUBGRAPH_DEVNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-core-devnet -export REACT_APP_DISPUTE_TEMPLATE_ARBGOERLI_SUBGRAPH_DEVNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-dr-devnet +export REACT_APP_KLEROS_CORE_SUBGRAPH_DEVNET=REDEPLOY SUBGRAPH IN ARBSEPOLIA AND PUT API THEGRAPH LINK HERE +export REACT_APP_DISPUTE_TEMPLATE_ARBSEPOLIA_SUBGRAPH_DEVNET=REDEPLOY SUBGRAPH IN ARBSEPOLIA AND PUT API THEGRAPH LINK HERE export REACT_APP_STATUS_URL=https://kleros-v2-devnet.betteruptime.com/badge \ No newline at end of file diff --git a/web/.env.local.public b/web/.env.local.public index 89b89dfb1..bb3c3e014 100644 --- a/web/.env.local.public +++ b/web/.env.local.public @@ -1,4 +1,4 @@ # Do not enter sensitive information here. export REACT_APP_DEPLOYMENT=devnet export REACT_APP_KLEROS_CORE_SUBGRAPH_DEVNET=http://localhost:8000/subgraphs/name/kleros/kleros-v2-core-local -export REACT_APP_DISPUTE_TEMPLATE_ARBGOERLI_SUBGRAPH_DEVNET=https://api.thegraph.com/subgraphs/name/alcercu/templateregistrydevnet +export REACT_APP_DISPUTE_TEMPLATE_ARBSEPOLIA_SUBGRAPH_DEVNET=https://api.thegraph.com/subgraphs/name/alcercu/templateregistrydevnet diff --git a/web/.env.testnet.public b/web/.env.testnet.public index a88ef5904..07c5c8780 100644 --- a/web/.env.testnet.public +++ b/web/.env.testnet.public @@ -1,5 +1,5 @@ # Do not enter sensitive information here. export REACT_APP_DEPLOYMENT=testnet -export REACT_APP_KLEROS_CORE_SUBGRAPH_TESTNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-core-testnet-2 -export REACT_APP_DISPUTE_TEMPLATE_ARBGOERLI_SUBGRAPH_TESTNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-dr-testnet-2 -export REACT_APP_STATUS_URL=https://kleros-v2.betteruptime.com/badge \ No newline at end of file +export REACT_APP_KLEROS_CORE_SUBGRAPH_TESTNET=REDEPLOY SUBGRAPH IN ARBSEPOLIA AND PUT API THEGRAPH LINK HERE +export REACT_APP_DISPUTE_TEMPLATE_ARBSEPOLIA_SUBGRAPH_TESTNET=REDEPLOY SUBGRAPH IN ARBSEPOLIA AND PUT API THEGRAPH LINK HERE +export REACT_APP_STATUS_URL=https://kleros-v2.betteruptime.com/badge diff --git a/web/src/consts/chains.ts b/web/src/consts/chains.ts index 63c7ab82c..549feee31 100644 --- a/web/src/consts/chains.ts +++ b/web/src/consts/chains.ts @@ -1,9 +1,9 @@ -import { Chain, arbitrumGoerli, gnosisChiado } from "@wagmi/chains"; +import { Chain, arbitrumSepolia, gnosisChiado } from "wagmi/chains"; -export const DEFAULT_CHAIN = arbitrumGoerli.id; +export const DEFAULT_CHAIN = arbitrumSepolia.id; export const SUPPORTED_CHAINS: Record = { - [arbitrumGoerli.id]: arbitrumGoerli, + [arbitrumSepolia.id]: arbitrumSepolia, }; export const SUPPORTED_CHAIN_IDS = Object.keys(SUPPORTED_CHAINS); diff --git a/web/src/context/Web3Provider.tsx b/web/src/context/Web3Provider.tsx index d47ddb479..03033e363 100644 --- a/web/src/context/Web3Provider.tsx +++ b/web/src/context/Web3Provider.tsx @@ -3,12 +3,12 @@ import { EthereumClient, w3mConnectors } from "@web3modal/ethereum"; import { alchemyProvider } from "@wagmi/core/providers/alchemy"; import { Web3Modal } from "@web3modal/react"; import { configureChains, createConfig, WagmiConfig } from "wagmi"; -import { mainnet, arbitrumGoerli, gnosisChiado } from "wagmi/chains"; +import { mainnet, arbitrumSepolia, gnosisChiado } from "wagmi/chains"; import { jsonRpcProvider } from "wagmi/providers/jsonRpc"; import { useToggleTheme } from "hooks/useToggleThemeContext"; import { useTheme } from "styled-components"; -const chains = [arbitrumGoerli, mainnet, gnosisChiado]; +const chains = [arbitrumSepolia, mainnet, gnosisChiado]; const projectId = process.env.WALLETCONNECT_PROJECT_ID ?? "6efaa26765fa742153baf9281e218217"; const { publicClient, webSocketPublicClient } = configureChains(chains, [ diff --git a/web/src/utils/graphqlQueryFnHelper.ts b/web/src/utils/graphqlQueryFnHelper.ts index 20aa7df41..ea7d3685c 100644 --- a/web/src/utils/graphqlQueryFnHelper.ts +++ b/web/src/utils/graphqlQueryFnHelper.ts @@ -9,19 +9,19 @@ const DEPLOYMENTS_TO_KLEROS_CORE_SUBGRAPHS = { DEVNET: process.env.REACT_APP_KLEROS_CORE_SUBGRAPH_DEVNET, }; -const DEPLOYMENTS_TO_DISPUTE_TEMPLATE_ARBGOERLI_SUBGRAPHS = { - MAINNET: process.env.REACT_APP_DISPUTE_TEMPLATE_ARBGOERLI_SUBGRAPH_MAINNET, - TESTNET: process.env.REACT_APP_DISPUTE_TEMPLATE_ARBGOERLI_SUBGRAPH_TESTNET, - DEVNET: process.env.REACT_APP_DISPUTE_TEMPLATE_ARBGOERLI_SUBGRAPH_DEVNET, +const DEPLOYMENTS_TO_DISPUTE_TEMPLATE_ARBSEPOLIA_SUBGRAPHS = { + MAINNET: process.env.REACT_APP_DISPUTE_TEMPLATE_ARBSEPOLIA_SUBGRAPH_MAINNET, + TESTNET: process.env.REACT_APP_DISPUTE_TEMPLATE_ARBSEPOLIA_SUBGRAPH_TESTNET, + DEVNET: process.env.REACT_APP_DISPUTE_TEMPLATE_ARBSEPOLIA_SUBGRAPH_DEVNET, }; const CHAINID_TO_DISPUTE_TEMPLATE_SUBGRAPH = { - 421613: - DEPLOYMENTS_TO_DISPUTE_TEMPLATE_ARBGOERLI_SUBGRAPHS[DEPLOYMENT] ?? + 421614: + DEPLOYMENTS_TO_DISPUTE_TEMPLATE_ARBSEPOLIA_SUBGRAPHS[DEPLOYMENT] ?? "https://api.thegraph.com/subgraphs/name/alcercu/disputetemplateregistryarbgrli", }; -export const graphqlUrl = (isDisputeTemplate = false, chainId = 421613) => { +export const graphqlUrl = (isDisputeTemplate = false, chainId = 421614) => { const coreUrl = DEPLOYMENTS_TO_KLEROS_CORE_SUBGRAPHS[DEPLOYMENT] ?? "https://api.thegraph.com/subgraphs/name/alcercu/kleroscoretest"; @@ -32,7 +32,7 @@ export const graphqlQueryFnHelper = async ( query: TypedDocumentNode, parametersObject: Record, isDisputeTemplate = false, - chainId = 421613 + chainId = 421614 ) => { const url = graphqlUrl(isDisputeTemplate, chainId); return request(url, query, parametersObject); diff --git a/web/wagmi.config.ts b/web/wagmi.config.ts index 298a69499..043440401 100644 --- a/web/wagmi.config.ts +++ b/web/wagmi.config.ts @@ -54,12 +54,12 @@ const getConfig = async (): Promise => { let hardhatNetwork: string; switch (deployment) { case "devnet": - viemNetwork = "arbitrumGoerli"; - hardhatNetwork = "arbitrumGoerliDevnet"; + viemNetwork = "arbitrumSepolia"; + hardhatNetwork = "arbitrumSepoliaDevnet"; break; case "testnet": - viemNetwork = "arbitrumGoerli"; - hardhatNetwork = "arbitrumGoerli"; + viemNetwork = "arbitrumSepolia"; + hardhatNetwork = "arbitrumSepolia"; break; case "mainnet": viemNetwork = "arbitrum"; From 4180928fbd8f6de53ffba71f6e0a9dcd7066ad2c Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Wed, 13 Dec 2023 17:42:10 +0000 Subject: [PATCH 43/77] chore: dependencies bump, small fixes --- .../deployments/chiado/ArbitrableExample.json | 2 +- .../chiadoDevnet/ArbitrableExample.json | 2 +- contracts/package.json | 28 +- ...rli.ts => disputeRelayerBotFromSepolia.ts} | 0 .../scripts/generateDeploymentArtifact.sh | 10 +- cspell.json | 1 + eslint-config/package.json | 10 +- package.json | 2 +- prettier-config/package.json | 4 +- subgraph/package.json | 2 +- web/package.json | 20 +- yarn.lock | 2008 ++++++++++++++--- 12 files changed, 1731 insertions(+), 358 deletions(-) rename contracts/scripts/{disputeRelayerBotFromGoerli.ts => disputeRelayerBotFromSepolia.ts} (100%) diff --git a/contracts/deployments/chiado/ArbitrableExample.json b/contracts/deployments/chiado/ArbitrableExample.json index 229acec50..76e24b60d 100644 --- a/contracts/deployments/chiado/ArbitrableExample.json +++ b/contracts/deployments/chiado/ArbitrableExample.json @@ -407,7 +407,7 @@ ], "policyURI": "/ipfs/Qmdvk...rSD6cE/policy.pdf", "frontendUrl": "https://kleros-v2.netlify.app/#/cases/%s/overview", - "arbitratorChainID": "421614", + "arbitratorChainID": "421613", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", "category": "Others", "specification": "KIP001", diff --git a/contracts/deployments/chiadoDevnet/ArbitrableExample.json b/contracts/deployments/chiadoDevnet/ArbitrableExample.json index 32b7428ea..ea0a63770 100644 --- a/contracts/deployments/chiadoDevnet/ArbitrableExample.json +++ b/contracts/deployments/chiadoDevnet/ArbitrableExample.json @@ -407,7 +407,7 @@ ], "policyURI": "/ipfs/Qmdvk...rSD6cE/policy.pdf", "frontendUrl": "https://kleros-v2.netlify.app/#/cases/%s/overview", - "arbitratorChainID": "421614", + "arbitratorChainID": "421613", "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", "category": "Others", "specification": "KIP001", diff --git a/contracts/package.json b/contracts/package.json index a0d2a3915..b9159791a 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -49,35 +49,35 @@ "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", "@nomiclabs/hardhat-ethers": "^2.2.3", "@nomiclabs/hardhat-solhint": "^3.0.1", - "@openzeppelin/contracts": "^4.9.3", - "@typechain/ethers-v5": "^11.0.0", + "@openzeppelin/contracts": "^4.9.5", + "@typechain/ethers-v5": "^11.1.2", "@typechain/hardhat": "^7.0.0", - "@types/chai": "^4.3.5", - "@types/mocha": "^10.0.1", - "@types/node": "^16.18.38", - "chai": "^4.3.7", + "@types/chai": "^4.3.11", + "@types/mocha": "^10.0.6", + "@types/node": "^16.18.68", + "chai": "^4.3.10", "dotenv": "^16.3.1", "ethereumjs-util": "^7.1.5", "ethers": "^5.7.2", "graphql": "^16.7.1", "graphql-request": "^6.1.0", - "hardhat": "^2.15.0", + "hardhat": "^2.19.2", "hardhat-contract-sizer": "^2.10.0", "hardhat-deploy": "^0.11.42", "hardhat-deploy-ethers": "^0.4.0-next.1", "hardhat-deploy-tenderly": "^0.2.0", "hardhat-docgen": "^1.3.0", "hardhat-gas-reporter": "^1.0.9", - "hardhat-tracer": "^2.5.0", + "hardhat-tracer": "^2.7.0", "hardhat-watcher": "^2.5.0", - "node-fetch": "^3.3.1", - "pino": "^8.14.1", - "pino-pretty": "^10.0.0", + "node-fetch": "^3.3.2", + "pino": "^8.17.0", + "pino-pretty": "^10.2.3", "shelljs": "^0.8.5", - "solhint-plugin-prettier": "^0.0.5", + "solhint-plugin-prettier": "^0.1.0", "solidity-coverage": "0.8.5", - "ts-node": "^10.9.1", - "typechain": "^8.3.1", + "ts-node": "^10.9.2", + "typechain": "^8.3.2", "typescript": "^4.9.5" }, "dependencies": { diff --git a/contracts/scripts/disputeRelayerBotFromGoerli.ts b/contracts/scripts/disputeRelayerBotFromSepolia.ts similarity index 100% rename from contracts/scripts/disputeRelayerBotFromGoerli.ts rename to contracts/scripts/disputeRelayerBotFromSepolia.ts diff --git a/contracts/scripts/generateDeploymentArtifact.sh b/contracts/scripts/generateDeploymentArtifact.sh index ba6bf7c81..fa7b87a27 100755 --- a/contracts/scripts/generateDeploymentArtifact.sh +++ b/contracts/scripts/generateDeploymentArtifact.sh @@ -18,7 +18,7 @@ address=$2 case $network in gnosischain) - url="https://api.gnosisscan.io/api" + url="https://api.gnosisscan.io" apiKey="$GNOSISSCAN_API_KEY" ;; chiado) @@ -29,19 +29,19 @@ chiado) apiKey="" ;; arbitrum) - url="https://api.arbiscan.io/api" + url="https://api.arbiscan.io" apiKey="$ARBISCAN_API_KEY" ;; arbitrumSepolia) - url="https://api-sepolia.arbiscan.io/api" + url="https://api-sepolia.arbiscan.io" apiKey="$ARBISCAN_API_KEY" ;; mainnet) - url="https://api.etherscan.io/api" + url="https://api.etherscan.io" apiKey="$ETHERSCAN_API_KEY" ;; sepolia) - url="https://api-sepolia.etherscan.io/api" + url="https://api-sepolia.etherscan.io" apiKey="$ETHERSCAN_API_KEY" ;; *) diff --git a/cspell.json b/cspell.json index e27b9bab7..759c8834e 100644 --- a/cspell.json +++ b/cspell.json @@ -35,6 +35,7 @@ "Proxiable", "Realitio", "repartitions", + "SEPOLIA", "solhint", "typechain", "uncommify", diff --git a/eslint-config/package.json b/eslint-config/package.json index 55760f54d..8764a6c99 100644 --- a/eslint-config/package.json +++ b/eslint-config/package.json @@ -5,12 +5,12 @@ "main": ".eslintrc.js", "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "^5.59.11", - "@typescript-eslint/parser": "^5.61.0", - "@typescript-eslint/utils": "^5.59.11", - "eslint-config-prettier": "^8.8.0", + "@typescript-eslint/eslint-plugin": "^5.62.0", + "@typescript-eslint/parser": "^5.62.0", + "@typescript-eslint/utils": "^5.62.0", + "eslint-config-prettier": "^8.10.0", "eslint-config-standard": "^16.0.3", - "eslint-plugin-import": "^2.27.5", + "eslint-plugin-import": "^2.29.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-promise": "^5.2.0", diff --git a/package.json b/package.json index 230906abb..840717250 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "buffer": "^5.5.0", "conventional-changelog-cli": "^2.2.2", "husky": "^8.0.3", - "lint-staged": "^13.2.2", + "lint-staged": "^13.3.0", "process": "^0.11.10" }, "resolutions": { diff --git a/prettier-config/package.json b/prettier-config/package.json index 6d5bae541..dd261bfe2 100644 --- a/prettier-config/package.json +++ b/prettier-config/package.json @@ -4,9 +4,9 @@ "main": "index.js", "license": "MIT", "dependencies": { - "eslint": "^8.43.0", + "eslint": "^8.55.0", "prettier": "^2.8.8", - "prettier-plugin-solidity": "^1.1.3" + "prettier-plugin-solidity": "^1.2.0" }, "scripts": { "lint:w": "eslint --fix '**/*.{gql,graphql,js,jsx,ts,tsx,json,md}'", diff --git a/subgraph/package.json b/subgraph/package.json index 57f9e81f3..ca0bddf38 100644 --- a/subgraph/package.json +++ b/subgraph/package.json @@ -32,7 +32,7 @@ "@kleros/kleros-v2-eslint-config": "workspace:^", "@kleros/kleros-v2-prettier-config": "workspace:^", "gluegun": "^5.1.2", - "matchstick-as": "0.6.0-beta.2" + "matchstick-as": "0.6.0" }, "dependenciesComments": { "@graphprotocol/graph-cli": "pinned because of this issue: https://github.com/graphprotocol/graph-tooling/issues/1399#issuecomment-1676104540" diff --git a/web/package.json b/web/package.json index d7ca79393..92ebf89ef 100644 --- a/web/package.json +++ b/web/package.json @@ -50,17 +50,17 @@ "@netlify/functions": "^1.6.0", "@parcel/transformer-svg-react": "2.8.3", "@parcel/watcher": "~2.2.0", - "@types/amqplib": "^0.10.1", - "@types/busboy": "^1.5.0", + "@types/amqplib": "^0.10.4", + "@types/busboy": "^1.5.3", "@types/react": "^18.2.14", "@types/react-dom": "^18.2.7", "@types/styled-components": "^5.1.26", - "@typescript-eslint/eslint-plugin": "^5.58.0", - "@typescript-eslint/parser": "^5.61.0", - "@typescript-eslint/utils": "^5.58.0", + "@typescript-eslint/eslint-plugin": "^5.62.0", + "@typescript-eslint/parser": "^5.62.0", + "@typescript-eslint/utils": "^5.62.0", "@wagmi/cli": "^1.5.2", - "eslint": "^8.38.0", - "eslint-config-prettier": "^8.8.0", + "eslint": "^8.55.0", + "eslint-config-prettier": "^8.10.0", "eslint-import-resolver-parcel": "^1.10.6", "eslint-plugin-react": "^7.33.0", "eslint-plugin-react-hooks": "^4.6.0", @@ -83,7 +83,7 @@ "amqplib": "^0.10.3", "chart.js": "^3.9.1", "chartjs-adapter-moment": "^1.0.1", - "core-js": "^3.31.0", + "core-js": "^3.34.0", "ethers": "^5.7.2", "graphql": "^16.7.1", "graphql-request": "~6.1.0", @@ -104,8 +104,8 @@ "react-toastify": "^9.1.3", "react-use": "^17.4.0", "styled-components": "^5.3.9", - "viem": "^1.16.1", - "wagmi": "^1.4.3" + "viem": "^1.19.13", + "wagmi": "^1.4.11" }, "volta": { "node": "16.20.1", diff --git a/yarn.lock b/yarn.lock index 08249ff41..44b9cc0cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,6 +5,13 @@ __metadata: version: 6 cacheKey: 8 +"@aashutoshrathi/word-wrap@npm:^1.2.3": + version: 1.2.6 + resolution: "@aashutoshrathi/word-wrap@npm:1.2.6" + checksum: ada901b9e7c680d190f1d012c84217ce0063d8f5c5a7725bb91ec3c5ed99bb7572680eb2d2938a531ccbaec39a95422fcd8a6b4a13110c7d98dd75402f66a0cd + languageName: node + linkType: hard + "@acuminous/bitsyntax@npm:^0.1.2": version: 0.1.2 resolution: "@acuminous/bitsyntax@npm:0.1.2" @@ -16,6 +23,13 @@ __metadata: languageName: node linkType: hard +"@adraffy/ens-normalize@npm:1.10.0": + version: 1.10.0 + resolution: "@adraffy/ens-normalize@npm:1.10.0" + checksum: af0540f963a2632da2bbc37e36ea6593dcfc607b937857133791781e246d47f870d5e3d21fa70d5cfe94e772c284588c81ea3f5b7f4ea8fbb824369444e4dbcb + languageName: node + linkType: hard + "@adraffy/ens-normalize@npm:1.9.0": version: 1.9.0 resolution: "@adraffy/ens-normalize@npm:1.9.0" @@ -30,13 +44,6 @@ __metadata: languageName: node linkType: hard -"@adraffy/ens-normalize@npm:1.9.4": - version: 1.9.4 - resolution: "@adraffy/ens-normalize@npm:1.9.4" - checksum: 7d7fff58ebe2c4961f7e5e61dad123aa6a63fec0df5c84af1fa41079dc05d398599690be4427b3a94d2baa94084544bcfdf2d51cbed7504b9b0583b0960ad550 - languageName: node - linkType: hard - "@alloc/quick-lru@npm:^5.2.0": version: 5.2.0 resolution: "@alloc/quick-lru@npm:5.2.0" @@ -3654,6 +3661,13 @@ __metadata: languageName: node linkType: hard +"@eslint-community/regexpp@npm:^4.6.1": + version: 4.10.0 + resolution: "@eslint-community/regexpp@npm:4.10.0" + checksum: 2a6e345429ea8382aaaf3a61f865cae16ed44d31ca917910033c02dc00d505d939f10b81e079fa14d43b51499c640138e153b7e40743c4c094d9df97d4e56f7b + languageName: node + linkType: hard + "@eslint/eslintrc@npm:^2.0.3": version: 2.0.3 resolution: "@eslint/eslintrc@npm:2.0.3" @@ -3671,6 +3685,23 @@ __metadata: languageName: node linkType: hard +"@eslint/eslintrc@npm:^2.1.4": + version: 2.1.4 + resolution: "@eslint/eslintrc@npm:2.1.4" + dependencies: + ajv: ^6.12.4 + debug: ^4.3.2 + espree: ^9.6.0 + globals: ^13.19.0 + ignore: ^5.2.0 + import-fresh: ^3.2.1 + js-yaml: ^4.1.0 + minimatch: ^3.1.2 + strip-json-comments: ^3.1.1 + checksum: 10957c7592b20ca0089262d8c2a8accbad14b4f6507e35416c32ee6b4dbf9cad67dfb77096bbd405405e9ada2b107f3797fe94362e1c55e0b09d6e90dd149127 + languageName: node + linkType: hard + "@eslint/js@npm:8.43.0": version: 8.43.0 resolution: "@eslint/js@npm:8.43.0" @@ -3678,6 +3709,13 @@ __metadata: languageName: node linkType: hard +"@eslint/js@npm:8.55.0": + version: 8.55.0 + resolution: "@eslint/js@npm:8.55.0" + checksum: fa33ef619f0646ed15649b0c2e313e4d9ccee8425884bdbfc78020d6b6b64c0c42fa9d83061d0e6158e1d4274f03f0f9008786540e2efab8fcdc48082259908c + languageName: node + linkType: hard + "@ethersproject/abi@npm:5.0.7": version: 5.0.7 resolution: "@ethersproject/abi@npm:5.0.7" @@ -4777,6 +4815,17 @@ __metadata: languageName: node linkType: hard +"@humanwhocodes/config-array@npm:^0.11.13": + version: 0.11.13 + resolution: "@humanwhocodes/config-array@npm:0.11.13" + dependencies: + "@humanwhocodes/object-schema": ^2.0.1 + debug: ^4.1.1 + minimatch: ^3.0.5 + checksum: f8ea57b0d7ed7f2d64cd3944654976829d9da91c04d9c860e18804729a33f7681f78166ef4c761850b8c324d362f7d53f14c5c44907a6b38b32c703ff85e4805 + languageName: node + linkType: hard + "@humanwhocodes/module-importer@npm:^1.0.1": version: 1.0.1 resolution: "@humanwhocodes/module-importer@npm:1.0.1" @@ -4791,6 +4840,13 @@ __metadata: languageName: node linkType: hard +"@humanwhocodes/object-schema@npm:^2.0.1": + version: 2.0.1 + resolution: "@humanwhocodes/object-schema@npm:2.0.1" + checksum: 24929487b1ed48795d2f08346a0116cc5ee4634848bce64161fb947109352c562310fd159fc64dda0e8b853307f5794605191a9547f7341158559ca3c8262a45 + languageName: node + linkType: hard + "@hutson/parse-repository-url@npm:^3.0.0": version: 3.0.2 resolution: "@hutson/parse-repository-url@npm:3.0.2" @@ -4798,6 +4854,13 @@ __metadata: languageName: node linkType: hard +"@ioredis/commands@npm:^1.1.1": + version: 1.2.0 + resolution: "@ioredis/commands@npm:1.2.0" + checksum: 9b20225ba36ef3e5caf69b3c0720597c3016cc9b1e157f519ea388f621dd9037177f84cfe7e25c4c32dad7dd90c70ff9123cd411f747e053cf292193c9c461e2 + languageName: node + linkType: hard + "@ipld/car@npm:^3.0.1, @ipld/car@npm:^3.2.3": version: 3.2.4 resolution: "@ipld/car@npm:3.2.4" @@ -5276,35 +5339,35 @@ __metadata: "@nomicfoundation/hardhat-chai-matchers": ^1.0.6 "@nomiclabs/hardhat-ethers": ^2.2.3 "@nomiclabs/hardhat-solhint": ^3.0.1 - "@openzeppelin/contracts": ^4.9.3 - "@typechain/ethers-v5": ^11.0.0 + "@openzeppelin/contracts": ^4.9.5 + "@typechain/ethers-v5": ^11.1.2 "@typechain/hardhat": ^7.0.0 - "@types/chai": ^4.3.5 - "@types/mocha": ^10.0.1 - "@types/node": ^16.18.38 - chai: ^4.3.7 + "@types/chai": ^4.3.11 + "@types/mocha": ^10.0.6 + "@types/node": ^16.18.68 + chai: ^4.3.10 dotenv: ^16.3.1 ethereumjs-util: ^7.1.5 ethers: ^5.7.2 graphql: ^16.7.1 graphql-request: ^6.1.0 - hardhat: ^2.15.0 + hardhat: ^2.19.2 hardhat-contract-sizer: ^2.10.0 hardhat-deploy: ^0.11.42 hardhat-deploy-ethers: ^0.4.0-next.1 hardhat-deploy-tenderly: ^0.2.0 hardhat-docgen: ^1.3.0 hardhat-gas-reporter: ^1.0.9 - hardhat-tracer: ^2.5.0 + hardhat-tracer: ^2.7.0 hardhat-watcher: ^2.5.0 - node-fetch: ^3.3.1 - pino: ^8.14.1 - pino-pretty: ^10.0.0 + node-fetch: ^3.3.2 + pino: ^8.17.0 + pino-pretty: ^10.2.3 shelljs: ^0.8.5 - solhint-plugin-prettier: ^0.0.5 + solhint-plugin-prettier: ^0.1.0 solidity-coverage: 0.8.5 - ts-node: ^10.9.1 - typechain: ^8.3.1 + ts-node: ^10.9.2 + typechain: ^8.3.2 typescript: ^4.9.5 languageName: unknown linkType: soft @@ -5313,12 +5376,12 @@ __metadata: version: 0.0.0-use.local resolution: "@kleros/kleros-v2-eslint-config@workspace:eslint-config" dependencies: - "@typescript-eslint/eslint-plugin": ^5.59.11 - "@typescript-eslint/parser": ^5.61.0 - "@typescript-eslint/utils": ^5.59.11 - eslint-config-prettier: ^8.8.0 + "@typescript-eslint/eslint-plugin": ^5.62.0 + "@typescript-eslint/parser": ^5.62.0 + "@typescript-eslint/utils": ^5.62.0 + eslint-config-prettier: ^8.10.0 eslint-config-standard: ^16.0.3 - eslint-plugin-import: ^2.27.5 + eslint-plugin-import: ^2.29.0 eslint-plugin-node: ^11.1.0 eslint-plugin-prettier: ^4.2.1 eslint-plugin-promise: ^5.2.0 @@ -5334,9 +5397,9 @@ __metadata: version: 0.0.0-use.local resolution: "@kleros/kleros-v2-prettier-config@workspace:prettier-config" dependencies: - eslint: ^8.43.0 + eslint: ^8.55.0 prettier: ^2.8.8 - prettier-plugin-solidity: ^1.1.3 + prettier-plugin-solidity: ^1.2.0 languageName: unknown linkType: soft @@ -5349,7 +5412,7 @@ __metadata: "@kleros/kleros-v2-eslint-config": "workspace:^" "@kleros/kleros-v2-prettier-config": "workspace:^" gluegun: ^5.1.2 - matchstick-as: 0.6.0-beta.2 + matchstick-as: 0.6.0 languageName: unknown linkType: soft @@ -5380,24 +5443,24 @@ __metadata: "@sentry/tracing": ^7.55.2 "@supabase/supabase-js": ^2.33.1 "@tanstack/react-query": ^4.28.0 - "@types/amqplib": ^0.10.1 - "@types/busboy": ^1.5.0 + "@types/amqplib": ^0.10.4 + "@types/busboy": ^1.5.3 "@types/react": ^18.2.14 "@types/react-dom": ^18.2.7 "@types/react-modal": ^3.16.0 "@types/styled-components": ^5.1.26 - "@typescript-eslint/eslint-plugin": ^5.58.0 - "@typescript-eslint/parser": ^5.61.0 - "@typescript-eslint/utils": ^5.58.0 + "@typescript-eslint/eslint-plugin": ^5.62.0 + "@typescript-eslint/parser": ^5.62.0 + "@typescript-eslint/utils": ^5.62.0 "@wagmi/cli": ^1.5.2 "@web3modal/ethereum": ^2.7.1 "@web3modal/react": ^2.2.2 amqplib: ^0.10.3 chart.js: ^3.9.1 chartjs-adapter-moment: ^1.0.1 - core-js: ^3.31.0 - eslint: ^8.38.0 - eslint-config-prettier: ^8.8.0 + core-js: ^3.34.0 + eslint: ^8.55.0 + eslint-config-prettier: ^8.10.0 eslint-import-resolver-parcel: ^1.10.6 eslint-plugin-react: ^7.33.0 eslint-plugin-react-hooks: ^4.6.0 @@ -5425,8 +5488,8 @@ __metadata: styled-components: ^5.3.9 supabase: ^1.102.2 typescript: ^4.9.5 - viem: ^1.16.1 - wagmi: ^1.4.3 + viem: ^1.19.13 + wagmi: ^1.4.11 languageName: unknown linkType: soft @@ -6565,13 +6628,20 @@ __metadata: languageName: node linkType: hard -"@openzeppelin/contracts@npm:^4.8.3, @openzeppelin/contracts@npm:^4.9.3": +"@openzeppelin/contracts@npm:^4.8.3": version: 4.9.3 resolution: "@openzeppelin/contracts@npm:4.9.3" checksum: 4932063e733b35fa7669b9fe2053f69b062366c5c208b0c6cfa1ac451712100c78acff98120c3a4b88d94154c802be05d160d71f37e7d74cadbe150964458838 languageName: node linkType: hard +"@openzeppelin/contracts@npm:^4.9.5": + version: 4.9.5 + resolution: "@openzeppelin/contracts@npm:4.9.5" + checksum: 2cddeb08c006a8f99c5cc40cc80aecb449fd941cd1a92ebda315d77f48c4b4d487798a1254bffbc3ec811b390365d14665e92dbb2dd8f45aacef479d69d94574 + languageName: node + linkType: hard + "@parcel/bundler-default@npm:2.8.3": version: 2.8.3 resolution: "@parcel/bundler-default@npm:2.8.3" @@ -7241,6 +7311,13 @@ __metadata: languageName: node linkType: hard +"@parcel/watcher-android-arm64@npm:2.3.0": + version: 2.3.0 + resolution: "@parcel/watcher-android-arm64@npm:2.3.0" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + "@parcel/watcher-darwin-arm64@npm:2.2.0": version: 2.2.0 resolution: "@parcel/watcher-darwin-arm64@npm:2.2.0" @@ -7248,6 +7325,13 @@ __metadata: languageName: node linkType: hard +"@parcel/watcher-darwin-arm64@npm:2.3.0": + version: 2.3.0 + resolution: "@parcel/watcher-darwin-arm64@npm:2.3.0" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + "@parcel/watcher-darwin-x64@npm:2.2.0": version: 2.2.0 resolution: "@parcel/watcher-darwin-x64@npm:2.2.0" @@ -7255,6 +7339,20 @@ __metadata: languageName: node linkType: hard +"@parcel/watcher-darwin-x64@npm:2.3.0": + version: 2.3.0 + resolution: "@parcel/watcher-darwin-x64@npm:2.3.0" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@parcel/watcher-freebsd-x64@npm:2.3.0": + version: 2.3.0 + resolution: "@parcel/watcher-freebsd-x64@npm:2.3.0" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + "@parcel/watcher-linux-arm-glibc@npm:2.2.0": version: 2.2.0 resolution: "@parcel/watcher-linux-arm-glibc@npm:2.2.0" @@ -7262,6 +7360,13 @@ __metadata: languageName: node linkType: hard +"@parcel/watcher-linux-arm-glibc@npm:2.3.0": + version: 2.3.0 + resolution: "@parcel/watcher-linux-arm-glibc@npm:2.3.0" + conditions: os=linux & cpu=arm & libc=glibc + languageName: node + linkType: hard + "@parcel/watcher-linux-arm64-glibc@npm:2.2.0": version: 2.2.0 resolution: "@parcel/watcher-linux-arm64-glibc@npm:2.2.0" @@ -7269,6 +7374,13 @@ __metadata: languageName: node linkType: hard +"@parcel/watcher-linux-arm64-glibc@npm:2.3.0": + version: 2.3.0 + resolution: "@parcel/watcher-linux-arm64-glibc@npm:2.3.0" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + "@parcel/watcher-linux-arm64-musl@npm:2.2.0": version: 2.2.0 resolution: "@parcel/watcher-linux-arm64-musl@npm:2.2.0" @@ -7276,6 +7388,13 @@ __metadata: languageName: node linkType: hard +"@parcel/watcher-linux-arm64-musl@npm:2.3.0": + version: 2.3.0 + resolution: "@parcel/watcher-linux-arm64-musl@npm:2.3.0" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + "@parcel/watcher-linux-x64-glibc@npm:2.2.0": version: 2.2.0 resolution: "@parcel/watcher-linux-x64-glibc@npm:2.2.0" @@ -7283,6 +7402,13 @@ __metadata: languageName: node linkType: hard +"@parcel/watcher-linux-x64-glibc@npm:2.3.0": + version: 2.3.0 + resolution: "@parcel/watcher-linux-x64-glibc@npm:2.3.0" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + "@parcel/watcher-linux-x64-musl@npm:2.2.0": version: 2.2.0 resolution: "@parcel/watcher-linux-x64-musl@npm:2.2.0" @@ -7290,6 +7416,24 @@ __metadata: languageName: node linkType: hard +"@parcel/watcher-linux-x64-musl@npm:2.3.0": + version: 2.3.0 + resolution: "@parcel/watcher-linux-x64-musl@npm:2.3.0" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@parcel/watcher-wasm@npm:2.3.0": + version: 2.3.0 + resolution: "@parcel/watcher-wasm@npm:2.3.0" + dependencies: + is-glob: ^4.0.3 + micromatch: ^4.0.5 + napi-wasm: ^1.1.0 + checksum: 61e3209e5253fc4eda2ddf903877475836cc3c65dca8b19c538de4b1fb598c17ca2797ab52cb45f61c01be963aed44059f2f9e536eb68539e31f27f1fcfb09ba + languageName: node + linkType: hard + "@parcel/watcher-win32-arm64@npm:2.2.0": version: 2.2.0 resolution: "@parcel/watcher-win32-arm64@npm:2.2.0" @@ -7297,6 +7441,20 @@ __metadata: languageName: node linkType: hard +"@parcel/watcher-win32-arm64@npm:2.3.0": + version: 2.3.0 + resolution: "@parcel/watcher-win32-arm64@npm:2.3.0" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@parcel/watcher-win32-ia32@npm:2.3.0": + version: 2.3.0 + resolution: "@parcel/watcher-win32-ia32@npm:2.3.0" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + "@parcel/watcher-win32-x64@npm:2.2.0": version: 2.2.0 resolution: "@parcel/watcher-win32-x64@npm:2.2.0" @@ -7304,6 +7462,13 @@ __metadata: languageName: node linkType: hard +"@parcel/watcher-win32-x64@npm:2.3.0": + version: 2.3.0 + resolution: "@parcel/watcher-win32-x64@npm:2.3.0" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@parcel/watcher@npm:^2.0.7, @parcel/watcher@npm:^2.1.0": version: 2.1.0 resolution: "@parcel/watcher@npm:2.1.0" @@ -7317,6 +7482,56 @@ __metadata: languageName: node linkType: hard +"@parcel/watcher@npm:^2.3.0": + version: 2.3.0 + resolution: "@parcel/watcher@npm:2.3.0" + dependencies: + "@parcel/watcher-android-arm64": 2.3.0 + "@parcel/watcher-darwin-arm64": 2.3.0 + "@parcel/watcher-darwin-x64": 2.3.0 + "@parcel/watcher-freebsd-x64": 2.3.0 + "@parcel/watcher-linux-arm-glibc": 2.3.0 + "@parcel/watcher-linux-arm64-glibc": 2.3.0 + "@parcel/watcher-linux-arm64-musl": 2.3.0 + "@parcel/watcher-linux-x64-glibc": 2.3.0 + "@parcel/watcher-linux-x64-musl": 2.3.0 + "@parcel/watcher-win32-arm64": 2.3.0 + "@parcel/watcher-win32-ia32": 2.3.0 + "@parcel/watcher-win32-x64": 2.3.0 + detect-libc: ^1.0.3 + is-glob: ^4.0.3 + micromatch: ^4.0.5 + node-addon-api: ^7.0.0 + node-gyp: latest + dependenciesMeta: + "@parcel/watcher-android-arm64": + optional: true + "@parcel/watcher-darwin-arm64": + optional: true + "@parcel/watcher-darwin-x64": + optional: true + "@parcel/watcher-freebsd-x64": + optional: true + "@parcel/watcher-linux-arm-glibc": + optional: true + "@parcel/watcher-linux-arm64-glibc": + optional: true + "@parcel/watcher-linux-arm64-musl": + optional: true + "@parcel/watcher-linux-x64-glibc": + optional: true + "@parcel/watcher-linux-x64-musl": + optional: true + "@parcel/watcher-win32-arm64": + optional: true + "@parcel/watcher-win32-ia32": + optional: true + "@parcel/watcher-win32-x64": + optional: true + checksum: 12f494998dbae363cc9c48b49f7e09589c179e84133e3b6cd0c087573a7dc70b3adec458f95b39e3b8e4d9c93cff770ce15b1d2452d6741a5047f1ca90485ded + languageName: node + linkType: hard + "@parcel/watcher@npm:~2.2.0": version: 2.2.0 resolution: "@parcel/watcher@npm:2.2.0" @@ -7456,6 +7671,15 @@ __metadata: languageName: node linkType: hard +"@prettier/sync@npm:^0.3.0": + version: 0.3.0 + resolution: "@prettier/sync@npm:0.3.0" + peerDependencies: + prettier: ^3.0.0 + checksum: a663ceca292629c66c2c983662293b047b48435942c25b7ea76f0eab899e434f2bc17ae3dce56ee66b29929f7853118073f716fd4c7dabc3cccf78458a168dd4 + languageName: node + linkType: hard + "@protobufjs/aspromise@npm:^1.1.1, @protobufjs/aspromise@npm:^1.1.2": version: 1.1.2 resolution: "@protobufjs/aspromise@npm:1.1.2" @@ -7615,27 +7839,17 @@ __metadata: languageName: node linkType: hard -"@safe-global/safe-apps-provider@npm:^0.17.1": - version: 0.17.1 - resolution: "@safe-global/safe-apps-provider@npm:0.17.1" +"@safe-global/safe-apps-provider@npm:^0.18.1": + version: 0.18.1 + resolution: "@safe-global/safe-apps-provider@npm:0.18.1" dependencies: - "@safe-global/safe-apps-sdk": 8.0.0 + "@safe-global/safe-apps-sdk": ^8.1.0 events: ^3.3.0 - checksum: 02f0415a4bb77b82e55f0055be045af715d9c0ea0fa7daa4e0604f40cc2189051d111b8ead67ddab0e99b1e423b444753c11d69bb213d51e459f706d2b430e34 - languageName: node - linkType: hard - -"@safe-global/safe-apps-sdk@npm:8.0.0": - version: 8.0.0 - resolution: "@safe-global/safe-apps-sdk@npm:8.0.0" - dependencies: - "@safe-global/safe-gateway-typescript-sdk": ^3.5.3 - viem: ^1.0.0 - checksum: 07295c44afa4d85fbc9419b4baac56b4fb493816d4438d6956842261e0689fdcea639ab86b39ee693c456fddace17b6c556c77a637892634a57de96f6b00b0c3 + checksum: fb77aee24149303a8886f1c23ed35ccd75ed63ed67cdb1dfd5c7160e7744f37c8872feadcfbf6d5712d2de65896a1aaf339dc4afb1fa648f0dddd689ff89183c languageName: node linkType: hard -"@safe-global/safe-apps-sdk@npm:^8.0.0": +"@safe-global/safe-apps-sdk@npm:^8.1.0": version: 8.1.0 resolution: "@safe-global/safe-apps-sdk@npm:8.1.0" dependencies: @@ -8017,6 +8231,15 @@ __metadata: languageName: node linkType: hard +"@solidity-parser/parser@npm:^0.16.2": + version: 0.16.2 + resolution: "@solidity-parser/parser@npm:0.16.2" + dependencies: + antlr4ts: ^0.5.0-alpha.4 + checksum: 109f7bec5de943c63e444fdde179d9bba6a592c18c836f585753798f428424cfcca72c715e7a345e4b79b83d6548543c9e56cb4b263e9b1e8352af2efcfd224a + languageName: node + linkType: hard + "@stablelib/aead@npm:^1.0.1": version: 1.0.1 resolution: "@stablelib/aead@npm:1.0.1" @@ -8671,9 +8894,9 @@ __metadata: languageName: node linkType: hard -"@typechain/ethers-v5@npm:^11.0.0": - version: 11.0.0 - resolution: "@typechain/ethers-v5@npm:11.0.0" +"@typechain/ethers-v5@npm:^11.1.2": + version: 11.1.2 + resolution: "@typechain/ethers-v5@npm:11.1.2" dependencies: lodash: ^4.17.15 ts-essentials: ^7.0.1 @@ -8681,9 +8904,9 @@ __metadata: "@ethersproject/abi": ^5.0.0 "@ethersproject/providers": ^5.0.0 ethers: ^5.1.3 - typechain: ^8.2.0 + typechain: ^8.3.2 typescript: ">=4.3.0" - checksum: 4f2986070b3e4492e64db308e437b887d73b689c9ddbf52c6f0874f3a7467b39fa53352172d8cd649568f9d44cb5393c92bdfc05f26cb917db1aa45fc0d5fe85 + checksum: 4f2d458306094c8e57bc0e05c86c1def210bd8b2cadd1062218cbc35fe3f6ac98aca08646c935a6fa5e57599be9fc0ddd2d4f7cf960fe28e27bf3ed58906c71f languageName: node linkType: hard @@ -8703,12 +8926,12 @@ __metadata: languageName: node linkType: hard -"@types/amqplib@npm:^0.10.1": - version: 0.10.1 - resolution: "@types/amqplib@npm:0.10.1" +"@types/amqplib@npm:^0.10.4": + version: 0.10.4 + resolution: "@types/amqplib@npm:0.10.4" dependencies: "@types/node": "*" - checksum: 9f7dd964d15df82f73c26e84f028a5fe91ee96878e34625cf09d0153079007d3d506fcf9d327463227e6e30a357e0220bfb0848fb40c121ccd795154004d3733 + checksum: 920362c9967d9ddc0fbc90ae519aec7f635857d9dba640619af504306070a8da9baf688cc75d416f2fd4f1c5bd3de766adacefb6e0546a1d18e8c40bdc1d25f0 languageName: node linkType: hard @@ -8790,12 +9013,12 @@ __metadata: languageName: node linkType: hard -"@types/busboy@npm:^1.5.0": - version: 1.5.0 - resolution: "@types/busboy@npm:1.5.0" +"@types/busboy@npm:^1.5.3": + version: 1.5.3 + resolution: "@types/busboy@npm:1.5.3" dependencies: "@types/node": "*" - checksum: ffa7bf25c0395f6927526b7d97e70cd2df789e4ca0d231e41855fb08542fa236891ce457d83cc50cac6e5cef6be092ab80597070dcf1413f736462690a23e987 + checksum: 1dbe097d318fe1eee4b91919cee7cb81e265867246df7c60994060e27c9e29eb989ac36cd6ecbd3f364e5992e840a1c6bb57c0cd1b8560af174cd4f48fdb2bdf languageName: node linkType: hard @@ -8820,13 +9043,20 @@ __metadata: languageName: node linkType: hard -"@types/chai@npm:*, @types/chai@npm:^4.3.5": +"@types/chai@npm:*": version: 4.3.5 resolution: "@types/chai@npm:4.3.5" checksum: c8f26a88c6b5b53a3275c7f5ff8f107028e3cbb9ff26795fff5f3d9dea07106a54ce9e2dce5e40347f7c4cc35657900aaf0c83934a25a1ae12e61e0f5516e431 languageName: node linkType: hard +"@types/chai@npm:^4.3.11": + version: 4.3.11 + resolution: "@types/chai@npm:4.3.11" + checksum: d0c05fe5d02b2e6bbca2bd4866a2ab20a59cf729bc04af0060e7a3277eaf2fb65651b90d4c74b0ebf1d152b4b1d49fa8e44143acef276a2bbaa7785fbe5642d3 + languageName: node + linkType: hard + "@types/cli-progress@npm:^3.11.0": version: 3.11.0 resolution: "@types/cli-progress@npm:3.11.0" @@ -9128,10 +9358,10 @@ __metadata: languageName: node linkType: hard -"@types/mocha@npm:^10.0.1": - version: 10.0.1 - resolution: "@types/mocha@npm:10.0.1" - checksum: 224ea9fce7b1734ccdb9aa99a622d902a538ce1847bca7fd22c5fb38adcf3ed536f50f48f587085db988a4bb3c2eb68f4b98e1cd6a38bc5547bd3bbbedc54495 +"@types/mocha@npm:^10.0.6": + version: 10.0.6 + resolution: "@types/mocha@npm:10.0.6" + checksum: f7c836cf6cf27dc0f5970d262591b56f2a3caeaec8cfdc612c12e1cfbb207f601f710ece207e935164d4e3343b93be5054d0db5544f31f453b3923775d82099f languageName: node linkType: hard @@ -9177,10 +9407,10 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^16.18.38": - version: 16.18.38 - resolution: "@types/node@npm:16.18.38" - checksum: a3baa141e49ce94486f083eea1240cf38479a73ba663e1bf3f52f85b466125821b6e3ea85ded38fde3901530aca4601291395a50eefcea533a4f3b45171bda28 +"@types/node@npm:^16.18.68": + version: 16.18.68 + resolution: "@types/node@npm:16.18.68" + checksum: 094ae9ed80eed2af4bd34d551467e307f2ecb6efb0f8b872feebfb9da5ea4b446c5883c9abe2349f8ea2b78bdacd8726a946c27c2a246676c4c330e41ccb9284 languageName: node linkType: hard @@ -9490,7 +9720,7 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^5.5.0, @typescript-eslint/eslint-plugin@npm:^5.58.0, @typescript-eslint/eslint-plugin@npm:^5.59.11": +"@typescript-eslint/eslint-plugin@npm:^5.5.0": version: 5.60.0 resolution: "@typescript-eslint/eslint-plugin@npm:5.60.0" dependencies: @@ -9514,6 +9744,30 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/eslint-plugin@npm:^5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/eslint-plugin@npm:5.62.0" + dependencies: + "@eslint-community/regexpp": ^4.4.0 + "@typescript-eslint/scope-manager": 5.62.0 + "@typescript-eslint/type-utils": 5.62.0 + "@typescript-eslint/utils": 5.62.0 + debug: ^4.3.4 + graphemer: ^1.4.0 + ignore: ^5.2.0 + natural-compare-lite: ^1.4.0 + semver: ^7.3.7 + tsutils: ^3.21.0 + peerDependencies: + "@typescript-eslint/parser": ^5.0.0 + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: fc104b389c768f9fa7d45a48c86d5c1ad522c1d0512943e782a56b1e3096b2cbcc1eea3fcc590647bf0658eef61aac35120a9c6daf979bf629ad2956deb516a1 + languageName: node + linkType: hard + "@typescript-eslint/experimental-utils@npm:^5.0.0": version: 5.60.0 resolution: "@typescript-eslint/experimental-utils@npm:5.60.0" @@ -9542,20 +9796,20 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.61.0": - version: 5.61.0 - resolution: "@typescript-eslint/parser@npm:5.61.0" +"@typescript-eslint/parser@npm:^5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/parser@npm:5.62.0" dependencies: - "@typescript-eslint/scope-manager": 5.61.0 - "@typescript-eslint/types": 5.61.0 - "@typescript-eslint/typescript-estree": 5.61.0 + "@typescript-eslint/scope-manager": 5.62.0 + "@typescript-eslint/types": 5.62.0 + "@typescript-eslint/typescript-estree": 5.62.0 debug: ^4.3.4 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 2422bca03ecc6830700aaa739ec46b8e9ab6c0a47a67f140dc6b62a42a8b98997e73bce52c6a010b8a9b461211c46ba865d5b7f680a7823cf5c245d3b61f7fd5 + checksum: d168f4c7f21a7a63f47002e2d319bcbb6173597af5c60c1cf2de046b46c76b4930a093619e69faf2d30214c29ab27b54dcf1efc7046a6a6bd6f37f59a990e752 languageName: node linkType: hard @@ -9569,13 +9823,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.61.0": - version: 5.61.0 - resolution: "@typescript-eslint/scope-manager@npm:5.61.0" +"@typescript-eslint/scope-manager@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/scope-manager@npm:5.62.0" dependencies: - "@typescript-eslint/types": 5.61.0 - "@typescript-eslint/visitor-keys": 5.61.0 - checksum: 6dfbb42c4b7d796ae3c395398bdfd2e5a4ae8aaf1448381278ecc39a1d1045af2cb452da5a00519d265bc1a5997523de22d5021acb4dbe1648502fe61512d3c6 + "@typescript-eslint/types": 5.62.0 + "@typescript-eslint/visitor-keys": 5.62.0 + checksum: 6062d6b797fe1ce4d275bb0d17204c827494af59b5eaf09d8a78cdd39dadddb31074dded4297aaf5d0f839016d601032857698b0e4516c86a41207de606e9573 languageName: node linkType: hard @@ -9596,6 +9850,23 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/type-utils@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/type-utils@npm:5.62.0" + dependencies: + "@typescript-eslint/typescript-estree": 5.62.0 + "@typescript-eslint/utils": 5.62.0 + debug: ^4.3.4 + tsutils: ^3.21.0 + peerDependencies: + eslint: "*" + peerDependenciesMeta: + typescript: + optional: true + checksum: fc41eece5f315dfda14320be0da78d3a971d650ea41300be7196934b9715f3fe1120a80207551eb71d39568275dbbcf359bde540d1ca1439d8be15e9885d2739 + languageName: node + linkType: hard + "@typescript-eslint/types@npm:5.60.0": version: 5.60.0 resolution: "@typescript-eslint/types@npm:5.60.0" @@ -9603,10 +9874,10 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:5.61.0": - version: 5.61.0 - resolution: "@typescript-eslint/types@npm:5.61.0" - checksum: d311ca2141f6bcb5f0f8f97ddbc218c9911e0735aaa30f0f2e64d518fb33568410754e1b04bf157175f8783504f8ec62a7ab53a66a18507f43edb1e21fe69e90 +"@typescript-eslint/types@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/types@npm:5.62.0" + checksum: 48c87117383d1864766486f24de34086155532b070f6264e09d0e6139449270f8a9559cfef3c56d16e3bcfb52d83d42105d61b36743626399c7c2b5e0ac3b670 languageName: node linkType: hard @@ -9628,12 +9899,12 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.61.0": - version: 5.61.0 - resolution: "@typescript-eslint/typescript-estree@npm:5.61.0" +"@typescript-eslint/typescript-estree@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/typescript-estree@npm:5.62.0" dependencies: - "@typescript-eslint/types": 5.61.0 - "@typescript-eslint/visitor-keys": 5.61.0 + "@typescript-eslint/types": 5.62.0 + "@typescript-eslint/visitor-keys": 5.62.0 debug: ^4.3.4 globby: ^11.1.0 is-glob: ^4.0.3 @@ -9642,11 +9913,11 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: efe25a1b2774939c02cb9b388cf72efa672811f1c39a87ddd617937f63c2320551ce459ba69c6d022e33322594d40b9f2d2c6bc9937387718adc40dc5e57ea8e + checksum: 3624520abb5807ed8f57b1197e61c7b1ed770c56dfcaca66372d584ff50175225798bccb701f7ef129d62c5989070e1ee3a0aa2d84e56d9524dcf011a2bb1a52 languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.60.0, @typescript-eslint/utils@npm:^5.58.0, @typescript-eslint/utils@npm:^5.59.11": +"@typescript-eslint/utils@npm:5.60.0, @typescript-eslint/utils@npm:^5.58.0": version: 5.60.0 resolution: "@typescript-eslint/utils@npm:5.60.0" dependencies: @@ -9664,6 +9935,24 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/utils@npm:5.62.0, @typescript-eslint/utils@npm:^5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/utils@npm:5.62.0" + dependencies: + "@eslint-community/eslint-utils": ^4.2.0 + "@types/json-schema": ^7.0.9 + "@types/semver": ^7.3.12 + "@typescript-eslint/scope-manager": 5.62.0 + "@typescript-eslint/types": 5.62.0 + "@typescript-eslint/typescript-estree": 5.62.0 + eslint-scope: ^5.1.1 + semver: ^7.3.7 + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + checksum: ee9398c8c5db6d1da09463ca7bf36ed134361e20131ea354b2da16a5fdb6df9ba70c62a388d19f6eebb421af1786dbbd79ba95ddd6ab287324fc171c3e28d931 + languageName: node + linkType: hard + "@typescript-eslint/visitor-keys@npm:5.60.0": version: 5.60.0 resolution: "@typescript-eslint/visitor-keys@npm:5.60.0" @@ -9674,13 +9963,20 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.61.0": - version: 5.61.0 - resolution: "@typescript-eslint/visitor-keys@npm:5.61.0" +"@typescript-eslint/visitor-keys@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/visitor-keys@npm:5.62.0" dependencies: - "@typescript-eslint/types": 5.61.0 + "@typescript-eslint/types": 5.62.0 eslint-visitor-keys: ^3.3.0 - checksum: a8d589f61ddfc380787218da4d347e8f9aef0f82f4a93f1daee46786bda889a90961c7ec1b470db5e3261438a728fdfd956f5bda6ee2de22c4be2d2152d6e270 + checksum: 976b05d103fe8335bef5c93ad3f76d781e3ce50329c0243ee0f00c0fcfb186c81df50e64bfdd34970148113f8ade90887f53e3c4938183afba830b4ba8e30a35 + languageName: node + linkType: hard + +"@ungap/structured-clone@npm:^1.2.0": + version: 1.2.0 + resolution: "@ungap/structured-clone@npm:1.2.0" + checksum: 4f656b7b4672f2ce6e272f2427d8b0824ed11546a601d8d5412b9d7704e83db38a8d9f402ecdf2b9063fc164af842ad0ec4a55819f621ed7e7ea4d1efcc74524 languageName: node linkType: hard @@ -9770,18 +10066,18 @@ __metadata: languageName: node linkType: hard -"@wagmi/connectors@npm:3.1.2": - version: 3.1.2 - resolution: "@wagmi/connectors@npm:3.1.2" +"@wagmi/connectors@npm:3.1.9": + version: 3.1.9 + resolution: "@wagmi/connectors@npm:3.1.9" dependencies: "@coinbase/wallet-sdk": ^3.6.6 "@ledgerhq/connect-kit-loader": ^1.1.0 - "@safe-global/safe-apps-provider": ^0.17.1 - "@safe-global/safe-apps-sdk": ^8.0.0 - "@walletconnect/ethereum-provider": 2.10.1 + "@safe-global/safe-apps-provider": ^0.18.1 + "@safe-global/safe-apps-sdk": ^8.1.0 + "@walletconnect/ethereum-provider": 2.10.6 "@walletconnect/legacy-provider": ^2.0.0 "@walletconnect/modal": 2.6.2 - "@walletconnect/utils": 2.10.1 + "@walletconnect/utils": 2.10.2 abitype: 0.8.7 eventemitter3: ^4.0.7 peerDependencies: @@ -9790,15 +10086,15 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 9e00708bafbd2735dafcadb40360fbbf8a90850f19d79172e7549bb4f9655dcdea20159638e1f0ed20c92beb6beb4fd0168cd946ef1c3fa271a1ed92f4265d5c + checksum: 95773a9617b17cae1adf818669a53126182087363cbbcd711b8452bb71b51b3173432993fbdfe9b0163489a32d8dcfee0735e2f02d646f8f5aeb9cdf9dcae5fc languageName: node linkType: hard -"@wagmi/core@npm:1.4.3": - version: 1.4.3 - resolution: "@wagmi/core@npm:1.4.3" +"@wagmi/core@npm:1.4.11": + version: 1.4.11 + resolution: "@wagmi/core@npm:1.4.11" dependencies: - "@wagmi/connectors": 3.1.2 + "@wagmi/connectors": 3.1.9 abitype: 0.8.7 eventemitter3: ^4.0.7 zustand: ^4.3.1 @@ -9808,31 +10104,31 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: a8a0622324076bc3087eb05eb1d74652511433bc68e1972e24f699018140508e56473760c5de0a56c92f621aed52ef7e683f3e0aca34aec5428464d28559c27f + checksum: a687ae63863772aaf2e3375c479c0fbefa77bfdfecc79faece2c595e706b9b1b2d917cfbd7b271210d02948d7e63879dd8b18923c11f77b8267ca8b67023f9b3 languageName: node linkType: hard -"@walletconnect/core@npm:2.10.1": - version: 2.10.1 - resolution: "@walletconnect/core@npm:2.10.1" +"@walletconnect/core@npm:2.10.6": + version: 2.10.6 + resolution: "@walletconnect/core@npm:2.10.6" dependencies: "@walletconnect/heartbeat": 1.2.1 "@walletconnect/jsonrpc-provider": 1.0.13 "@walletconnect/jsonrpc-types": 1.0.3 "@walletconnect/jsonrpc-utils": 1.0.8 - "@walletconnect/jsonrpc-ws-connection": 1.0.13 - "@walletconnect/keyvaluestorage": ^1.0.2 + "@walletconnect/jsonrpc-ws-connection": 1.0.14 + "@walletconnect/keyvaluestorage": ^1.1.1 "@walletconnect/logger": ^2.0.1 "@walletconnect/relay-api": ^1.0.9 "@walletconnect/relay-auth": ^1.0.4 "@walletconnect/safe-json": ^1.0.2 "@walletconnect/time": ^1.0.2 - "@walletconnect/types": 2.10.1 - "@walletconnect/utils": 2.10.1 + "@walletconnect/types": 2.10.6 + "@walletconnect/utils": 2.10.6 events: ^3.3.0 lodash.isequal: 4.5.0 uint8arrays: ^3.1.0 - checksum: d58ae15c53efe1792da8c7aa1b7ba47efb49807cfe0c73f225d59c5cd847a0e50979ce6965b94915812412deba3e5aa2dca13a02bd41c087e85575e99afad223 + checksum: 7ed74d0feaf4f4b332da2e82932340e6897e26910ae66c111e8724f41b15f14376fd9fd4b93ba9395107d24d2147932ef29bd7b7edce1bbde89e4258e8b2f574 languageName: node linkType: hard @@ -9870,25 +10166,21 @@ __metadata: languageName: node linkType: hard -"@walletconnect/ethereum-provider@npm:2.10.1": - version: 2.10.1 - resolution: "@walletconnect/ethereum-provider@npm:2.10.1" +"@walletconnect/ethereum-provider@npm:2.10.6": + version: 2.10.6 + resolution: "@walletconnect/ethereum-provider@npm:2.10.6" dependencies: "@walletconnect/jsonrpc-http-connection": ^1.0.7 "@walletconnect/jsonrpc-provider": ^1.0.13 "@walletconnect/jsonrpc-types": ^1.0.3 "@walletconnect/jsonrpc-utils": ^1.0.8 - "@walletconnect/sign-client": 2.10.1 - "@walletconnect/types": 2.10.1 - "@walletconnect/universal-provider": 2.10.1 - "@walletconnect/utils": 2.10.1 + "@walletconnect/modal": ^2.4.3 + "@walletconnect/sign-client": 2.10.6 + "@walletconnect/types": 2.10.6 + "@walletconnect/universal-provider": 2.10.6 + "@walletconnect/utils": 2.10.6 events: ^3.3.0 - peerDependencies: - "@walletconnect/modal": ">=2" - peerDependenciesMeta: - "@walletconnect/modal": - optional: true - checksum: ec3d88ba101a5d8f193262b5b1e770cccad6457ec56fa1f3d17fa531de4e07e8cf03a1341669122c61956f0d5c3a6eca57d3f12f524e046acddb401cdb76fe7c + checksum: 02452044400ef751358598aada659ce77ae69495f3b01f040a6888289d74d22a03c1736a4860a9e1157bc0211bbcde1e3b0eb01d4ff209c2bf14efe7172774c9 languageName: node linkType: hard @@ -9957,16 +10249,15 @@ __metadata: languageName: node linkType: hard -"@walletconnect/jsonrpc-ws-connection@npm:1.0.13": - version: 1.0.13 - resolution: "@walletconnect/jsonrpc-ws-connection@npm:1.0.13" +"@walletconnect/jsonrpc-ws-connection@npm:1.0.14": + version: 1.0.14 + resolution: "@walletconnect/jsonrpc-ws-connection@npm:1.0.14" dependencies: "@walletconnect/jsonrpc-utils": ^1.0.6 "@walletconnect/safe-json": ^1.0.2 events: ^3.3.0 - tslib: 1.14.1 ws: ^7.5.1 - checksum: f2253b17564f7622e69b1252830f05efdf7f4d58b120adb3a3e950c2087845171c912307c39948d0b869aa8610688b83f54f54de4657091f7431aea95a59f8b9 + checksum: a401e60b19390098183ef1b2a7b3e15c4dd3c64f9ac87fd2bbc0ae1f7fb31539ba542374ca021193efc4a2ae59fa3b04e588aed98cdf5c364f50524403d50f9f languageName: node linkType: hard @@ -9988,6 +10279,22 @@ __metadata: languageName: node linkType: hard +"@walletconnect/keyvaluestorage@npm:^1.1.1": + version: 1.1.1 + resolution: "@walletconnect/keyvaluestorage@npm:1.1.1" + dependencies: + "@walletconnect/safe-json": ^1.0.1 + idb-keyval: ^6.2.1 + unstorage: ^1.9.0 + peerDependencies: + "@react-native-async-storage/async-storage": 1.x + peerDependenciesMeta: + "@react-native-async-storage/async-storage": + optional: true + checksum: 7f85cb83963153417745367742070ccb78e03bd62adb549de57a7d5fae7bcfbd9a8f42b2f445ca76a3817ffacacc69d85bbf67757c3616ee7b3525f2f8a0faea + languageName: node + linkType: hard + "@walletconnect/legacy-client@npm:^2.0.0": version: 2.0.0 resolution: "@walletconnect/legacy-client@npm:2.0.0" @@ -10089,7 +10396,7 @@ __metadata: languageName: node linkType: hard -"@walletconnect/modal@npm:2.6.2": +"@walletconnect/modal@npm:2.6.2, @walletconnect/modal@npm:^2.4.3": version: 2.6.2 resolution: "@walletconnect/modal@npm:2.6.2" dependencies: @@ -10144,20 +10451,20 @@ __metadata: languageName: node linkType: hard -"@walletconnect/sign-client@npm:2.10.1": - version: 2.10.1 - resolution: "@walletconnect/sign-client@npm:2.10.1" +"@walletconnect/sign-client@npm:2.10.6": + version: 2.10.6 + resolution: "@walletconnect/sign-client@npm:2.10.6" dependencies: - "@walletconnect/core": 2.10.1 + "@walletconnect/core": 2.10.6 "@walletconnect/events": ^1.0.1 "@walletconnect/heartbeat": 1.2.1 "@walletconnect/jsonrpc-utils": 1.0.8 "@walletconnect/logger": ^2.0.1 "@walletconnect/time": ^1.0.2 - "@walletconnect/types": 2.10.1 - "@walletconnect/utils": 2.10.1 + "@walletconnect/types": 2.10.6 + "@walletconnect/utils": 2.10.6 events: ^3.3.0 - checksum: dbdced8dece73b20ae73df9c0cf0d9e3eee753f6c81e264c87583ca60d1d13d4f7d61944e4b22d1f70c5f32424fd842a7de778838aa7d0ae27195976a86e102f + checksum: 610dd354d53159eb26ec61d3399507ba63739d9070a458b3a791a944d8b62d9b55d487d3d41c68aa9af0052fc04daea0a05a2f5d664c6ff21cb89e0909a1323b languageName: node linkType: hard @@ -10170,9 +10477,9 @@ __metadata: languageName: node linkType: hard -"@walletconnect/types@npm:2.10.1": - version: 2.10.1 - resolution: "@walletconnect/types@npm:2.10.1" +"@walletconnect/types@npm:2.10.2": + version: 2.10.2 + resolution: "@walletconnect/types@npm:2.10.2" dependencies: "@walletconnect/events": ^1.0.1 "@walletconnect/heartbeat": 1.2.1 @@ -10180,30 +10487,44 @@ __metadata: "@walletconnect/keyvaluestorage": ^1.0.2 "@walletconnect/logger": ^2.0.1 events: ^3.3.0 - checksum: b663a236404bb423d3cc5cde656794ce42132f09193da5a51dac815d844f78eebb29c7275ebe10f6134492db21386ffd81b66ce42992332847b72c9128f74990 + checksum: dafcb840b2b93343db56ca6684edfe8a20d9b2f703f81b2d1fdbea558fe41de9fbddec12c24e9d51a50c75ee6298a1cfd347d7fa0202146033788670371cfd6a + languageName: node + linkType: hard + +"@walletconnect/types@npm:2.10.6": + version: 2.10.6 + resolution: "@walletconnect/types@npm:2.10.6" + dependencies: + "@walletconnect/events": ^1.0.1 + "@walletconnect/heartbeat": 1.2.1 + "@walletconnect/jsonrpc-types": 1.0.3 + "@walletconnect/keyvaluestorage": ^1.1.1 + "@walletconnect/logger": ^2.0.1 + events: ^3.3.0 + checksum: 84f411fd41debc310b4aae4969e5a78074f1f8cc937c4f1a6f92fa80775dd88bb400b365533396fc9325109a3c5dc4c4951615f2e265b5f82e9f454b17b96d5e languageName: node linkType: hard -"@walletconnect/universal-provider@npm:2.10.1": - version: 2.10.1 - resolution: "@walletconnect/universal-provider@npm:2.10.1" +"@walletconnect/universal-provider@npm:2.10.6": + version: 2.10.6 + resolution: "@walletconnect/universal-provider@npm:2.10.6" dependencies: "@walletconnect/jsonrpc-http-connection": ^1.0.7 "@walletconnect/jsonrpc-provider": 1.0.13 "@walletconnect/jsonrpc-types": ^1.0.2 "@walletconnect/jsonrpc-utils": ^1.0.7 "@walletconnect/logger": ^2.0.1 - "@walletconnect/sign-client": 2.10.1 - "@walletconnect/types": 2.10.1 - "@walletconnect/utils": 2.10.1 + "@walletconnect/sign-client": 2.10.6 + "@walletconnect/types": 2.10.6 + "@walletconnect/utils": 2.10.6 events: ^3.3.0 - checksum: a33ad597a7601157cd96bceb7637c3463a5df981e5548c5343ab84f92c542bd7cae577fb2884d549164c9ad8262b097dc5fc0bc7fd9a515ee7c3f30b271cb034 + checksum: c09fd28819389d990edafb261d0570d54527f0872dd3c2ac38ac0c6fc25905dc2248809fc4fea2de382b2f68c86eee8e1d192fb46402bcc49370d76959662436 languageName: node linkType: hard -"@walletconnect/utils@npm:2.10.1": - version: 2.10.1 - resolution: "@walletconnect/utils@npm:2.10.1" +"@walletconnect/utils@npm:2.10.2": + version: 2.10.2 + resolution: "@walletconnect/utils@npm:2.10.2" dependencies: "@stablelib/chacha20poly1305": 1.0.1 "@stablelib/hkdf": 1.0.1 @@ -10213,23 +10534,45 @@ __metadata: "@walletconnect/relay-api": ^1.0.9 "@walletconnect/safe-json": ^1.0.2 "@walletconnect/time": ^1.0.2 - "@walletconnect/types": 2.10.1 + "@walletconnect/types": 2.10.2 "@walletconnect/window-getters": ^1.0.1 "@walletconnect/window-metadata": ^1.0.1 detect-browser: 5.3.0 query-string: 7.1.3 uint8arrays: ^3.1.0 - checksum: 150d1a3c75ce0736ffc8ed8a844e3dc63476e556f7f308154ee6bc9d99e08907bc11a504b7ce3889951293b48d9eef4e32b84de1c7f27b7a84e6731a7bb65189 + checksum: 168e65d48ce6121f04f040662668fce63c8e42050c7c7d1da2948cf2e486657f8bf972f3386dc84251fcabf3626a26bb696e3363d55bc92826ec1602d7b493c7 languageName: node linkType: hard -"@walletconnect/window-getters@npm:^1.0.1": - version: 1.0.1 - resolution: "@walletconnect/window-getters@npm:1.0.1" +"@walletconnect/utils@npm:2.10.6": + version: 2.10.6 + resolution: "@walletconnect/utils@npm:2.10.6" dependencies: - tslib: 1.14.1 - checksum: fae312c4e1be5574d97f071de58e6aa0d0296869761499caf9d4a9a5fd2643458af32233a2120521b00873a599ff88457d405bd82ced5fb5bd6dc3191c07a3e5 - languageName: node + "@stablelib/chacha20poly1305": 1.0.1 + "@stablelib/hkdf": 1.0.1 + "@stablelib/random": ^1.0.2 + "@stablelib/sha256": 1.0.1 + "@stablelib/x25519": ^1.0.3 + "@walletconnect/relay-api": ^1.0.9 + "@walletconnect/safe-json": ^1.0.2 + "@walletconnect/time": ^1.0.2 + "@walletconnect/types": 2.10.6 + "@walletconnect/window-getters": ^1.0.1 + "@walletconnect/window-metadata": ^1.0.1 + detect-browser: 5.3.0 + query-string: 7.1.3 + uint8arrays: ^3.1.0 + checksum: f6543601897aaa00f7aa0178df1cb88cca8f06f65846d3f4be85c458e79d04c462ad45e1f38d3fc993fcfa4f77871c92308e81620d6256da8138ae10e4b7546c + languageName: node + linkType: hard + +"@walletconnect/window-getters@npm:^1.0.1": + version: 1.0.1 + resolution: "@walletconnect/window-getters@npm:1.0.1" + dependencies: + tslib: 1.14.1 + checksum: fae312c4e1be5574d97f071de58e6aa0d0296869761499caf9d4a9a5fd2643458af32233a2120521b00873a599ff88457d405bd82ced5fb5bd6dc3191c07a3e5 + languageName: node linkType: hard "@walletconnect/window-metadata@npm:^1.0.1": @@ -10750,6 +11093,15 @@ __metadata: languageName: node linkType: hard +"acorn@npm:^8.10.0, acorn@npm:^8.9.0": + version: 8.11.2 + resolution: "acorn@npm:8.11.2" + bin: + acorn: bin/acorn + checksum: 818450408684da89423e3daae24e4dc9b68692db8ab49ea4569c7c5abb7a3f23669438bf129cc81dfdada95e1c9b944ee1bfca2c57a05a4dc73834a612fbf6a7 + languageName: node + linkType: hard + "acorn@npm:^8.2.4, acorn@npm:^8.4.1, acorn@npm:^8.7.1, acorn@npm:^8.8.0, acorn@npm:^8.8.2": version: 8.9.0 resolution: "acorn@npm:8.9.0" @@ -10980,6 +11332,15 @@ __metadata: languageName: node linkType: hard +"ansi-escapes@npm:^5.0.0": + version: 5.0.0 + resolution: "ansi-escapes@npm:5.0.0" + dependencies: + type-fest: ^1.0.2 + checksum: d4b5eb8207df38367945f5dd2ef41e08c28edc192dc766ef18af6b53736682f49d8bfcfa4e4d6ecbc2e2f97c258fda084fb29a9e43b69170b71090f771afccac + languageName: node + linkType: hard + "ansi-html-community@npm:^0.0.8": version: 0.0.8 resolution: "ansi-html-community@npm:0.0.8" @@ -11117,7 +11478,7 @@ __metadata: languageName: node linkType: hard -"anymatch@npm:^3.0.3, anymatch@npm:~3.1.1, anymatch@npm:~3.1.2": +"anymatch@npm:^3.0.3, anymatch@npm:^3.1.3, anymatch@npm:~3.1.1, anymatch@npm:~3.1.2": version: 3.1.3 resolution: "anymatch@npm:3.1.3" dependencies: @@ -11150,6 +11511,13 @@ __metadata: languageName: node linkType: hard +"arch@npm:^2.2.0": + version: 2.2.0 + resolution: "arch@npm:2.2.0" + checksum: e21b7635029fe8e9cdd5a026f9a6c659103e63fff423834323cdf836a1bb240a72d0c39ca8c470f84643385cf581bd8eda2cad8bf493e27e54bd9783abe9101f + languageName: node + linkType: hard + "are-we-there-yet@npm:^3.0.0": version: 3.0.1 resolution: "are-we-there-yet@npm:3.0.1" @@ -11257,6 +11625,19 @@ __metadata: languageName: node linkType: hard +"array-includes@npm:^3.1.7": + version: 3.1.7 + resolution: "array-includes@npm:3.1.7" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 + get-intrinsic: ^1.2.1 + is-string: ^1.0.7 + checksum: 06f9e4598fac12a919f7c59a3f04f010ea07f0b7f0585465ed12ef528a60e45f374e79d1bddbb34cdd4338357d00023ddbd0ac18b0be36964f5e726e8965d7fc + languageName: node + linkType: hard + "array-union@npm:^2.1.0": version: 2.1.0 resolution: "array-union@npm:2.1.0" @@ -11271,6 +11652,19 @@ __metadata: languageName: node linkType: hard +"array.prototype.findlastindex@npm:^1.2.3": + version: 1.2.3 + resolution: "array.prototype.findlastindex@npm:1.2.3" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 + es-shim-unscopables: ^1.0.0 + get-intrinsic: ^1.2.1 + checksum: 31f35d7b370c84db56484618132041a9af401b338f51899c2e78ef7690fbba5909ee7ca3c59a7192085b328cc0c68c6fd1f6d1553db01a689a589ae510f3966e + languageName: node + linkType: hard + "array.prototype.flat@npm:^1.3.1": version: 1.3.1 resolution: "array.prototype.flat@npm:1.3.1" @@ -11283,6 +11677,18 @@ __metadata: languageName: node linkType: hard +"array.prototype.flat@npm:^1.3.2": + version: 1.3.2 + resolution: "array.prototype.flat@npm:1.3.2" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 + es-shim-unscopables: ^1.0.0 + checksum: 5d6b4bf102065fb3f43764bfff6feb3295d372ce89591e6005df3d0ce388527a9f03c909af6f2a973969a4d178ab232ffc9236654149173e0e187ec3a1a6b87b + languageName: node + linkType: hard + "array.prototype.flatmap@npm:^1.3.1": version: 1.3.1 resolution: "array.prototype.flatmap@npm:1.3.1" @@ -11295,6 +11701,18 @@ __metadata: languageName: node linkType: hard +"array.prototype.flatmap@npm:^1.3.2": + version: 1.3.2 + resolution: "array.prototype.flatmap@npm:1.3.2" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 + es-shim-unscopables: ^1.0.0 + checksum: ce09fe21dc0bcd4f30271f8144083aa8c13d4639074d6c8dc82054b847c7fc9a0c97f857491f4da19d4003e507172a78f4bcd12903098adac8b9cd374f734be3 + languageName: node + linkType: hard + "array.prototype.reduce@npm:^1.0.5": version: 1.0.5 resolution: "array.prototype.reduce@npm:1.0.5" @@ -11321,6 +11739,21 @@ __metadata: languageName: node linkType: hard +"arraybuffer.prototype.slice@npm:^1.0.2": + version: 1.0.2 + resolution: "arraybuffer.prototype.slice@npm:1.0.2" + dependencies: + array-buffer-byte-length: ^1.0.0 + call-bind: ^1.0.2 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 + get-intrinsic: ^1.2.1 + is-array-buffer: ^3.0.2 + is-shared-array-buffer: ^1.0.2 + checksum: c200faf437786f5b2c80d4564ff5481c886a16dee642ef02abdc7306c7edd523d1f01d1dd12b769c7eb42ac9bc53874510db19a92a2c035c0f6696172aafa5d3 + languageName: node + linkType: hard + "arrify@npm:^1.0.1": version: 1.0.1 resolution: "arrify@npm:1.0.1" @@ -12440,6 +12873,17 @@ __metadata: languageName: node linkType: hard +"call-bind@npm:^1.0.4, call-bind@npm:^1.0.5": + version: 1.0.5 + resolution: "call-bind@npm:1.0.5" + dependencies: + function-bind: ^1.1.2 + get-intrinsic: ^1.2.1 + set-function-length: ^1.1.1 + checksum: 449e83ecbd4ba48e7eaac5af26fea3b50f8f6072202c2dd7c5a6e7a6308f2421abe5e13a3bbd55221087f76320c5e09f25a8fdad1bab2b77c68ae74d92234ea5 + languageName: node + linkType: hard + "callsites@npm:^3.0.0": version: 3.1.0 resolution: "callsites@npm:3.1.0" @@ -12614,18 +13058,18 @@ __metadata: languageName: node linkType: hard -"chai@npm:^4.3.7": - version: 4.3.7 - resolution: "chai@npm:4.3.7" +"chai@npm:^4.3.10": + version: 4.3.10 + resolution: "chai@npm:4.3.10" dependencies: assertion-error: ^1.1.0 - check-error: ^1.0.2 - deep-eql: ^4.1.2 - get-func-name: ^2.0.0 - loupe: ^2.3.1 + check-error: ^1.0.3 + deep-eql: ^4.1.3 + get-func-name: ^2.0.2 + loupe: ^2.3.6 pathval: ^1.1.1 - type-detect: ^4.0.5 - checksum: 0bba7d267848015246a66995f044ce3f0ebc35e530da3cbdf171db744e14cbe301ab913a8d07caf7952b430257ccbb1a4a983c570a7c5748dc537897e5131f7c + type-detect: ^4.0.8 + checksum: 536668c60a0d985a0fbd94418028e388d243a925d7c5e858c7443e334753511614a3b6a124bac9ca077dfc4c37acc367d62f8c294960f440749536dc181dfc6d languageName: node linkType: hard @@ -12639,10 +13083,10 @@ __metadata: languageName: node linkType: hard -"chalk@npm:5.2.0, chalk@npm:^5.0.0": - version: 5.2.0 - resolution: "chalk@npm:5.2.0" - checksum: 03d8060277de6cf2fd567dc25fcf770593eb5bb85f460ce443e49255a30ff1242edd0c90a06a03803b0466ff0687a939b41db1757bec987113e83de89a003caa +"chalk@npm:5.3.0": + version: 5.3.0 + resolution: "chalk@npm:5.3.0" + checksum: 623922e077b7d1e9dedaea6f8b9e9352921f8ae3afe739132e0e00c275971bdd331268183b2628cf4ab1727c45ea1f28d7e24ac23ce1db1eb653c414ca8a5a80 languageName: node linkType: hard @@ -12680,6 +13124,13 @@ __metadata: languageName: node linkType: hard +"chalk@npm:^5.0.0": + version: 5.2.0 + resolution: "chalk@npm:5.2.0" + checksum: 03d8060277de6cf2fd567dc25fcf770593eb5bb85f460ce443e49255a30ff1242edd0c90a06a03803b0466ff0687a939b41db1757bec987113e83de89a003caa + languageName: node + linkType: hard + "change-case-all@npm:1.0.15": version: 1.0.15 resolution: "change-case-all@npm:1.0.15" @@ -12777,6 +13228,15 @@ __metadata: languageName: node linkType: hard +"check-error@npm:^1.0.3": + version: 1.0.3 + resolution: "check-error@npm:1.0.3" + dependencies: + get-func-name: ^2.0.2 + checksum: e2131025cf059b21080f4813e55b3c480419256914601750b0fee3bd9b2b8315b531e551ef12560419b8b6d92a3636511322752b1ce905703239e7cc451b6399 + languageName: node + linkType: hard + "check-types@npm:^11.1.1": version: 11.2.2 resolution: "check-types@npm:11.2.2" @@ -12867,6 +13327,15 @@ __metadata: languageName: node linkType: hard +"citty@npm:^0.1.3, citty@npm:^0.1.4": + version: 0.1.5 + resolution: "citty@npm:0.1.5" + dependencies: + consola: ^3.2.3 + checksum: 9a2379fd01345500f1eb2bcc33f5e60be8379551091b43a3ba4e3a39c63a92e41453dea542ab9f2528fe9e19177ff1453c01a845a74529292af34fdafd23a5f6 + languageName: node + linkType: hard + "cjs-module-lexer@npm:^1.0.0": version: 1.2.3 resolution: "cjs-module-lexer@npm:1.2.3" @@ -13048,6 +13517,17 @@ __metadata: languageName: node linkType: hard +"clipboardy@npm:^3.0.0": + version: 3.0.0 + resolution: "clipboardy@npm:3.0.0" + dependencies: + arch: ^2.2.0 + execa: ^5.1.1 + is-wsl: ^2.2.0 + checksum: 2c292acb59705494cbe07d7df7c8becff4f01651514d32ebd80f4aec2d20946d8f3824aac67ecdf2d09ef21fdf0eb24b6a7f033c137ccdceedc4661c54455c94 + languageName: node + linkType: hard + "cliui@npm:^5.0.0": version: 5.0.0 resolution: "cliui@npm:5.0.0" @@ -13122,6 +13602,13 @@ __metadata: languageName: node linkType: hard +"cluster-key-slot@npm:^1.1.0": + version: 1.1.2 + resolution: "cluster-key-slot@npm:1.1.2" + checksum: be0ad2d262502adc998597e83f9ded1b80f827f0452127c5a37b22dfca36bab8edf393f7b25bb626006fb9fb2436106939ede6d2d6ecf4229b96a47f27edd681 + languageName: node + linkType: hard + "cmd-shim@npm:^6.0.0": version: 6.0.1 resolution: "cmd-shim@npm:6.0.1" @@ -13209,7 +13696,7 @@ __metadata: languageName: node linkType: hard -"colorette@npm:^2.0.10, colorette@npm:^2.0.16, colorette@npm:^2.0.19, colorette@npm:^2.0.7": +"colorette@npm:^2.0.10, colorette@npm:^2.0.16, colorette@npm:^2.0.20, colorette@npm:^2.0.7": version: 2.0.20 resolution: "colorette@npm:2.0.20" checksum: 0c016fea2b91b733eb9f4bcdb580018f52c0bc0979443dad930e5037a968237ac53d9beb98e218d2e9235834f8eebce7f8e080422d6194e957454255bde71d3d @@ -13270,6 +13757,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:11.0.0": + version: 11.0.0 + resolution: "commander@npm:11.0.0" + checksum: 6621954e1e1d078b4991c1f5bbd9439ad37aa7768d6ab4842de1dbd4d222c8a27e1b8e62108b3a92988614af45031d5bb2a2aaa92951f4d0c934d1a1ac564bb4 + languageName: node + linkType: hard + "commander@npm:3.0.2": version: 3.0.2 resolution: "commander@npm:3.0.2" @@ -13416,6 +13910,13 @@ __metadata: languageName: node linkType: hard +"consola@npm:^3.2.3": + version: 3.2.3 + resolution: "consola@npm:3.2.3" + checksum: 32ec70e177dd2385c42e38078958cc7397be91db21af90c6f9faa0b16168b49b1c61d689338604bbb2d64370b9347a35f42a9197663a913d3a405bb0ce728499 + languageName: node + linkType: hard + "console-control-strings@npm:^1.1.0": version: 1.1.0 resolution: "console-control-strings@npm:1.1.0" @@ -13693,6 +14194,13 @@ __metadata: languageName: node linkType: hard +"cookie-es@npm:^1.0.0": + version: 1.0.0 + resolution: "cookie-es@npm:1.0.0" + checksum: e8721cf4d38f3e44049c9118874b323f4f674b1c5cef84a2b888f5bf86ad720ad17b51b43150cad7535a375c24e2921da603801ad28aa6125c3d36c031b41468 + languageName: node + linkType: hard + "cookie-signature@npm:1.0.6": version: 1.0.6 resolution: "cookie-signature@npm:1.0.6" @@ -13739,13 +14247,20 @@ __metadata: languageName: node linkType: hard -"core-js@npm:^3.0.1, core-js@npm:^3.19.2, core-js@npm:^3.31.0": +"core-js@npm:^3.0.1, core-js@npm:^3.19.2": version: 3.31.0 resolution: "core-js@npm:3.31.0" checksum: f7cf9b3010f7ca99c026d95b61743baca1a85512742ed2b67e8f65a72ac4f4fe0b90b00057783e886bdd39d3a295f42f845d33e7cba3973ed263df978343ab79 languageName: node linkType: hard +"core-js@npm:^3.34.0": + version: 3.34.0 + resolution: "core-js@npm:3.34.0" + checksum: 26b0d103716b33fc660ee8737da7bc9475fbc655f93bbf1360ab692966449d18f2fc393805095937283db9f919ca2aa5c88d86d16f2846217983ad7da707e31e + languageName: node + linkType: hard + "core-util-is@npm:1.0.2": version: 1.0.2 resolution: "core-util-is@npm:1.0.2" @@ -14443,7 +14958,7 @@ __metadata: languageName: node linkType: hard -"deep-eql@npm:^4.0.1, deep-eql@npm:^4.1.2": +"deep-eql@npm:^4.0.1, deep-eql@npm:^4.1.3": version: 4.1.3 resolution: "deep-eql@npm:4.1.3" dependencies: @@ -14498,6 +15013,17 @@ __metadata: languageName: node linkType: hard +"define-data-property@npm:^1.0.1, define-data-property@npm:^1.1.1": + version: 1.1.1 + resolution: "define-data-property@npm:1.1.1" + dependencies: + get-intrinsic: ^1.2.1 + gopd: ^1.0.1 + has-property-descriptors: ^1.0.0 + checksum: a29855ad3f0630ea82e3c5012c812efa6ca3078d5c2aa8df06b5f597c1cde6f7254692df41945851d903e05a1668607b6d34e778f402b9ff9ffb38111f1a3f0d + languageName: node + linkType: hard + "define-lazy-prop@npm:^2.0.0": version: 2.0.0 resolution: "define-lazy-prop@npm:2.0.0" @@ -14515,6 +15041,13 @@ __metadata: languageName: node linkType: hard +"defu@npm:^6.1.2, defu@npm:^6.1.3": + version: 6.1.3 + resolution: "defu@npm:6.1.3" + checksum: c857a0cf854632e8528dad36454fd1c812bff8f5f091d5a6892e75d7f6b76d8319afbbfb8c504daab84ac86e40037ff37c544d50f89ed5b5419ba1989a226777 + languageName: node + linkType: hard + "delay@npm:^5.0.0": version: 5.0.0 resolution: "delay@npm:5.0.0" @@ -14536,6 +15069,13 @@ __metadata: languageName: node linkType: hard +"denque@npm:^2.1.0": + version: 2.1.0 + resolution: "denque@npm:2.1.0" + checksum: 1d4ae1d05e59ac3a3481e7b478293f4b4c813819342273f3d5b826c7ffa9753c520919ba264f377e09108d24ec6cf0ec0ac729a5686cbb8f32d797126c5dae74 + languageName: node + linkType: hard + "depd@npm:2.0.0, depd@npm:^2.0.0": version: 2.0.0 resolution: "depd@npm:2.0.0" @@ -14571,6 +15111,13 @@ __metadata: languageName: node linkType: hard +"destr@npm:^2.0.1, destr@npm:^2.0.2": + version: 2.0.2 + resolution: "destr@npm:2.0.2" + checksum: cb63dd477d1c323f95650ce7784f1497466d68150ac0fddd6c99652be45c9dcb997d53fd5eb6c6fda6c0b2a5e5b4fc7fa3c3e18dace3d810ba4cf45d8b55bdd6 + languageName: node + linkType: hard + "destroy@npm:1.2.0": version: 1.2.0 resolution: "destroy@npm:1.2.0" @@ -15288,6 +15835,53 @@ __metadata: languageName: node linkType: hard +"es-abstract@npm:^1.22.1": + version: 1.22.3 + resolution: "es-abstract@npm:1.22.3" + dependencies: + array-buffer-byte-length: ^1.0.0 + arraybuffer.prototype.slice: ^1.0.2 + available-typed-arrays: ^1.0.5 + call-bind: ^1.0.5 + es-set-tostringtag: ^2.0.1 + es-to-primitive: ^1.2.1 + function.prototype.name: ^1.1.6 + get-intrinsic: ^1.2.2 + get-symbol-description: ^1.0.0 + globalthis: ^1.0.3 + gopd: ^1.0.1 + has-property-descriptors: ^1.0.0 + has-proto: ^1.0.1 + has-symbols: ^1.0.3 + hasown: ^2.0.0 + internal-slot: ^1.0.5 + is-array-buffer: ^3.0.2 + is-callable: ^1.2.7 + is-negative-zero: ^2.0.2 + is-regex: ^1.1.4 + is-shared-array-buffer: ^1.0.2 + is-string: ^1.0.7 + is-typed-array: ^1.1.12 + is-weakref: ^1.0.2 + object-inspect: ^1.13.1 + object-keys: ^1.1.1 + object.assign: ^4.1.4 + regexp.prototype.flags: ^1.5.1 + safe-array-concat: ^1.0.1 + safe-regex-test: ^1.0.0 + string.prototype.trim: ^1.2.8 + string.prototype.trimend: ^1.0.7 + string.prototype.trimstart: ^1.0.7 + typed-array-buffer: ^1.0.0 + typed-array-byte-length: ^1.0.0 + typed-array-byte-offset: ^1.0.0 + typed-array-length: ^1.0.4 + unbox-primitive: ^1.0.2 + which-typed-array: ^1.1.13 + checksum: b1bdc962856836f6e72be10b58dc128282bdf33771c7a38ae90419d920fc3b36cc5d2b70a222ad8016e3fc322c367bf4e9e89fc2bc79b7e933c05b218e83d79a + languageName: node + linkType: hard + "es-array-method-boxes-properly@npm:^1.0.0": version: 1.0.0 resolution: "es-array-method-boxes-properly@npm:1.0.0" @@ -15531,14 +16125,14 @@ __metadata: languageName: node linkType: hard -"eslint-config-prettier@npm:^8.8.0": - version: 8.8.0 - resolution: "eslint-config-prettier@npm:8.8.0" +"eslint-config-prettier@npm:^8.10.0": + version: 8.10.0 + resolution: "eslint-config-prettier@npm:8.10.0" peerDependencies: eslint: ">=7.0.0" bin: eslint-config-prettier: bin/cli.js - checksum: 1e94c3882c4d5e41e1dcfa2c368dbccbfe3134f6ac7d40101644d3bfbe3eb2f2ffac757f3145910b5eacf20c0e85e02b91293d3126d770cbf3dc390b3564681c + checksum: 153266badd477e49b0759816246b2132f1dbdb6c7f313ca60a9af5822fd1071c2bc5684a3720d78b725452bbac04bb130878b2513aea5e72b1b792de5a69fec8 languageName: node linkType: hard @@ -15589,6 +16183,17 @@ __metadata: languageName: node linkType: hard +"eslint-import-resolver-node@npm:^0.3.9": + version: 0.3.9 + resolution: "eslint-import-resolver-node@npm:0.3.9" + dependencies: + debug: ^3.2.7 + is-core-module: ^2.13.0 + resolve: ^1.22.4 + checksum: 439b91271236b452d478d0522a44482e8c8540bf9df9bd744062ebb89ab45727a3acd03366a6ba2bdbcde8f9f718bab7fe8db64688aca75acf37e04eafd25e22 + languageName: node + linkType: hard + "eslint-import-resolver-parcel@npm:^1.10.6": version: 1.10.6 resolution: "eslint-import-resolver-parcel@npm:1.10.6" @@ -15598,7 +16203,7 @@ __metadata: languageName: node linkType: hard -"eslint-module-utils@npm:^2.7.4": +"eslint-module-utils@npm:^2.7.4, eslint-module-utils@npm:^2.8.0": version: 2.8.0 resolution: "eslint-module-utils@npm:2.8.0" dependencies: @@ -15636,7 +16241,7 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-import@npm:^2.25.3, eslint-plugin-import@npm:^2.27.5": +"eslint-plugin-import@npm:^2.25.3": version: 2.27.5 resolution: "eslint-plugin-import@npm:2.27.5" dependencies: @@ -15661,6 +16266,33 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-import@npm:^2.29.0": + version: 2.29.0 + resolution: "eslint-plugin-import@npm:2.29.0" + dependencies: + array-includes: ^3.1.7 + array.prototype.findlastindex: ^1.2.3 + array.prototype.flat: ^1.3.2 + array.prototype.flatmap: ^1.3.2 + debug: ^3.2.7 + doctrine: ^2.1.0 + eslint-import-resolver-node: ^0.3.9 + eslint-module-utils: ^2.8.0 + hasown: ^2.0.0 + is-core-module: ^2.13.1 + is-glob: ^4.0.3 + minimatch: ^3.1.2 + object.fromentries: ^2.0.7 + object.groupby: ^1.0.1 + object.values: ^1.1.7 + semver: ^6.3.1 + tsconfig-paths: ^3.14.2 + peerDependencies: + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + checksum: 19ee541fb95eb7a796f3daebe42387b8d8262bbbcc4fd8a6e92f63a12035f3d2c6cb8bc0b6a70864fa14b1b50ed6b8e6eed5833e625e16cb6bb98b665beff269 + languageName: node + linkType: hard + "eslint-plugin-jest@npm:^25.3.0": version: 25.7.0 resolution: "eslint-plugin-jest@npm:25.7.0" @@ -15843,6 +16475,16 @@ __metadata: languageName: node linkType: hard +"eslint-scope@npm:^7.2.2": + version: 7.2.2 + resolution: "eslint-scope@npm:7.2.2" + dependencies: + esrecurse: ^4.3.0 + estraverse: ^5.2.0 + checksum: ec97dbf5fb04b94e8f4c5a91a7f0a6dd3c55e46bfc7bbcd0e3138c3a76977570e02ed89a1810c778dcd72072ff0e9621ba1379b4babe53921d71e2e4486fda3e + languageName: node + linkType: hard + "eslint-utils@npm:^2.0.0": version: 2.1.0 resolution: "eslint-utils@npm:2.1.0" @@ -15884,6 +16526,13 @@ __metadata: languageName: node linkType: hard +"eslint-visitor-keys@npm:^3.4.3": + version: 3.4.3 + resolution: "eslint-visitor-keys@npm:3.4.3" + checksum: 36e9ef87fca698b6fd7ca5ca35d7b2b6eeaaf106572e2f7fd31c12d3bfdaccdb587bba6d3621067e5aece31c8c3a348b93922ab8f7b2cbc6aaab5e1d89040c60 + languageName: node + linkType: hard + "eslint-webpack-plugin@npm:^3.1.1": version: 3.2.0 resolution: "eslint-webpack-plugin@npm:3.2.0" @@ -15900,7 +16549,7 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.3.0, eslint@npm:^8.38.0, eslint@npm:^8.43.0": +"eslint@npm:^8.3.0": version: 8.43.0 resolution: "eslint@npm:8.43.0" dependencies: @@ -15949,6 +16598,54 @@ __metadata: languageName: node linkType: hard +"eslint@npm:^8.55.0": + version: 8.55.0 + resolution: "eslint@npm:8.55.0" + dependencies: + "@eslint-community/eslint-utils": ^4.2.0 + "@eslint-community/regexpp": ^4.6.1 + "@eslint/eslintrc": ^2.1.4 + "@eslint/js": 8.55.0 + "@humanwhocodes/config-array": ^0.11.13 + "@humanwhocodes/module-importer": ^1.0.1 + "@nodelib/fs.walk": ^1.2.8 + "@ungap/structured-clone": ^1.2.0 + ajv: ^6.12.4 + chalk: ^4.0.0 + cross-spawn: ^7.0.2 + debug: ^4.3.2 + doctrine: ^3.0.0 + escape-string-regexp: ^4.0.0 + eslint-scope: ^7.2.2 + eslint-visitor-keys: ^3.4.3 + espree: ^9.6.1 + esquery: ^1.4.2 + esutils: ^2.0.2 + fast-deep-equal: ^3.1.3 + file-entry-cache: ^6.0.1 + find-up: ^5.0.0 + glob-parent: ^6.0.2 + globals: ^13.19.0 + graphemer: ^1.4.0 + ignore: ^5.2.0 + imurmurhash: ^0.1.4 + is-glob: ^4.0.0 + is-path-inside: ^3.0.3 + js-yaml: ^4.1.0 + json-stable-stringify-without-jsonify: ^1.0.1 + levn: ^0.4.1 + lodash.merge: ^4.6.2 + minimatch: ^3.1.2 + natural-compare: ^1.4.0 + optionator: ^0.9.3 + strip-ansi: ^6.0.1 + text-table: ^0.2.0 + bin: + eslint: bin/eslint.js + checksum: 83f82a604559dc1faae79d28fdf3dfc9e592ca221052e2ea516e1b379b37e77e4597705a16880e2f5ece4f79087c1dd13fd7f6e9746f794a401175519db18b41 + languageName: node + linkType: hard + "esm@npm:^3.2.25": version: 3.2.25 resolution: "esm@npm:3.2.25" @@ -15967,6 +16664,17 @@ __metadata: languageName: node linkType: hard +"espree@npm:^9.6.0, espree@npm:^9.6.1": + version: 9.6.1 + resolution: "espree@npm:9.6.1" + dependencies: + acorn: ^8.9.0 + acorn-jsx: ^5.3.2 + eslint-visitor-keys: ^3.4.1 + checksum: eb8c149c7a2a77b3f33a5af80c10875c3abd65450f60b8af6db1bfcfa8f101e21c1e56a561c6dc13b848e18148d43469e7cd208506238554fb5395a9ea5a1ab9 + languageName: node + linkType: hard + "esprima@npm:2.7.x, esprima@npm:^2.7.1": version: 2.7.3 resolution: "esprima@npm:2.7.3" @@ -16328,6 +17036,13 @@ __metadata: languageName: node linkType: hard +"eventemitter3@npm:^5.0.1": + version: 5.0.1 + resolution: "eventemitter3@npm:5.0.1" + checksum: 543d6c858ab699303c3c32e0f0f47fc64d360bf73c3daf0ac0b5079710e340d6fe9f15487f94e66c629f5f82cd1a8678d692f3dbb6f6fcd1190e1b97fcad36f8 + languageName: node + linkType: hard + "events@npm:3.3.0, events@npm:^3.2.0, events@npm:^3.3.0": version: 3.3.0 resolution: "events@npm:3.3.0" @@ -16363,37 +17078,37 @@ __metadata: languageName: node linkType: hard -"execa@npm:^6.1.0": - version: 6.1.0 - resolution: "execa@npm:6.1.0" +"execa@npm:7.2.0": + version: 7.2.0 + resolution: "execa@npm:7.2.0" dependencies: cross-spawn: ^7.0.3 get-stream: ^6.0.1 - human-signals: ^3.0.1 + human-signals: ^4.3.0 is-stream: ^3.0.0 merge-stream: ^2.0.0 npm-run-path: ^5.1.0 onetime: ^6.0.0 signal-exit: ^3.0.7 strip-final-newline: ^3.0.0 - checksum: 1a4af799839134f5c72eb63d525b87304c1114a63aa71676c91d57ccef2e26f2f53e14c11384ab11c4ec479be1efa83d11c8190e00040355c2c5c3364327fa8e + checksum: 14fd17ba0ca8c87b277584d93b1d9fc24f2a65e5152b31d5eb159a3b814854283eaae5f51efa9525e304447e2f757c691877f7adff8fde5746aae67eb1edd1cc languageName: node linkType: hard -"execa@npm:^7.0.0": - version: 7.1.1 - resolution: "execa@npm:7.1.1" +"execa@npm:^6.1.0": + version: 6.1.0 + resolution: "execa@npm:6.1.0" dependencies: cross-spawn: ^7.0.3 get-stream: ^6.0.1 - human-signals: ^4.3.0 + human-signals: ^3.0.1 is-stream: ^3.0.0 merge-stream: ^2.0.0 npm-run-path: ^5.1.0 onetime: ^6.0.0 signal-exit: ^3.0.7 strip-final-newline: ^3.0.0 - checksum: 21fa46fc69314ace4068cf820142bdde5b643a5d89831c2c9349479c1555bff137a291b8e749e7efca36535e4e0a8c772c11008ca2e84d2cbd6ca141a3c8f937 + checksum: 1a4af799839134f5c72eb63d525b87304c1114a63aa71676c91d57ccef2e26f2f53e14c11384ab11c4ec479be1efa83d11c8190e00040355c2c5c3364327fa8e languageName: node linkType: hard @@ -17248,6 +17963,13 @@ __metadata: languageName: node linkType: hard +"function-bind@npm:^1.1.2": + version: 1.1.2 + resolution: "function-bind@npm:1.1.2" + checksum: 2b0ff4ce708d99715ad14a6d1f894e2a83242e4a52ccfcefaee5e40050562e5f6dafc1adbb4ce2d4ab47279a45dc736ab91ea5042d843c3c092820dfe032efb1 + languageName: node + linkType: hard + "function.prototype.name@npm:^1.1.5": version: 1.1.5 resolution: "function.prototype.name@npm:1.1.5" @@ -17260,6 +17982,18 @@ __metadata: languageName: node linkType: hard +"function.prototype.name@npm:^1.1.6": + version: 1.1.6 + resolution: "function.prototype.name@npm:1.1.6" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 + functions-have-names: ^1.2.3 + checksum: 7a3f9bd98adab09a07f6e1f03da03d3f7c26abbdeaeee15223f6c04a9fb5674792bdf5e689dac19b97ac71de6aad2027ba3048a9b883aa1b3173eed6ab07f479 + languageName: node + linkType: hard + "functional-red-black-tree@npm:^1.0.1": version: 1.0.1 resolution: "functional-red-black-tree@npm:1.0.1" @@ -17304,10 +18038,10 @@ __metadata: languageName: node linkType: hard -"get-func-name@npm:^2.0.0": - version: 2.0.0 - resolution: "get-func-name@npm:2.0.0" - checksum: 8d82e69f3e7fab9e27c547945dfe5cc0c57fc0adf08ce135dddb01081d75684a03e7a0487466f478872b341d52ac763ae49e660d01ab83741f74932085f693c3 +"get-func-name@npm:^2.0.1, get-func-name@npm:^2.0.2": + version: 2.0.2 + resolution: "get-func-name@npm:2.0.2" + checksum: 3f62f4c23647de9d46e6f76d2b3eafe58933a9b3830c60669e4180d6c601ce1b4aa310ba8366143f55e52b139f992087a9f0647274e8745621fa2af7e0acf13b languageName: node linkType: hard @@ -17323,6 +18057,18 @@ __metadata: languageName: node linkType: hard +"get-intrinsic@npm:^1.2.1, get-intrinsic@npm:^1.2.2": + version: 1.2.2 + resolution: "get-intrinsic@npm:1.2.2" + dependencies: + function-bind: ^1.1.2 + has-proto: ^1.0.1 + has-symbols: ^1.0.3 + hasown: ^2.0.0 + checksum: 447ff0724df26829908dc033b62732359596fcf66027bc131ab37984afb33842d9cd458fd6cecadfe7eac22fd8a54b349799ed334cf2726025c921c7250e7417 + languageName: node + linkType: hard + "get-iterator@npm:^1.0.2": version: 1.0.2 resolution: "get-iterator@npm:1.0.2" @@ -17358,6 +18104,13 @@ __metadata: languageName: node linkType: hard +"get-port-please@npm:^3.1.1": + version: 3.1.1 + resolution: "get-port-please@npm:3.1.1" + checksum: e2b0b3822e5a5a37994a0bd1c708eb220ca47fd4b29adbc6ba076fb378d4706c07eba4d382a8283f6534e870f9081a58f923a9f873f7d1f298f5fae386470211 + languageName: node + linkType: hard + "get-port@npm:^3.1.0": version: 3.2.0 resolution: "get-port@npm:3.2.0" @@ -17906,6 +18659,22 @@ __metadata: languageName: node linkType: hard +"h3@npm:^1.8.1, h3@npm:^1.8.2": + version: 1.9.0 + resolution: "h3@npm:1.9.0" + dependencies: + cookie-es: ^1.0.0 + defu: ^6.1.3 + destr: ^2.0.2 + iron-webcrypto: ^1.0.0 + radix3: ^1.1.0 + ufo: ^1.3.2 + uncrypto: ^0.1.3 + unenv: ^1.7.4 + checksum: 7305163b6fa4ecd7d14fce85e6372fae3580728957c8c021fa6b18176ce5e0cbfcc07c523bafcf7b34e895d2dab3ba731a11af43282faee4f2c8a331ec144f51 + languageName: node + linkType: hard + "hamt-sharding@npm:^2.0.0": version: 2.0.1 resolution: "hamt-sharding@npm:2.0.1" @@ -18074,9 +18843,9 @@ __metadata: languageName: node linkType: hard -"hardhat-tracer@npm:^2.5.0": - version: 2.5.0 - resolution: "hardhat-tracer@npm:2.5.0" +"hardhat-tracer@npm:^2.7.0": + version: 2.7.0 + resolution: "hardhat-tracer@npm:2.7.0" dependencies: chalk: ^4.1.2 debug: ^4.3.4 @@ -18084,7 +18853,7 @@ __metadata: peerDependencies: chai: 4.x hardhat: ">=2.16 <3.x" - checksum: b270d2346631a8add64b68c3770f2a968dbade16c78ac003cfd2071c771b86f181f0cb8b1f98e261c858bef854579fb60b2ace33bff49cb78814984b13c9fe8c + checksum: 9d2fa6a3d838684d681186225b44413959533dbf5d48e4f7fc9743117c15a36af918f283bf40f5a645665593c5a5081c86e924bf3f2333427c9b4627d8534485 languageName: node linkType: hard @@ -18099,9 +18868,9 @@ __metadata: languageName: node linkType: hard -"hardhat@npm:^2.15.0": - version: 2.18.2 - resolution: "hardhat@npm:2.18.2" +"hardhat@npm:^2.19.2": + version: 2.19.2 + resolution: "hardhat@npm:2.19.2" dependencies: "@ethersproject/abi": ^5.1.2 "@metamask/eth-sig-util": ^4.0.0 @@ -18161,7 +18930,7 @@ __metadata: optional: true bin: hardhat: internal/cli/bootstrap.js - checksum: b234ec9c4030ee91c0c91b78acbebf7fd6354ea46c7a5d1ced245b2e0e6045996d130944e6d2d5b2139fb53895a15c5eb054ab76571f9835e2021d9f70beccbe + checksum: 0b5499890e46750ca8c51bbe1205599b1424a2e5293b40c9f7cb56320d56b9935fbd4e276de370e07664ae81fa57dc7ab227bf2b2363f5732ef9f06df1a9a6d9 languageName: node linkType: hard @@ -18295,6 +19064,15 @@ __metadata: languageName: node linkType: hard +"hasown@npm:^2.0.0": + version: 2.0.0 + resolution: "hasown@npm:2.0.0" + dependencies: + function-bind: ^1.1.2 + checksum: 6151c75ca12554565098641c98a40f4cc86b85b0fd5b6fe92360967e4605a4f9610f7757260b4e8098dd1c2ce7f4b095f2006fe72a570e3b6d2d28de0298c176 + languageName: node + linkType: hard + "hast-util-whitespace@npm:^2.0.0": version: 2.0.1 resolution: "hast-util-whitespace@npm:2.0.1" @@ -18644,6 +19422,13 @@ __metadata: languageName: node linkType: hard +"http-shutdown@npm:^1.2.2": + version: 1.2.2 + resolution: "http-shutdown@npm:1.2.2" + checksum: 5dccd94f4fe4f51f9cbd7ec4586121160cd6470728e581662ea8032724440d891c4c92b8210b871ac468adadb3c99c40098ad0f752a781a550abae49dfa26206 + languageName: node + linkType: hard + "http-signature@npm:~1.2.0": version: 1.2.0 resolution: "http-signature@npm:1.2.0" @@ -18765,7 +19550,7 @@ __metadata: languageName: node linkType: hard -"idb-keyval@npm:^6.0.3": +"idb-keyval@npm:^6.0.3, idb-keyval@npm:^6.2.1": version: 6.2.1 resolution: "idb-keyval@npm:6.2.1" checksum: 7c0836f832096086e99258167740181132a71dd2694c8b8454a4f5ec69114ba6d70983115153306f0b6de1c8d3bad04f67eed3dff8f50c96815b9985d6d78470 @@ -19100,6 +19885,23 @@ __metadata: languageName: node linkType: hard +"ioredis@npm:^5.3.2": + version: 5.3.2 + resolution: "ioredis@npm:5.3.2" + dependencies: + "@ioredis/commands": ^1.1.1 + cluster-key-slot: ^1.1.0 + debug: ^4.3.4 + denque: ^2.1.0 + lodash.defaults: ^4.2.0 + lodash.isarguments: ^3.1.0 + redis-errors: ^1.2.0 + redis-parser: ^3.0.0 + standard-as-callback: ^2.1.0 + checksum: 9a23559133e862a768778301efb68ae8c2af3c33562174b54a4c2d6574b976e85c75a4c34857991af733e35c48faf4c356e7daa8fb0a3543d85ff1768c8754bc + languageName: node + linkType: hard + "ip-regex@npm:^4.0.0": version: 4.3.0 resolution: "ip-regex@npm:4.3.0" @@ -19432,6 +20234,13 @@ __metadata: languageName: node linkType: hard +"iron-webcrypto@npm:^1.0.0": + version: 1.0.0 + resolution: "iron-webcrypto@npm:1.0.0" + checksum: bbd96cbbfec7d072296bc7464763b96555bdadb12aca50f1f1c7e4fcdc6acb102bc3488333e924f94404dd50eda24f84b67ad28323b9138ec7255a023e8dc19e + languageName: node + linkType: hard + "is-absolute@npm:^1.0.0": version: 1.0.0 resolution: "is-absolute@npm:1.0.0" @@ -19521,6 +20330,15 @@ __metadata: languageName: node linkType: hard +"is-core-module@npm:^2.13.0, is-core-module@npm:^2.13.1": + version: 2.13.1 + resolution: "is-core-module@npm:2.13.1" + dependencies: + hasown: ^2.0.0 + checksum: 256559ee8a9488af90e4bad16f5583c6d59e92f0742e9e8bb4331e758521ee86b810b93bae44f390766ffbc518a0488b18d9dab7da9a5ff997d499efc9403f7c + languageName: node + linkType: hard + "is-date-object@npm:^1.0.1": version: 1.0.5 resolution: "is-date-object@npm:1.0.5" @@ -19893,6 +20711,15 @@ __metadata: languageName: node linkType: hard +"is-typed-array@npm:^1.1.12": + version: 1.1.12 + resolution: "is-typed-array@npm:1.1.12" + dependencies: + which-typed-array: ^1.1.11 + checksum: 4c89c4a3be07186caddadf92197b17fda663a9d259ea0d44a85f171558270d36059d1c386d34a12cba22dfade5aba497ce22778e866adc9406098c8fc4771796 + languageName: node + linkType: hard + "is-typedarray@npm:1.0.0, is-typedarray@npm:^1.0.0, is-typedarray@npm:~1.0.0": version: 1.0.0 resolution: "is-typedarray@npm:1.0.0" @@ -20960,6 +21787,15 @@ __metadata: languageName: node linkType: hard +"jiti@npm:^1.20.0": + version: 1.21.0 + resolution: "jiti@npm:1.21.0" + bin: + jiti: bin/jiti.js + checksum: a7bd5d63921c170eaec91eecd686388181c7828e1fa0657ab374b9372bfc1f383cf4b039e6b272383d5cb25607509880af814a39abdff967322459cca41f2961 + languageName: node + linkType: hard + "jose@npm:^4.11.4": version: 4.14.4 resolution: "jose@npm:4.14.4" @@ -21232,6 +22068,13 @@ __metadata: languageName: node linkType: hard +"jsonc-parser@npm:^3.2.0": + version: 3.2.0 + resolution: "jsonc-parser@npm:3.2.0" + checksum: 946dd9a5f326b745aa326d48a7257e3f4a4b62c5e98ec8e49fa2bdd8d96cef7e6febf1399f5c7016114fd1f68a1c62c6138826d5d90bc650448e3cf0951c53c7 + languageName: node + linkType: hard + "jsonfile@npm:^2.1.0": version: 2.4.0 resolution: "jsonfile@npm:2.4.0" @@ -21382,7 +22225,7 @@ __metadata: buffer: ^5.5.0 conventional-changelog-cli: ^2.2.2 husky: ^8.0.3 - lint-staged: ^13.2.2 + lint-staged: ^13.3.0 process: ^0.11.10 languageName: unknown linkType: soft @@ -21619,26 +22462,51 @@ __metadata: languageName: node linkType: hard -"lint-staged@npm:^13.2.2": - version: 13.2.2 - resolution: "lint-staged@npm:13.2.2" +"lint-staged@npm:^13.3.0": + version: 13.3.0 + resolution: "lint-staged@npm:13.3.0" dependencies: - chalk: 5.2.0 - cli-truncate: ^3.1.0 - commander: ^10.0.0 - debug: ^4.3.4 - execa: ^7.0.0 + chalk: 5.3.0 + commander: 11.0.0 + debug: 4.3.4 + execa: 7.2.0 lilconfig: 2.1.0 - listr2: ^5.0.7 - micromatch: ^4.0.5 - normalize-path: ^3.0.0 - object-inspect: ^1.12.3 - pidtree: ^0.6.0 - string-argv: ^0.3.1 - yaml: ^2.2.2 + listr2: 6.6.1 + micromatch: 4.0.5 + pidtree: 0.6.0 + string-argv: 0.3.2 + yaml: 2.3.1 bin: lint-staged: bin/lint-staged.js - checksum: f34f6e2e85e827364658ab8717bf8b35239473c2d4959d746b053a4cf158ac657348444c755820a8ef3eac2d4753a37c52e9db3e201ee20b085f26d2f2fbc9ed + checksum: f7c146cc2849c9ce4f1d2808d990fcbdef5e0bb79e6e79cc895f53c91f5ac4dcefdb8c3465156b38a015dcb051f2795c6bda4f20a1e2f2fa654c7ba521b2d2e0 + languageName: node + linkType: hard + +"listhen@npm:^1.5.5": + version: 1.5.5 + resolution: "listhen@npm:1.5.5" + dependencies: + "@parcel/watcher": ^2.3.0 + "@parcel/watcher-wasm": 2.3.0 + citty: ^0.1.4 + clipboardy: ^3.0.0 + consola: ^3.2.3 + defu: ^6.1.2 + get-port-please: ^3.1.1 + h3: ^1.8.1 + http-shutdown: ^1.2.2 + jiti: ^1.20.0 + mlly: ^1.4.2 + node-forge: ^1.3.1 + pathe: ^1.1.1 + std-env: ^3.4.3 + ufo: ^1.3.0 + untun: ^0.1.2 + uqr: ^0.1.2 + bin: + listen: bin/listhen.mjs + listhen: bin/listhen.mjs + checksum: 2d4a9d9d25b41e1569b50f0c7c72004dacb35ced91b0de943734f4e2f828fdeea890d9f5ab48c37133b06ee1f188ee1d335ae6dbb5dee6a86c21740aa309f485 languageName: node linkType: hard @@ -21679,37 +22547,35 @@ __metadata: languageName: node linkType: hard -"listr2@npm:^4.0.5": - version: 4.0.5 - resolution: "listr2@npm:4.0.5" +"listr2@npm:6.6.1": + version: 6.6.1 + resolution: "listr2@npm:6.6.1" dependencies: - cli-truncate: ^2.1.0 - colorette: ^2.0.16 - log-update: ^4.0.0 - p-map: ^4.0.0 + cli-truncate: ^3.1.0 + colorette: ^2.0.20 + eventemitter3: ^5.0.1 + log-update: ^5.0.1 rfdc: ^1.3.0 - rxjs: ^7.5.5 - through: ^2.3.8 - wrap-ansi: ^7.0.0 + wrap-ansi: ^8.1.0 peerDependencies: enquirer: ">= 2.3.0 < 3" peerDependenciesMeta: enquirer: optional: true - checksum: 7af31851abe25969ef0581c6db808117e36af15b131401795182427769d9824f451ba9e8aff6ccd25b6a4f6c8796f816292caf08e5f1f9b1775e8e9c313dc6c5 + checksum: 99600e8a51f838f7208bce7e16d6b3d91d361f13881e6aa91d0b561a9a093ddcf63b7bc2a7b47aec7fdbff9d0e8c9f68cb66e6dfe2d857e5b1df8ab045c26ce8 languageName: node linkType: hard -"listr2@npm:^5.0.7": - version: 5.0.8 - resolution: "listr2@npm:5.0.8" +"listr2@npm:^4.0.5": + version: 4.0.5 + resolution: "listr2@npm:4.0.5" dependencies: cli-truncate: ^2.1.0 - colorette: ^2.0.19 + colorette: ^2.0.16 log-update: ^4.0.0 p-map: ^4.0.0 rfdc: ^1.3.0 - rxjs: ^7.8.0 + rxjs: ^7.5.5 through: ^2.3.8 wrap-ansi: ^7.0.0 peerDependencies: @@ -21717,7 +22583,7 @@ __metadata: peerDependenciesMeta: enquirer: optional: true - checksum: 8be9f5632627c4df0dc33f452c98d415a49e5f1614650d3cab1b103c33e95f2a7a0e9f3e1e5de00d51bf0b4179acd8ff11b25be77dbe097cf3773c05e728d46c + checksum: 7af31851abe25969ef0581c6db808117e36af15b131401795182427769d9824f451ba9e8aff6ccd25b6a4f6c8796f816292caf08e5f1f9b1775e8e9c313dc6c5 languageName: node linkType: hard @@ -21945,6 +22811,20 @@ __metadata: languageName: node linkType: hard +"lodash.defaults@npm:^4.2.0": + version: 4.2.0 + resolution: "lodash.defaults@npm:4.2.0" + checksum: 84923258235592c8886e29de5491946ff8c2ae5c82a7ac5cddd2e3cb697e6fbdfbbb6efcca015795c86eec2bb953a5a2ee4016e3735a3f02720428a40efbb8f1 + languageName: node + linkType: hard + +"lodash.isarguments@npm:^3.1.0": + version: 3.1.0 + resolution: "lodash.isarguments@npm:3.1.0" + checksum: ae1526f3eb5c61c77944b101b1f655f846ecbedcb9e6b073526eba6890dc0f13f09f72e11ffbf6540b602caee319af9ac363d6cdd6be41f4ee453436f04f13b5 + languageName: node + linkType: hard + "lodash.isequal@npm:4.5.0": version: 4.5.0 resolution: "lodash.isequal@npm:4.5.0" @@ -22188,6 +23068,19 @@ __metadata: languageName: node linkType: hard +"log-update@npm:^5.0.1": + version: 5.0.1 + resolution: "log-update@npm:5.0.1" + dependencies: + ansi-escapes: ^5.0.0 + cli-cursor: ^4.0.0 + slice-ansi: ^5.0.0 + strip-ansi: ^7.0.1 + wrap-ansi: ^8.0.1 + checksum: 2c6b47dcce6f9233df6d232a37d9834cb3657a0749ef6398f1706118de74c55f158587d4128c225297ea66803f35c5ac3db4f3f617046d817233c45eedc32ef1 + languageName: node + linkType: hard + "long@npm:^4.0.0": version: 4.0.0 resolution: "long@npm:4.0.0" @@ -22213,12 +23106,12 @@ __metadata: languageName: node linkType: hard -"loupe@npm:^2.3.1": - version: 2.3.6 - resolution: "loupe@npm:2.3.6" +"loupe@npm:^2.3.6": + version: 2.3.7 + resolution: "loupe@npm:2.3.7" dependencies: - get-func-name: ^2.0.0 - checksum: cc83f1b124a1df7384601d72d8d1f5fe95fd7a8185469fec48bb2e4027e45243949e7a013e8d91051a138451ff0552310c32aa9786e60b6a30d1e801bdc2163f + get-func-name: ^2.0.1 + checksum: 96c058ec7167598e238bb7fb9def2f9339215e97d6685d9c1e3e4bdb33d14600e11fe7a812cf0c003dfb73ca2df374f146280b2287cae9e8d989e9d7a69a203b languageName: node linkType: hard @@ -22247,6 +23140,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^10.0.2": + version: 10.1.0 + resolution: "lru-cache@npm:10.1.0" + checksum: 58056d33e2500fbedce92f8c542e7c11b50d7d086578f14b7074d8c241422004af0718e08a6eaae8705cee09c77e39a61c1c79e9370ba689b7010c152e6a76ab + languageName: node + linkType: hard + "lru-cache@npm:^4.1.2": version: 4.1.5 resolution: "lru-cache@npm:4.1.5" @@ -22388,12 +23288,12 @@ __metadata: languageName: node linkType: hard -"matchstick-as@npm:0.6.0-beta.2": - version: 0.6.0-beta.2 - resolution: "matchstick-as@npm:0.6.0-beta.2" +"matchstick-as@npm:0.6.0": + version: 0.6.0 + resolution: "matchstick-as@npm:0.6.0" dependencies: wabt: 1.0.24 - checksum: d3a72d9c35efd0388eabe24ed4726cf3d522769ba7beca3696baa8e0eaebd05b28d27a07ee8687eec543862a12b796982ec8d44d7cb5a15484d99bb94413f4cd + checksum: 340025caf2fe677675d9e388f2726b9517dcd977e13c1d5d13517d3d72ebfe561ea849e5859df74e1ccf48559d5fe3a9bb7cce107187102ec9a3d0d677c596ff languageName: node linkType: hard @@ -22852,7 +23752,7 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:^4.0.2, micromatch@npm:^4.0.4, micromatch@npm:^4.0.5": +"micromatch@npm:4.0.5, micromatch@npm:^4.0.2, micromatch@npm:^4.0.4, micromatch@npm:^4.0.5": version: 4.0.5 resolution: "micromatch@npm:4.0.5" dependencies: @@ -22887,6 +23787,15 @@ __metadata: languageName: node linkType: hard +"mime@npm:^3.0.0": + version: 3.0.0 + resolution: "mime@npm:3.0.0" + bin: + mime: cli.js + checksum: f43f9b7bfa64534e6b05bd6062961681aeb406a5b53673b53b683f27fcc4e739989941836a355eef831f4478923651ecc739f4a5f6e20a76487b432bfd4db928 + languageName: node + linkType: hard + "mimic-fn@npm:^1.0.0": version: 1.2.0 resolution: "mimic-fn@npm:1.2.0" @@ -23155,6 +24064,18 @@ __metadata: languageName: node linkType: hard +"mlly@npm:^1.2.0, mlly@npm:^1.4.2": + version: 1.4.2 + resolution: "mlly@npm:1.4.2" + dependencies: + acorn: ^8.10.0 + pathe: ^1.1.1 + pkg-types: ^1.0.3 + ufo: ^1.3.0 + checksum: ad0813eca133e59ac03b356b87deea57da96083dce7dda58a8eeb2dce92b7cc2315bedd9268f3ff8e98effe1867ddb1307486d4c5cd8be162daa8e0fa0a98ed4 + languageName: node + linkType: hard + "mnemonist@npm:^0.38.0": version: 0.38.5 resolution: "mnemonist@npm:0.38.5" @@ -23275,7 +24196,7 @@ __metadata: languageName: node linkType: hard -"mri@npm:^1.1.0": +"mri@npm:^1.1.0, mri@npm:^1.2.0": version: 1.2.0 resolution: "mri@npm:1.2.0" checksum: 83f515abbcff60150873e424894a2f65d68037e5a7fcde8a9e2b285ee9c13ac581b63cfc1e6826c4732de3aeb84902f7c1e16b7aff46cd3f897a0f757a894e85 @@ -23514,6 +24435,13 @@ __metadata: languageName: node linkType: hard +"napi-wasm@npm:^1.1.0": + version: 1.1.0 + resolution: "napi-wasm@npm:1.1.0" + checksum: 649a5d03477b89ee75cd8d7be5404daa5c889915640fd4ab042f2d38d265e961f86933e83982388d72c8b0a3952f36f099b96598ea88210205519ec2adc41d8d + languageName: node + linkType: hard + "native-abort-controller@npm:^1.0.3, native-abort-controller@npm:^1.0.4": version: 1.0.4 resolution: "native-abort-controller@npm:1.0.4" @@ -23655,6 +24583,13 @@ __metadata: languageName: node linkType: hard +"node-fetch-native@npm:^1.4.0, node-fetch-native@npm:^1.4.1": + version: 1.4.1 + resolution: "node-fetch-native@npm:1.4.1" + checksum: 339001ad3235a09b195198df8be71b591eec4064a2fcfb7f54b9f0716f6ccb3bda5828e1746f809a6d2edb062a0330e5798f408396c33b3b88339c73d6e9575d + languageName: node + linkType: hard + "node-fetch@npm:^2.6.7": version: 2.6.11 resolution: "node-fetch@npm:2.6.11" @@ -23669,7 +24604,7 @@ __metadata: languageName: node linkType: hard -"node-forge@npm:^1, node-forge@npm:^1.1.0": +"node-forge@npm:^1, node-forge@npm:^1.1.0, node-forge@npm:^1.3.1": version: 1.3.1 resolution: "node-forge@npm:1.3.1" checksum: 08fb072d3d670599c89a1704b3e9c649ff1b998256737f0e06fbd1a5bf41cae4457ccaee32d95052d80bbafd9ffe01284e078c8071f0267dc9744e51c5ed42a9 @@ -23934,6 +24869,13 @@ __metadata: languageName: node linkType: hard +"object-inspect@npm:^1.13.1": + version: 1.13.1 + resolution: "object-inspect@npm:1.13.1" + checksum: 7d9fa9221de3311dcb5c7c307ee5dc011cdd31dc43624b7c184b3840514e118e05ef0002be5388304c416c0eb592feb46e983db12577fc47e47d5752fbbfb61f + languageName: node + linkType: hard + "object-keys@npm:^1.0.11, object-keys@npm:^1.1.1": version: 1.1.1 resolution: "object-keys@npm:1.1.1" @@ -23994,6 +24936,17 @@ __metadata: languageName: node linkType: hard +"object.fromentries@npm:^2.0.7": + version: 2.0.7 + resolution: "object.fromentries@npm:2.0.7" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 + checksum: 7341ce246e248b39a431b87a9ddd331ff52a454deb79afebc95609f94b1f8238966cf21f52188f2a353f0fdf83294f32f1ebf1f7826aae915ebad21fd0678065 + languageName: node + linkType: hard + "object.getownpropertydescriptors@npm:^2.0.3, object.getownpropertydescriptors@npm:^2.1.0": version: 2.1.6 resolution: "object.getownpropertydescriptors@npm:2.1.6" @@ -24007,6 +24960,18 @@ __metadata: languageName: node linkType: hard +"object.groupby@npm:^1.0.1": + version: 1.0.1 + resolution: "object.groupby@npm:1.0.1" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 + get-intrinsic: ^1.2.1 + checksum: d7959d6eaaba358b1608066fc67ac97f23ce6f573dc8fc661f68c52be165266fcb02937076aedb0e42722fdda0bdc0bbf74778196ac04868178888e9fd3b78b5 + languageName: node + linkType: hard + "object.hasown@npm:^1.1.2": version: 1.1.2 resolution: "object.hasown@npm:1.1.2" @@ -24028,6 +24993,17 @@ __metadata: languageName: node linkType: hard +"object.values@npm:^1.1.7": + version: 1.1.7 + resolution: "object.values@npm:1.1.7" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 + checksum: f3e4ae4f21eb1cc7cebb6ce036d4c67b36e1c750428d7b7623c56a0db90edced63d08af8a316d81dfb7c41a3a5fa81b05b7cc9426e98d7da986b1682460f0777 + languageName: node + linkType: hard + "obliterator@npm:^2.0.0": version: 2.0.4 resolution: "obliterator@npm:2.0.4" @@ -24042,6 +25018,17 @@ __metadata: languageName: node linkType: hard +"ofetch@npm:^1.3.3": + version: 1.3.3 + resolution: "ofetch@npm:1.3.3" + dependencies: + destr: ^2.0.1 + node-fetch-native: ^1.4.0 + ufo: ^1.3.0 + checksum: 945d757b25ba144f9f45d9de3382de743f0950e68e76726a4c0d2ef01456fa6700a6b102cc343a4e06f71d5ac59a8affdd9a673751c448f4265996f7f22ffa3d + languageName: node + linkType: hard + "on-exit-leak-free@npm:^0.2.0": version: 0.2.0 resolution: "on-exit-leak-free@npm:0.2.0" @@ -24147,6 +25134,20 @@ __metadata: languageName: node linkType: hard +"optionator@npm:^0.9.3": + version: 0.9.3 + resolution: "optionator@npm:0.9.3" + dependencies: + "@aashutoshrathi/word-wrap": ^1.2.3 + deep-is: ^0.1.3 + fast-levenshtein: ^2.0.6 + levn: ^0.4.1 + prelude-ls: ^1.2.1 + type-check: ^0.4.0 + checksum: 09281999441f2fe9c33a5eeab76700795365a061563d66b098923eb719251a42bdbe432790d35064d0816ead9296dbeb1ad51a733edf4167c96bd5d0882e428a + languageName: node + linkType: hard + "ora@npm:4.0.2": version: 4.0.2 resolution: "ora@npm:4.0.2" @@ -24667,7 +25668,7 @@ __metadata: languageName: node linkType: hard -"pathe@npm:^1.0.0": +"pathe@npm:^1.0.0, pathe@npm:^1.1.0, pathe@npm:^1.1.1": version: 1.1.1 resolution: "pathe@npm:1.1.1" checksum: 34ab3da2e5aa832ebc6a330ffe3f73d7ba8aec6e899b53b8ec4f4018de08e40742802deb12cf5add9c73b7bf719b62c0778246bd376ca62b0fb23e0dde44b759 @@ -24722,7 +25723,7 @@ __metadata: languageName: node linkType: hard -"pidtree@npm:^0.6.0": +"pidtree@npm:0.6.0": version: 0.6.0 resolution: "pidtree@npm:0.6.0" bin: @@ -24759,7 +25760,7 @@ __metadata: languageName: node linkType: hard -"pino-abstract-transport@npm:^1.0.0, pino-abstract-transport@npm:v1.0.0": +"pino-abstract-transport@npm:^1.0.0": version: 1.0.0 resolution: "pino-abstract-transport@npm:1.0.0" dependencies: @@ -24779,9 +25780,19 @@ __metadata: languageName: node linkType: hard -"pino-pretty@npm:^10.0.0": - version: 10.0.0 - resolution: "pino-pretty@npm:10.0.0" +"pino-abstract-transport@npm:v1.1.0": + version: 1.1.0 + resolution: "pino-abstract-transport@npm:1.1.0" + dependencies: + readable-stream: ^4.0.0 + split2: ^4.0.0 + checksum: cc84caabee5647b5753ae484d5f63a1bca0f6e1791845e2db2b6d830a561c2b5dd1177720f68d78994c8a93aecc69f2729e6ac2bc871a1bf5bb4b0ec17210668 + languageName: node + linkType: hard + +"pino-pretty@npm:^10.2.3": + version: 10.2.3 + resolution: "pino-pretty@npm:10.2.3" dependencies: colorette: ^2.0.7 dateformat: ^4.6.3 @@ -24799,7 +25810,7 @@ __metadata: strip-json-comments: ^3.1.1 bin: pino-pretty: bin.js - checksum: af45c69fdb50bdd27875d1456b7f2a7227bc1b98ca8b39ff3a4ef0c473ac8bd2ae1cb7de19921dc8cc0217b6d5f800c7af040eae294e5cc26e0fadf0a0a4afd7 + checksum: 9182886855515000df2ef381762c69fc29dbdd9014a76839cc3d8a7a94ac96d4ce17423adb9ddd61eae78986bb0ff3a1d9e6e7aa55476c096a3dd4a0c89440e8 languageName: node linkType: hard @@ -24838,24 +25849,24 @@ __metadata: languageName: node linkType: hard -"pino@npm:^8.14.1": - version: 8.14.1 - resolution: "pino@npm:8.14.1" +"pino@npm:^8.17.0": + version: 8.17.0 + resolution: "pino@npm:8.17.0" dependencies: atomic-sleep: ^1.0.0 fast-redact: ^3.1.1 on-exit-leak-free: ^2.1.0 - pino-abstract-transport: v1.0.0 + pino-abstract-transport: v1.1.0 pino-std-serializers: ^6.0.0 process-warning: ^2.0.0 quick-format-unescaped: ^4.0.3 real-require: ^0.2.0 safe-stable-stringify: ^2.3.1 - sonic-boom: ^3.1.0 + sonic-boom: ^3.7.0 thread-stream: ^2.0.0 bin: pino: bin.js - checksum: 72dcae8f550d375695bb8745f11b30c42aaa20d0bcab8f546ca5af0684d784453850949fe1b244206793e813a46d72cbbf0dda8aed2cee86e9491ba44a643e3e + checksum: 9bd2bc5ee4bf368d7ea79f13a58817c64ba481c424f022e1d60aea8a63f4dd428a94015953739f0f504bfb2dced1a0abadf494884d688a7043e0bc5967d93885 languageName: node linkType: hard @@ -24875,6 +25886,17 @@ __metadata: languageName: node linkType: hard +"pkg-types@npm:^1.0.3": + version: 1.0.3 + resolution: "pkg-types@npm:1.0.3" + dependencies: + jsonc-parser: ^3.2.0 + mlly: ^1.2.0 + pathe: ^1.1.0 + checksum: 4b305c834b912ddcc8a0fe77530c0b0321fe340396f84cbb87aecdbc126606f47f2178f23b8639e71a4870f9631c7217aef52ffed0ae17ea2dbbe7e43d116a6e + languageName: node + linkType: hard + "pkg-up@npm:^3.1.0": version: 3.1.0 resolution: "pkg-up@npm:3.1.0" @@ -25806,16 +26828,16 @@ __metadata: languageName: node linkType: hard -"prettier-plugin-solidity@npm:^1.1.3": - version: 1.1.3 - resolution: "prettier-plugin-solidity@npm:1.1.3" +"prettier-plugin-solidity@npm:^1.2.0": + version: 1.2.0 + resolution: "prettier-plugin-solidity@npm:1.2.0" dependencies: - "@solidity-parser/parser": ^0.16.0 - semver: ^7.3.8 + "@solidity-parser/parser": ^0.16.2 + semver: ^7.5.4 solidity-comments-extractor: ^0.0.7 peerDependencies: - prettier: ">=2.3.0 || >=3.0.0-alpha.0" - checksum: d5aadfa411a4d983a2bd204048726fd91fbcaffbfa26d818ef0d6001fb65f82d0eae082e935e96c79e65e09ed979b186311ddb8c38be2f0ce5dd5f5265df77fe + prettier: ">=2.3.0" + checksum: 96dc9751a7393dfbfb1fcc08d662fd8e69df9ddf51ad70172e6915e86a61491f93f3051ea716deb50ae6023f50b64aa064ffef81224405fba92566124250edb2 languageName: node linkType: hard @@ -26228,6 +27250,13 @@ __metadata: languageName: node linkType: hard +"radix3@npm:^1.1.0": + version: 1.1.0 + resolution: "radix3@npm:1.1.0" + checksum: e5e6ed8fcf68be4d124bca4f7da7ba0fc7c5b6f9e98bc3f4424459c45d50f1f92506c5f7f8421b5cfee5823c524a4a2cef416053e88845813ce9fc9c7086729a + languageName: node + linkType: hard + "raf@npm:^3.4.1": version: 3.4.1 resolution: "raf@npm:3.4.1" @@ -26917,6 +27946,22 @@ __metadata: languageName: node linkType: hard +"redis-errors@npm:^1.0.0, redis-errors@npm:^1.2.0": + version: 1.2.0 + resolution: "redis-errors@npm:1.2.0" + checksum: f28ac2692113f6f9c222670735aa58aeae413464fd58ccf3fce3f700cae7262606300840c802c64f2b53f19f65993da24dc918afc277e9e33ac1ff09edb394f4 + languageName: node + linkType: hard + +"redis-parser@npm:^3.0.0": + version: 3.0.0 + resolution: "redis-parser@npm:3.0.0" + dependencies: + redis-errors: ^1.0.0 + checksum: 89290ae530332f2ae37577647fa18208d10308a1a6ba750b9d9a093e7398f5e5253f19855b64c98757f7129cccce958e4af2573fdc33bad41405f87f1943459a + languageName: node + linkType: hard + "reduce-flatten@npm:^2.0.0": version: 2.0.0 resolution: "reduce-flatten@npm:2.0.0" @@ -26983,6 +28028,17 @@ __metadata: languageName: node linkType: hard +"regexp.prototype.flags@npm:^1.5.1": + version: 1.5.1 + resolution: "regexp.prototype.flags@npm:1.5.1" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.2.0 + set-function-name: ^2.0.0 + checksum: 869edff00288442f8d7fa4c9327f91d85f3b3acf8cbbef9ea7a220345cf23e9241b6def9263d2c1ebcf3a316b0aa52ad26a43a84aa02baca3381717b3e307f47 + languageName: node + linkType: hard + "regexpp@npm:^3.0.0": version: 3.2.0 resolution: "regexpp@npm:3.2.0" @@ -27291,6 +28347,19 @@ __metadata: languageName: node linkType: hard +"resolve@npm:^1.22.4": + version: 1.22.8 + resolution: "resolve@npm:1.22.8" + dependencies: + is-core-module: ^2.13.0 + path-parse: ^1.0.7 + supports-preserve-symlinks-flag: ^1.0.0 + bin: + resolve: bin/resolve + checksum: f8a26958aa572c9b064562750b52131a37c29d072478ea32e129063e2da7f83e31f7f11e7087a18225a8561cfe8d2f0df9dbea7c9d331a897571c0a2527dbb4c + languageName: node + linkType: hard + "resolve@npm:^2.0.0-next.4": version: 2.0.0-next.4 resolution: "resolve@npm:2.0.0-next.4" @@ -27333,6 +28402,19 @@ __metadata: languageName: node linkType: hard +"resolve@patch:resolve@^1.22.4#~builtin": + version: 1.22.8 + resolution: "resolve@patch:resolve@npm%3A1.22.8#~builtin::version=1.22.8&hash=c3c19d" + dependencies: + is-core-module: ^2.13.0 + path-parse: ^1.0.7 + supports-preserve-symlinks-flag: ^1.0.0 + bin: + resolve: bin/resolve + checksum: 5479b7d431cacd5185f8db64bfcb7286ae5e31eb299f4c4f404ad8aa6098b77599563ac4257cb2c37a42f59dfc06a1bec2bcf283bb448f319e37f0feb9a09847 + languageName: node + linkType: hard + "resolve@patch:resolve@^2.0.0-next.4#~builtin": version: 2.0.0-next.4 resolution: "resolve@patch:resolve@npm%3A2.0.0-next.4#~builtin::version=2.0.0-next.4&hash=c3c19d" @@ -27567,7 +28649,7 @@ __metadata: languageName: node linkType: hard -"rxjs@npm:^7.5.5, rxjs@npm:^7.8.0": +"rxjs@npm:^7.5.5": version: 7.8.1 resolution: "rxjs@npm:7.8.1" dependencies: @@ -27597,6 +28679,18 @@ __metadata: languageName: node linkType: hard +"safe-array-concat@npm:^1.0.1": + version: 1.0.1 + resolution: "safe-array-concat@npm:1.0.1" + dependencies: + call-bind: ^1.0.2 + get-intrinsic: ^1.2.1 + has-symbols: ^1.0.3 + isarray: ^2.0.5 + checksum: 001ecf1d8af398251cbfabaf30ed66e3855127fbceee178179524b24160b49d15442f94ed6c0db0b2e796da76bb05b73bf3cc241490ec9c2b741b41d33058581 + languageName: node + linkType: hard + "safe-buffer@npm:5.1.2, safe-buffer@npm:~5.1.0, safe-buffer@npm:~5.1.1, safe-buffer@npm:~5.1.2": version: 5.1.2 resolution: "safe-buffer@npm:5.1.2" @@ -27881,7 +28975,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.5.4": +"semver@npm:7.5.4, semver@npm:^7.5.4": version: 7.5.4 resolution: "semver@npm:7.5.4" dependencies: @@ -28023,6 +29117,29 @@ __metadata: languageName: node linkType: hard +"set-function-length@npm:^1.1.1": + version: 1.1.1 + resolution: "set-function-length@npm:1.1.1" + dependencies: + define-data-property: ^1.1.1 + get-intrinsic: ^1.2.1 + gopd: ^1.0.1 + has-property-descriptors: ^1.0.0 + checksum: c131d7569cd7e110cafdfbfbb0557249b538477624dfac4fc18c376d879672fa52563b74029ca01f8f4583a8acb35bb1e873d573a24edb80d978a7ee607c6e06 + languageName: node + linkType: hard + +"set-function-name@npm:^2.0.0": + version: 2.0.1 + resolution: "set-function-name@npm:2.0.1" + dependencies: + define-data-property: ^1.0.1 + functions-have-names: ^1.2.3 + has-property-descriptors: ^1.0.0 + checksum: 4975d17d90c40168eee2c7c9c59d023429f0a1690a89d75656306481ece0c3c1fb1ebcc0150ea546d1913e35fbd037bace91372c69e543e51fc5d1f31a9fa126 + languageName: node + linkType: hard + "set-harmonic-interval@npm:^1.0.1": version: 1.0.1 resolution: "set-harmonic-interval@npm:1.0.1" @@ -28335,15 +29452,16 @@ __metadata: languageName: node linkType: hard -"solhint-plugin-prettier@npm:^0.0.5": - version: 0.0.5 - resolution: "solhint-plugin-prettier@npm:0.0.5" +"solhint-plugin-prettier@npm:^0.1.0": + version: 0.1.0 + resolution: "solhint-plugin-prettier@npm:0.1.0" dependencies: + "@prettier/sync": ^0.3.0 prettier-linter-helpers: ^1.0.0 peerDependencies: - prettier: ^1.15.0 || ^2.0.0 - prettier-plugin-solidity: ^1.0.0-alpha.14 - checksum: ca721e327daf49a4d9ef0ee5c9622482a8c5563d600eedfd3856c69ce67e416dd77da5166a033e2e641c9cdd7a0f2cbc7913b0eb1712081b3c7e8c633eef82a5 + prettier: ^3.0.0 + prettier-plugin-solidity: ^1.0.0 + checksum: 241caa07b9d1570117cf0cc56371cc81c69fb17706dbc68136dfb112279c8c1cf815dbaa70c146acd06876e16d9a7385312b63302f2381868c02c3bdfa23715b languageName: node linkType: hard @@ -28426,7 +29544,7 @@ __metadata: languageName: node linkType: hard -"sonic-boom@npm:^3.0.0, sonic-boom@npm:^3.1.0": +"sonic-boom@npm:^3.0.0": version: 3.3.0 resolution: "sonic-boom@npm:3.3.0" dependencies: @@ -28435,6 +29553,15 @@ __metadata: languageName: node linkType: hard +"sonic-boom@npm:^3.7.0": + version: 3.7.0 + resolution: "sonic-boom@npm:3.7.0" + dependencies: + atomic-sleep: ^1.0.0 + checksum: 528f0f7f7e09dcdb02ad5985039f66554266cbd8813f9920781607c9248e01f468598c1334eab2cc740c016a63c8b2a20e15c3f618cddb08ea1cfb4a390a796e + languageName: node + linkType: hard + "source-list-map@npm:^2.0.0, source-list-map@npm:^2.0.1": version: 2.0.1 resolution: "source-list-map@npm:2.0.1" @@ -28771,6 +29898,13 @@ __metadata: languageName: node linkType: hard +"standard-as-callback@npm:^2.1.0": + version: 2.1.0 + resolution: "standard-as-callback@npm:2.1.0" + checksum: 88bec83ee220687c72d94fd86a98d5272c91d37ec64b66d830dbc0d79b62bfa6e47f53b71646011835fc9ce7fae62739545d13124262b53be4fbb3e2ebad551c + languageName: node + linkType: hard + "statuses@npm:2.0.1": version: 2.0.1 resolution: "statuses@npm:2.0.1" @@ -28785,6 +29919,13 @@ __metadata: languageName: node linkType: hard +"std-env@npm:^3.4.3": + version: 3.6.0 + resolution: "std-env@npm:3.6.0" + checksum: ec344e93af17fd1b71eb28aeb4712f72790b9f2363981fc91ad1a91c9c7967c1ab89271819242d1b3bdbd57f10ac8ef0559d561ccf081a5377f9b3cd8c9b2259 + languageName: node + linkType: hard + "stdin-discarder@npm:^0.1.0": version: 0.1.0 resolution: "stdin-discarder@npm:0.1.0" @@ -28848,7 +29989,7 @@ __metadata: languageName: node linkType: hard -"string-argv@npm:^0.3.1": +"string-argv@npm:0.3.2": version: 0.3.2 resolution: "string-argv@npm:0.3.2" checksum: 8703ad3f3db0b2641ed2adbb15cf24d3945070d9a751f9e74a924966db9f325ac755169007233e8985a39a6a292f14d4fee20482989b89b96e473c4221508a0f @@ -28977,6 +30118,17 @@ __metadata: languageName: node linkType: hard +"string.prototype.trim@npm:^1.2.8": + version: 1.2.8 + resolution: "string.prototype.trim@npm:1.2.8" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 + checksum: 49eb1a862a53aba73c3fb6c2a53f5463173cb1f4512374b623bcd6b43ad49dd559a06fb5789bdec771a40fc4d2a564411c0a75d35fb27e76bbe738c211ecff07 + languageName: node + linkType: hard + "string.prototype.trimend@npm:^1.0.6": version: 1.0.6 resolution: "string.prototype.trimend@npm:1.0.6" @@ -28988,6 +30140,17 @@ __metadata: languageName: node linkType: hard +"string.prototype.trimend@npm:^1.0.7": + version: 1.0.7 + resolution: "string.prototype.trimend@npm:1.0.7" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 + checksum: 2375516272fd1ba75992f4c4aa88a7b5f3c7a9ca308d963bcd5645adf689eba6f8a04ebab80c33e30ec0aefc6554181a3a8416015c38da0aa118e60ec896310c + languageName: node + linkType: hard + "string.prototype.trimstart@npm:^1.0.6": version: 1.0.6 resolution: "string.prototype.trimstart@npm:1.0.6" @@ -28999,6 +30162,17 @@ __metadata: languageName: node linkType: hard +"string.prototype.trimstart@npm:^1.0.7": + version: 1.0.7 + resolution: "string.prototype.trimstart@npm:1.0.7" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 + checksum: 13d0c2cb0d5ff9e926fa0bec559158b062eed2b68cd5be777ffba782c96b2b492944e47057274e064549b94dd27cf81f48b27a31fee8af5b574cff253e7eb613 + languageName: node + linkType: hard + "string_decoder@npm:^1.1.1": version: 1.3.0 resolution: "string_decoder@npm:1.3.0" @@ -30108,7 +31282,45 @@ __metadata: languageName: node linkType: hard -"tsconfig-paths@npm:^3.14.1": +"ts-node@npm:^10.9.2": + version: 10.9.2 + resolution: "ts-node@npm:10.9.2" + dependencies: + "@cspotcode/source-map-support": ^0.8.0 + "@tsconfig/node10": ^1.0.7 + "@tsconfig/node12": ^1.0.7 + "@tsconfig/node14": ^1.0.0 + "@tsconfig/node16": ^1.0.2 + acorn: ^8.4.1 + acorn-walk: ^8.1.1 + arg: ^4.1.0 + create-require: ^1.1.0 + diff: ^4.0.1 + make-error: ^1.1.1 + v8-compile-cache-lib: ^3.0.1 + yn: 3.1.1 + peerDependencies: + "@swc/core": ">=1.2.50" + "@swc/wasm": ">=1.2.50" + "@types/node": "*" + typescript: ">=2.7" + peerDependenciesMeta: + "@swc/core": + optional: true + "@swc/wasm": + optional: true + bin: + ts-node: dist/bin.js + ts-node-cwd: dist/bin-cwd.js + ts-node-esm: dist/bin-esm.js + ts-node-script: dist/bin-script.js + ts-node-transpile-only: dist/bin-transpile.js + ts-script: dist/bin-script-deprecated.js + checksum: fde256c9073969e234526e2cfead42591b9a2aec5222bac154b0de2fa9e4ceb30efcd717ee8bc785a56f3a119bdd5aa27b333d9dbec94ed254bd26f8944c67ac + languageName: node + linkType: hard + +"tsconfig-paths@npm:^3.14.1, tsconfig-paths@npm:^3.14.2": version: 3.14.2 resolution: "tsconfig-paths@npm:3.14.2" dependencies: @@ -30207,7 +31419,7 @@ __metadata: languageName: node linkType: hard -"type-detect@npm:4.0.8, type-detect@npm:^4.0.0, type-detect@npm:^4.0.5": +"type-detect@npm:4.0.8, type-detect@npm:^4.0.0, type-detect@npm:^4.0.8": version: 4.0.8 resolution: "type-detect@npm:4.0.8" checksum: 62b5628bff67c0eb0b66afa371bd73e230399a8d2ad30d852716efcc4656a7516904570cd8631a49a3ce57c10225adf5d0cbdcb47f6b0255fe6557c453925a15 @@ -30270,6 +31482,13 @@ __metadata: languageName: node linkType: hard +"type-fest@npm:^1.0.2": + version: 1.4.0 + resolution: "type-fest@npm:1.4.0" + checksum: b011c3388665b097ae6a109a437a04d6f61d81b7357f74cbcb02246f2f5bd72b888ae33631b99871388122ba0a87f4ff1c94078e7119ff22c70e52c0ff828201 + languageName: node + linkType: hard + "type-is@npm:~1.6.18": version: 1.6.18 resolution: "type-is@npm:1.6.18" @@ -30294,9 +31513,9 @@ __metadata: languageName: node linkType: hard -"typechain@npm:^8.3.1": - version: 8.3.1 - resolution: "typechain@npm:8.3.1" +"typechain@npm:^8.3.2": + version: 8.3.2 + resolution: "typechain@npm:8.3.2" dependencies: "@types/prettier": ^2.1.1 debug: ^4.3.1 @@ -30312,7 +31531,43 @@ __metadata: typescript: ">=4.3.0" bin: typechain: dist/cli/cli.js - checksum: c1e11ab1452d0c83be0c34a8b900b156b0c6654b95f7e7bb18dd98c0decd6009ffa1316e393f4e8def187af1bea3e931a13503815cc37155c0c945b7ae5b5215 + checksum: 146a1896fa93403404be78757790b0f95b5457efebcca16b61622e09c374d555ef4f837c1c4eedf77e03abc50276d96a2f33064ec09bb802f62d8cc2b13fce70 + languageName: node + linkType: hard + +"typed-array-buffer@npm:^1.0.0": + version: 1.0.0 + resolution: "typed-array-buffer@npm:1.0.0" + dependencies: + call-bind: ^1.0.2 + get-intrinsic: ^1.2.1 + is-typed-array: ^1.1.10 + checksum: 3e0281c79b2a40cd97fe715db803884301993f4e8c18e8d79d75fd18f796e8cd203310fec8c7fdb5e6c09bedf0af4f6ab8b75eb3d3a85da69328f28a80456bd3 + languageName: node + linkType: hard + +"typed-array-byte-length@npm:^1.0.0": + version: 1.0.0 + resolution: "typed-array-byte-length@npm:1.0.0" + dependencies: + call-bind: ^1.0.2 + for-each: ^0.3.3 + has-proto: ^1.0.1 + is-typed-array: ^1.1.10 + checksum: b03db16458322b263d87a702ff25388293f1356326c8a678d7515767ef563ef80e1e67ce648b821ec13178dd628eb2afdc19f97001ceae7a31acf674c849af94 + languageName: node + linkType: hard + +"typed-array-byte-offset@npm:^1.0.0": + version: 1.0.0 + resolution: "typed-array-byte-offset@npm:1.0.0" + dependencies: + available-typed-arrays: ^1.0.5 + call-bind: ^1.0.2 + for-each: ^0.3.3 + has-proto: ^1.0.1 + is-typed-array: ^1.1.10 + checksum: 04f6f02d0e9a948a95fbfe0d5a70b002191fae0b8fe0fe3130a9b2336f043daf7a3dda56a31333c35a067a97e13f539949ab261ca0f3692c41603a46a94e960b languageName: node linkType: hard @@ -30404,6 +31659,13 @@ __metadata: languageName: node linkType: hard +"ufo@npm:^1.3.0, ufo@npm:^1.3.1, ufo@npm:^1.3.2": + version: 1.3.2 + resolution: "ufo@npm:1.3.2" + checksum: f1180bb715ff4dd46152fd4dec41c731e84d7b9eaf1432548a0210b2f7e0cd29de125ac88e582c6a079d8ae5bc9ab04ef2bdbafe125086480b10c1006b81bfce + languageName: node + linkType: hard + "uglify-js@npm:^3.1.4": version: 3.17.4 resolution: "uglify-js@npm:3.17.4" @@ -30459,6 +31721,13 @@ __metadata: languageName: node linkType: hard +"uncrypto@npm:^0.1.3": + version: 0.1.3 + resolution: "uncrypto@npm:0.1.3" + checksum: 07160e08806dd6cea16bb96c3fd54cd70fc801e02fc3c6f86980144d15c9ebbd1c55587f7280a207b3af6cd34901c0d0b77ada5a02c2f7081a033a05acf409e2 + languageName: node + linkType: hard + "undici@npm:^5.12.0, undici@npm:^5.14.0": version: 5.22.1 resolution: "undici@npm:5.22.1" @@ -30468,6 +31737,19 @@ __metadata: languageName: node linkType: hard +"unenv@npm:^1.7.4": + version: 1.8.0 + resolution: "unenv@npm:1.8.0" + dependencies: + consola: ^3.2.3 + defu: ^6.1.3 + mime: ^3.0.0 + node-fetch-native: ^1.4.1 + pathe: ^1.1.1 + checksum: 8118260ac7be8d13f99ebb5ca6a40203cf64cc592142753c1a1f75d40b07398c3208430d9a0299573cef3e4f2eba3bf6735901ff4217583df8344b2491314fb0 + languageName: node + linkType: hard + "unicode-canonical-property-names-ecmascript@npm:^2.0.0": version: 2.0.0 resolution: "unicode-canonical-property-names-ecmascript@npm:2.0.0" @@ -30647,6 +31929,76 @@ __metadata: languageName: node linkType: hard +"unstorage@npm:^1.9.0": + version: 1.10.1 + resolution: "unstorage@npm:1.10.1" + dependencies: + anymatch: ^3.1.3 + chokidar: ^3.5.3 + destr: ^2.0.2 + h3: ^1.8.2 + ioredis: ^5.3.2 + listhen: ^1.5.5 + lru-cache: ^10.0.2 + mri: ^1.2.0 + node-fetch-native: ^1.4.1 + ofetch: ^1.3.3 + ufo: ^1.3.1 + peerDependencies: + "@azure/app-configuration": ^1.4.1 + "@azure/cosmos": ^4.0.0 + "@azure/data-tables": ^13.2.2 + "@azure/identity": ^3.3.2 + "@azure/keyvault-secrets": ^4.7.0 + "@azure/storage-blob": ^12.16.0 + "@capacitor/preferences": ^5.0.6 + "@netlify/blobs": ^6.2.0 + "@planetscale/database": ^1.11.0 + "@upstash/redis": ^1.23.4 + "@vercel/kv": ^0.2.3 + idb-keyval: ^6.2.1 + peerDependenciesMeta: + "@azure/app-configuration": + optional: true + "@azure/cosmos": + optional: true + "@azure/data-tables": + optional: true + "@azure/identity": + optional: true + "@azure/keyvault-secrets": + optional: true + "@azure/storage-blob": + optional: true + "@capacitor/preferences": + optional: true + "@netlify/blobs": + optional: true + "@planetscale/database": + optional: true + "@upstash/redis": + optional: true + "@vercel/kv": + optional: true + idb-keyval: + optional: true + checksum: 59dc9f21d25df2bc8d14e3965235cbb85e3e2e8cb332da70ca471ba4519269a06936eba4012916251f3b88e23176df44b64abb826202a3a3c9d0a185bfe5e500 + languageName: node + linkType: hard + +"untun@npm:^0.1.2": + version: 0.1.2 + resolution: "untun@npm:0.1.2" + dependencies: + citty: ^0.1.3 + consola: ^3.2.3 + pathe: ^1.1.1 + bin: + untun: bin/untun.mjs + checksum: 4ba32a6273138712ce8db3df027262902ec2a2c106d44ab94202a73b652e76b984e5661e3a7897dce048a740890f23165fb810a2ab1a69df2d6f729dad8078e2 + languageName: node + linkType: hard + "upath@npm:^1.2.0": version: 1.2.0 resolution: "upath@npm:1.2.0" @@ -30686,6 +32038,13 @@ __metadata: languageName: node linkType: hard +"uqr@npm:^0.1.2": + version: 0.1.2 + resolution: "uqr@npm:0.1.2" + checksum: 717766f03814172f5a9934dae2c4c48f6de065a4fd7da82aa513bd8300b621c1e606efdd174478cab79093e5ba244a99f0c0b1b0b9c0175656ab5e637a006d92 + languageName: node + linkType: hard + "uri-js@npm:^4.2.2": version: 4.4.1 resolution: "uri-js@npm:4.4.1" @@ -30988,11 +32347,11 @@ __metadata: languageName: node linkType: hard -"viem@npm:^1.16.1": - version: 1.16.1 - resolution: "viem@npm:1.16.1" +"viem@npm:^1.19.13": + version: 1.19.13 + resolution: "viem@npm:1.19.13" dependencies: - "@adraffy/ens-normalize": 1.9.4 + "@adraffy/ens-normalize": 1.10.0 "@noble/curves": 1.2.0 "@noble/hashes": 1.3.2 "@scure/bip32": 1.3.2 @@ -31005,7 +32364,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: c09de9651b9a203818f719afc392c0522ed8896f94534e1294e8182cdff014c92b1025e082648cb1a9d27a67c3b07bfc075c9f255ccf579ef8367ec20ee84ade + checksum: 1794550a0879d35c902b0dc8468b09c664182b3df463f1039a3d86d0e9677938fe3aa89aee14c3fa184fef72843fdb44a25da61f3a2cba7b6ffe74a57c5f0e0a languageName: node linkType: hard @@ -31116,14 +32475,14 @@ __metadata: languageName: node linkType: hard -"wagmi@npm:^1.4.3": - version: 1.4.3 - resolution: "wagmi@npm:1.4.3" +"wagmi@npm:^1.4.11": + version: 1.4.11 + resolution: "wagmi@npm:1.4.11" dependencies: "@tanstack/query-sync-storage-persister": ^4.27.1 "@tanstack/react-query": ^4.28.0 "@tanstack/react-query-persist-client": ^4.28.0 - "@wagmi/core": 1.4.3 + "@wagmi/core": 1.4.11 abitype: 0.8.7 use-sync-external-store: ^1.2.0 peerDependencies: @@ -31133,7 +32492,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: df0dfddb898a59246c14e7053caeeea313801340d589e5545bad631ec47fc66e2cc1dafaaa7880c9947931efad442f834ed3d3c6b2d0952b586f6da575c3293f + checksum: 44fe06ebf874fb8e3575161b8a4ae991929ddd9a9547df7696b42a251e52fb847f681bf37b8abc5401aadc39e48064a4d99b76d56876d99c92bdb8ee189d665f languageName: node linkType: hard @@ -31536,6 +32895,19 @@ __metadata: languageName: node linkType: hard +"which-typed-array@npm:^1.1.11, which-typed-array@npm:^1.1.13": + version: 1.1.13 + resolution: "which-typed-array@npm:1.1.13" + dependencies: + available-typed-arrays: ^1.0.5 + call-bind: ^1.0.4 + for-each: ^0.3.3 + gopd: ^1.0.1 + has-tostringtag: ^1.0.0 + checksum: 3828a0d5d72c800e369d447e54c7620742a4cc0c9baf1b5e8c17e9b6ff90d8d861a3a6dd4800f1953dbf80e5e5cec954a289e5b4a223e3bee4aeb1f8c5f33309 + languageName: node + linkType: hard + "which-typed-array@npm:^1.1.2, which-typed-array@npm:^1.1.9": version: 1.1.9 resolution: "which-typed-array@npm:1.1.9" @@ -31878,7 +33250,7 @@ __metadata: languageName: node linkType: hard -"wrap-ansi@npm:^8.1.0": +"wrap-ansi@npm:^8.0.1, wrap-ansi@npm:^8.1.0": version: 8.1.0 resolution: "wrap-ansi@npm:8.1.0" dependencies: @@ -32084,7 +33456,7 @@ __metadata: languageName: node linkType: hard -"yaml@npm:^2.1.1, yaml@npm:^2.2.2": +"yaml@npm:2.3.1, yaml@npm:^2.1.1, yaml@npm:^2.2.2": version: 2.3.1 resolution: "yaml@npm:2.3.1" checksum: 2c7bc9a7cd4c9f40d3b0b0a98e370781b68b8b7c4515720869aced2b00d92f5da1762b4ffa947f9e795d6cd6b19f410bd4d15fdd38aca7bd96df59bd9486fb54 From 723bfcecf1465cd66515798375a10772e5b87514 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Wed, 13 Dec 2023 17:44:58 +0000 Subject: [PATCH 44/77] chore: cleaned up some old references to Rinkeby --- bot-pinner/docker-compose-dappnode.yml | 2 +- contracts/scripts/changeRng.ts | 1 - contracts/scripts/populateCourts.ts | 1 - contracts/scripts/populatePolicyRegistry.ts | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/bot-pinner/docker-compose-dappnode.yml b/bot-pinner/docker-compose-dappnode.yml index 94a46cc17..1272637b3 100644 --- a/bot-pinner/docker-compose-dappnode.yml +++ b/bot-pinner/docker-compose-dappnode.yml @@ -9,7 +9,7 @@ services: volumes: - "data:/var/lib/data/" environment: - RPC: "https://rinkeby.arbitrum.io/rpc" + RPC: "https://sepolia-rollup.arbitrum.io/rpc" IPFS: "http://ipfs-cluster.dappnode:9094" INTERVAL: 60 RETRY: 2 diff --git a/contracts/scripts/changeRng.ts b/contracts/scripts/changeRng.ts index 5394d2340..e0b363720 100644 --- a/contracts/scripts/changeRng.ts +++ b/contracts/scripts/changeRng.ts @@ -3,7 +3,6 @@ const { deploy, execute } = deployments; enum HomeChains { ARBITRUM_ONE = 42161, - ARBITRUM_RINKEBY = 421611, ARBITRUM_SEPOLIA = 421614, HARDHAT = 31337, } diff --git a/contracts/scripts/populateCourts.ts b/contracts/scripts/populateCourts.ts index 26639f39c..38b8bb114 100644 --- a/contracts/scripts/populateCourts.ts +++ b/contracts/scripts/populateCourts.ts @@ -9,7 +9,6 @@ import { isDevnet } from "../deploy/utils"; enum HomeChains { ARBITRUM_ONE = 42161, - ARBITRUM_RINKEBY = 421611, ARBITRUM_SEPOLIA = 421614, HARDHAT = 31337, } diff --git a/contracts/scripts/populatePolicyRegistry.ts b/contracts/scripts/populatePolicyRegistry.ts index 43fb1b38f..75d1570a3 100644 --- a/contracts/scripts/populatePolicyRegistry.ts +++ b/contracts/scripts/populatePolicyRegistry.ts @@ -8,7 +8,6 @@ import { isDevnet } from "../deploy/utils"; enum HomeChains { ARBITRUM_ONE = 42161, - ARBITRUM_RINKEBY = 421611, ARBITRUM_SEPOLIA = 421614, HARDHAT = 31337, } From 71f0b3b8a619ed2c57631de902586462d09e3e30 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Tue, 19 Dec 2023 14:51:55 +0000 Subject: [PATCH 45/77] chore: deploy script fixes and artifacts for PNK --- contracts/deploy/00-ethereum-pnk.ts | 1 - contracts/deploy/00-home-chain-arbitration.ts | 2 +- .../deploy/01-foreign-gateway-on-ethereum.ts | 2 +- .../deploy/01-foreign-gateway-on-gnosis.ts | 2 +- contracts/deploy/03-vea-mock.ts | 2 +- contracts/deploy/fix1148.ts | 12 +- contracts/deploy/upgrade-kleros-core.ts | 8 +- contracts/deploy/upgrade-sortition-module.ts | 8 +- ...ntractAddress.js => getContractAddress.ts} | 6 +- .../deployments/arbitrumSepolia/.chainId | 1 + .../deployments/arbitrumSepolia/PNK.json | 280 ++++++++ .../arbitrumSepolia/PinakionV2.json | 1 + .../arbitrumSepoliaDevnet/.chainId | 1 + .../arbitrumSepoliaDevnet/PNK.json | 280 ++++++++ .../arbitrumSepoliaDevnet/PinakionV2.json | 1 + contracts/deployments/sepolia/.chainId | 1 + contracts/deployments/sepolia/PinakionV2.json | 605 ++++++++++++++++++ contracts/package.json | 2 +- .../scripts/generateDeploymentsMarkdown.sh | 12 +- yarn.lock | 198 +++--- 20 files changed, 1288 insertions(+), 137 deletions(-) rename contracts/deploy/utils/{getContractAddress.js => getContractAddress.ts} (86%) create mode 100644 contracts/deployments/arbitrumSepolia/.chainId create mode 100644 contracts/deployments/arbitrumSepolia/PNK.json create mode 120000 contracts/deployments/arbitrumSepolia/PinakionV2.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/.chainId create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/PNK.json create mode 120000 contracts/deployments/arbitrumSepoliaDevnet/PinakionV2.json create mode 100644 contracts/deployments/sepolia/.chainId create mode 100644 contracts/deployments/sepolia/PinakionV2.json diff --git a/contracts/deploy/00-ethereum-pnk.ts b/contracts/deploy/00-ethereum-pnk.ts index c35a6be67..033519998 100644 --- a/contracts/deploy/00-ethereum-pnk.ts +++ b/contracts/deploy/00-ethereum-pnk.ts @@ -1,6 +1,5 @@ import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; -import disputeTemplate from "../test/fixtures/DisputeTemplate.simple.json"; import { isSkipped } from "./utils"; enum Chains { diff --git a/contracts/deploy/00-home-chain-arbitration.ts b/contracts/deploy/00-home-chain-arbitration.ts index 1cef0c47e..1fe81a2fb 100644 --- a/contracts/deploy/00-home-chain-arbitration.ts +++ b/contracts/deploy/00-home-chain-arbitration.ts @@ -1,7 +1,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; import { BigNumber } from "ethers"; -import getContractAddress from "./utils/getContractAddress"; +import { getContractAddress } from "./utils/getContractAddress"; import { deployUpgradable } from "./utils/deployUpgradable"; import { HomeChains, isSkipped, isDevnet } from "./utils"; diff --git a/contracts/deploy/01-foreign-gateway-on-ethereum.ts b/contracts/deploy/01-foreign-gateway-on-ethereum.ts index f2329d54d..f1431de1a 100644 --- a/contracts/deploy/01-foreign-gateway-on-ethereum.ts +++ b/contracts/deploy/01-foreign-gateway-on-ethereum.ts @@ -1,6 +1,6 @@ import { HardhatRuntimeEnvironment, HttpNetworkConfig } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; -import getContractAddress from "./utils/getContractAddress"; +import { getContractAddress } from "./utils/getContractAddress"; import { KlerosCore__factory } from "../typechain-types"; import { Courts, ForeignChains, isSkipped } from "./utils"; import { deployUpgradable } from "./utils/deployUpgradable"; diff --git a/contracts/deploy/01-foreign-gateway-on-gnosis.ts b/contracts/deploy/01-foreign-gateway-on-gnosis.ts index 38cfbadee..77c26a2c6 100644 --- a/contracts/deploy/01-foreign-gateway-on-gnosis.ts +++ b/contracts/deploy/01-foreign-gateway-on-gnosis.ts @@ -1,7 +1,7 @@ import { parseUnits } from "ethers/lib/utils"; import { HardhatRuntimeEnvironment, HttpNetworkConfig } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; -import getContractAddress from "./utils/getContractAddress"; +import { getContractAddress } from "./utils/getContractAddress"; import { KlerosCore__factory } from "../typechain-types"; import { Courts, ForeignChains, isSkipped } from "./utils"; import { deployUpgradable } from "./utils/deployUpgradable"; diff --git a/contracts/deploy/03-vea-mock.ts b/contracts/deploy/03-vea-mock.ts index 5e4df8bc8..f01704b6f 100644 --- a/contracts/deploy/03-vea-mock.ts +++ b/contracts/deploy/03-vea-mock.ts @@ -1,6 +1,6 @@ import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; -import getContractAddress from "./utils/getContractAddress"; +import { getContractAddress } from "./utils/getContractAddress"; import { KlerosCore__factory } from "../typechain-types"; import disputeTemplate from "../test/fixtures/DisputeTemplate.simple.json"; import { Courts, HardhatChain, isSkipped } from "./utils"; diff --git a/contracts/deploy/fix1148.ts b/contracts/deploy/fix1148.ts index 917c8edb0..f8febc3a9 100644 --- a/contracts/deploy/fix1148.ts +++ b/contracts/deploy/fix1148.ts @@ -2,13 +2,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; import { DisputeKitClassic, KlerosCore, SortitionModule } from "../typechain-types"; import assert from "node:assert"; -import { isSkipped } from "./utils"; - -enum HomeChains { - ARBITRUM_ONE = 42161, - ARBITRUM_SEPOLIA = 421614, - HARDHAT = 31337, -} +import { HomeChains, isSkipped } from "./utils"; const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { const { ethers, deployments, getNamedAccounts, getChainId } = hre; @@ -38,11 +32,11 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) const newDisputeKitId = 2; assert( - await klerosCore.disputeKitNodes(oldDisputeKitId).then((node) => node.disputeKit === oldDisputeKit.address), + await klerosCore.disputeKits(oldDisputeKitId).then((dk) => dk === oldDisputeKit.address), `wrong dispute kit id ${oldDisputeKitId}` ); assert( - await klerosCore.disputeKitNodes(newDisputeKitId).then((node) => node.disputeKit === newDisputeKit.address), + await klerosCore.disputeKits(newDisputeKitId).then((dk) => dk === newDisputeKit.address), `wrong dispute kit id ${newDisputeKitId}` ); diff --git a/contracts/deploy/upgrade-kleros-core.ts b/contracts/deploy/upgrade-kleros-core.ts index 566898ba0..c05f0a14c 100644 --- a/contracts/deploy/upgrade-kleros-core.ts +++ b/contracts/deploy/upgrade-kleros-core.ts @@ -2,13 +2,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; import { BigNumber } from "ethers"; import { deployUpgradable } from "./utils/deployUpgradable"; -import { isSkipped } from "./utils"; - -enum HomeChains { - ARBITRUM_ONE = 42161, - ARBITRUM_SEPOLIA = 421614, - HARDHAT = 31337, -} +import { HomeChains, isSkipped } from "./utils"; const deployUpgradeKlerosCore: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { const { ethers, deployments, getNamedAccounts, getChainId } = hre; diff --git a/contracts/deploy/upgrade-sortition-module.ts b/contracts/deploy/upgrade-sortition-module.ts index 7ae999bd0..6b9865842 100644 --- a/contracts/deploy/upgrade-sortition-module.ts +++ b/contracts/deploy/upgrade-sortition-module.ts @@ -1,13 +1,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; import { deployUpgradable } from "./utils/deployUpgradable"; -import { isSkipped } from "./utils"; - -enum HomeChains { - ARBITRUM_ONE = 42161, - ARBITRUM_SEPOLIA = 421614, - HARDHAT = 31337, -} +import { HomeChains, isSkipped } from "./utils"; const deployUpgradeSortitionModule: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { const { deployments, getNamedAccounts, getChainId } = hre; diff --git a/contracts/deploy/utils/getContractAddress.js b/contracts/deploy/utils/getContractAddress.ts similarity index 86% rename from contracts/deploy/utils/getContractAddress.js rename to contracts/deploy/utils/getContractAddress.ts index f691bbd73..bfad406d3 100644 --- a/contracts/deploy/utils/getContractAddress.js +++ b/contracts/deploy/utils/getContractAddress.ts @@ -6,9 +6,7 @@ const { BN, Address, toChecksumAddress } = require("ethereumjs-util"); * @param {number|BN} nonce The current nonce for the deployer account. * @return {string} The address of a contract if it is deployed in the next transaction sent by the deployer account. */ -function getContractAddress(deployer, nonce) { +export const getContractAddress = (deployer, nonce) => { const deployAddress = Address.generate(Address.fromString(deployer), new BN(String(nonce))); return toChecksumAddress(deployAddress.toString()); -} - -module.exports = getContractAddress; +}; diff --git a/contracts/deployments/arbitrumSepolia/.chainId b/contracts/deployments/arbitrumSepolia/.chainId new file mode 100644 index 000000000..357f9c751 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/.chainId @@ -0,0 +1 @@ +421614 diff --git a/contracts/deployments/arbitrumSepolia/PNK.json b/contracts/deployments/arbitrumSepolia/PNK.json new file mode 100644 index 000000000..5a97a10ee --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/PNK.json @@ -0,0 +1,280 @@ +{ + "address": "0x34B944D42cAcfC8266955D07A80181D2054aa225", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/contracts/deployments/arbitrumSepolia/PinakionV2.json b/contracts/deployments/arbitrumSepolia/PinakionV2.json new file mode 120000 index 000000000..0f29cb015 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/PinakionV2.json @@ -0,0 +1 @@ +PNK.json \ No newline at end of file diff --git a/contracts/deployments/arbitrumSepoliaDevnet/.chainId b/contracts/deployments/arbitrumSepoliaDevnet/.chainId new file mode 100644 index 000000000..357f9c751 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/.chainId @@ -0,0 +1 @@ +421614 diff --git a/contracts/deployments/arbitrumSepoliaDevnet/PNK.json b/contracts/deployments/arbitrumSepoliaDevnet/PNK.json new file mode 100644 index 000000000..5a97a10ee --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/PNK.json @@ -0,0 +1,280 @@ +{ + "address": "0x34B944D42cAcfC8266955D07A80181D2054aa225", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/PinakionV2.json b/contracts/deployments/arbitrumSepoliaDevnet/PinakionV2.json new file mode 120000 index 000000000..0f29cb015 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/PinakionV2.json @@ -0,0 +1 @@ +PNK.json \ No newline at end of file diff --git a/contracts/deployments/sepolia/.chainId b/contracts/deployments/sepolia/.chainId new file mode 100644 index 000000000..bd8d1cd44 --- /dev/null +++ b/contracts/deployments/sepolia/.chainId @@ -0,0 +1 @@ +11155111 \ No newline at end of file diff --git a/contracts/deployments/sepolia/PinakionV2.json b/contracts/deployments/sepolia/PinakionV2.json new file mode 100644 index 000000000..ce9e361f7 --- /dev/null +++ b/contracts/deployments/sepolia/PinakionV2.json @@ -0,0 +1,605 @@ +{ + "address": "0x593e89704D285B0c3fbF157c7CF2537456CE64b5", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "recoverTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xc14f8d7b4ea34d9ecef6b9ca621b2fe60a6a23f5d25d1646b2f7470e212c9f9b", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x593e89704D285B0c3fbF157c7CF2537456CE64b5", + "transactionIndex": 74, + "gasUsed": "1020268", + "logsBloom": "0x00000020000000000000000000000000000000000040000006800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000010000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000002000000000000000000000000000000000000000000000080000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x521251c8f56abab468b5c730c8dee5113536bc6ab051ce4201960f84b2cb130b", + "transactionHash": "0xc14f8d7b4ea34d9ecef6b9ca621b2fe60a6a23f5d25d1646b2f7470e212c9f9b", + "logs": [ + { + "transactionIndex": 74, + "blockNumber": 4880097, + "transactionHash": "0xc14f8d7b4ea34d9ecef6b9ca621b2fe60a6a23f5d25d1646b2f7470e212c9f9b", + "address": "0x593e89704D285B0c3fbF157c7CF2537456CE64b5", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "data": "0x", + "logIndex": 95, + "blockHash": "0x521251c8f56abab468b5c730c8dee5113536bc6ab051ce4201960f84b2cb130b" + }, + { + "transactionIndex": 74, + "blockNumber": 4880097, + "transactionHash": "0xc14f8d7b4ea34d9ecef6b9ca621b2fe60a6a23f5d25d1646b2f7470e212c9f9b", + "address": "0x593e89704D285B0c3fbF157c7CF2537456CE64b5", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "data": "0x0000000000000000000000000000000000000000033b2e3c9fd0803ce8000000", + "logIndex": 96, + "blockHash": "0x521251c8f56abab468b5c730c8dee5113536bc6ab051ce4201960f84b2cb130b" + } + ], + "blockNumber": 4880097, + "cumulativeGasUsed": "10131785", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "efecbc06b185b229926f80f198f0ff7d", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burnFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"}],\"name\":\"recoverTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"contact@kleros.io\",\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"burn(uint256)\":{\"details\":\"Destroys `amount` tokens from the caller. See {ERC20-_burn}.\"},\"burnFrom(address,uint256)\":{\"details\":\"Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {ERC20-_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for ``accounts``'s tokens of at least `amount`.\"},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"recoverTokens(address)\":{\"params\":{\"_token\":\"The address of the token contract that you want to recover, or set to 0 in case you want to extract ether.\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"recoverTokens(address)\":{\"notice\":\"Recover tokens sent mistakenly to this contract.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/token/PinakionV2.sol\":\"PinakionV2\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xba43b97fba0d32eb4254f6a5a297b39a19a247082a02d6e69349e071e2946218\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * The default value of {decimals} is 18. To change this, you should override\\n * this function so it returns a different value.\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20 is Context, IERC20, IERC20Metadata {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the default value returned by this function, unless\\n * it's overridden.\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(address from, address to, uint256 amount) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(address owner, address spender, uint256 amount) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\\n}\\n\",\"keccak256\":\"0xa56ca923f70c1748830700250b19c61b70db9a683516dc5e216694a50445d99c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC20.sol\\\";\\nimport \\\"../../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Extension of {ERC20} that allows token holders to destroy both their own\\n * tokens and those that they have an allowance for, in a way that can be\\n * recognized off-chain (via event analysis).\\n */\\nabstract contract ERC20Burnable is Context, ERC20 {\\n /**\\n * @dev Destroys `amount` tokens from the caller.\\n *\\n * See {ERC20-_burn}.\\n */\\n function burn(uint256 amount) public virtual {\\n _burn(_msgSender(), amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, deducting from the caller's\\n * allowance.\\n *\\n * See {ERC20-_burn} and {ERC20-allowance}.\\n *\\n * Requirements:\\n *\\n * - the caller must have allowance for ``accounts``'s tokens of at least\\n * `amount`.\\n */\\n function burnFrom(address account, uint256 amount) public virtual {\\n _spendAllowance(account, _msgSender(), amount);\\n _burn(account, amount);\\n }\\n}\\n\",\"keccak256\":\"0x0d19410453cda55960a818e02bd7c18952a5c8fe7a3036e81f0d599f34487a7b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0xa92e4fa126feb6907daa0513ddd816b2eb91f30a808de54f63c17d0e162c3439\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"},\"src/token/PinakionV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"../libraries/SafeERC20.sol\\\";\\n\\n/// @custom:security-contact contact@kleros.io\\ncontract PinakionV2 is ERC20, ERC20Burnable, Ownable {\\n using SafeERC20 for IERC20;\\n\\n constructor() ERC20(\\\"PinakionV2\\\", \\\"PNK\\\") {\\n _mint(msg.sender, 1000000000 * 10 ** decimals());\\n }\\n\\n function mint(address to, uint256 amount) public onlyOwner {\\n _mint(to, amount);\\n }\\n\\n /// @notice Recover tokens sent mistakenly to this contract.\\n /// @param _token The address of the token contract that you want to recover, or set to 0 in case you want to extract ether.\\n function recoverTokens(address _token) public onlyOwner {\\n if (_token == address(0)) {\\n require(payable(owner()).send(address(this).balance), \\\"Transfer failed\\\");\\n return;\\n }\\n\\n IERC20 token = IERC20(_token);\\n uint balance = token.balanceOf(address(this));\\n require(token.safeTransfer(payable(owner()), balance), \\\"Token transfer failed\\\");\\n }\\n}\\n\",\"keccak256\":\"0x842a8e750d437381116c5619e89930c41053570a5361286a63f109ec92bc44f0\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b506040518060400160405280600a8152602001692834b730b5b4b7b72b1960b11b81525060405180604001604052806003815260200162504e4b60e81b815250816003908162000062919062000282565b50600462000071828262000282565b5050506200008e62000088620000bd60201b60201c565b620000c1565b620000b733620000a16012600a62000463565b620000b190633b9aca006200047b565b62000113565b620004ab565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166200016e5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b806002600082825462000182919062000495565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200020957607f821691505b6020821081036200022a57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001d957600081815260208120601f850160051c81016020861015620002595750805b601f850160051c820191505b818110156200027a5782815560010162000265565b505050505050565b81516001600160401b038111156200029e576200029e620001de565b620002b681620002af8454620001f4565b8462000230565b602080601f831160018114620002ee5760008415620002d55750858301515b600019600386901b1c1916600185901b1785556200027a565b600085815260208120601f198616915b828110156200031f57888601518255948401946001909101908401620002fe565b50858210156200033e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b600181815b80851115620003a55781600019048211156200038957620003896200034e565b808516156200039757918102915b93841c939080029062000369565b509250929050565b600082620003be575060016200045d565b81620003cd575060006200045d565b8160018114620003e65760028114620003f15762000411565b60019150506200045d565b60ff8411156200040557620004056200034e565b50506001821b6200045d565b5060208310610133831016604e8410600b841016171562000436575081810a6200045d565b62000442838362000364565b80600019048211156200045957620004596200034e565b0290505b92915050565b60006200047460ff841683620003ad565b9392505050565b80820281158282048414176200045d576200045d6200034e565b808201808211156200045d576200045d6200034e565b610f1280620004bb6000396000f3fe608060405234801561001057600080fd5b50600436106100f65760003560e01c806370a082311161009257806370a08231146101be578063715018a6146101e757806379cc6790146101ef5780638da5cb5b1461020257806395d89b411461021d578063a457c2d714610225578063a9059cbb14610238578063dd62ed3e1461024b578063f2fde38b1461025e57600080fd5b806306fdde03146100fb578063095ea7b31461011957806316114acd1461013c57806318160ddd1461015157806323b872dd14610163578063313ce56714610176578063395093511461018557806340c10f191461019857806342966c68146101ab575b600080fd5b610103610271565b6040516101109190610ce7565b60405180910390f35b61012c610127366004610d36565b610303565b6040519015158152602001610110565b61014f61014a366004610d60565b61031d565b005b6002545b604051908152602001610110565b61012c610171366004610d82565b61047f565b60405160128152602001610110565b61012c610193366004610d36565b6104a3565b61014f6101a6366004610d36565b6104c5565b61014f6101b9366004610dbe565b6104db565b6101556101cc366004610d60565b6001600160a01b031660009081526020819052604090205490565b61014f6104e5565b61014f6101fd366004610d36565b6104f9565b6005546040516001600160a01b039091168152602001610110565b61010361050e565b61012c610233366004610d36565b61051d565b61012c610246366004610d36565b610598565b610155610259366004610dd7565b6105a6565b61014f61026c366004610d60565b6105d1565b60606003805461028090610e0a565b80601f01602080910402602001604051908101604052809291908181526020018280546102ac90610e0a565b80156102f95780601f106102ce576101008083540402835291602001916102f9565b820191906000526020600020905b8154815290600101906020018083116102dc57829003601f168201915b5050505050905090565b600033610311818585610647565b60019150505b92915050565b61032561076b565b6001600160a01b0381166103a1576005546040516001600160a01b03909116904780156108fc02916000818181858888f1935050505061039e5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064015b60405180910390fd5b50565b6040516370a0823160e01b815230600482015281906000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156103ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040e9190610e44565b90506104366104256005546001600160a01b031690565b6001600160a01b03841690836107c5565b61047a5760405162461bcd60e51b8152602060048201526015602482015274151bdad95b881d1c985b9cd9995c8819985a5b1959605a1b6044820152606401610395565b505050565b60003361048d858285610898565b610498858585610912565b506001949350505050565b6000336103118185856104b683836105a6565b6104c09190610e5d565b610647565b6104cd61076b565b6104d78282610aa4565b5050565b61039e3382610b51565b6104ed61076b565b6104f76000610c71565b565b610504823383610898565b6104d78282610b51565b60606004805461028090610e0a565b6000338161052b82866105a6565b90508381101561058b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610395565b6104988286868403610647565b600033610311818585610912565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6105d961076b565b6001600160a01b03811661063e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610395565b61039e81610c71565b6001600160a01b0383166106a95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610395565b6001600160a01b03821661070a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610395565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6005546001600160a01b031633146104f75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610395565b6040516001600160a01b03838116602483015260448201839052600091829182919087169060640160408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b179052516108229190610e7e565b6000604051808303816000865af19150503d806000811461085f576040519150601f19603f3d011682016040523d82523d6000602084013e610864565b606091505b509150915081801561088e57508051158061088e57508080602001905181019061088e9190610e9a565b9695505050505050565b60006108a484846105a6565b9050600019811461090c57818110156108ff5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610395565b61090c8484848403610647565b50505050565b6001600160a01b0383166109765760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610395565b6001600160a01b0382166109d85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610395565b6001600160a01b03831660009081526020819052604090205481811015610a505760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610395565b6001600160a01b0384811660008181526020818152604080832087870390559387168083529184902080548701905592518581529092600080516020610ebd833981519152910160405180910390a361090c565b6001600160a01b038216610afa5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610395565b8060026000828254610b0c9190610e5d565b90915550506001600160a01b03821660008181526020818152604080832080548601905551848152600080516020610ebd833981519152910160405180910390a35050565b6001600160a01b038216610bb15760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610395565b6001600160a01b03821660009081526020819052604090205481811015610c255760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610395565b6001600160a01b038316600081815260208181526040808320868603905560028054879003905551858152919291600080516020610ebd833981519152910160405180910390a3505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005b83811015610cde578181015183820152602001610cc6565b50506000910152565b6020815260008251806020840152610d06816040850160208701610cc3565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114610d3157600080fd5b919050565b60008060408385031215610d4957600080fd5b610d5283610d1a565b946020939093013593505050565b600060208284031215610d7257600080fd5b610d7b82610d1a565b9392505050565b600080600060608486031215610d9757600080fd5b610da084610d1a565b9250610dae60208501610d1a565b9150604084013590509250925092565b600060208284031215610dd057600080fd5b5035919050565b60008060408385031215610dea57600080fd5b610df383610d1a565b9150610e0160208401610d1a565b90509250929050565b600181811c90821680610e1e57607f821691505b602082108103610e3e57634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215610e5657600080fd5b5051919050565b8082018082111561031757634e487b7160e01b600052601160045260246000fd5b60008251610e90818460208701610cc3565b9190910192915050565b600060208284031215610eac57600080fd5b81518015158114610d7b57600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220b9413b3e295ea54466427cb3885d953a088c004783f196ffc402f8c96242d9e764736f6c63430008120033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f65760003560e01c806370a082311161009257806370a08231146101be578063715018a6146101e757806379cc6790146101ef5780638da5cb5b1461020257806395d89b411461021d578063a457c2d714610225578063a9059cbb14610238578063dd62ed3e1461024b578063f2fde38b1461025e57600080fd5b806306fdde03146100fb578063095ea7b31461011957806316114acd1461013c57806318160ddd1461015157806323b872dd14610163578063313ce56714610176578063395093511461018557806340c10f191461019857806342966c68146101ab575b600080fd5b610103610271565b6040516101109190610ce7565b60405180910390f35b61012c610127366004610d36565b610303565b6040519015158152602001610110565b61014f61014a366004610d60565b61031d565b005b6002545b604051908152602001610110565b61012c610171366004610d82565b61047f565b60405160128152602001610110565b61012c610193366004610d36565b6104a3565b61014f6101a6366004610d36565b6104c5565b61014f6101b9366004610dbe565b6104db565b6101556101cc366004610d60565b6001600160a01b031660009081526020819052604090205490565b61014f6104e5565b61014f6101fd366004610d36565b6104f9565b6005546040516001600160a01b039091168152602001610110565b61010361050e565b61012c610233366004610d36565b61051d565b61012c610246366004610d36565b610598565b610155610259366004610dd7565b6105a6565b61014f61026c366004610d60565b6105d1565b60606003805461028090610e0a565b80601f01602080910402602001604051908101604052809291908181526020018280546102ac90610e0a565b80156102f95780601f106102ce576101008083540402835291602001916102f9565b820191906000526020600020905b8154815290600101906020018083116102dc57829003601f168201915b5050505050905090565b600033610311818585610647565b60019150505b92915050565b61032561076b565b6001600160a01b0381166103a1576005546040516001600160a01b03909116904780156108fc02916000818181858888f1935050505061039e5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064015b60405180910390fd5b50565b6040516370a0823160e01b815230600482015281906000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156103ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040e9190610e44565b90506104366104256005546001600160a01b031690565b6001600160a01b03841690836107c5565b61047a5760405162461bcd60e51b8152602060048201526015602482015274151bdad95b881d1c985b9cd9995c8819985a5b1959605a1b6044820152606401610395565b505050565b60003361048d858285610898565b610498858585610912565b506001949350505050565b6000336103118185856104b683836105a6565b6104c09190610e5d565b610647565b6104cd61076b565b6104d78282610aa4565b5050565b61039e3382610b51565b6104ed61076b565b6104f76000610c71565b565b610504823383610898565b6104d78282610b51565b60606004805461028090610e0a565b6000338161052b82866105a6565b90508381101561058b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610395565b6104988286868403610647565b600033610311818585610912565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6105d961076b565b6001600160a01b03811661063e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610395565b61039e81610c71565b6001600160a01b0383166106a95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610395565b6001600160a01b03821661070a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610395565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6005546001600160a01b031633146104f75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610395565b6040516001600160a01b03838116602483015260448201839052600091829182919087169060640160408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b179052516108229190610e7e565b6000604051808303816000865af19150503d806000811461085f576040519150601f19603f3d011682016040523d82523d6000602084013e610864565b606091505b509150915081801561088e57508051158061088e57508080602001905181019061088e9190610e9a565b9695505050505050565b60006108a484846105a6565b9050600019811461090c57818110156108ff5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610395565b61090c8484848403610647565b50505050565b6001600160a01b0383166109765760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610395565b6001600160a01b0382166109d85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610395565b6001600160a01b03831660009081526020819052604090205481811015610a505760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610395565b6001600160a01b0384811660008181526020818152604080832087870390559387168083529184902080548701905592518581529092600080516020610ebd833981519152910160405180910390a361090c565b6001600160a01b038216610afa5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610395565b8060026000828254610b0c9190610e5d565b90915550506001600160a01b03821660008181526020818152604080832080548601905551848152600080516020610ebd833981519152910160405180910390a35050565b6001600160a01b038216610bb15760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610395565b6001600160a01b03821660009081526020819052604090205481811015610c255760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610395565b6001600160a01b038316600081815260208181526040808320868603905560028054879003905551858152919291600080516020610ebd833981519152910160405180910390a3505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005b83811015610cde578181015183820152602001610cc6565b50506000910152565b6020815260008251806020840152610d06816040850160208701610cc3565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114610d3157600080fd5b919050565b60008060408385031215610d4957600080fd5b610d5283610d1a565b946020939093013593505050565b600060208284031215610d7257600080fd5b610d7b82610d1a565b9392505050565b600080600060608486031215610d9757600080fd5b610da084610d1a565b9250610dae60208501610d1a565b9150604084013590509250925092565b600060208284031215610dd057600080fd5b5035919050565b60008060408385031215610dea57600080fd5b610df383610d1a565b9150610e0160208401610d1a565b90509250929050565b600181811c90821680610e1e57607f821691505b602082108103610e3e57634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215610e5657600080fd5b5051919050565b8082018082111561031757634e487b7160e01b600052601160045260246000fd5b60008251610e90818460208701610cc3565b9190910192915050565b600060208284031215610eac57600080fd5b81518015158114610d7b57600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220b9413b3e295ea54466427cb3885d953a088c004783f196ffc402f8c96242d9e764736f6c63430008120033", + "devdoc": { + "custom:security-contact": "contact@kleros.io", + "events": { + "Approval(address,address,uint256)": { + "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." + }, + "Transfer(address,address,uint256)": { + "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." + } + }, + "kind": "dev", + "methods": { + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "burn(uint256)": { + "details": "Destroys `amount` tokens from the caller. See {ERC20-_burn}." + }, + "burnFrom(address,uint256)": { + "details": "Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {ERC20-_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for ``accounts``'s tokens of at least `amount`." + }, + "decimals()": { + "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." + }, + "decreaseAllowance(address,uint256)": { + "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." + }, + "increaseAllowance(address,uint256)": { + "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." + }, + "name()": { + "details": "Returns the name of the token." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "recoverTokens(address)": { + "params": { + "_token": "The address of the token contract that you want to recover, or set to 0 in case you want to extract ether." + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "recoverTokens(address)": { + "notice": "Recover tokens sent mistakenly to this contract." + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 393, + "contract": "src/token/PinakionV2.sol:PinakionV2", + "label": "_balances", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 399, + "contract": "src/token/PinakionV2.sol:PinakionV2", + "label": "_allowances", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 401, + "contract": "src/token/PinakionV2.sol:PinakionV2", + "label": "_totalSupply", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 403, + "contract": "src/token/PinakionV2.sol:PinakionV2", + "label": "_name", + "offset": 0, + "slot": "3", + "type": "t_string_storage" + }, + { + "astId": 405, + "contract": "src/token/PinakionV2.sol:PinakionV2", + "label": "_symbol", + "offset": 0, + "slot": "4", + "type": "t_string_storage" + }, + { + "astId": 103, + "contract": "src/token/PinakionV2.sol:PinakionV2", + "label": "_owner", + "offset": 0, + "slot": "5", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/package.json b/contracts/package.json index b9159791a..1e582bafc 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -61,7 +61,7 @@ "ethers": "^5.7.2", "graphql": "^16.7.1", "graphql-request": "^6.1.0", - "hardhat": "^2.19.2", + "hardhat": "2.15.0", "hardhat-contract-sizer": "^2.10.0", "hardhat-deploy": "^0.11.42", "hardhat-deploy-ethers": "^0.4.0-next.1", diff --git a/contracts/scripts/generateDeploymentsMarkdown.sh b/contracts/scripts/generateDeploymentsMarkdown.sh index 7c73b0217..7946375d9 100755 --- a/contracts/scripts/generateDeploymentsMarkdown.sh +++ b/contracts/scripts/generateDeploymentsMarkdown.sh @@ -23,25 +23,25 @@ echo "#### Chiado" echo generate "$SCRIPT_DIR/../deployments/chiado" "https://gnosis-chiado.blockscout.com/address/" echo -echo "#### Goerli" +echo "#### Sepolia" echo generate "$SCRIPT_DIR/../deployments/goerli" "https://goerli.etherscan.io/address/" echo -echo "#### Arbitrum Goerli" +echo "#### Arbitrum Sepolia" echo echo "- [PNK](https://goerli.arbiscan.io/token/0x3483FA1b87792cd5BE4100822C4eCEC8D3E531ee)" -generate "$SCRIPT_DIR/../deployments/arbitrumGoerli" "https://goerli.arbiscan.io/address/" +generate "$SCRIPT_DIR/../deployments/arbitrumSepolia" "https://goerli.arbiscan.io/address/" echo echo "### Devnet" echo "#### Chiado" echo generate "$SCRIPT_DIR/../deployments/chiadoDevnet" "https://gnosis-chiado.blockscout.com/address/" echo -echo "#### Goerli" +echo "#### Sepolia" echo generate "$SCRIPT_DIR/../deployments/goerliDevnet" "https://goerli.etherscan.io/address/" echo -echo "#### Arbitrum Goerli" +echo "#### Arbitrum Sepolia" echo echo "- [PNK](https://goerli.arbiscan.io/token/0x3483FA1b87792cd5BE4100822C4eCEC8D3E531ee)" -generate "$SCRIPT_DIR/../deployments/arbitrumGoerliDevnet" "https://goerli.arbiscan.io/address/" \ No newline at end of file +generate "$SCRIPT_DIR/../deployments/arbitrumSepoliaDevnet" "https://goerli.arbiscan.io/address/" \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 44b9cc0cf..051f4844a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5351,7 +5351,7 @@ __metadata: ethers: ^5.7.2 graphql: ^16.7.1 graphql-request: ^6.1.0 - hardhat: ^2.19.2 + hardhat: 2.15.0 hardhat-contract-sizer: ^2.10.0 hardhat-deploy: ^0.11.42 hardhat-deploy-ethers: ^0.4.0-next.1 @@ -6145,161 +6145,161 @@ __metadata: languageName: node linkType: hard -"@nomicfoundation/ethereumjs-block@npm:5.0.2": - version: 5.0.2 - resolution: "@nomicfoundation/ethereumjs-block@npm:5.0.2" +"@nomicfoundation/ethereumjs-block@npm:5.0.1": + version: 5.0.1 + resolution: "@nomicfoundation/ethereumjs-block@npm:5.0.1" dependencies: - "@nomicfoundation/ethereumjs-common": 4.0.2 - "@nomicfoundation/ethereumjs-rlp": 5.0.2 - "@nomicfoundation/ethereumjs-trie": 6.0.2 - "@nomicfoundation/ethereumjs-tx": 5.0.2 - "@nomicfoundation/ethereumjs-util": 9.0.2 + "@nomicfoundation/ethereumjs-common": 4.0.1 + "@nomicfoundation/ethereumjs-rlp": 5.0.1 + "@nomicfoundation/ethereumjs-trie": 6.0.1 + "@nomicfoundation/ethereumjs-tx": 5.0.1 + "@nomicfoundation/ethereumjs-util": 9.0.1 ethereum-cryptography: 0.1.3 ethers: ^5.7.1 - checksum: 7ff744f44a01f1c059ca7812a1cfc8089f87aa506af6cb39c78331dca71b32993cbd6fa05ad03f8c4f4fab73bb998a927af69e0d8ff01ae192ee5931606e09f5 + checksum: 02591bc9ba02b56edc5faf75a7991d6b9430bd98542864f2f6ab202f0f4aed09be156fdba60948375beb10e524ffa4e461475edc8a15b3098b1c58ff59a0137e languageName: node linkType: hard -"@nomicfoundation/ethereumjs-blockchain@npm:7.0.2": - version: 7.0.2 - resolution: "@nomicfoundation/ethereumjs-blockchain@npm:7.0.2" - dependencies: - "@nomicfoundation/ethereumjs-block": 5.0.2 - "@nomicfoundation/ethereumjs-common": 4.0.2 - "@nomicfoundation/ethereumjs-ethash": 3.0.2 - "@nomicfoundation/ethereumjs-rlp": 5.0.2 - "@nomicfoundation/ethereumjs-trie": 6.0.2 - "@nomicfoundation/ethereumjs-tx": 5.0.2 - "@nomicfoundation/ethereumjs-util": 9.0.2 +"@nomicfoundation/ethereumjs-blockchain@npm:7.0.1": + version: 7.0.1 + resolution: "@nomicfoundation/ethereumjs-blockchain@npm:7.0.1" + dependencies: + "@nomicfoundation/ethereumjs-block": 5.0.1 + "@nomicfoundation/ethereumjs-common": 4.0.1 + "@nomicfoundation/ethereumjs-ethash": 3.0.1 + "@nomicfoundation/ethereumjs-rlp": 5.0.1 + "@nomicfoundation/ethereumjs-trie": 6.0.1 + "@nomicfoundation/ethereumjs-tx": 5.0.1 + "@nomicfoundation/ethereumjs-util": 9.0.1 abstract-level: ^1.0.3 debug: ^4.3.3 ethereum-cryptography: 0.1.3 level: ^8.0.0 lru-cache: ^5.1.1 memory-level: ^1.0.0 - checksum: b7e440dcd73e32aa72d13bfd28cb472773c9c60ea808a884131bf7eb3f42286ad594a0864215f599332d800f3fe1f772fff4b138d2dcaa8f41e4d8389bff33e7 + checksum: 8b7a4e3613c2abbf59e92a927cb074d1df8640fbf6a0ec4be7fcb5ecaead1310ebbe3a41613c027253742f6dccca6eaeee8dde0a38315558de156313d0c8f313 languageName: node linkType: hard -"@nomicfoundation/ethereumjs-common@npm:4.0.2": - version: 4.0.2 - resolution: "@nomicfoundation/ethereumjs-common@npm:4.0.2" +"@nomicfoundation/ethereumjs-common@npm:4.0.1": + version: 4.0.1 + resolution: "@nomicfoundation/ethereumjs-common@npm:4.0.1" dependencies: - "@nomicfoundation/ethereumjs-util": 9.0.2 + "@nomicfoundation/ethereumjs-util": 9.0.1 crc-32: ^1.2.0 - checksum: f0d84704d6254d374299c19884312bd5666974b4b6f342d3f10bc76e549de78d20e45a53d25fbdc146268a52335497127e4f069126da7c60ac933a158e704887 + checksum: af5b599bcc07430b57017e516b0bad70af04e812b970be9bfae0c1d3433ab26656b3d1db71717b3b0fb38a889db2b93071b45adc1857000e7cd58a99a8e29495 languageName: node linkType: hard -"@nomicfoundation/ethereumjs-ethash@npm:3.0.2": - version: 3.0.2 - resolution: "@nomicfoundation/ethereumjs-ethash@npm:3.0.2" +"@nomicfoundation/ethereumjs-ethash@npm:3.0.1": + version: 3.0.1 + resolution: "@nomicfoundation/ethereumjs-ethash@npm:3.0.1" dependencies: - "@nomicfoundation/ethereumjs-block": 5.0.2 - "@nomicfoundation/ethereumjs-rlp": 5.0.2 - "@nomicfoundation/ethereumjs-util": 9.0.2 + "@nomicfoundation/ethereumjs-block": 5.0.1 + "@nomicfoundation/ethereumjs-rlp": 5.0.1 + "@nomicfoundation/ethereumjs-util": 9.0.1 abstract-level: ^1.0.3 bigint-crypto-utils: ^3.0.23 ethereum-cryptography: 0.1.3 - checksum: e4011e4019dd9b92f7eeebfc1e6c9a9685c52d8fd0ee4f28f03e50048a23b600c714490827f59fdce497b3afb503b3fd2ebf6815ff307e9949c3efeff1403278 + checksum: beeec9788a9ed57020ee47271447715bdc0a98990a0bd0e9d598c6de74ade836db17c0590275e6aab12fa9b0fbd81f1d02e3cdf1fb8497583cec693ec3ed6aed languageName: node linkType: hard -"@nomicfoundation/ethereumjs-evm@npm:2.0.2": - version: 2.0.2 - resolution: "@nomicfoundation/ethereumjs-evm@npm:2.0.2" +"@nomicfoundation/ethereumjs-evm@npm:2.0.1": + version: 2.0.1 + resolution: "@nomicfoundation/ethereumjs-evm@npm:2.0.1" dependencies: "@ethersproject/providers": ^5.7.1 - "@nomicfoundation/ethereumjs-common": 4.0.2 - "@nomicfoundation/ethereumjs-tx": 5.0.2 - "@nomicfoundation/ethereumjs-util": 9.0.2 + "@nomicfoundation/ethereumjs-common": 4.0.1 + "@nomicfoundation/ethereumjs-tx": 5.0.1 + "@nomicfoundation/ethereumjs-util": 9.0.1 debug: ^4.3.3 ethereum-cryptography: 0.1.3 mcl-wasm: ^0.7.1 rustbn.js: ~0.2.0 - checksum: a23cf570836ddc147606b02df568069de946108e640f902358fef67e589f6b371d856056ee44299d9b4e3497f8ae25faa45e6b18fefd90e9b222dc6a761d85f0 + checksum: 0aa2e1460e1c311506fd3bf9d03602c7c3a5e03f352173a55a274a9cc1840bd774692d1c4e5c6e82a7eee015a7cf1585f1c5be02cfdf54cc2a771421820e3f84 languageName: node linkType: hard -"@nomicfoundation/ethereumjs-rlp@npm:5.0.2": - version: 5.0.2 - resolution: "@nomicfoundation/ethereumjs-rlp@npm:5.0.2" +"@nomicfoundation/ethereumjs-rlp@npm:5.0.1": + version: 5.0.1 + resolution: "@nomicfoundation/ethereumjs-rlp@npm:5.0.1" bin: rlp: bin/rlp - checksum: a74434cadefca9aa8754607cc1ad7bb4bbea4ee61c6214918e60a5bbee83206850346eb64e39fd1fe97f854c7ec0163e01148c0c881dda23881938f0645a0ef2 + checksum: 5a51d2cf92b84e50ce516cbdadff5d39cb4c6b71335e92eaf447dfb7d88f5499d78d599024b9252efd7ba99495de36f4d983cec6a89e77db286db691fc6328f7 languageName: node linkType: hard -"@nomicfoundation/ethereumjs-statemanager@npm:2.0.2": - version: 2.0.2 - resolution: "@nomicfoundation/ethereumjs-statemanager@npm:2.0.2" +"@nomicfoundation/ethereumjs-statemanager@npm:2.0.1": + version: 2.0.1 + resolution: "@nomicfoundation/ethereumjs-statemanager@npm:2.0.1" dependencies: - "@nomicfoundation/ethereumjs-common": 4.0.2 - "@nomicfoundation/ethereumjs-rlp": 5.0.2 + "@nomicfoundation/ethereumjs-common": 4.0.1 + "@nomicfoundation/ethereumjs-rlp": 5.0.1 debug: ^4.3.3 ethereum-cryptography: 0.1.3 ethers: ^5.7.1 js-sdsl: ^4.1.4 - checksum: 3ab6578e252e53609afd98d8ba42a99f182dcf80252f23ed9a5e0471023ffb2502130f85fc47fa7c94cd149f9be799ed9a0942ca52a143405be9267f4ad94e64 + checksum: 157b503fa3e45a3695ba2eba5b089b56719f7790274edd09c95bb0d223570820127f6a2cbfcb14f2d9d876d1440ea4dccb04a4922fa9e9e34b416fddd6517c20 languageName: node linkType: hard -"@nomicfoundation/ethereumjs-trie@npm:6.0.2": - version: 6.0.2 - resolution: "@nomicfoundation/ethereumjs-trie@npm:6.0.2" +"@nomicfoundation/ethereumjs-trie@npm:6.0.1": + version: 6.0.1 + resolution: "@nomicfoundation/ethereumjs-trie@npm:6.0.1" dependencies: - "@nomicfoundation/ethereumjs-rlp": 5.0.2 - "@nomicfoundation/ethereumjs-util": 9.0.2 + "@nomicfoundation/ethereumjs-rlp": 5.0.1 + "@nomicfoundation/ethereumjs-util": 9.0.1 "@types/readable-stream": ^2.3.13 ethereum-cryptography: 0.1.3 readable-stream: ^3.6.0 - checksum: d4da918d333851b9f2cce7dbd25ab5753e0accd43d562d98fd991b168b6a08d1794528f0ade40fe5617c84900378376fe6256cdbe52c8d66bf4c53293bbc7c40 + checksum: 7001c3204120fd4baba673b4bb52015594f5ad28311f24574cd16f38c015ef87ed51188d6f46d6362ffb9da589359a9e0f99e6068ef7a2f61cb66213e2f493d7 languageName: node linkType: hard -"@nomicfoundation/ethereumjs-tx@npm:5.0.2": - version: 5.0.2 - resolution: "@nomicfoundation/ethereumjs-tx@npm:5.0.2" +"@nomicfoundation/ethereumjs-tx@npm:5.0.1": + version: 5.0.1 + resolution: "@nomicfoundation/ethereumjs-tx@npm:5.0.1" dependencies: "@chainsafe/ssz": ^0.9.2 "@ethersproject/providers": ^5.7.2 - "@nomicfoundation/ethereumjs-common": 4.0.2 - "@nomicfoundation/ethereumjs-rlp": 5.0.2 - "@nomicfoundation/ethereumjs-util": 9.0.2 + "@nomicfoundation/ethereumjs-common": 4.0.1 + "@nomicfoundation/ethereumjs-rlp": 5.0.1 + "@nomicfoundation/ethereumjs-util": 9.0.1 ethereum-cryptography: 0.1.3 - checksum: 0bbcea75786b2ccb559afe2ecc9866fb4566a9f157b6ffba4f50960d14f4b3da2e86e273f6fadda9b860e67cfcabf589970fb951b328cb5f900a585cd21842a2 + checksum: aa3829e4a43f5e10cfd66b87eacb3e737ba98f5e3755a3e6a4ccfbc257dbf10d926838cc3acb8fef8afa3362a023b7fd11b53e6ba53f94bb09c345f083cd29a8 languageName: node linkType: hard -"@nomicfoundation/ethereumjs-util@npm:9.0.2": - version: 9.0.2 - resolution: "@nomicfoundation/ethereumjs-util@npm:9.0.2" +"@nomicfoundation/ethereumjs-util@npm:9.0.1": + version: 9.0.1 + resolution: "@nomicfoundation/ethereumjs-util@npm:9.0.1" dependencies: "@chainsafe/ssz": ^0.10.0 - "@nomicfoundation/ethereumjs-rlp": 5.0.2 + "@nomicfoundation/ethereumjs-rlp": 5.0.1 ethereum-cryptography: 0.1.3 - checksum: 3a08f7b88079ef9f53b43da9bdcb8195498fd3d3911c2feee2571f4d1204656053f058b2f650471c86f7d2d0ba2f814768c7cfb0f266eede41c848356afc4900 + checksum: 5f8a50a25c68c974b717f36ad0a5828b786ce1aaea3c874663c2014593fa387de5ad5c8cea35e94379df306dbd1a58c55b310779fd82197dcb993d5dbd4de7a1 languageName: node linkType: hard -"@nomicfoundation/ethereumjs-vm@npm:7.0.2": - version: 7.0.2 - resolution: "@nomicfoundation/ethereumjs-vm@npm:7.0.2" - dependencies: - "@nomicfoundation/ethereumjs-block": 5.0.2 - "@nomicfoundation/ethereumjs-blockchain": 7.0.2 - "@nomicfoundation/ethereumjs-common": 4.0.2 - "@nomicfoundation/ethereumjs-evm": 2.0.2 - "@nomicfoundation/ethereumjs-rlp": 5.0.2 - "@nomicfoundation/ethereumjs-statemanager": 2.0.2 - "@nomicfoundation/ethereumjs-trie": 6.0.2 - "@nomicfoundation/ethereumjs-tx": 5.0.2 - "@nomicfoundation/ethereumjs-util": 9.0.2 +"@nomicfoundation/ethereumjs-vm@npm:7.0.1": + version: 7.0.1 + resolution: "@nomicfoundation/ethereumjs-vm@npm:7.0.1" + dependencies: + "@nomicfoundation/ethereumjs-block": 5.0.1 + "@nomicfoundation/ethereumjs-blockchain": 7.0.1 + "@nomicfoundation/ethereumjs-common": 4.0.1 + "@nomicfoundation/ethereumjs-evm": 2.0.1 + "@nomicfoundation/ethereumjs-rlp": 5.0.1 + "@nomicfoundation/ethereumjs-statemanager": 2.0.1 + "@nomicfoundation/ethereumjs-trie": 6.0.1 + "@nomicfoundation/ethereumjs-tx": 5.0.1 + "@nomicfoundation/ethereumjs-util": 9.0.1 debug: ^4.3.3 ethereum-cryptography: 0.1.3 mcl-wasm: ^0.7.1 rustbn.js: ~0.2.0 - checksum: 1c25ba4d0644cadb8a2b0241a4bb02e578bfd7f70e3492b855c2ab5c120cb159cb8f7486f84dc1597884bd1697feedbfb5feb66e91352afb51f3694fd8e4a043 + checksum: 0f637316322744140d6f75d894c21b8055e27a94c72dd8ae9b0b9b93c0d54d7f30fa2aaf909e802e183a3f1020b4aa6a8178dedb823a4ce70a227ac7b432f8c1 languageName: node linkType: hard @@ -18868,26 +18868,27 @@ __metadata: languageName: node linkType: hard -"hardhat@npm:^2.19.2": - version: 2.19.2 - resolution: "hardhat@npm:2.19.2" +"hardhat@npm:2.15.0": + version: 2.15.0 + resolution: "hardhat@npm:2.15.0" dependencies: "@ethersproject/abi": ^5.1.2 "@metamask/eth-sig-util": ^4.0.0 - "@nomicfoundation/ethereumjs-block": 5.0.2 - "@nomicfoundation/ethereumjs-blockchain": 7.0.2 - "@nomicfoundation/ethereumjs-common": 4.0.2 - "@nomicfoundation/ethereumjs-evm": 2.0.2 - "@nomicfoundation/ethereumjs-rlp": 5.0.2 - "@nomicfoundation/ethereumjs-statemanager": 2.0.2 - "@nomicfoundation/ethereumjs-trie": 6.0.2 - "@nomicfoundation/ethereumjs-tx": 5.0.2 - "@nomicfoundation/ethereumjs-util": 9.0.2 - "@nomicfoundation/ethereumjs-vm": 7.0.2 + "@nomicfoundation/ethereumjs-block": 5.0.1 + "@nomicfoundation/ethereumjs-blockchain": 7.0.1 + "@nomicfoundation/ethereumjs-common": 4.0.1 + "@nomicfoundation/ethereumjs-evm": 2.0.1 + "@nomicfoundation/ethereumjs-rlp": 5.0.1 + "@nomicfoundation/ethereumjs-statemanager": 2.0.1 + "@nomicfoundation/ethereumjs-trie": 6.0.1 + "@nomicfoundation/ethereumjs-tx": 5.0.1 + "@nomicfoundation/ethereumjs-util": 9.0.1 + "@nomicfoundation/ethereumjs-vm": 7.0.1 "@nomicfoundation/solidity-analyzer": ^0.1.0 "@sentry/node": ^5.18.1 "@types/bn.js": ^5.1.0 "@types/lru-cache": ^5.1.0 + abort-controller: ^3.0.0 adm-zip: ^0.4.16 aggregate-error: ^3.0.0 ansi-escapes: ^4.3.0 @@ -18910,6 +18911,7 @@ __metadata: mnemonist: ^0.38.0 mocha: ^10.0.0 p-map: ^4.0.0 + qs: ^6.7.0 raw-body: ^2.4.1 resolve: 1.17.0 semver: ^6.3.0 @@ -18930,7 +18932,7 @@ __metadata: optional: true bin: hardhat: internal/cli/bootstrap.js - checksum: 0b5499890e46750ca8c51bbe1205599b1424a2e5293b40c9f7cb56320d56b9935fbd4e276de370e07664ae81fa57dc7ab227bf2b2363f5732ef9f06df1a9a6d9 + checksum: 46767f0eb75f08e1f47585d3aec3261932251b47909051bfffcbff317f7efe06fdab7cb8686cb67c46cc7ed4cedb80d0c21157fe03f103054001b2762085ef92 languageName: node linkType: hard @@ -27157,7 +27159,7 @@ __metadata: languageName: node linkType: hard -"qs@npm:^6.10.3, qs@npm:^6.4.0, qs@npm:^6.9.4": +"qs@npm:^6.10.3, qs@npm:^6.4.0, qs@npm:^6.7.0, qs@npm:^6.9.4": version: 6.11.2 resolution: "qs@npm:6.11.2" dependencies: From 3c6c5db6b23edb61a89516f46038984410ab97f6 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Tue, 19 Dec 2023 21:45:25 +0000 Subject: [PATCH 46/77] feat: devnet deployment to ArbitrumSepolia and scripts refactor --- contracts/README.md | 103 +- contracts/deploy/00-ethereum-pnk.ts | 8 +- contracts/deploy/00-home-chain-arbitrable.ts | 15 +- contracts/deploy/00-home-chain-arbitration.ts | 119 +- contracts/deploy/00-home-chain-pnk-faucet.ts | 2 +- contracts/deploy/00-rng.ts | 57 +- .../deploy/01-foreign-gateway-on-ethereum.ts | 6 +- .../deploy/01-foreign-gateway-on-gnosis.ts | 6 +- .../deploy/02-home-gateway-to-ethereum.ts | 4 +- contracts/deploy/02-home-gateway-to-gnosis.ts | 4 +- contracts/deploy/03-vea-mock.ts | 4 +- contracts/deploy/04-foreign-arbitrable.ts | 4 +- .../deploy/04-klerosliquid-to-v2-gnosis.ts | 4 +- contracts/deploy/fix1148.ts | 2 +- contracts/deploy/upgrade-kleros-core.ts | 4 +- contracts/deploy/upgrade-sortition-module.ts | 4 +- .../deploy/utils/deployERC20AndFaucet.ts | 35 + contracts/deploy/utils/getContractOrDeploy.ts | 19 + contracts/deployments/arbitrum/Pinakion.json | 280 ++ .../arbitrum/RandomizerOracle.json | 4 + .../arbitrumSepolia/RandomizerOracle.json | 4 + .../arbitrumSepoliaDevnet/DAI.json | 458 +++ .../arbitrumSepoliaDevnet/DAIFaucet.json | 226 ++ .../DisputeKitClassic.json | 1011 +++++++ .../DisputeKitClassic_Implementation.json | 1530 ++++++++++ .../DisputeKitClassic_Proxy.json | 93 + .../arbitrumSepoliaDevnet/EvidenceModule.json | 268 ++ .../EvidenceModule_Implementation.json | 327 +++ .../EvidenceModule_Proxy.json | 93 + .../arbitrumSepoliaDevnet/KlerosCore.json | 1905 ++++++++++++ .../KlerosCore_Implementation.json | 2571 +++++++++++++++++ .../KlerosCore_Proxy.json | 136 + .../arbitrumSepoliaDevnet/PolicyRegistry.json | 305 ++ .../PolicyRegistry_Implementation.json | 397 +++ .../PolicyRegistry_Proxy.json | 93 + .../RandomizerOracle.json | 4 + .../arbitrumSepoliaDevnet/RandomizerRNG.json | 397 +++ .../RandomizerRNG_Implementation.json | 533 ++++ .../RandomizerRNG_Proxy.json | 93 + .../SortitionModule.json | 1053 +++++++ .../SortitionModule_Implementation.json | 1533 ++++++++++ .../SortitionModule_Proxy.json | 93 + .../arbitrumSepoliaDevnet/WETH.json | 458 +++ .../arbitrumSepoliaDevnet/WETHFaucet.json | 226 ++ contracts/deployments/sepoliaDevnet/.chainId | 1 + .../deployments/sepoliaDevnet/PinakionV2.json | 605 ++++ contracts/foundry.toml | 2 + contracts/hardhat.config.ts | 2 + .../scripts/generateDeploymentsMarkdown.sh | 34 +- contracts/test/arbitration/staking.ts | 1 - cspell.json | 1 + 51 files changed, 14918 insertions(+), 219 deletions(-) create mode 100644 contracts/deploy/utils/deployERC20AndFaucet.ts create mode 100644 contracts/deploy/utils/getContractOrDeploy.ts create mode 100644 contracts/deployments/arbitrum/Pinakion.json create mode 100644 contracts/deployments/arbitrum/RandomizerOracle.json create mode 100644 contracts/deployments/arbitrumSepolia/RandomizerOracle.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/DAI.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/DAIFaucet.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic_Implementation.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic_Proxy.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule_Implementation.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule_Proxy.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/KlerosCore.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/KlerosCore_Implementation.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/KlerosCore_Proxy.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/PolicyRegistry.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/PolicyRegistry_Implementation.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/PolicyRegistry_Proxy.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/RandomizerOracle.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/RandomizerRNG.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/RandomizerRNG_Implementation.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/RandomizerRNG_Proxy.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/SortitionModule.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/SortitionModule_Implementation.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/SortitionModule_Proxy.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/WETH.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/WETHFaucet.json create mode 100644 contracts/deployments/sepoliaDevnet/.chainId create mode 100644 contracts/deployments/sepoliaDevnet/PinakionV2.json diff --git a/contracts/README.md b/contracts/README.md index dc53025a6..fceded066 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -8,6 +8,14 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments ### Official Testnet +#### Arbitrum Sepolia + +- [PinakionV2](https://sepolia.arbiscan.io/address/0x34B944D42cAcfC8266955D07A80181D2054aa225) + +#### Sepolia + +- [PinakionV2](https://sepolia.etherscan.io/address/0x593e89704D285B0c3fbF157c7CF2537456CE64b5) + #### Chiado - [ArbitrableExample](https://gnosis-chiado.blockscout.com/address/0x438ca5337AE771dF926B7f4fDE1A21D72a315bDC) @@ -22,32 +30,26 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments - [WrappedPinakionV2](https://gnosis-chiado.blockscout.com/address/0xD75E27A56AaF9eE7F8d9A472a8C2EF2f65a764dd) - [xKlerosLiquidV2](https://gnosis-chiado.blockscout.com/address/0x34E520dc1d2Db660113b64724e14CEdCD01Ee879) -#### Goerli - -- [PinakionV2](https://goerli.etherscan.io/address/0x8EAA3Bc72CD250b9A97B255991e8E58933EFB9ee) - -#### Arbitrum Goerli - -- [PNK](https://goerli.arbiscan.io/token/0x3483FA1b87792cd5BE4100822C4eCEC8D3E531ee) -- [ArbitrableExample](https://goerli.arbiscan.io/address/0x983Ac51c7aDa934651dd1ee58176111FccfBFA5B) -- [BlockHashRNG](https://goerli.arbiscan.io/address/0x68eE49dfD9d76f3386257a3D0e0A85c0A5519bBD) -- [DAI](https://goerli.arbiscan.io/address/0x70A704Dce4cCC00568Cc142C86D07Ec71C944a39) -- [DAIFaucet](https://goerli.arbiscan.io/address/0xB7C693623437cC46a8E50DF234d90Ab9F57DdE63) -- [DisputeKitClassic: proxy](https://goerli.arbiscan.io/address/0x448F5B93b054BD33A765168d3447cA96D5aD4818), [implementation](https://goerli.arbiscan.io/address/0xACCeDd7cF1dAc4d0E4d149E3395F6Fe83cE7af31) -- [DisputeResolver](https://goerli.arbiscan.io/address/0xCf1da8f2b4BC9d35146433c7F69f4204Cf6b7655) -- [DisputeTemplateRegistry: proxy](https://goerli.arbiscan.io/address/0x9c0b277C0B14c80bC5c560Cd56941816B6Fe7703), [implementation](https://goerli.arbiscan.io/address/0x32D001F8Cf32086ba8937f920b2f3A2820Ba69F2) -- [EvidenceModule: proxy](https://goerli.arbiscan.io/address/0x36e1e5C2644Ec9ba0C3d85B89182f8EDD5696248), [implementation](https://goerli.arbiscan.io/address/0xa94d95084c7Cb165C565CBF4FD024Bc5e6E9DDb8) -- [KlerosCore: proxy](https://goerli.arbiscan.io/address/0x7d6b24d4DC36a6BC3F0E3B40B9383782Bcd0aDd7), [implementation](https://goerli.arbiscan.io/address/0x821af5f921E392Ce623c706CADc37d5b84ccE3C3) -- [PNKFaucet](https://goerli.arbiscan.io/address/0x28638dD9515fB1a74909C81e1c9A7cdf698Ff962) -- [PinakionV2](https://goerli.arbiscan.io/address/0x3483FA1b87792cd5BE4100822C4eCEC8D3E531ee) -- [PolicyRegistry: proxy](https://goerli.arbiscan.io/address/0x9c5dD8bBe4342dFC53f47Bd5ba0808e0B4d825e8), [implementation](https://goerli.arbiscan.io/address/0xE92BEd1c2704217b446C4a065bbAEE23D406699D) -- [RandomizerRNG: proxy](https://goerli.arbiscan.io/address/0x5BF61114fc88F405A523A410b6371Ea223785870), [implementation](https://goerli.arbiscan.io/address/0x32F0db14e66eAC97f202679cEB1DF74EA1b887D9) -- [SortitionModule: proxy](https://goerli.arbiscan.io/address/0xe2536798227fdd68fD8cf74d87D050D667eCaC0F), [implementation](https://goerli.arbiscan.io/address/0xf91915e0f20Ab032D856DC52825a281571053CDD) -- [WETH](https://goerli.arbiscan.io/address/0xddE1b84E43505432Fdf5F810ebB9373dD37e9230) -- [WETHFaucet](https://goerli.arbiscan.io/address/0x16FD9d82ccA652EE7d85443f82062013aC0A4Ab8) - ### Devnet +#### Arbitrum Sepolia + +- [DAI](https://sepolia.arbiscan.io/address/0x593e89704D285B0c3fbF157c7CF2537456CE64b5) +- [DAIFaucet](https://sepolia.arbiscan.io/address/0xB5b39A1bcD2D7097A8824B3cC18Ebd2dFb0D9B5E) +- [DisputeKitClassic: proxy](https://sepolia.arbiscan.io/address/0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3), [implementation](https://sepolia.arbiscan.io/address/0xC3dB344755b15c8Edfd834db79af4f8860029FB4) +- [EvidenceModule: proxy](https://sepolia.arbiscan.io/address/0x827411b3e98bAe8c441efBf26842A1670f8f378F), [implementation](https://sepolia.arbiscan.io/address/0x26c1980120F1C82cF611D666CE81D2b54d018547) +- [KlerosCore: proxy](https://sepolia.arbiscan.io/address/0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284), [implementation](https://sepolia.arbiscan.io/address/0x614498118850184c62f82d08261109334bFB050f) +- [PinakionV2](https://sepolia.arbiscan.io/address/0x34B944D42cAcfC8266955D07A80181D2054aa225) +- [PolicyRegistry: proxy](https://sepolia.arbiscan.io/address/0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da), [implementation](https://sepolia.arbiscan.io/address/0xAA637C9E2831614158d7eB193D03af4a7223C56E) +- [RandomizerRNG: proxy](https://sepolia.arbiscan.io/address/0xA995C172d286f8F4eE137CC662e2844E59Cf4836), [implementation](https://sepolia.arbiscan.io/address/0xe62B776498F48061ef9425fCEf30F3d1370DB005) +- [SortitionModule: proxy](https://sepolia.arbiscan.io/address/0xf327200420F21BAafce8F1C03B1EEdF926074B95), [implementation](https://sepolia.arbiscan.io/address/0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9) +- [WETH](https://sepolia.arbiscan.io/address/0x3829A2486d53ee984a0ca2D76552715726b77138) +- [WETHFaucet](https://sepolia.arbiscan.io/address/0x6F8C10E0030aDf5B8030a5E282F026ADdB6525fd) + +#### Sepolia + +- [PinakionV2](https://sepolia.etherscan.io/address/0x593e89704D285B0c3fbF157c7CF2537456CE64b5) + #### Chiado - [ArbitrableExample](https://gnosis-chiado.blockscout.com/address/0xB56A23b396E0eae85414Ce5815da448ba529Cb4A) @@ -59,30 +61,6 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments - [WPNKFaucet](https://gnosis-chiado.blockscout.com/address/0x5898aeE045A25B276369914c3448B72a41758B2c) - [WrappedPinakionV2](https://gnosis-chiado.blockscout.com/address/0xD75E27A56AaF9eE7F8d9A472a8C2EF2f65a764dd) -#### Goerli - -- [PinakionV2](https://goerli.etherscan.io/address/0x8EAA3Bc72CD250b9A97B255991e8E58933EFB9ee) - -#### Arbitrum Goerli - -- [PNK](https://goerli.arbiscan.io/token/0x3483FA1b87792cd5BE4100822C4eCEC8D3E531ee) -- [ArbitrableExample](https://goerli.arbiscan.io/address/0x2f3e9594cD762d270b4546dfc62ab98dB595DA59) -- [BlockHashRNG](https://goerli.arbiscan.io/address/0xCea37c9A838831F6B4eE3BffbDC21b945113AD0C) -- [DAI](https://goerli.arbiscan.io/address/0xB755843e26F2cD1c6A46659cEBb67CcFAE0f2EeE) -- [DAIFaucet](https://goerli.arbiscan.io/address/0xCEBF1e0A5921767dd97b999ed14801A3770afAfd) -- [DisputeKitClassic: proxy](https://goerli.arbiscan.io/address/0x67f3b472F345119692d575E59190400E371946f6), [implementation](https://goerli.arbiscan.io/address/0x5a41ebCD0b78eD6C42E0AD23A7b7a8001c45bEC9) -- [DisputeResolver](https://goerli.arbiscan.io/address/0x881319f439F65e4926c08F38303FE676488914Bd) -- [DisputeTemplateRegistry: proxy](https://goerli.arbiscan.io/address/0x8d17Ed667512412D9c194d178699f68159f250A2), [implementation](https://goerli.arbiscan.io/address/0x2F4c6c23C516A9247a413186cDcA693E1C078A1D) -- [EvidenceModule: proxy](https://goerli.arbiscan.io/address/0xF679E4a92AE843fd5cD0717A7417C3A773Dfd55F), [implementation](https://goerli.arbiscan.io/address/0x5d5488ed34dC07EE547A39f6631d6f8595a7f618) -- [KlerosCore: proxy](https://goerli.arbiscan.io/address/0xB88643fd1e4351dAF9eA7292db126207FDE42e45), [implementation](https://goerli.arbiscan.io/address/0x5A8f51e70b77cCa3c309f7AC0f55f3b630D46B6c) -- [PNKFaucet](https://goerli.arbiscan.io/address/0x05648Ee14941630a649082e0dA5cb80D29cC9002) -- [PinakionV2](https://goerli.arbiscan.io/address/0x3483FA1b87792cd5BE4100822C4eCEC8D3E531ee) -- [PolicyRegistry: proxy](https://goerli.arbiscan.io/address/0x37FFaF5506BB16327B4a32191Bb39d739fCE55a3), [implementation](https://goerli.arbiscan.io/address/0x3ab4C2906E3Cbc44C3e282affDb66272BCae6482) -- [RandomizerRNG: proxy](https://goerli.arbiscan.io/address/0x105C019c2724F08BFA41Ff0D0bD77030E1DEA177), [implementation](https://goerli.arbiscan.io/address/0xc90d73C64997699d835a1122D47d4A231965740C) -- [SortitionModule: proxy](https://goerli.arbiscan.io/address/0x45480bFF7AE062205AB16f4e014ecee942640779), [implementation](https://goerli.arbiscan.io/address/0x7FebBE9de959f83D67A89ee9e4E31Cf11bC2B258) -- [WETH](https://goerli.arbiscan.io/address/0xbB5839497dE7e6d4ddaFde093F69abA9be782E07) -- [WETHFaucet](https://goerli.arbiscan.io/address/0xD2d862B060986b25996aaeDB54813002AB791013) - ## Getting Started ### Install the Dependencies @@ -162,18 +140,18 @@ yarn deploy --network localhost --tags ` directory and look for the respective file. @@ -202,10 +180,11 @@ This must be done for each network separately. ```bash # explorer -yarn etherscan-verify --network +yarn etherscan-verify --network +yarn etherscan-verify-proxies # sourcify -yarn sourcify --network +yarn sourcify --network ``` @@ -245,8 +224,8 @@ yarn hardhat run scripts/populatePolicyRegistry.ts --network localhost #### 3/ Import the data to V2 - Public Testnet ```bash -yarn hardhat run scripts/populateCourts.ts --network arbitrumGoerli -yarn hardhat run scripts/populatePolicyRegistry.ts --network arbitrumGoerli +yarn hardhat run scripts/populateCourts.ts --network arbitrumSepolia +yarn hardhat run scripts/populatePolicyRegistry.ts --network arbitrumSepolia ``` ### Generate deployment artifacts for existing contracts @@ -268,6 +247,6 @@ scripts/generateDeploymentArtifact.sh gnosischain 0xf8d1677c8a0c961938bf2f9adc3f Ensure that your `$TENDERLY_PROJECT` and `$TENDERLY_USERNAME` is set correctly in `.env`. ```bash -yarn tenderly-verify --network goerli -yarn tenderly-verify --network arbitrumGoerli +yarn tenderly-verify --network sepolia +yarn tenderly-verify --network arbitrumSepolia ``` diff --git a/contracts/deploy/00-ethereum-pnk.ts b/contracts/deploy/00-ethereum-pnk.ts index 033519998..85c674fb7 100644 --- a/contracts/deploy/00-ethereum-pnk.ts +++ b/contracts/deploy/00-ethereum-pnk.ts @@ -1,10 +1,10 @@ import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; -import { isSkipped } from "./utils"; +import { ForeignChains, HardhatChain, isSkipped } from "./utils"; enum Chains { - SEPOLIA = 11155111, - HARDHAT = 31337, + SEPOLIA = ForeignChains.ETHEREUM_SEPOLIA, + HARDHAT = HardhatChain.HARDHAT, } const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { @@ -14,7 +14,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; const chainId = Number(await getChainId()); - console.log("Deploying to %s with deployer %s", Chains[chainId], deployer); + console.log("deploying to %s with deployer %s", Chains[chainId], deployer); await deploy("PinakionV2", { from: deployer, diff --git a/contracts/deploy/00-home-chain-arbitrable.ts b/contracts/deploy/00-home-chain-arbitrable.ts index a2c866e23..378ab2cbb 100644 --- a/contracts/deploy/00-home-chain-arbitrable.ts +++ b/contracts/deploy/00-home-chain-arbitrable.ts @@ -11,7 +11,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; const chainId = Number(await getChainId()); - console.log("Deploying to %s with deployer %s", HomeChains[chainId], deployer); + console.log("deploying to %s with deployer %s", HomeChains[chainId], deployer); const klerosCore = await deployments.get("KlerosCore"); const extraData = @@ -42,6 +42,19 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) args: [klerosCore.address, disputeTemplateRegistry.address], log: true, }); + + await deploy("Escrow", { + from: deployer, + args: [ + klerosCore.address, + extraData, + disputeTemplate, // TODO: use an Escrow-specific dispute template + "disputeTemplateMapping: TODO", + disputeTemplateRegistry.address, + 600, // feeTimeout: 10 minutes + ], + log: true, + }); }; deployArbitration.tags = ["HomeArbitrable"]; diff --git a/contracts/deploy/00-home-chain-arbitration.ts b/contracts/deploy/00-home-chain-arbitration.ts index 1fe81a2fb..b5385de81 100644 --- a/contracts/deploy/00-home-chain-arbitration.ts +++ b/contracts/deploy/00-home-chain-arbitration.ts @@ -1,23 +1,12 @@ import { HardhatRuntimeEnvironment } from "hardhat/types"; import { DeployFunction } from "hardhat-deploy/types"; -import { BigNumber } from "ethers"; +import { BigNumber, BigNumberish } from "ethers"; import { getContractAddress } from "./utils/getContractAddress"; import { deployUpgradable } from "./utils/deployUpgradable"; import { HomeChains, isSkipped, isDevnet } from "./utils"; - -const pnkByChain = new Map([ - [HomeChains.ARBITRUM_ONE, "0x330bD769382cFc6d50175903434CCC8D206DCAE5"], - [HomeChains.ARBITRUM_SEPOLIA, "INSERT ARBITRUM SEPOLIA PNK TOKEN ADDRESS HERE"], -]); - -// https://randomizer.ai/docs#addresses -const randomizerByChain = new Map([ - [HomeChains.ARBITRUM_ONE, "0x5b8bB80f2d72D0C85caB8fB169e8170A05C94bAF"], - [HomeChains.ARBITRUM_SEPOLIA, "INSERT ARBITRUM SEPOLIA RANDOMIZER ADDRESS HERE"], -]); - -const daiByChain = new Map([[HomeChains.ARBITRUM_ONE, "??"]]); -const wethByChain = new Map([[HomeChains.ARBITRUM_ONE, "??"]]); +import { getContractOrDeploy } from "./utils/getContractOrDeploy"; +import { deployERC20AndFaucet } from "./utils/deployERC20AndFaucet"; +import { KlerosCore } from "../typechain-types"; const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { const { ethers, deployments, getNamedAccounts, getChainId } = hre; @@ -28,38 +17,26 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; const chainId = Number(await getChainId()); - console.log("Deploying to %s with deployer %s", HomeChains[chainId], deployer); + console.log("deploying to %s with deployer %s", HomeChains[chainId], deployer); - if (!pnkByChain.get(chainId)) { - const erc20Address = await deployERC20AndFaucet(hre, deployer, "PNK"); - pnkByChain.set(HomeChains[HomeChains[chainId]], erc20Address); - } - if (!daiByChain.get(chainId)) { - const erc20Address = await deployERC20AndFaucet(hre, deployer, "DAI"); - daiByChain.set(HomeChains[HomeChains[chainId]], erc20Address); - } - if (!wethByChain.get(chainId)) { - const erc20Address = await deployERC20AndFaucet(hre, deployer, "WETH"); - wethByChain.set(HomeChains[HomeChains[chainId]], erc20Address); - } + const pnk = await deployERC20AndFaucet(hre, deployer, "PNK"); + const dai = await deployERC20AndFaucet(hre, deployer, "DAI"); + const weth = await deployERC20AndFaucet(hre, deployer, "WETH"); - if (!randomizerByChain.get(chainId)) { - const randomizerMock = await deploy("RandomizerMock", { - from: deployer, - args: [], - log: true, - }); - randomizerByChain.set(HomeChains[HomeChains[chainId]], randomizerMock.address); - } + const randomizerOracle = await getContractOrDeploy(hre, "RandomizerOracle", { + from: deployer, + contract: "RandomizerMock", + args: [], + log: true, + }); await deployUpgradable(deployments, "PolicyRegistry", { from: deployer, args: [deployer], log: true }); await deployUpgradable(deployments, "EvidenceModule", { from: deployer, args: [deployer], log: true }); - const randomizer = randomizerByChain.get(Number(await getChainId())) ?? AddressZero; const rng = await deployUpgradable(deployments, "RandomizerRNG", { from: deployer, - args: [randomizer, deployer], + args: [randomizerOracle.address, deployer], log: true, }); @@ -84,9 +61,6 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) log: true, }); // nonce (implementation), nonce+1 (proxy) - const pnk = pnkByChain.get(chainId) ?? AddressZero; - const dai = daiByChain.get(chainId) ?? AddressZero; - const weth = wethByChain.get(chainId) ?? AddressZero; const minStake = BigNumber.from(10).pow(20).mul(2); const alpha = 10000; const feeForJuror = BigNumber.from(10).pow(17); @@ -94,7 +68,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) from: deployer, args: [ deployer, - pnk, + pnk.address, AddressZero, disputeKit.address, false, @@ -112,13 +86,31 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) await execute("DisputeKitClassic", { from: deployer, log: true }, "changeCore", klerosCore.address); } - await execute("KlerosCore", { from: deployer, log: true }, "changeAcceptedFeeTokens", pnk, true); - await execute("KlerosCore", { from: deployer, log: true }, "changeAcceptedFeeTokens", dai, true); - await execute("KlerosCore", { from: deployer, log: true }, "changeAcceptedFeeTokens", weth, true); - - await execute("KlerosCore", { from: deployer, log: true }, "changeCurrencyRates", pnk, 12225583, 12); - await execute("KlerosCore", { from: deployer, log: true }, "changeCurrencyRates", dai, 60327783, 11); - await execute("KlerosCore", { from: deployer, log: true }, "changeCurrencyRates", weth, 1, 1); + const changeCurrencyRate = async ( + erc20: string, + accepted: boolean, + rateInEth: BigNumberish, + rateDecimals: BigNumberish + ) => { + const core = (await ethers.getContract("KlerosCore")) as KlerosCore; + const pnkRate = await core.currencyRates(erc20); + if (pnkRate.feePaymentAccepted !== accepted) { + console.log(`core.changeAcceptedFeeTokens(${erc20}, ${accepted})`); + await core.changeAcceptedFeeTokens(erc20, accepted); + } + if (!pnkRate.rateInEth.eq(rateInEth) || pnkRate.rateDecimals !== rateDecimals) { + console.log(`core.changeCurrencyRates(${erc20}, ${rateInEth}, ${rateDecimals})`); + await core.changeCurrencyRates(erc20, rateInEth, rateDecimals); + } + }; + + try { + await changeCurrencyRate(pnk.address, true, 12225583, 12); + await changeCurrencyRate(dai.address, true, 60327783, 11); + await changeCurrencyRate(weth.address, true, 1, 1); + } catch (e) { + console.error("failed to change currency rates:", e); + } }; deployArbitration.tags = ["Arbitration"]; @@ -126,33 +118,4 @@ deployArbitration.skip = async ({ network }) => { return isSkipped(network, !HomeChains[network.config.chainId ?? 0]); }; -const deployERC20AndFaucet = async ( - hre: HardhatRuntimeEnvironment, - deployer: string, - ticker: string -): Promise => { - const { deploy } = hre.deployments; - const erc20 = await deploy(ticker, { - from: deployer, - contract: "TestERC20", - args: [ticker, ticker], - log: true, - }); - const faucet = await deploy(`${ticker}Faucet`, { - from: deployer, - contract: "Faucet", - args: [erc20.address], - log: true, - }); - const funding = hre.ethers.utils.parseUnits("100000"); - const erc20Instance = await hre.ethers.getContract(ticker); - const faucetBalance = await erc20Instance.balanceOf(faucet.address); - const deployerBalance = await erc20Instance.balanceOf(deployer); - if (deployerBalance.gte(funding) && faucetBalance.isZero()) { - console.log("Funding %sFaucet with %d", ticker, funding); - await erc20Instance.transfer(faucet.address, funding); - } - return erc20.address; -}; - export default deployArbitration; diff --git a/contracts/deploy/00-home-chain-pnk-faucet.ts b/contracts/deploy/00-home-chain-pnk-faucet.ts index 224ddc612..e6af9d071 100644 --- a/contracts/deploy/00-home-chain-pnk-faucet.ts +++ b/contracts/deploy/00-home-chain-pnk-faucet.ts @@ -14,7 +14,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; const chainId = Number(await getChainId()); - console.log("Deploying to %s with deployer %s", HomeChains[chainId], deployer); + console.log("deploying to %s with deployer %s", HomeChains[chainId], deployer); const pnkAddress = pnkByChain.get(chainId); if (pnkAddress) { diff --git a/contracts/deploy/00-rng.ts b/contracts/deploy/00-rng.ts index fe6472e5a..3433491e7 100644 --- a/contracts/deploy/00-rng.ts +++ b/contracts/deploy/00-rng.ts @@ -3,60 +3,41 @@ import { DeployFunction } from "hardhat-deploy/types"; import { SortitionModule, RandomizerRNG } from "../typechain-types"; import { HomeChains, isSkipped } from "./utils"; import { deployUpgradable } from "./utils/deployUpgradable"; - -const pnkByChain = new Map([ - [HomeChains.ARBITRUM_ONE, "0x330bD769382cFc6d50175903434CCC8D206DCAE5"], - [HomeChains.ARBITRUM_SEPOLIA, "INSERT ARBITRUM SEPOLIA PNK TOKEN ADDRESS HERE"], -]); - -const randomizerByChain = new Map([ - [HomeChains.ARBITRUM_ONE, "0x5b8bB80f2d72D0C85caB8fB169e8170A05C94bAF"], - [HomeChains.ARBITRUM_SEPOLIA, "INSERT ARBITRUM SEPOLIA RANDOMIZER ADDRESS HERE"], -]); +import { getContractOrDeploy } from "./utils/getContractOrDeploy"; const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { - const { deployments, getNamedAccounts, getChainId } = hre; + const { deployments, getNamedAccounts, getChainId, ethers } = hre; const { deploy, execute } = deployments; - const { AddressZero } = hre.ethers.constants; + const { getContract } = ethers; + const { AddressZero } = ethers.constants; const RNG_LOOKAHEAD = 20; // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; const chainId = Number(await getChainId()); - console.log("Deploying to %s with deployer %s", HomeChains[chainId], deployer); + console.log("deploying to %s with deployer %s", HomeChains[chainId], deployer); + + const randomizerOracle = await getContractOrDeploy(hre, "RandomizerOracle", { + from: deployer, + contract: "RandomizerMock", + args: [], + log: true, + }); - if (chainId === HomeChains.HARDHAT) { - pnkByChain.set( - HomeChains.HARDHAT, - ( - await deploy("PNK", { - from: deployer, - log: true, - }) - ).address - ); - randomizerByChain.set( - HomeChains.HARDHAT, - ( - await deploy("RandomizerMock", { - from: deployer, - args: [], - log: true, - }) - ).address - ); - } + const rng1 = await deployUpgradable(deployments, "RandomizerRNG", { + from: deployer, + args: [randomizerOracle.address, deployer], + log: true, + }); - const randomizer = randomizerByChain.get(Number(await getChainId())) ?? AddressZero; - await deployUpgradable(deployments, "RandomizerRNG", { from: deployer, args: [randomizer, deployer], log: true }); - const rng = await deploy("BlockHashRNG", { + const rng2 = await deploy("BlockHashRNG", { from: deployer, args: [], log: true, }); const sortitionModule = (await hre.ethers.getContract("SortitionModule")) as SortitionModule; - await sortitionModule.changeRandomNumberGenerator(rng.address, RNG_LOOKAHEAD); + await sortitionModule.changeRandomNumberGenerator(rng2.address, RNG_LOOKAHEAD); }; deployArbitration.tags = ["RNG"]; diff --git a/contracts/deploy/01-foreign-gateway-on-ethereum.ts b/contracts/deploy/01-foreign-gateway-on-ethereum.ts index f1431de1a..bc482f7b3 100644 --- a/contracts/deploy/01-foreign-gateway-on-ethereum.ts +++ b/contracts/deploy/01-foreign-gateway-on-ethereum.ts @@ -13,7 +13,7 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; const chainId = Number(await getChainId()); - console.log("Deploying to chainId %s with deployer %s", chainId, deployer); + console.log("deploying to chainId %s with deployer %s", chainId, deployer); // Hack to predict the deployment address on the home chain. // TODO: use deterministic deployments @@ -23,10 +23,10 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme let nonce = await homeChainProvider.getTransactionCount(deployer); nonce += 1; // HomeGatewayToEthereum Proxy deploy tx will be the 2nd tx after this on its home network, so we add 1 to the current nonce. const homeGatewayAddress = getContractAddress(deployer, nonce); - console.log("Calculated future HomeGatewayToEthereum address for nonce %d: %s", nonce, homeGatewayAddress); + console.log("calculated future HomeGatewayToEthereum address for nonce %d: %s", nonce, homeGatewayAddress); const veaOutbox = await deployments.get("VeaOutboxArbToEthDevnet"); - console.log("Using VeaOutboxArbToEthDevnet at %s", veaOutbox.address); + console.log("using VeaOutboxArbToEthDevnet at %s", veaOutbox.address); const homeChainId = (await homeChainProvider.getNetwork()).chainId; const homeChainIdAsBytes32 = hexZeroPad(hexlify(homeChainId), 32); diff --git a/contracts/deploy/01-foreign-gateway-on-gnosis.ts b/contracts/deploy/01-foreign-gateway-on-gnosis.ts index 77c26a2c6..cadec5e3d 100644 --- a/contracts/deploy/01-foreign-gateway-on-gnosis.ts +++ b/contracts/deploy/01-foreign-gateway-on-gnosis.ts @@ -16,7 +16,7 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; const chainId = Number(await getChainId()); - console.log("Deploying to chainId %s with deployer %s", chainId, deployer); + console.log("deploying to chainId %s with deployer %s", chainId, deployer); // Hack to predict the deployment address on the home chain. // TODO: use deterministic deployments @@ -26,10 +26,10 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme let nonce = await homeChainProvider.getTransactionCount(deployer); nonce += 1; // HomeGatewayToEthereum Proxy deploy tx will be the 2nd tx after this on its home network, so we add 1 to the current nonce. const homeGatewayAddress = getContractAddress(deployer, nonce); // HomeGateway deploy tx will be the next tx home network - console.log("Calculated future HomeGatewayToEthereum address for nonce %d: %s", nonce, homeGatewayAddress); + console.log("calculated future HomeGatewayToEthereum address for nonce %d: %s", nonce, homeGatewayAddress); const veaOutbox = await deployments.get("VeaOutboxArbToGnosisDevnet"); - console.log("Using VeaOutboxArbToGnosisDevnet at %s", veaOutbox.address); + console.log("using VeaOutboxArbToGnosisDevnet at %s", veaOutbox.address); const homeChainId = (await homeChainProvider.getNetwork()).chainId; const homeChainIdAsBytes32 = hexZeroPad(hexlify(homeChainId), 32); diff --git a/contracts/deploy/02-home-gateway-to-ethereum.ts b/contracts/deploy/02-home-gateway-to-ethereum.ts index 459d18756..03fbbcee2 100644 --- a/contracts/deploy/02-home-gateway-to-ethereum.ts +++ b/contracts/deploy/02-home-gateway-to-ethereum.ts @@ -13,7 +13,7 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; const chainId = Number(await getChainId()); - console.log("Deploying to chainId %s with deployer %s", chainId, deployer); + console.log("deploying to chainId %s with deployer %s", chainId, deployer); const veaInbox = await deployments.get("VeaInboxArbToEthDevnet"); const klerosCore = await deployments.get("KlerosCore"); @@ -21,7 +21,7 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) const foreignGateway = await hre.companionNetworks.foreignSepolia.deployments.get("ForeignGatewayOnEthereum"); const foreignChainId = Number(await hre.companionNetworks.foreignSepolia.getChainId()); const foreignChainName = await hre.companionNetworks.foreignSepolia.deployments.getNetworkName(); - console.log("Using ForeignGateway %s on chainId %s (%s)", foreignGateway.address, foreignChainId, foreignChainName); + console.log("using ForeignGateway %s on chainId %s (%s)", foreignGateway.address, foreignChainId, foreignChainName); await deployUpgradable(deployments, "HomeGatewayToEthereum", { from: deployer, diff --git a/contracts/deploy/02-home-gateway-to-gnosis.ts b/contracts/deploy/02-home-gateway-to-gnosis.ts index 56f2b97fa..c86ec8442 100644 --- a/contracts/deploy/02-home-gateway-to-gnosis.ts +++ b/contracts/deploy/02-home-gateway-to-gnosis.ts @@ -12,7 +12,7 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; const chainId = Number(await getChainId()); - console.log("Deploying to chainId %s with deployer %s", chainId, deployer); + console.log("deploying to chainId %s with deployer %s", chainId, deployer); const veaInbox = await deployments.get("VeaInboxArbToGnosisDevnet"); const klerosCore = await deployments.get("KlerosCore"); @@ -21,7 +21,7 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) const foreignGateway = await hre.companionNetworks.foreignChiado.deployments.get("ForeignGatewayOnGnosis"); const foreignChainId = Number(await hre.companionNetworks.foreignChiado.getChainId()); const foreignChainName = await hre.companionNetworks.foreignChiado.deployments.getNetworkName(); - console.log("Using ForeignGateway %s on chainId %s (%s)", foreignGateway.address, foreignChainId, foreignChainName); + console.log("using ForeignGateway %s on chainId %s (%s)", foreignGateway.address, foreignChainId, foreignChainName); await deployUpgradable(deployments, "HomeGatewayToGnosis", { from: deployer, diff --git a/contracts/deploy/03-vea-mock.ts b/contracts/deploy/03-vea-mock.ts index f01704b6f..b1c8e5010 100644 --- a/contracts/deploy/03-vea-mock.ts +++ b/contracts/deploy/03-vea-mock.ts @@ -15,7 +15,7 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; - console.log("Deploying to chainId %s with deployer %s", HardhatChain.HARDHAT, deployer); + console.log("deploying to chainId %s with deployer %s", HardhatChain.HARDHAT, deployer); const klerosCore = await deployments.get("KlerosCore"); @@ -27,7 +27,7 @@ const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) let nonce = await ethers.provider.getTransactionCount(deployer); nonce += 3; // deployed on the 4th tx (nonce+3): SortitionModule Impl tx, SortitionModule Proxy tx, KlerosCore Impl tx, KlerosCore Proxy tx const homeGatewayAddress = getContractAddress(deployer, nonce); - console.log("Calculated future HomeGatewayToEthereum address for nonce %d: %s", nonce, homeGatewayAddress); + console.log("calculated future HomeGatewayToEthereum address for nonce %d: %s", nonce, homeGatewayAddress); const homeChainIdAsBytes32 = hexZeroPad(hexlify(HardhatChain.HARDHAT), 32); const foreignGateway = await deployUpgradable(deployments, "ForeignGatewayOnEthereum", { diff --git a/contracts/deploy/04-foreign-arbitrable.ts b/contracts/deploy/04-foreign-arbitrable.ts index cdfeabff0..135d0b8fe 100644 --- a/contracts/deploy/04-foreign-arbitrable.ts +++ b/contracts/deploy/04-foreign-arbitrable.ts @@ -20,11 +20,11 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; const chainId = Number(await getChainId()); - console.log("Deploying to chainId %s with deployer %s", chainId, deployer); + console.log("deploying to chainId %s with deployer %s", chainId, deployer); const foreignGatewayArtifact = foreignGatewayArtifactByChain.get(chainId) ?? ethers.constants.AddressZero; const foreignGateway = await deployments.get(foreignGatewayArtifact); - console.log("Using foreign gateway: %s", foreignGatewayArtifact); + console.log("using foreign gateway: %s", foreignGatewayArtifact); const extraData = "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003"; // General court, 3 jurors diff --git a/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts b/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts index 0366f74ef..99ac9b7b7 100644 --- a/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts +++ b/contracts/deploy/04-klerosliquid-to-v2-gnosis.ts @@ -17,7 +17,7 @@ const deployKlerosLiquid: DeployFunction = async (hre: HardhatRuntimeEnvironment // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; const chainId = Number(await getChainId()); - console.log("Deploying to chainId %s with deployer %s", chainId, deployer); + console.log("deploying to chainId %s with deployer %s", chainId, deployer); if (!wrappedPNKByChain.get(chainId)) { const wPnk = await deploy("WrappedPinakionV2", { @@ -53,7 +53,7 @@ const deployKlerosLiquid: DeployFunction = async (hre: HardhatRuntimeEnvironment "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003"; // General court, 3 jurors const weth = await deployments.get("WETH"); - console.log("Using: \nwPNK at %s, \nForeignGateway at %s", wPnkAddress, foreignGateway.address, weth.address); + console.log("using: \nwPNK at %s, \nForeignGateway at %s", wPnkAddress, foreignGateway.address, weth.address); const sortitionSumTreeLibrary = await deploy("SortitionSumTreeFactory", { from: deployer, diff --git a/contracts/deploy/fix1148.ts b/contracts/deploy/fix1148.ts index f8febc3a9..601050290 100644 --- a/contracts/deploy/fix1148.ts +++ b/contracts/deploy/fix1148.ts @@ -12,7 +12,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await ethers.getSigners())[0].address; const chainId = Number(await getChainId()); - console.log("Deploying to %s with deployer %s", HomeChains[chainId], deployer); + console.log("deploying to %s with deployer %s", HomeChains[chainId], deployer); const klerosCore = (await ethers.getContract("KlerosCore")) as KlerosCore; const oldDisputeKit = (await ethers.getContract("DisputeKitClassic")) as DisputeKitClassic; diff --git a/contracts/deploy/upgrade-kleros-core.ts b/contracts/deploy/upgrade-kleros-core.ts index c05f0a14c..956b1e65c 100644 --- a/contracts/deploy/upgrade-kleros-core.ts +++ b/contracts/deploy/upgrade-kleros-core.ts @@ -11,7 +11,7 @@ const deployUpgradeKlerosCore: DeployFunction = async (hre: HardhatRuntimeEnviro // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; const chainId = Number(await getChainId()); - console.log("Upgrading to %s with deployer %s", HomeChains[chainId], deployer); + console.log("upgrading to %s with deployer %s", HomeChains[chainId], deployer); try { const pnk = await deployments.get("PNK"); @@ -21,7 +21,7 @@ const deployUpgradeKlerosCore: DeployFunction = async (hre: HardhatRuntimeEnviro const feeForJuror = BigNumber.from(10).pow(17); const sortitionModule = await deployments.get("SortitionModule"); - console.log("Upgrading the KlerosCore..."); + console.log("upgrading the KlerosCore..."); await deployUpgradable(deployments, "KlerosCore", { from: deployer, args: [ diff --git a/contracts/deploy/upgrade-sortition-module.ts b/contracts/deploy/upgrade-sortition-module.ts index 6b9865842..a556d232f 100644 --- a/contracts/deploy/upgrade-sortition-module.ts +++ b/contracts/deploy/upgrade-sortition-module.ts @@ -10,14 +10,14 @@ const deployUpgradeSortitionModule: DeployFunction = async (hre: HardhatRuntimeE // fallback to hardhat node signers on local network const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; const chainId = Number(await getChainId()); - console.log("Upgrading to %s with deployer %s", HomeChains[chainId], deployer); + console.log("upgrading to %s with deployer %s", HomeChains[chainId], deployer); try { const rng = await deployments.get("RandomizerRNG"); const klerosCore = await deployments.get("KlerosCore"); const klerosCoreAddress = klerosCore.address; - console.log("Upgrading the SortitionModule..."); + console.log("upgrading the SortitionModule..."); await deployUpgradable(deployments, "SortitionModule", { from: deployer, args: [ diff --git a/contracts/deploy/utils/deployERC20AndFaucet.ts b/contracts/deploy/utils/deployERC20AndFaucet.ts new file mode 100644 index 000000000..d3b9b2e77 --- /dev/null +++ b/contracts/deploy/utils/deployERC20AndFaucet.ts @@ -0,0 +1,35 @@ +import { Contract } from "@ethersproject/contracts"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { BigNumber } from "ethers"; +import { getContractOrDeploy } from "./getContractOrDeploy"; + +export const deployERC20AndFaucet = async ( + hre: HardhatRuntimeEnvironment, + deployer: string, + ticker: string, + faucetFundingAmount: BigNumber = hre.ethers.utils.parseUnits("100000") +): Promise => { + let erc20 = await hre.ethers.getContractOrNull(ticker); + if (erc20) { + return erc20; + } + erc20 = await getContractOrDeploy(hre, ticker, { + from: deployer, + contract: "TestERC20", + args: [ticker, ticker], + log: true, + }); + const faucet = await getContractOrDeploy(hre, `${ticker}Faucet`, { + from: deployer, + contract: "Faucet", + args: [erc20.address], + log: true, + }); + const faucetBalance = await erc20.balanceOf(faucet.address); + const deployerBalance = await erc20.balanceOf(deployer); + if (deployerBalance.gte(faucetFundingAmount) && faucetBalance.isZero()) { + console.log(`funding ${ticker}Faucet with ${faucetFundingAmount}`); + await erc20.transfer(faucet.address, faucetFundingAmount); + } + return erc20; +}; diff --git a/contracts/deploy/utils/getContractOrDeploy.ts b/contracts/deploy/utils/getContractOrDeploy.ts new file mode 100644 index 000000000..1865971f0 --- /dev/null +++ b/contracts/deploy/utils/getContractOrDeploy.ts @@ -0,0 +1,19 @@ +import { Contract } from "@ethersproject/contracts"; +import { DeployOptions } from "hardhat-deploy/types"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; + +export const getContractOrDeploy = async ( + hre: HardhatRuntimeEnvironment, + contractName: string, + options: DeployOptions +): Promise => { + let contract = await hre.ethers.getContractOrNull(contractName); + if (!contract) { + console.log(`contract ${contractName} not deployed, deploying now...`); + await hre.deployments.deploy(contractName, options); + contract = await hre.ethers.getContract(contractName); + } else { + console.log(`contract ${contractName} already deployed`); + } + return contract; +}; diff --git a/contracts/deployments/arbitrum/Pinakion.json b/contracts/deployments/arbitrum/Pinakion.json new file mode 100644 index 000000000..2fab003bd --- /dev/null +++ b/contracts/deployments/arbitrum/Pinakion.json @@ -0,0 +1,280 @@ +{ + "address": "0x330bD769382cFc6d50175903434CCC8D206DCAE5", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/contracts/deployments/arbitrum/RandomizerOracle.json b/contracts/deployments/arbitrum/RandomizerOracle.json new file mode 100644 index 000000000..b345d104e --- /dev/null +++ b/contracts/deployments/arbitrum/RandomizerOracle.json @@ -0,0 +1,4 @@ +{ + "address": "0x5b8bB80f2d72D0C85caB8fB169e8170A05C94bAF", + "abi": [] +} diff --git a/contracts/deployments/arbitrumSepolia/RandomizerOracle.json b/contracts/deployments/arbitrumSepolia/RandomizerOracle.json new file mode 100644 index 000000000..0ed65f9d1 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/RandomizerOracle.json @@ -0,0 +1,4 @@ +{ + "address": "0xE775D7fde1d0D09ae627C0131040012ccBcC4b9b", + "abi": [] +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DAI.json b/contracts/deployments/arbitrumSepoliaDevnet/DAI.json new file mode 100644 index 000000000..aeb0db522 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/DAI.json @@ -0,0 +1,458 @@ +{ + "address": "0x593e89704D285B0c3fbF157c7CF2537456CE64b5", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x251195ad7dabd55250d3d7e56ca4fb46842bf6c03d03ae6ffcd65f5160ba6411", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x593e89704D285B0c3fbF157c7CF2537456CE64b5", + "transactionIndex": 1, + "gasUsed": "621518", + "logsBloom": "0x00000020000000000000000000000000000000000040000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000002000000000000000000000000000000000000000000000080000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x4d5427ba5759721f27265eca1417b6c5911724c4c21c2b0456713cb0dca99377", + "transactionHash": "0x251195ad7dabd55250d3d7e56ca4fb46842bf6c03d03ae6ffcd65f5160ba6411", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084543, + "transactionHash": "0x251195ad7dabd55250d3d7e56ca4fb46842bf6c03d03ae6ffcd65f5160ba6411", + "address": "0x593e89704D285B0c3fbF157c7CF2537456CE64b5", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "data": "0x00000000000000000000000000000000000000000000d3c21bcecceda1000000", + "logIndex": 0, + "blockHash": "0x4d5427ba5759721f27265eca1417b6c5911724c4c21c2b0456713cb0dca99377" + } + ], + "blockNumber": 3084543, + "cumulativeGasUsed": "621518", + "status": 1, + "byzantium": true + }, + "args": [ + "DAI", + "DAI" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/token/TestERC20.sol\":\"TestERC20\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * The default value of {decimals} is 18. To change this, you should override\\n * this function so it returns a different value.\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20 is Context, IERC20, IERC20Metadata {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the default value returned by this function, unless\\n * it's overridden.\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(address from, address to, uint256 amount) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(address owner, address spender, uint256 amount) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\\n}\\n\",\"keccak256\":\"0xa56ca923f70c1748830700250b19c61b70db9a683516dc5e216694a50445d99c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0xa92e4fa126feb6907daa0513ddd816b2eb91f30a808de54f63c17d0e162c3439\",\"license\":\"MIT\"},\"src/token/TestERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\n\\ncontract TestERC20 is ERC20 {\\n constructor(string memory _name, string memory _symbol) ERC20(_name, _symbol) {\\n _mint(msg.sender, 1000000 ether);\\n }\\n}\\n\",\"keccak256\":\"0x9f67e6b63ca87e6c98b2986364ce16a747ce4098e9146fffb17ea13863c0b7e4\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162000c5838038062000c5883398101604081905262000034916200020a565b8181600362000044838262000302565b50600462000053828262000302565b505050620000723369d3c21bcecceda10000006200007a60201b60201c565b5050620003f6565b6001600160a01b038216620000d55760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060026000828254620000e99190620003ce565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b505050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200016d57600080fd5b81516001600160401b03808211156200018a576200018a62000145565b604051601f8301601f19908116603f01168101908282118183101715620001b557620001b562000145565b81604052838152602092508683858801011115620001d257600080fd5b600091505b83821015620001f65785820183015181830184015290820190620001d7565b600093810190920192909252949350505050565b600080604083850312156200021e57600080fd5b82516001600160401b03808211156200023657600080fd5b62000244868387016200015b565b935060208501519150808211156200025b57600080fd5b506200026a858286016200015b565b9150509250929050565b600181811c908216806200028957607f821691505b602082108103620002aa57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200014057600081815260208120601f850160051c81016020861015620002d95750805b601f850160051c820191505b81811015620002fa57828155600101620002e5565b505050505050565b81516001600160401b038111156200031e576200031e62000145565b62000336816200032f845462000274565b84620002b0565b602080601f8311600181146200036e5760008415620003555750858301515b600019600386901b1c1916600185901b178555620002fa565b600085815260208120601f198616915b828110156200039f578886015182559484019460019091019084016200037e565b5085821015620003be5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80820180821115620003f057634e487b7160e01b600052601160045260246000fd5b92915050565b61085280620004066000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b411461015f578063a457c2d714610167578063a9059cbb1461017a578063dd62ed3e1461018d57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101a0565b6040516100c3919061069c565b60405180910390f35b6100df6100da366004610706565b610232565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610730565b61024c565b604051601281526020016100c3565b6100df610131366004610706565b610270565b6100f361014436600461076c565b6001600160a01b031660009081526020819052604090205490565b6100b6610292565b6100df610175366004610706565b6102a1565b6100df610188366004610706565b610321565b6100f361019b36600461078e565b61032f565b6060600380546101af906107c1565b80601f01602080910402602001604051908101604052809291908181526020018280546101db906107c1565b80156102285780601f106101fd57610100808354040283529160200191610228565b820191906000526020600020905b81548152906001019060200180831161020b57829003601f168201915b5050505050905090565b60003361024081858561035a565b60019150505b92915050565b60003361025a85828561047e565b6102658585856104f8565b506001949350505050565b600033610240818585610283838361032f565b61028d91906107fb565b61035a565b6060600480546101af906107c1565b600033816102af828661032f565b9050838110156103145760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b610265828686840361035a565b6000336102408185856104f8565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166103bc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161030b565b6001600160a01b03821661041d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161030b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600061048a848461032f565b905060001981146104f257818110156104e55760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161030b565b6104f2848484840361035a565b50505050565b6001600160a01b03831661055c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161030b565b6001600160a01b0382166105be5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161030b565b6001600160a01b038316600090815260208190526040902054818110156106365760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161030b565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36104f2565b600060208083528351808285015260005b818110156106c9578581018301518582016040015282016106ad565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b038116811461070157600080fd5b919050565b6000806040838503121561071957600080fd5b610722836106ea565b946020939093013593505050565b60008060006060848603121561074557600080fd5b61074e846106ea565b925061075c602085016106ea565b9150604084013590509250925092565b60006020828403121561077e57600080fd5b610787826106ea565b9392505050565b600080604083850312156107a157600080fd5b6107aa836106ea565b91506107b8602084016106ea565b90509250929050565b600181811c908216806107d557607f821691505b6020821081036107f557634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561024657634e487b7160e01b600052601160045260246000fdfea26469706673582212203a956e65a766c03ac95ae037cbdfb51b56810340c98132c2d2482405d386101b64736f6c63430008120033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b411461015f578063a457c2d714610167578063a9059cbb1461017a578063dd62ed3e1461018d57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101a0565b6040516100c3919061069c565b60405180910390f35b6100df6100da366004610706565b610232565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610730565b61024c565b604051601281526020016100c3565b6100df610131366004610706565b610270565b6100f361014436600461076c565b6001600160a01b031660009081526020819052604090205490565b6100b6610292565b6100df610175366004610706565b6102a1565b6100df610188366004610706565b610321565b6100f361019b36600461078e565b61032f565b6060600380546101af906107c1565b80601f01602080910402602001604051908101604052809291908181526020018280546101db906107c1565b80156102285780601f106101fd57610100808354040283529160200191610228565b820191906000526020600020905b81548152906001019060200180831161020b57829003601f168201915b5050505050905090565b60003361024081858561035a565b60019150505b92915050565b60003361025a85828561047e565b6102658585856104f8565b506001949350505050565b600033610240818585610283838361032f565b61028d91906107fb565b61035a565b6060600480546101af906107c1565b600033816102af828661032f565b9050838110156103145760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b610265828686840361035a565b6000336102408185856104f8565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166103bc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161030b565b6001600160a01b03821661041d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161030b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600061048a848461032f565b905060001981146104f257818110156104e55760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161030b565b6104f2848484840361035a565b50505050565b6001600160a01b03831661055c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161030b565b6001600160a01b0382166105be5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161030b565b6001600160a01b038316600090815260208190526040902054818110156106365760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161030b565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36104f2565b600060208083528351808285015260005b818110156106c9578581018301518582016040015282016106ad565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b038116811461070157600080fd5b919050565b6000806040838503121561071957600080fd5b610722836106ea565b946020939093013593505050565b60008060006060848603121561074557600080fd5b61074e846106ea565b925061075c602085016106ea565b9150604084013590509250925092565b60006020828403121561077e57600080fd5b610787826106ea565b9392505050565b600080604083850312156107a157600080fd5b6107aa836106ea565b91506107b8602084016106ea565b90509250929050565b600181811c908216806107d557607f821691505b6020821081036107f557634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561024657634e487b7160e01b600052601160045260246000fdfea26469706673582212203a956e65a766c03ac95ae037cbdfb51b56810340c98132c2d2482405d386101b64736f6c63430008120033", + "devdoc": { + "events": { + "Approval(address,address,uint256)": { + "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." + }, + "Transfer(address,address,uint256)": { + "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." + } + }, + "kind": "dev", + "methods": { + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "decimals()": { + "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." + }, + "decreaseAllowance(address,uint256)": { + "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." + }, + "increaseAllowance(address,uint256)": { + "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." + }, + "name()": { + "details": "Returns the name of the token." + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 393, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_balances", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 399, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_allowances", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 401, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_totalSupply", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 403, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_name", + "offset": 0, + "slot": "3", + "type": "t_string_storage" + }, + { + "astId": 405, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_symbol", + "offset": 0, + "slot": "4", + "type": "t_string_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DAIFaucet.json b/contracts/deployments/arbitrumSepoliaDevnet/DAIFaucet.json new file mode 100644 index 000000000..677639852 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/DAIFaucet.json @@ -0,0 +1,226 @@ +{ + "address": "0xB5b39A1bcD2D7097A8824B3cC18Ebd2dFb0D9B5E", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "amount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "balance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "changeAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "request", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "withdrewAlready", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xdf588e021ff6efc1b61abc01989d34c5a404b7cd4b6091425db964a334e4e547", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xB5b39A1bcD2D7097A8824B3cC18Ebd2dFb0D9B5E", + "transactionIndex": 1, + "gasUsed": "435555", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x2bfdb7df6af7cd9e6e96a159146ebe27fd2a1021f90f340503fb16acc5cf656a", + "transactionHash": "0xdf588e021ff6efc1b61abc01989d34c5a404b7cd4b6091425db964a334e4e547", + "logs": [], + "blockNumber": 3084545, + "cumulativeGasUsed": "435555", + "status": 1, + "byzantium": true + }, + "args": [ + "0x593e89704D285B0c3fbF157c7CF2537456CE64b5" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"amount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"balance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"changeAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"request\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"withdrewAlready\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/token/Faucet.sol\":\"Faucet\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/token/Faucet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ncontract Faucet {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n IERC20 public token;\\n address public governor;\\n mapping(address => bool) public withdrewAlready;\\n uint256 public amount = 10_000 ether;\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(address(governor) == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n constructor(IERC20 _token) {\\n token = _token;\\n governor = msg.sender;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n function changeGovernor(address _governor) public onlyByGovernor {\\n governor = _governor;\\n }\\n\\n function changeAmount(uint256 _amount) public onlyByGovernor {\\n amount = _amount;\\n }\\n\\n function withdraw() public onlyByGovernor {\\n token.transfer(governor, token.balanceOf(address(this)));\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function request() public {\\n require(\\n !withdrewAlready[msg.sender],\\n \\\"You have used this faucet already. If you need more tokens, please use another address.\\\"\\n );\\n token.transfer(msg.sender, amount);\\n withdrewAlready[msg.sender] = true;\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n function balance() public view returns (uint) {\\n return token.balanceOf(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x3a54681cc304ccbfdb42215104b63809919a432ac5d3986d3021a11fcc7a1cc3\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405269021e19e0c9bab240000060035534801561001e57600080fd5b5060405161065538038061065583398101604081905261003d9161006b565b600080546001600160a01b039092166001600160a01b0319928316179055600180549091163317905561009b565b60006020828403121561007d57600080fd5b81516001600160a01b038116811461009457600080fd5b9392505050565b6105ab806100aa6000396000f3fe608060405234801561001057600080fd5b50600436106100835760003560e01c80630c340a2414610088578063338cdca1146100b15780633ccfd60b146100bb5780635c320516146100c3578063aa8c217c146100d6578063b69ef8a8146100ed578063d61c40dc146100f5578063e4c0aaf414610128578063fc0c546a1461013b575b600080fd5b60015461009b906001600160a01b031681565b6040516100a8919061049b565b60405180910390f35b6100b961014e565b005b6100b961028f565b6100b96100d13660046104af565b6103a9565b6100df60035481565b6040519081526020016100a8565b6100df6103d8565b6101186101033660046104c8565b60026020526000908152604090205460ff1681565b60405190151581526020016100a8565b6100b96101363660046104c8565b61044f565b60005461009b906001600160a01b031681565b3360009081526002602052604090205460ff16156101f95760405162461bcd60e51b815260206004820152605760248201527f596f752068617665207573656420746869732066617563657420616c7265616460448201527f792e20496620796f75206e656564206d6f726520746f6b656e732c20706c656160648201527639b2903ab9b29030b737ba3432b91030b2323932b9b99760491b608482015260a4015b60405180910390fd5b60005460035460405163a9059cbb60e01b815233600482015260248101919091526001600160a01b039091169063a9059cbb906044016020604051808303816000875af115801561024e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027291906104f8565b50336000908152600260205260409020805460ff19166001179055565b6001546001600160a01b031633146102b95760405162461bcd60e51b81526004016101f09061051a565b6000546001546040516370a0823160e01b81526001600160a01b039283169263a9059cbb92169083906370a08231906102f690309060040161049b565b602060405180830381865afa158015610313573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610337919061055c565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a691906104f8565b50565b6001546001600160a01b031633146103d35760405162461bcd60e51b81526004016101f09061051a565b600355565b600080546040516370a0823160e01b81526001600160a01b03909116906370a082319061040990309060040161049b565b602060405180830381865afa158015610426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a919061055c565b905090565b6001546001600160a01b031633146104795760405162461bcd60e51b81526004016101f09061051a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0391909116815260200190565b6000602082840312156104c157600080fd5b5035919050565b6000602082840312156104da57600080fd5b81356001600160a01b03811681146104f157600080fd5b9392505050565b60006020828403121561050a57600080fd5b815180151581146104f157600080fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60006020828403121561056e57600080fd5b505191905056fea26469706673582212204f7fd812260eacd88f23b436eb40b4943480e914005f0a0f2738f0d3c9696a5964736f6c63430008120033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100835760003560e01c80630c340a2414610088578063338cdca1146100b15780633ccfd60b146100bb5780635c320516146100c3578063aa8c217c146100d6578063b69ef8a8146100ed578063d61c40dc146100f5578063e4c0aaf414610128578063fc0c546a1461013b575b600080fd5b60015461009b906001600160a01b031681565b6040516100a8919061049b565b60405180910390f35b6100b961014e565b005b6100b961028f565b6100b96100d13660046104af565b6103a9565b6100df60035481565b6040519081526020016100a8565b6100df6103d8565b6101186101033660046104c8565b60026020526000908152604090205460ff1681565b60405190151581526020016100a8565b6100b96101363660046104c8565b61044f565b60005461009b906001600160a01b031681565b3360009081526002602052604090205460ff16156101f95760405162461bcd60e51b815260206004820152605760248201527f596f752068617665207573656420746869732066617563657420616c7265616460448201527f792e20496620796f75206e656564206d6f726520746f6b656e732c20706c656160648201527639b2903ab9b29030b737ba3432b91030b2323932b9b99760491b608482015260a4015b60405180910390fd5b60005460035460405163a9059cbb60e01b815233600482015260248101919091526001600160a01b039091169063a9059cbb906044016020604051808303816000875af115801561024e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027291906104f8565b50336000908152600260205260409020805460ff19166001179055565b6001546001600160a01b031633146102b95760405162461bcd60e51b81526004016101f09061051a565b6000546001546040516370a0823160e01b81526001600160a01b039283169263a9059cbb92169083906370a08231906102f690309060040161049b565b602060405180830381865afa158015610313573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610337919061055c565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a691906104f8565b50565b6001546001600160a01b031633146103d35760405162461bcd60e51b81526004016101f09061051a565b600355565b600080546040516370a0823160e01b81526001600160a01b03909116906370a082319061040990309060040161049b565b602060405180830381865afa158015610426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a919061055c565b905090565b6001546001600160a01b031633146104795760405162461bcd60e51b81526004016101f09061051a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0391909116815260200190565b6000602082840312156104c157600080fd5b5035919050565b6000602082840312156104da57600080fd5b81356001600160a01b03811681146104f157600080fd5b9392505050565b60006020828403121561050a57600080fd5b815180151581146104f157600080fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60006020828403121561056e57600080fd5b505191905056fea26469706673582212204f7fd812260eacd88f23b436eb40b4943480e914005f0a0f2738f0d3c9696a5964736f6c63430008120033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 24559, + "contract": "src/token/Faucet.sol:Faucet", + "label": "token", + "offset": 0, + "slot": "0", + "type": "t_contract(IERC20)1042" + }, + { + "astId": 24561, + "contract": "src/token/Faucet.sol:Faucet", + "label": "governor", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 24565, + "contract": "src/token/Faucet.sol:Faucet", + "label": "withdrewAlready", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 24568, + "contract": "src/token/Faucet.sol:Faucet", + "label": "amount", + "offset": 0, + "slot": "3", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)1042": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json b/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json new file mode 100644 index 000000000..59171d8eb --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json @@ -0,0 +1,1011 @@ +{ + "address": "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "ChoiceFunded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "_commit", + "type": "bytes32" + } + ], + "name": "CommitCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "Contribution", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_justification", + "type": "string" + } + ], + "name": "VoteCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "Withdrawal", + "type": "event" + }, + { + "inputs": [], + "name": "LOSER_APPEAL_PERIOD_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "LOSER_STAKE_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ONE_BASIS_POINT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WINNER_STAKE_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "areCommitsAllCast", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "areVotesAllCast", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "internalType": "bytes32", + "name": "_commit", + "type": "bytes32" + } + ], + "name": "castCommit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_salt", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_justification", + "type": "string" + } + ], + "name": "castVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_core", + "type": "address" + } + ], + "name": "changeCore", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "core", + "outputs": [ + { + "internalType": "contract KlerosCore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "coreDisputeIDToLocal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_nbVotes", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "currentRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "bool", + "name": "overridden", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "uint256", + "name": "numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "jumped", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [ + { + "internalType": "address", + "name": "drawnAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeGovernorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "fundAppeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + } + ], + "name": "getCoherentCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "getDegreeOfCoherence", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "getFundedChoices", + "outputs": [ + { + "internalType": "uint256[]", + "name": "fundedChoices", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "getRoundInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "winningChoice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "totalVoted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCommited", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbVoters", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "choiceCount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "getVoteInfo", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "commit", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "choice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "voted", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract KlerosCore", + "name": "_core", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "isVoteActive", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "withdrawFeesAndRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0x3d8b4b6c62d6ca8ab1c6ccd5fd16bbf9894db1e11575d1e075fd1e335bd9d3c4", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + "transactionIndex": 1, + "gasUsed": "177903", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x9f7975c49e1f36319c3912d8040ec70fa39232d7c8416bce33dd3bf578803044", + "transactionHash": "0x3d8b4b6c62d6ca8ab1c6ccd5fd16bbf9894db1e11575d1e075fd1e335bd9d3c4", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084586, + "transactionHash": "0x3d8b4b6c62d6ca8ab1c6ccd5fd16bbf9894db1e11575d1e075fd1e335bd9d3c4", + "address": "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x9f7975c49e1f36319c3912d8040ec70fa39232d7c8416bce33dd3bf578803044" + } + ], + "blockNumber": 3084586, + "cumulativeGasUsed": "177903", + "status": 1, + "byzantium": true + }, + "args": [ + "0xC3dB344755b15c8Edfd834db79af4f8860029FB4", + "0x485cc955000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c590000000000000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "0x0000000000000000000000000000000000000000" + ] + }, + "implementation": "0xC3dB344755b15c8Edfd834db79af4f8860029FB4", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic_Implementation.json b/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic_Implementation.json new file mode 100644 index 000000000..9338cc8e8 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic_Implementation.json @@ -0,0 +1,1530 @@ +{ + "address": "0xC3dB344755b15c8Edfd834db79af4f8860029FB4", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "ChoiceFunded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "_commit", + "type": "bytes32" + } + ], + "name": "CommitCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "Contribution", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_justification", + "type": "string" + } + ], + "name": "VoteCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "Withdrawal", + "type": "event" + }, + { + "inputs": [], + "name": "LOSER_APPEAL_PERIOD_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "LOSER_STAKE_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ONE_BASIS_POINT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WINNER_STAKE_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "areCommitsAllCast", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "areVotesAllCast", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "internalType": "bytes32", + "name": "_commit", + "type": "bytes32" + } + ], + "name": "castCommit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_salt", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_justification", + "type": "string" + } + ], + "name": "castVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_core", + "type": "address" + } + ], + "name": "changeCore", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "core", + "outputs": [ + { + "internalType": "contract KlerosCore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "coreDisputeIDToLocal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_nbVotes", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "currentRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "bool", + "name": "overridden", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "uint256", + "name": "numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "jumped", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [ + { + "internalType": "address", + "name": "drawnAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeGovernorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "fundAppeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + } + ], + "name": "getCoherentCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "getDegreeOfCoherence", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "getFundedChoices", + "outputs": [ + { + "internalType": "uint256[]", + "name": "fundedChoices", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "getRoundInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "winningChoice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "totalVoted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCommited", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbVoters", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "choiceCount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "getVoteInfo", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "commit", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "choice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "voted", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract KlerosCore", + "name": "_core", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "isVoteActive", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "withdrawFeesAndRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x1f0ce8d7ed97f6426105ba4b8b51b6d34ae35959f3d3ff1edb3e4c4beccb008b", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xC3dB344755b15c8Edfd834db79af4f8860029FB4", + "transactionIndex": 1, + "gasUsed": "3504819", + "logsBloom": "0x00000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000004000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x491cd79e7eef2473a6fcdc8e5e3c7b49cbd3e2fb144da954a2457ec087fa0696", + "transactionHash": "0x1f0ce8d7ed97f6426105ba4b8b51b6d34ae35959f3d3ff1edb3e4c4beccb008b", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084585, + "transactionHash": "0x1f0ce8d7ed97f6426105ba4b8b51b6d34ae35959f3d3ff1edb3e4c4beccb008b", + "address": "0xC3dB344755b15c8Edfd834db79af4f8860029FB4", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 0, + "blockHash": "0x491cd79e7eef2473a6fcdc8e5e3c7b49cbd3e2fb144da954a2457ec087fa0696" + } + ], + "blockNumber": 3084585, + "cumulativeGasUsed": "3504819", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"ChoiceFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_commit\",\"type\":\"bytes32\"}],\"name\":\"CommitCast\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Contribution\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"DisputeCreation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_justification\",\"type\":\"string\"}],\"name\":\"VoteCast\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"LOSER_APPEAL_PERIOD_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LOSER_STAKE_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ONE_BASIS_POINT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WINNER_STAKE_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"areCommitsAllCast\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"areVotesAllCast\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes32\",\"name\":\"_commit\",\"type\":\"bytes32\"}],\"name\":\"castCommit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_salt\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_justification\",\"type\":\"string\"}],\"name\":\"castVote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_core\",\"type\":\"address\"}],\"name\":\"changeCore\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"core\",\"outputs\":[{\"internalType\":\"contract KlerosCore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"coreDisputeIDToLocal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_nbVotes\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"currentRuling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"overridden\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"jumped\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"drawnAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_destination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"executeGovernorProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"fundAppeal\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"}],\"name\":\"getCoherentCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"getDegreeOfCoherence\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"getFundedChoices\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"fundedChoices\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"getRoundInfo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"winningChoice\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"totalVoted\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalCommited\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbVoters\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"choiceCount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"getVoteInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"commit\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"choice\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"voted\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract KlerosCore\",\"name\":\"_core\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"isVoteActive\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"withdrawFeesAndRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"ChoiceFunded(uint256,uint256,uint256)\":{\"details\":\"To be emitted when a choice is fully funded for an appeal.\",\"params\":{\"_choice\":\"The choice that is being funded.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_coreRoundID\":\"The identifier of the round in the Arbitrator contract.\"}},\"CommitCast(uint256,address,uint256[],bytes32)\":{\"details\":\"To be emitted when a vote commitment is cast.\",\"params\":{\"_commit\":\"The commitment of the juror.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_juror\":\"The address of the juror casting the vote commitment.\",\"_voteIDs\":\"The identifiers of the votes in the dispute.\"}},\"Contribution(uint256,uint256,uint256,address,uint256)\":{\"details\":\"To be emitted when a funding contribution is made.\",\"params\":{\"_amount\":\"The amount contributed.\",\"_choice\":\"The choice that is being funded.\",\"_contributor\":\"The address of the contributor.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_coreRoundID\":\"The identifier of the round in the Arbitrator contract.\"}},\"DisputeCreation(uint256,uint256,bytes)\":{\"details\":\"To be emitted when a dispute is created.\",\"params\":{\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_extraData\":\"The extra data for the dispute.\",\"_numberOfChoices\":\"The number of choices available in the dispute.\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}},\"VoteCast(uint256,address,uint256[],uint256,string)\":{\"details\":\"Emitted when casting a vote to provide the justification of juror's choice.\",\"params\":{\"_choice\":\"The choice juror voted for.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_juror\":\"Address of the juror.\",\"_justification\":\"Justification of the choice.\",\"_voteIDs\":\"The identifiers of the votes in the dispute.\"}},\"Withdrawal(uint256,uint256,uint256,address,uint256)\":{\"details\":\"To be emitted when the contributed funds are withdrawn.\",\"params\":{\"_amount\":\"The amount withdrawn.\",\"_choice\":\"The choice that is being funded.\",\"_contributor\":\"The address of the contributor.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_coreRoundID\":\"The identifier of the round in the Arbitrator contract.\"}}},\"kind\":\"dev\",\"methods\":{\"areCommitsAllCast(uint256)\":{\"details\":\"Returns true if all of the jurors have cast their commits for the last round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"_0\":\"Whether all of the jurors have cast their commits for the last round.\"}},\"areVotesAllCast(uint256)\":{\"details\":\"Returns true if all of the jurors have cast their votes for the last round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"_0\":\"Whether all of the jurors have cast their votes for the last round.\"}},\"castCommit(uint256,uint256[],bytes32)\":{\"details\":\"Sets the caller's commit for the specified votes. It can be called multiple times during the commit period, each call overrides the commits of the previous one. `O(n)` where `n` is the number of votes.\",\"params\":{\"_commit\":\"The commit. Note that justification string is a part of the commit.\",\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_voteIDs\":\"The IDs of the votes.\"}},\"castVote(uint256,uint256[],uint256,uint256,string)\":{\"details\":\"Sets the caller's choices for the specified votes. `O(n)` where `n` is the number of votes.\",\"params\":{\"_choice\":\"The choice.\",\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_justification\":\"Justification of the choice.\",\"_salt\":\"The salt for the commit if the votes were hidden.\",\"_voteIDs\":\"The IDs of the votes.\"}},\"changeCore(address)\":{\"details\":\"Changes the `core` storage variable.\",\"params\":{\"_core\":\"The new value for the `core` storage variable.\"}},\"changeGovernor(address)\":{\"details\":\"Changes the `governor` storage variable.\",\"params\":{\"_governor\":\"The new value for the `governor` storage variable.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"createDispute(uint256,uint256,bytes,uint256)\":{\"details\":\"Creates a local dispute and maps it to the dispute ID in the Core contract. Note: Access restricted to Kleros Core only.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_extraData\":\"Additional info about the dispute, for possible use in future dispute kits.\",\"_nbVotes\":\"Number of votes for this dispute.\",\"_numberOfChoices\":\"Number of choices of the dispute\"}},\"currentRuling(uint256)\":{\"details\":\"Gets the current ruling of a specified dispute.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"overridden\":\"Whether the ruling was overridden by appeal funding or not.\",\"ruling\":\"The current ruling.\",\"tied\":\"Whether it's a tie or not.\"}},\"draw(uint256,uint256)\":{\"details\":\"Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core. Note: Access restricted to Kleros Core only.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_nonce\":\"Nonce of the drawing iteration.\"},\"returns\":{\"drawnAddress\":\"The drawn address.\"}},\"executeGovernorProposal(address,uint256,bytes)\":{\"details\":\"Allows the governor to call anything on behalf of the contract.\",\"params\":{\"_amount\":\"The value sent with the call.\",\"_data\":\"The data sent with the call.\",\"_destination\":\"The destination of the call.\"}},\"fundAppeal(uint256,uint256)\":{\"details\":\"Manages contributions, and appeals a dispute if at least two choices are fully funded. Note that the surplus deposit will be reimbursed.\",\"params\":{\"_choice\":\"A choice that receives funding.\",\"_coreDisputeID\":\"Index of the dispute in Kleros Core.\"}},\"getCoherentCount(uint256,uint256)\":{\"details\":\"Gets the number of jurors who are eligible to a reward in this round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core, not in the Dispute Kit.\",\"_coreRoundID\":\"The ID of the round in Kleros Core, not in the Dispute Kit.\"},\"returns\":{\"_0\":\"The number of coherent jurors.\"}},\"getDegreeOfCoherence(uint256,uint256,uint256)\":{\"details\":\"Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core, not in the Dispute Kit.\",\"_coreRoundID\":\"The ID of the round in Kleros Core, not in the Dispute Kit.\",\"_voteID\":\"The ID of the vote.\"},\"returns\":{\"_0\":\"The degree of coherence in basis points.\"}},\"initialize(address,address)\":{\"details\":\"Initializer.\",\"params\":{\"_core\":\"The KlerosCore arbitrator.\",\"_governor\":\"The governor's address.\"}},\"isVoteActive(uint256,uint256,uint256)\":{\"details\":\"Returns true if the specified voter was active in this round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core, not in the Dispute Kit.\",\"_coreRoundID\":\"The ID of the round in Kleros Core, not in the Dispute Kit.\",\"_voteID\":\"The ID of the voter.\"},\"returns\":{\"_0\":\"Whether the voter was active or not.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}},\"withdrawFeesAndRewards(uint256,address,uint256,uint256)\":{\"details\":\"Allows those contributors who attempted to fund an appeal round to withdraw any reimbursable fees or rewards after the dispute gets resolved.\",\"params\":{\"_beneficiary\":\"The address whose rewards to withdraw.\",\"_choice\":\"The ruling option that the caller wants to withdraw from.\",\"_coreDisputeID\":\"Index of the dispute in Kleros Core contract.\",\"_coreRoundID\":\"The round in the Kleros Core contract the caller wants to withdraw from.\"},\"returns\":{\"amount\":\"The withdrawn amount.\"}}},\"title\":\"DisputeKitClassic Dispute kit implementation of the Kleros v1 features including: - a drawing system: proportional to staked PNK, - a vote aggregation system: plurality, - an incentive system: equal split between coherent votes, - an appeal system: fund 2 choices only, vote on any choice.\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/dispute-kits/DisputeKitClassic.sol\":\"DisputeKitClassic\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/KlerosCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"./interfaces/IArbitratorV2.sol\\\";\\nimport {IDisputeKit} from \\\"./interfaces/IDisputeKit.sol\\\";\\nimport {ISortitionModule} from \\\"./interfaces/ISortitionModule.sol\\\";\\nimport {SafeERC20, IERC20} from \\\"../libraries/SafeERC20.sol\\\";\\nimport {Constants} from \\\"../libraries/Constants.sol\\\";\\nimport {OnError} from \\\"../libraries/Types.sol\\\";\\nimport {UUPSProxiable} from \\\"../proxy/UUPSProxiable.sol\\\";\\nimport {Initializable} from \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title KlerosCore\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\ncontract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum PNKs needed to stake in the court.\\n uint256 alpha; // Basis point of PNKs that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court. Note that each court must support classic dispute kit.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrableV2 arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 pnkAtStakePerJuror; // The amount of PNKs at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 pnkPenalties; // The amount of PNKs collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumFeeRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumPnkRewardPaid; // Total sum of PNK paid to coherent jurors as a reward in this round.\\n IERC20 feeToken; // The token used for paying fees in this round.\\n uint256 drawIterations; // The number of iterations passed drawing the jurors for this round.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 pnkPenaltiesInRound; // The amount of PNKs collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n struct CurrencyRate {\\n bool feePaymentAccepted;\\n uint64 rateInEth;\\n uint8 rateDecimals;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 private constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 private constant NON_PAYABLE_AMOUNT = (2 ** 256 - 2) / 2; // An amount higher than the supply of ETH.\\n\\n address public governor; // The governor of the contract.\\n IERC20 public pinakion; // The Pinakion token contract.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n Court[] public courts; // The courts.\\n IDisputeKit[] public disputeKits; // Array of dispute kits.\\n Dispute[] public disputes; // The disputes.\\n mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(\\n uint96 indexed _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod\\n );\\n event DisputeKitCreated(uint256 indexed _disputeKitID, IDisputeKit indexed _disputeKitAddress);\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _pnkAmount,\\n int256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _pnkAmount,\\n uint256 _feeAmount,\\n IERC20 _feeToken\\n );\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _governor The governor's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n function initialize(\\n address _governor,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) external reinitializer(1) {\\n governor = _governor;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a dispute kit is not supported.\\n disputeKits.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKits.push(_disputeKit);\\n\\n emit DisputeKitCreated(Constants.DISPUTE_KIT_CLASSIC, _disputeKit);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(Constants.FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = Constants.FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(Constants.GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(Constants.GENERAL_COURT, Constants.DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /* @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n if (!success) revert UnsuccessfulCall();\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress) external onlyByGovernor {\\n uint256 disputeKitID = disputeKits.length;\\n disputeKits.push(_disputeKitAddress);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress);\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt();\\n if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit();\\n if (_parent == Constants.FORKING_COURT) revert InvalidForkingCourtAsParent();\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n // Check that Classic DK support was added.\\n if (!court.supportedDisputeKits[Constants.DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic();\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n function changeCourtParameters(\\n uint96 _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod\\n ) external onlyByGovernor {\\n Court storage court = courts[_courtID];\\n if (_courtID != Constants.GENERAL_COURT && courts[court.parent].minStake > _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n for (uint256 i = 0; i < court.children.length; i++) {\\n if (courts[court.children[i]].minStake < _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n }\\n court.minStake = _minStake;\\n court.hiddenVotes = _hiddenVotes;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(\\n _courtID,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod\\n );\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n // Classic dispute kit must be supported by all courts.\\n if (_disputeKitIDs[i] == Constants.DISPUTE_KIT_CLASSIC) {\\n revert CannotDisableClassicDK();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n /// @dev Changes the supported fee tokens.\\n /// @param _feeToken The fee token.\\n /// @param _accepted Whether the token is supported or not as a method of fee payment.\\n function changeAcceptedFeeTokens(IERC20 _feeToken, bool _accepted) external onlyByGovernor {\\n currencyRates[_feeToken].feePaymentAccepted = _accepted;\\n emit AcceptedFeeToken(_feeToken, _accepted);\\n }\\n\\n /// @dev Changes the currency rate of a fee token.\\n /// @param _feeToken The fee token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n function changeCurrencyRates(IERC20 _feeToken, uint64 _rateInEth, uint8 _rateDecimals) external onlyByGovernor {\\n currencyRates[_feeToken].rateInEth = _rateInEth;\\n currencyRates[_feeToken].rateDecimals = _rateDecimals;\\n emit NewCurrencyRate(_feeToken, _rateInEth, _rateDecimals);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// Note that the existing delayed stake will be nullified as non-relevant.\\n function setStake(uint96 _courtID, uint256 _newStake) external {\\n _setStake(msg.sender, _courtID, _newStake, false, OnError.Revert);\\n }\\n\\n /// @dev Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.\\n /// @param _account The account whose stake is being set.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs have already been transferred to the contract.\\n function setStakeBySortitionModule(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external {\\n if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly();\\n _setStake(_account, _courtID, _newStake, _alreadyTransferred, OnError.Return);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough();\\n\\n return _createDispute(_numberOfChoices, _extraData, Constants.NATIVE_CURRENCY, msg.value);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external override returns (uint256 disputeID) {\\n if (!currencyRates[_feeToken].feePaymentAccepted) revert TokenNotAccepted();\\n if (_feeAmount < arbitrationCost(_extraData, _feeToken)) revert ArbitrationFeesNotEnough();\\n\\n if (!_feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount)) revert TransferFailed();\\n return _createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount);\\n }\\n\\n function _createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) internal returns (uint256 disputeID) {\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n if (!courts[courtID].supportedDisputeKits[disputeKitID]) revert DisputeKitNotSupportedByCourt();\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrableV2(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKits[disputeKitID];\\n Court storage court = courts[dispute.courtID];\\n Round storage round = dispute.rounds.push();\\n\\n // Obtain the feeForJuror in the same currency as the _feeAmount\\n uint256 feeForJuror = (_feeToken == Constants.NATIVE_CURRENCY)\\n ? court.feeForJuror\\n : convertEthToTokenAmount(_feeToken, court.feeForJuror);\\n round.nbVotes = _feeAmount / feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = _feeAmount;\\n round.feeToken = IERC20(_feeToken);\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrableV2(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n if (\\n currentRound == 0 &&\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]\\n ) {\\n revert EvidenceNotPassedAndNotAppeal();\\n }\\n if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing();\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areCommitsAllCast(_disputeID)\\n ) {\\n revert CommitPeriodNotPassed();\\n }\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areVotesAllCast(_disputeID)\\n ) {\\n revert VotePeriodNotPassed();\\n }\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) {\\n revert AppealPeriodNotPassed();\\n }\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert DisputePeriodIsFinal();\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period != Period.evidence) revert NotEvidencePeriod();\\n\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 startIndex = round.drawIterations; // for gas: less storage reads\\n uint256 i;\\n while (i < _iterations && round.drawnJurors.length < round.nbVotes) {\\n address drawnAddress = disputeKit.draw(_disputeID, startIndex + i++);\\n if (drawnAddress == address(0)) {\\n continue;\\n }\\n sortitionModule.lockStake(drawnAddress, round.pnkAtStakePerJuror);\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n round.drawIterations += i;\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n if (msg.value < appealCost(_disputeID)) revert AppealFeesNotEnough();\\n\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.appeal) revert DisputeNotAppealable();\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n if (msg.sender != address(disputeKits[round.disputeKitID])) revert DisputeKitOnly();\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n // Switch to classic dispute kit if parent court doesn't support the current one.\\n newDisputeKitID = Constants.DISPUTE_KIT_CLASSIC;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKits[extraRound.disputeKitID].createDispute(\\n _disputeID,\\n _numberOfChoices,\\n _extraData,\\n extraRound.nbVotes\\n );\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n\\n Round storage round = dispute.rounds[_round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 pnkPenaltiesInRoundCache = round.pnkPenalties; // For saving gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect the PNK penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n pnkPenaltiesInRoundCache = _executePenalties(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n }\\n }\\n if (round.pnkPenalties != pnkPenaltiesInRoundCache) {\\n round.pnkPenalties = pnkPenaltiesInRoundCache; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return pnkPenaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.pnkAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.pnkPenaltiesInRound += penalty;\\n\\n // Unlock the PNKs affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n sortitionModule.unlockStake(account, penalty);\\n\\n // Apply the penalty to the staked PNKs.\\n sortitionModule.penalizeStake(account, penalty);\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n -int256(penalty),\\n 0,\\n round.feeToken\\n );\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(round.totalFeesForJurors);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, round.totalFeesForJurors);\\n }\\n pinakion.safeTransfer(governor, _params.pnkPenaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.pnkPenaltiesInRound,\\n round.totalFeesForJurors,\\n round.feeToken\\n );\\n }\\n return _params.pnkPenaltiesInRound;\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the PNKs of the juror for this round.\\n sortitionModule.unlockStake(account, pnkLocked);\\n\\n // Give back the locked PNKs in case the juror fully unstaked earlier.\\n if (!sortitionModule.isJurorStaked(account)) {\\n pinakion.safeTransfer(account, pnkLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumPnkRewardPaid += pnkReward;\\n uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumFeeRewardPaid += feeReward;\\n pinakion.safeTransfer(account, pnkReward);\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(account).send(feeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(account, feeReward);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(pnkReward),\\n int256(feeReward),\\n round.feeToken\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverPnkReward = _params.pnkPenaltiesInRound - round.sumPnkRewardPaid;\\n uint256 leftoverFeeReward = round.totalFeesForJurors - round.sumFeeRewardPaid;\\n if (leftoverPnkReward != 0 || leftoverFeeReward != 0) {\\n if (leftoverPnkReward != 0) {\\n pinakion.safeTransfer(governor, leftoverPnkReward);\\n }\\n if (leftoverFeeReward != 0) {\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(leftoverFeeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, leftoverFeeReward);\\n }\\n }\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n leftoverPnkReward,\\n leftoverFeeReward,\\n round.feeToken\\n );\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n if (dispute.ruled) revert RulingAlreadyExecuted();\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Compute the cost of arbitration denominated in ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) public view override returns (uint256 cost) {\\n cost = convertEthToTokenAmount(_feeToken, arbitrationCost(_extraData));\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == Constants.GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(uint256 _disputeID, uint256 _round) external view returns (Round memory) {\\n return disputes[_disputeID].rounds[_round];\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n timesPerPeriod = courts[_courtID].timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitsLength() external view returns (uint256) {\\n return disputeKits.length;\\n }\\n\\n function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) {\\n return (_amountInEth * 10 ** currencyRates[_toToken].rateDecimals) / currencyRates[_toToken].rateInEth;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support. Note that classic dispute kit should always be enabled.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev If called only once then set _onError to Revert, otherwise set it to Return\\n /// @param _account The account to set the stake for.\\n /// @param _courtID The ID of the court to set the stake for.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs were already transferred to/from the staking contract.\\n /// @param _onError Whether to revert or return false on error.\\n /// @return Whether the stake was successfully set or not.\\n function _setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred,\\n OnError _onError\\n ) internal returns (bool) {\\n if (_courtID == Constants.FORKING_COURT || _courtID > courts.length) {\\n _stakingFailed(_onError); // Staking directly into the forking court is not allowed.\\n return false;\\n }\\n if (_newStake != 0 && _newStake < courts[_courtID].minStake) {\\n _stakingFailed(_onError); // Staking less than the minimum stake is not allowed.\\n return false;\\n }\\n (uint256 pnkDeposit, uint256 pnkWithdrawal, bool sortitionSuccess) = sortitionModule.setStake(\\n _account,\\n _courtID,\\n _newStake,\\n _alreadyTransferred\\n );\\n if (!sortitionSuccess) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n if (pnkDeposit > 0) {\\n if (!pinakion.safeTransferFrom(_account, address(this), pnkDeposit)) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n }\\n if (pnkWithdrawal > 0) {\\n if (!pinakion.safeTransfer(_account, pnkWithdrawal)) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @dev It may revert depending on the _onError parameter.\\n function _stakingFailed(OnError _onError) internal pure {\\n if (_onError == OnError.Return) return;\\n revert StakingFailed();\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == Constants.FORKING_COURT || courtID >= courts.length) {\\n courtID = Constants.GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = Constants.DEFAULT_NB_OF_JURORS;\\n }\\n if (disputeKitID == Constants.NULL_DISPUTE_KIT || disputeKitID >= disputeKits.length) {\\n disputeKitID = Constants.DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = Constants.GENERAL_COURT;\\n minJurors = Constants.DEFAULT_NB_OF_JURORS;\\n disputeKitID = Constants.DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error DisputeKitOnly();\\n error SortitionModuleOnly();\\n error UnsuccessfulCall();\\n error InvalidDisputKitParent();\\n error DepthLevelMax();\\n error MinStakeLowerThanParentCourt();\\n error UnsupportedDisputeKit();\\n error InvalidForkingCourtAsParent();\\n error WrongDisputeKitIndex();\\n error CannotDisableClassicDK();\\n error ArraysLengthMismatch();\\n error StakingFailed();\\n error ArbitrationFeesNotEnough();\\n error DisputeKitNotSupportedByCourt();\\n error MustSupportDisputeKitClassic();\\n error TokenNotAccepted();\\n error EvidenceNotPassedAndNotAppeal();\\n error DisputeStillDrawing();\\n error CommitPeriodNotPassed();\\n error VotePeriodNotPassed();\\n error AppealPeriodNotPassed();\\n error NotEvidencePeriod();\\n error AppealFeesNotEnough();\\n error DisputeNotAppealable();\\n error NotExecutionPeriod();\\n error RulingAlreadyExecuted();\\n error DisputePeriodIsFinal();\\n error TransferFailed();\\n}\\n\",\"keccak256\":\"0x43205bc90f6965b5c1380effd2c29994f6dfea074696e39d5df037343a768d6b\",\"license\":\"MIT\"},\"src/arbitration/dispute-kits/DisputeKitClassic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"../KlerosCore.sol\\\";\\nimport \\\"../interfaces/IDisputeKit.sol\\\";\\nimport \\\"../../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../../proxy/Initializable.sol\\\";\\n\\n/// @title DisputeKitClassic\\n/// Dispute kit implementation of the Kleros v1 features including:\\n/// - a drawing system: proportional to staked PNK,\\n/// - a vote aggregation system: plurality,\\n/// - an incentive system: equal split between coherent votes,\\n/// - an appeal system: fund 2 choices only, vote on any choice.\\ncontract DisputeKitClassic is IDisputeKit, Initializable, UUPSProxiable {\\n // ************************************* //\\n // * Structs * //\\n // ************************************* //\\n\\n struct Dispute {\\n Round[] rounds; // Rounds of the dispute. 0 is the default round, and [1, ..n] are the appeal rounds.\\n uint256 numberOfChoices; // The number of choices jurors have when voting. This does not include choice `0` which is reserved for \\\"refuse to arbitrate\\\".\\n bool jumped; // True if dispute jumped to a parent dispute kit and won't be handled by this DK anymore.\\n mapping(uint256 => uint256) coreRoundIDToLocal; // Maps id of the round in the core contract to the index of the round of related local dispute.\\n bytes extraData; // Extradata for the dispute.\\n }\\n\\n struct Round {\\n Vote[] votes; // Former votes[_appeal][].\\n uint256 winningChoice; // The choice with the most votes. Note that in the case of a tie, it is the choice that reached the tied number of votes first.\\n mapping(uint256 => uint256) counts; // The sum of votes for each choice in the form `counts[choice]`.\\n bool tied; // True if there is a tie, false otherwise.\\n uint256 totalVoted; // Former uint[_appeal] votesInEachRound.\\n uint256 totalCommitted; // Former commitsInRound.\\n mapping(uint256 => uint256) paidFees; // Tracks the fees paid for each choice in this round.\\n mapping(uint256 => bool) hasPaid; // True if this choice was fully funded, false otherwise.\\n mapping(address => mapping(uint256 => uint256)) contributions; // Maps contributors to their contributions for each choice.\\n uint256 feeRewards; // Sum of reimbursable appeal fees available to the parties that made contributions to the ruling that ultimately wins a dispute.\\n uint256[] fundedChoices; // Stores the choices that are fully funded.\\n uint256 nbVotes; // Maximal number of votes this dispute can get.\\n }\\n\\n struct Vote {\\n address account; // The address of the juror.\\n bytes32 commit; // The commit of the juror. For courts with hidden votes.\\n uint256 choice; // The choice of the juror.\\n bool voted; // True if the vote has been cast.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant WINNER_STAKE_MULTIPLIER = 10000; // Multiplier of the appeal cost that the winner has to pay as fee stake for a round in basis points. Default is 1x of appeal fee.\\n uint256 public constant LOSER_STAKE_MULTIPLIER = 20000; // Multiplier of the appeal cost that the loser has to pay as fee stake for a round in basis points. Default is 2x of appeal fee.\\n uint256 public constant LOSER_APPEAL_PERIOD_MULTIPLIER = 5000; // Multiplier of the appeal period for the choice that wasn't voted for in the previous round, in basis points. Default is 1/2 of original appeal period.\\n uint256 public constant ONE_BASIS_POINT = 10000; // One basis point, for scaling.\\n\\n address public governor; // The governor of the contract.\\n KlerosCore public core; // The Kleros Core arbitrator\\n Dispute[] public disputes; // Array of the locally created disputes.\\n mapping(uint256 => uint256) public coreDisputeIDToLocal; // Maps the dispute ID in Kleros Core to the local dispute ID.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n /// @dev To be emitted when a dispute is created.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _numberOfChoices The number of choices available in the dispute.\\n /// @param _extraData The extra data for the dispute.\\n event DisputeCreation(uint256 indexed _coreDisputeID, uint256 _numberOfChoices, bytes _extraData);\\n\\n /// @dev To be emitted when a vote commitment is cast.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _juror The address of the juror casting the vote commitment.\\n /// @param _voteIDs The identifiers of the votes in the dispute.\\n /// @param _commit The commitment of the juror.\\n event CommitCast(uint256 indexed _coreDisputeID, address indexed _juror, uint256[] _voteIDs, bytes32 _commit);\\n\\n /// @dev To be emitted when a funding contribution is made.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _coreRoundID The identifier of the round in the Arbitrator contract.\\n /// @param _choice The choice that is being funded.\\n /// @param _contributor The address of the contributor.\\n /// @param _amount The amount contributed.\\n event Contribution(\\n uint256 indexed _coreDisputeID,\\n uint256 indexed _coreRoundID,\\n uint256 _choice,\\n address indexed _contributor,\\n uint256 _amount\\n );\\n\\n /// @dev To be emitted when the contributed funds are withdrawn.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _coreRoundID The identifier of the round in the Arbitrator contract.\\n /// @param _choice The choice that is being funded.\\n /// @param _contributor The address of the contributor.\\n /// @param _amount The amount withdrawn.\\n event Withdrawal(\\n uint256 indexed _coreDisputeID,\\n uint256 indexed _coreRoundID,\\n uint256 _choice,\\n address indexed _contributor,\\n uint256 _amount\\n );\\n\\n /// @dev To be emitted when a choice is fully funded for an appeal.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _coreRoundID The identifier of the round in the Arbitrator contract.\\n /// @param _choice The choice that is being funded.\\n event ChoiceFunded(uint256 indexed _coreDisputeID, uint256 indexed _coreRoundID, uint256 indexed _choice);\\n\\n // ************************************* //\\n // * Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n modifier onlyByCore() {\\n require(address(core) == msg.sender, \\\"Access not allowed: KlerosCore only.\\\");\\n _;\\n }\\n\\n modifier notJumped(uint256 _coreDisputeID) {\\n require(!disputes[coreDisputeIDToLocal[_coreDisputeID]].jumped, \\\"Dispute jumped to a parent DK!\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer.\\n /// @param _governor The governor's address.\\n /// @param _core The KlerosCore arbitrator.\\n function initialize(address _governor, KlerosCore _core) external reinitializer(1) {\\n governor = _governor;\\n core = _core;\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /**\\n * @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n require(success, \\\"Unsuccessful call\\\");\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `core` storage variable.\\n /// @param _core The new value for the `core` storage variable.\\n function changeCore(address _core) external onlyByGovernor {\\n core = KlerosCore(_core);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n /// @param _nbVotes Number of votes for this dispute.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external override onlyByCore {\\n uint256 localDisputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.numberOfChoices = _numberOfChoices;\\n dispute.extraData = _extraData;\\n\\n // New round in the Core should be created before the dispute creation in DK.\\n dispute.coreRoundIDToLocal[core.getNumberOfRounds(_coreDisputeID) - 1] = dispute.rounds.length;\\n\\n Round storage round = dispute.rounds.push();\\n round.nbVotes = _nbVotes;\\n round.tied = true;\\n\\n coreDisputeIDToLocal[_coreDisputeID] = localDisputeID;\\n emit DisputeCreation(_coreDisputeID, _numberOfChoices, _extraData);\\n }\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _nonce Nonce of the drawing iteration.\\n /// @return drawnAddress The drawn address.\\n function draw(\\n uint256 _coreDisputeID,\\n uint256 _nonce\\n ) external override onlyByCore notJumped(_coreDisputeID) returns (address drawnAddress) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n\\n ISortitionModule sortitionModule = core.sortitionModule();\\n (uint96 courtID, , , , ) = core.disputes(_coreDisputeID);\\n bytes32 key = bytes32(uint256(courtID)); // Get the ID of the tree.\\n\\n // TODO: Handle the situation when no one has staked yet.\\n drawnAddress = sortitionModule.draw(key, _coreDisputeID, _nonce);\\n\\n if (_postDrawCheck(_coreDisputeID, drawnAddress)) {\\n round.votes.push(Vote({account: drawnAddress, commit: bytes32(0), choice: 0, voted: false}));\\n } else {\\n drawnAddress = address(0);\\n }\\n }\\n\\n /// @dev Sets the caller's commit for the specified votes. It can be called multiple times during the\\n /// commit period, each call overrides the commits of the previous one.\\n /// `O(n)` where\\n /// `n` is the number of votes.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _voteIDs The IDs of the votes.\\n /// @param _commit The commit. Note that justification string is a part of the commit.\\n function castCommit(\\n uint256 _coreDisputeID,\\n uint256[] calldata _voteIDs,\\n bytes32 _commit\\n ) external notJumped(_coreDisputeID) {\\n (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID);\\n require(period == KlerosCore.Period.commit, \\\"The dispute should be in Commit period.\\\");\\n require(_commit != bytes32(0), \\\"Empty commit.\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n for (uint256 i = 0; i < _voteIDs.length; i++) {\\n require(round.votes[_voteIDs[i]].account == msg.sender, \\\"The caller has to own the vote.\\\");\\n round.votes[_voteIDs[i]].commit = _commit;\\n }\\n round.totalCommitted += _voteIDs.length;\\n emit CommitCast(_coreDisputeID, msg.sender, _voteIDs, _commit);\\n }\\n\\n /// @dev Sets the caller's choices for the specified votes.\\n /// `O(n)` where\\n /// `n` is the number of votes.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _voteIDs The IDs of the votes.\\n /// @param _choice The choice.\\n /// @param _salt The salt for the commit if the votes were hidden.\\n /// @param _justification Justification of the choice.\\n function castVote(\\n uint256 _coreDisputeID,\\n uint256[] calldata _voteIDs,\\n uint256 _choice,\\n uint256 _salt,\\n string memory _justification\\n ) external notJumped(_coreDisputeID) {\\n (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID);\\n require(period == KlerosCore.Period.vote, \\\"The dispute should be in Vote period.\\\");\\n require(_voteIDs.length > 0, \\\"No voteID provided\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n require(_choice <= dispute.numberOfChoices, \\\"Choice out of bounds\\\");\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n (uint96 courtID, , , , ) = core.disputes(_coreDisputeID);\\n (, bool hiddenVotes, , , , , ) = core.courts(courtID);\\n\\n // Save the votes.\\n for (uint256 i = 0; i < _voteIDs.length; i++) {\\n require(round.votes[_voteIDs[i]].account == msg.sender, \\\"The caller has to own the vote.\\\");\\n require(\\n !hiddenVotes || round.votes[_voteIDs[i]].commit == keccak256(abi.encodePacked(_choice, _salt)),\\n \\\"The commit must match the choice in courts with hidden votes.\\\"\\n );\\n require(!round.votes[_voteIDs[i]].voted, \\\"Vote already cast.\\\");\\n round.votes[_voteIDs[i]].choice = _choice;\\n round.votes[_voteIDs[i]].voted = true;\\n }\\n\\n round.totalVoted += _voteIDs.length;\\n\\n round.counts[_choice] += _voteIDs.length;\\n if (_choice == round.winningChoice) {\\n if (round.tied) round.tied = false;\\n } else {\\n // Voted for another choice.\\n if (round.counts[_choice] == round.counts[round.winningChoice]) {\\n // Tie.\\n if (!round.tied) round.tied = true;\\n } else if (round.counts[_choice] > round.counts[round.winningChoice]) {\\n // New winner.\\n round.winningChoice = _choice;\\n round.tied = false;\\n }\\n }\\n emit VoteCast(_coreDisputeID, msg.sender, _voteIDs, _choice, _justification);\\n }\\n\\n /// @dev Manages contributions, and appeals a dispute if at least two choices are fully funded.\\n /// Note that the surplus deposit will be reimbursed.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core.\\n /// @param _choice A choice that receives funding.\\n function fundAppeal(uint256 _coreDisputeID, uint256 _choice) external payable notJumped(_coreDisputeID) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n require(_choice <= dispute.numberOfChoices, \\\"There is no such ruling to fund.\\\");\\n\\n (uint256 appealPeriodStart, uint256 appealPeriodEnd) = core.appealPeriod(_coreDisputeID);\\n require(block.timestamp >= appealPeriodStart && block.timestamp < appealPeriodEnd, \\\"Appeal period is over.\\\");\\n\\n uint256 multiplier;\\n (uint256 ruling, , ) = this.currentRuling(_coreDisputeID);\\n if (ruling == _choice) {\\n multiplier = WINNER_STAKE_MULTIPLIER;\\n } else {\\n require(\\n block.timestamp - appealPeriodStart <\\n ((appealPeriodEnd - appealPeriodStart) * LOSER_APPEAL_PERIOD_MULTIPLIER) / ONE_BASIS_POINT,\\n \\\"Appeal period is over for loser\\\"\\n );\\n multiplier = LOSER_STAKE_MULTIPLIER;\\n }\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n uint256 coreRoundID = core.getNumberOfRounds(_coreDisputeID) - 1;\\n\\n require(!round.hasPaid[_choice], \\\"Appeal fee is already paid.\\\");\\n uint256 appealCost = core.appealCost(_coreDisputeID);\\n uint256 totalCost = appealCost + (appealCost * multiplier) / ONE_BASIS_POINT;\\n\\n // Take up to the amount necessary to fund the current round at the current costs.\\n uint256 contribution;\\n if (totalCost > round.paidFees[_choice]) {\\n contribution = totalCost - round.paidFees[_choice] > msg.value // Overflows and underflows will be managed on the compiler level.\\n ? msg.value\\n : totalCost - round.paidFees[_choice];\\n emit Contribution(_coreDisputeID, coreRoundID, _choice, msg.sender, contribution);\\n }\\n\\n round.contributions[msg.sender][_choice] += contribution;\\n round.paidFees[_choice] += contribution;\\n if (round.paidFees[_choice] >= totalCost) {\\n round.feeRewards += round.paidFees[_choice];\\n round.fundedChoices.push(_choice);\\n round.hasPaid[_choice] = true;\\n emit ChoiceFunded(_coreDisputeID, coreRoundID, _choice);\\n }\\n\\n if (round.fundedChoices.length > 1) {\\n // At least two sides are fully funded.\\n round.feeRewards = round.feeRewards - appealCost;\\n\\n if (core.isDisputeKitJumping(_coreDisputeID)) {\\n // Don't create a new round in case of a jump, and remove local dispute from the flow.\\n dispute.jumped = true;\\n } else {\\n // Don't subtract 1 from length since both round arrays haven't been updated yet.\\n dispute.coreRoundIDToLocal[coreRoundID + 1] = dispute.rounds.length;\\n\\n Round storage newRound = dispute.rounds.push();\\n newRound.nbVotes = core.getNumberOfVotes(_coreDisputeID);\\n newRound.tied = true;\\n }\\n core.appeal{value: appealCost}(_coreDisputeID, dispute.numberOfChoices, dispute.extraData);\\n }\\n\\n if (msg.value > contribution) payable(msg.sender).send(msg.value - contribution);\\n }\\n\\n /// @dev Allows those contributors who attempted to fund an appeal round to withdraw any reimbursable fees or rewards after the dispute gets resolved.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core contract.\\n /// @param _beneficiary The address whose rewards to withdraw.\\n /// @param _coreRoundID The round in the Kleros Core contract the caller wants to withdraw from.\\n /// @param _choice The ruling option that the caller wants to withdraw from.\\n /// @return amount The withdrawn amount.\\n function withdrawFeesAndRewards(\\n uint256 _coreDisputeID,\\n address payable _beneficiary,\\n uint256 _coreRoundID,\\n uint256 _choice\\n ) external returns (uint256 amount) {\\n (, , , bool isRuled, ) = core.disputes(_coreDisputeID);\\n require(isRuled, \\\"Dispute should be resolved.\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];\\n (uint256 finalRuling, , ) = core.currentRuling(_coreDisputeID);\\n\\n if (!round.hasPaid[_choice]) {\\n // Allow to reimburse if funding was unsuccessful for this ruling option.\\n amount = round.contributions[_beneficiary][_choice];\\n } else {\\n // Funding was successful for this ruling option.\\n if (_choice == finalRuling) {\\n // This ruling option is the ultimate winner.\\n amount = round.paidFees[_choice] > 0\\n ? (round.contributions[_beneficiary][_choice] * round.feeRewards) / round.paidFees[_choice]\\n : 0;\\n } else if (!round.hasPaid[finalRuling]) {\\n // The ultimate winner was not funded in this round. In this case funded ruling option(s) are reimbursed.\\n amount =\\n (round.contributions[_beneficiary][_choice] * round.feeRewards) /\\n (round.paidFees[round.fundedChoices[0]] + round.paidFees[round.fundedChoices[1]]);\\n }\\n }\\n round.contributions[_beneficiary][_choice] = 0;\\n\\n if (amount != 0) {\\n _beneficiary.send(amount); // Deliberate use of send to prevent reverting fallback. It's the user's responsibility to accept ETH.\\n emit Withdrawal(_coreDisputeID, _coreRoundID, _choice, _beneficiary, amount);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n function getFundedChoices(uint256 _coreDisputeID) public view returns (uint256[] memory fundedChoices) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage lastRound = dispute.rounds[dispute.rounds.length - 1];\\n return lastRound.fundedChoices;\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(\\n uint256 _coreDisputeID\\n ) external view override returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n tied = round.tied;\\n ruling = tied ? 0 : round.winningChoice;\\n (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID);\\n // Override the final ruling if only one side funded the appeals.\\n if (period == KlerosCore.Period.execution) {\\n uint256[] memory fundedChoices = getFundedChoices(_coreDisputeID);\\n if (fundedChoices.length == 1) {\\n ruling = fundedChoices[0];\\n tied = false;\\n overridden = true;\\n }\\n }\\n }\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view override returns (uint256) {\\n // In this contract this degree can be either 0 or 1, but in other dispute kits this value can be something in between.\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Vote storage vote = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]].votes[_voteID];\\n (uint256 winningChoice, bool tied, ) = core.currentRuling(_coreDisputeID);\\n\\n if (vote.voted && (vote.choice == winningChoice || tied)) {\\n return ONE_BASIS_POINT;\\n } else {\\n return 0;\\n }\\n }\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view override returns (uint256) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage currentRound = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];\\n (uint256 winningChoice, bool tied, ) = core.currentRuling(_coreDisputeID);\\n\\n if (currentRound.totalVoted == 0 || (!tied && currentRound.counts[winningChoice] == 0)) {\\n return 0;\\n } else if (tied) {\\n return currentRound.totalVoted;\\n } else {\\n return currentRound.counts[winningChoice];\\n }\\n }\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n return round.totalCommitted == round.votes.length;\\n }\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n return round.totalVoted == round.votes.length;\\n }\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Vote storage vote = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]].votes[_voteID];\\n return vote.voted;\\n }\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n override\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n )\\n {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];\\n return (\\n round.winningChoice,\\n round.tied,\\n round.totalVoted,\\n round.totalCommitted,\\n round.votes.length,\\n round.counts[_choice]\\n );\\n }\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view override returns (address account, bytes32 commit, uint256 choice, bool voted) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Vote storage vote = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]].votes[_voteID];\\n return (vote.account, vote.commit, vote.choice, vote.voted);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Checks that the chosen address satisfies certain conditions for being drawn.\\n /// @param _coreDisputeID ID of the dispute in the core contract.\\n /// @param _juror Chosen address.\\n /// @return Whether the address can be drawn or not.\\n function _postDrawCheck(uint256 _coreDisputeID, address _juror) internal view returns (bool) {\\n (uint96 courtID, , , , ) = core.disputes(_coreDisputeID);\\n uint256 lockedAmountPerJuror = core\\n .getRoundInfo(_coreDisputeID, core.getNumberOfRounds(_coreDisputeID) - 1)\\n .pnkAtStakePerJuror;\\n (uint256 totalStaked, uint256 totalLocked, , ) = core.sortitionModule().getJurorBalance(_juror, courtID);\\n return totalStaked >= totalLocked + lockedAmountPerJuror;\\n }\\n}\\n\",\"keccak256\":\"0xdf2e2e6aacabe3323dad6e8d7bbae2d749ebf0d84c3f71f84ec8d8ed918387e1\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _juror Address of the juror.\\n /// @param _voteIDs The identifiers of the votes in the dispute.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event VoteCast(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256[] _voteIDs,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _nonce Nonce.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID, uint256 _nonce) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0x7fe6b1d9b991cc327cc5895f34208a7b1e3b6ebf8efb20fcb9f3ff0f40d2d209\",\"license\":\"MIT\"},\"src/arbitration/interfaces/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external returns (uint256 pnkDeposit, uint256 pnkWithdrawal, bool succeeded);\\n\\n function setJurorInactive(address _account) external;\\n\\n function lockStake(address _account, uint256 _relativeAmount) external;\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external;\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _nonce) external view returns (address);\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts);\\n\\n function getJurorCourtIDs(address _juror) external view returns (uint96[] memory);\\n\\n function isJurorStaked(address _juror) external view returns (bool);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0xa6d79053edfe04f7d3c8ad9b9ce3f182e45f2f74be40a77a304a93168549c474\",\"license\":\"MIT\"},\"src/libraries/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title Constants\\nlibrary Constants {\\n // Courts\\n uint96 public constant FORKING_COURT = 0; // Index of the forking court.\\n uint96 public constant GENERAL_COURT = 1; // Index of the default (general) court.\\n\\n // Dispute Kits\\n uint256 public constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\n uint256 public constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n\\n // Defaults\\n uint256 public constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute.\\n IERC20 public constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1.\\n}\\n\",\"keccak256\":\"0xde8fd28a18669261b052aebb00bf09ec592bb9298fa5efc76ca8606e0c7dbb25\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"},\"src/libraries/Types.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nenum OnError {\\n Revert,\\n Return\\n}\\n\",\"keccak256\":\"0xc7deebd8227dfaa46a36ae8d2c24fe1b5d5c776ab963b44943829ab4058b5701\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000d9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff1615620000765760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b0390811614620000d65780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051613dfb62000103600039600081816114d3015281816114fc01526118370152613dfb6000f3fe6080604052600436106101825760003560e01c80636d4cd8ea116100d7578063b6ede54011610085578063b6ede540146104ca578063ba66fde7146104ea578063be4676041461050a578063d2b8035a14610520578063da3beb8c14610540578063e349ad3014610412578063e4c0aaf414610560578063f2f4eb261461058057600080fd5b80636d4cd8ea146103d2578063751accd0146103f2578063796490f9146104125780637c04034e146104285780638e42646014610448578063a7cc08fe14610468578063b34bfaa8146104b457600080fd5b80634f1ef286116101345780634f1ef286146102c15780634fe264fb146102d457806352d1902d146102f4578063564a565d146103095780635c92e2f61461033857806365540b961461035857806369f3f0411461038557600080fd5b80630baa64d1146101875780630c340a24146101bc5780631200aabc146101f45780631c3db16d1461022f578063362c34791461026c578063485cc9551461028c5780634b2f0ea0146102ae575b600080fd5b34801561019357600080fd5b506101a76101a23660046130cf565b6105a0565b60405190151581526020015b60405180910390f35b3480156101c857600080fd5b506000546101dc906001600160a01b031681565b6040516001600160a01b0390911681526020016101b3565b34801561020057600080fd5b5061022161020f3660046130cf565b60036020526000908152604090205481565b6040519081526020016101b3565b34801561023b57600080fd5b5061024f61024a3660046130cf565b610617565b6040805193845291151560208401521515908201526060016101b3565b34801561027857600080fd5b506102216102873660046130fd565b610785565b34801561029857600080fd5b506102ac6102a736600461313a565b610b5b565b005b6102ac6102bc366004613173565b610c58565b6102ac6102cf36600461327b565b6114bf565b3480156102e057600080fd5b506102216102ef3660046132ca565b6116e7565b34801561030057600080fd5b5061022161182a565b34801561031557600080fd5b506103296103243660046130cf565b611888565b6040516101b393929190613346565b34801561034457600080fd5b506102ac6103533660046133bb565b61194e565b34801561036457600080fd5b506103786103733660046130cf565b611c5b565b6040516101b3919061340d565b34801561039157600080fd5b506103a56103a03660046132ca565b611d1f565b604080519687529415156020870152938501929092526060840152608083015260a082015260c0016101b3565b3480156103de57600080fd5b506101a76103ed3660046130cf565b611dd7565b3480156103fe57600080fd5b506102ac61040d366004613451565b611e4e565b34801561041e57600080fd5b5061022161271081565b34801561043457600080fd5b506102ac6104433660046134a9565b611f1a565b34801561045457600080fd5b506102ac610463366004613541565b6125f5565b34801561047457600080fd5b506104886104833660046132ca565b612641565b604080516001600160a01b039095168552602085019390935291830152151560608201526080016101b3565b3480156104c057600080fd5b50610221614e2081565b3480156104d657600080fd5b506102ac6104e536600461355e565b612707565b3480156104f657600080fd5b506101a76105053660046132ca565b6128dc565b34801561051657600080fd5b5061022161138881565b34801561052c57600080fd5b506101dc61053b366004613173565b612977565b34801561054c57600080fd5b5061022161055b366004613173565b612c80565b34801561056c57600080fd5b506102ac61057b366004613541565b612dd3565b34801561058c57600080fd5b506001546101dc906001600160a01b031681565b6000818152600360205260408120546002805483929081106105c4576105c46135e5565b600091825260208220600590910201805490925082906105e690600190613611565b815481106105f6576105f66135e5565b60009182526020909120600c90910201805460059091015414949350505050565b6000806000806002600360008781526020019081526020016000205481548110610643576106436135e5565b6000918252602082206005909102018054909250829061066590600190613611565b81548110610675576106756135e5565b60009182526020909120600c90910201600381015460ff1694509050836106a05780600101546106a3565b60005b60015460405163564a565d60e01b8152600481018990529196506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156106f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107169190613650565b5090935060049250610726915050565b816004811115610738576107386136b7565b0361077b57600061074888611c5b565b905080516001036107795780600081518110610766576107666135e5565b6020026020010151965060009550600194505b505b5050509193909250565b60015460405163564a565d60e01b81526004810186905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156107d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f79190613650565b5093505050508061084f5760405162461bcd60e51b815260206004820152601b60248201527f446973707574652073686f756c64206265207265736f6c7665642e000000000060448201526064015b60405180910390fd5b600086815260036020526040812054600280549091908110610873576108736135e5565b600091825260208083208884526003600590930201918201905260408220548154919350839181106108a7576108a76135e5565b600091825260208220600154604051631c3db16d60e01b8152600481018d9052600c9390930290910193506001600160a01b031690631c3db16d90602401606060405180830381865afa158015610902573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092691906136cd565b5050600087815260078401602052604090205490915060ff16610970576001600160a01b038816600090815260088301602090815260408083208984529091529020549450610ab5565b8086036109e55760008681526006830160205260409020546109935760006109de565b600086815260068301602090815260408083205460098601546001600160a01b038d1685526008870184528285208b86529093529220546109d49190613709565b6109de9190613720565b9450610ab5565b600081815260078301602052604090205460ff16610ab55781600601600083600a01600181548110610a1957610a196135e5565b906000526020600020015481526020019081526020016000205482600601600084600a01600081548110610a4f57610a4f6135e5565b9060005260206000200154815260200190815260200160002054610a739190613742565b60098301546001600160a01b038a16600090815260088501602090815260408083208b8452909152902054610aa89190613709565b610ab29190613720565b94505b6001600160a01b038816600090815260088301602090815260408083208984529091528120558415610b4f576040516001600160a01b0389169086156108fc029087906000818181858888f15050604080518a8152602081018a90526001600160a01b038d1694508b93508d92507f54b3cab3cb5c4aca3209db1151caff092e878011202e43a36782d4ebe0b963ae910160405180910390a45b50505050949350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff1680610ba4575080546001600160401b03808416911610155b15610bc15760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b038316908117600160401b178255600080546001600160a01b038781166001600160a01b0319928316179092556001805492871692909116919091179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b600082815260036020526040902054600280548492908110610c7c57610c7c6135e5565b600091825260209091206002600590920201015460ff1615610cb05760405162461bcd60e51b815260040161084690613755565b600083815260036020526040812054600280549091908110610cd457610cd46135e5565b906000526020600020906005020190508060010154831115610d385760405162461bcd60e51b815260206004820181905260248201527f5468657265206973206e6f20737563682072756c696e6720746f2066756e642e6044820152606401610846565b60015460405163afe15cfb60e01b81526004810186905260009182916001600160a01b039091169063afe15cfb906024016040805180830381865afa158015610d85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da9919061378c565b91509150814210158015610dbc57508042105b610e015760405162461bcd60e51b815260206004820152601660248201527520b83832b0b6103832b934b7b21034b99037bb32b91760511b6044820152606401610846565b604051631c3db16d60e01b81526004810187905260009081903090631c3db16d90602401606060405180830381865afa158015610e42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6691906136cd565b50509050868103610e7b576127109150610efc565b612710611388610e8b8686613611565b610e959190613709565b610e9f9190613720565b610ea98542613611565b10610ef65760405162461bcd60e51b815260206004820152601f60248201527f41707065616c20706572696f64206973206f76657220666f72206c6f736572006044820152606401610846565b614e2091505b84546000908690610f0f90600190613611565b81548110610f1f57610f1f6135e5565b60009182526020822060018054604051637e37c78b60e11b8152600481018f9052600c949094029092019450916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa158015610f7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa291906137b0565b610fac9190613611565b60008a815260078401602052604090205490915060ff16156110105760405162461bcd60e51b815260206004820152601b60248201527f41707065616c2066656520697320616c726561647920706169642e00000000006044820152606401610846565b600154604051632cf6413f60e11b8152600481018c90526000916001600160a01b0316906359ec827e90602401602060405180830381865afa15801561105a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107e91906137b0565b9050600061271061108f8784613709565b6110999190613720565b6110a39083613742565b60008c8152600686016020526040812054919250908211156111545760008c815260068601602052604090205434906110dc9084613611565b116111015760008c81526006860160205260409020546110fc9083613611565b611103565b345b9050336001600160a01b0316848e7fcae597f39a3ad75c2e10d46b031f023c5c2babcd58ca0491b122acda3968d4c08f8560405161114b929190918252602082015260400190565b60405180910390a45b33600090815260088601602090815260408083208f845290915281208054839290611180908490613742565b909155505060008c8152600686016020526040812080548392906111a5908490613742565b909155505060008c815260068601602052604090205482116112775760008c8152600686016020526040812054600987018054919290916111e7908490613742565b9250508190555084600a018c908060018154018082558091505060019003906000526020600020016000909190919091505560018560070160008e815260200190815260200160002060006101000a81548160ff0219169083151502179055508b848e7fed764996238e4c1c873ae3af7ae2f00f1f6f4f10b9ac7d4bbea4a764c5dea00960405160405180910390a45b600a85015460011015611482578285600901546112949190613611565b60098601556001546040516319b8152960e01b8152600481018f90526001600160a01b03909116906319b8152990602401602060405180830381865afa1580156112e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130691906137c9565b1561131f5760028a01805460ff19166001179055611402565b895460038b016000611332876001613742565b81526020019081526020016000208190555060008a6000016001816001815401808255809150500390600052602060002090600c02019050600160009054906101000a90046001600160a01b03166001600160a01b031663c71f42538f6040518263ffffffff1660e01b81526004016113ad91815260200190565b602060405180830381865afa1580156113ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ee91906137b0565b600b820155600301805460ff191660011790555b600160009054906101000a90046001600160a01b03166001600160a01b031663c3569902848f8d600101548e6004016040518563ffffffff1660e01b815260040161144f9392919061381e565b6000604051808303818588803b15801561146857600080fd5b505af115801561147c573d6000803e3d6000fd5b50505050505b803411156114b057336108fc6114988334613611565b6040518115909202916000818181858888f150505050505b50505050505050505050505050565b6114c882612e1f565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061154657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661153a600080516020613da68339815191525490565b6001600160a01b031614155b156115645760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156115be575060408051601f3d908101601f191682019092526115bb918101906137b0565b60015b6115e657604051630c76093760e01b81526001600160a01b0383166004820152602401610846565b600080516020613da6833981519152811461161757604051632a87526960e21b815260048101829052602401610846565b600080516020613da68339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28151156116e2576000836001600160a01b03168360405161167e91906138b8565b600060405180830381855af49150503d80600081146116b9576040519150601f19603f3d011682016040523d82523d6000602084013e6116be565b606091505b50509050806116e0576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b60008381526003602052604081205460028054839290811061170b5761170b6135e5565b6000918252602080832087845260036005909302019182019052604082205481549193508391811061173f5761173f6135e5565b90600052602060002090600c02016000018481548110611761576117616135e5565b600091825260208220600154604051631c3db16d60e01b815260048082018c905293909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa1580156117bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e391906136cd565b506003850154919350915060ff168015611807575081836002015414806118075750805b1561181a57612710945050505050611823565b60009450505050505b9392505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118755760405163703e46dd60e11b815260040160405180910390fd5b50600080516020613da683398151915290565b6002818154811061189857600080fd5b600091825260209091206005909102016001810154600282015460048301805492945060ff90911692916118cb906137e4565b80601f01602080910402602001604051908101604052809291908181526020018280546118f7906137e4565b80156119445780601f1061191957610100808354040283529160200191611944565b820191906000526020600020905b81548152906001019060200180831161192757829003601f168201915b5050505050905083565b600084815260036020526040902054600280548692908110611972576119726135e5565b600091825260209091206002600590920201015460ff16156119a65760405162461bcd60e51b815260040161084690613755565b60015460405163564a565d60e01b8152600481018790526000916001600160a01b03169063564a565d9060240160a060405180830381865afa1580156119f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a149190613650565b5090935060019250611a24915050565b816004811115611a3657611a366136b7565b14611a935760405162461bcd60e51b815260206004820152602760248201527f54686520646973707574652073686f756c6420626520696e20436f6d6d6974206044820152663832b934b7b21760c91b6064820152608401610846565b82611ad05760405162461bcd60e51b815260206004820152600d60248201526c22b6b83a3c9031b7b6b6b4ba1760991b6044820152606401610846565b600086815260036020526040812054600280549091908110611af457611af46135e5565b60009182526020822060059091020180549092508290611b1690600190613611565b81548110611b2657611b266135e5565b90600052602060002090600c0201905060005b86811015611bf4573382898984818110611b5557611b556135e5565b9050602002013581548110611b6c57611b6c6135e5565b60009182526020909120600490910201546001600160a01b031614611ba35760405162461bcd60e51b8152600401610846906138d4565b8582898984818110611bb757611bb76135e5565b9050602002013581548110611bce57611bce6135e5565b600091825260209091206001600490920201015580611bec8161390b565b915050611b39565b5086869050816005016000828254611c0c9190613742565b9091555050604051339089907f05cc2f1c94966f1c961b410a50f3d3ffb64501346753a258177097ea23707f0890611c49908b908b908b90613956565b60405180910390a35050505050505050565b6000818152600360205260408120546002805460609392908110611c8157611c816135e5565b60009182526020822060059091020180549092508290611ca390600190613611565b81548110611cb357611cb36135e5565b90600052602060002090600c0201905080600a01805480602002602001604051908101604052809291908181526020018280548015611d1157602002820191906000526020600020905b815481526020019060010190808311611cfd575b505050505092505050919050565b60008060008060008060006002600360008c81526020019081526020016000205481548110611d5057611d506135e5565b600091825260208083208c8452600360059093020191820190526040822054815491935083918110611d8457611d846135e5565b600091825260208083206001600c909302019182015460038301546004840154600585015485549f87526002909501909352604090942054909f60ff9094169e50909c50909a9950975095505050505050565b600081815260036020526040812054600280548392908110611dfb57611dfb6135e5565b60009182526020822060059091020180549092508290611e1d90600190613611565b81548110611e2d57611e2d6135e5565b60009182526020909120600c90910201805460049091015414949350505050565b6000546001600160a01b03163314611e785760405162461bcd60e51b81526004016108469061397a565b6000836001600160a01b03168383604051611e9391906138b8565b60006040518083038185875af1925050503d8060008114611ed0576040519150601f19603f3d011682016040523d82523d6000602084013e611ed5565b606091505b50509050806116e05760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b6044820152606401610846565b600086815260036020526040902054600280548892908110611f3e57611f3e6135e5565b600091825260209091206002600590920201015460ff1615611f725760405162461bcd60e51b815260040161084690613755565b60015460405163564a565d60e01b8152600481018990526000916001600160a01b03169063564a565d9060240160a060405180830381865afa158015611fbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fe09190613650565b5090935060029250611ff0915050565b816004811115612002576120026136b7565b1461205d5760405162461bcd60e51b815260206004820152602560248201527f54686520646973707574652073686f756c6420626520696e20566f74652070656044820152643934b7b21760d91b6064820152608401610846565b8561209f5760405162461bcd60e51b8152602060048201526012602482015271139bc81d9bdd195251081c1c9bdd9a59195960721b6044820152606401610846565b6000888152600360205260408120546002805490919081106120c3576120c36135e5565b90600052602060002090600502019050806001015486111561211e5760405162461bcd60e51b815260206004820152601460248201527343686f696365206f7574206f6620626f756e647360601b6044820152606401610846565b8054600090829061213190600190613611565b81548110612141576121416135e5565b60009182526020822060015460405163564a565d60e01b8152600481018f9052600c9390930290910193506001600160a01b03169063564a565d9060240160a060405180830381865afa15801561219c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121c09190613650565b5050600154604051630fad06e960e11b81526001600160601b03851660048201529394506000936001600160a01b039091169250631f5a0dd2915060240160e060405180830381865afa15801561221b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061223f91906139bc565b505050505091505060005b8a8110156124bb5733848d8d84818110612266576122666135e5565b905060200201358154811061227d5761227d6135e5565b60009182526020909120600490910201546001600160a01b0316146122b45760405162461bcd60e51b8152600401610846906138d4565b811580612327575060408051602081018c90529081018a905260600160405160208183030381529060405280519060200120846000018d8d848181106122fc576122fc6135e5565b9050602002013581548110612313576123136135e5565b906000526020600020906004020160010154145b6123995760405162461bcd60e51b815260206004820152603d60248201527f54686520636f6d6d6974206d757374206d61746368207468652063686f69636560448201527f20696e20636f7572747320776974682068696464656e20766f7465732e0000006064820152608401610846565b838c8c838181106123ac576123ac6135e5565b90506020020135815481106123c3576123c36135e5565b600091825260209091206003600490920201015460ff161561241c5760405162461bcd60e51b81526020600482015260126024820152712b37ba329030b63932b0b23c9031b0b9ba1760711b6044820152606401610846565b89848d8d84818110612430576124306135e5565b9050602002013581548110612447576124476135e5565b60009182526020909120600260049092020101556001848d8d84818110612470576124706135e5565b9050602002013581548110612487576124876135e5565b60009182526020909120600490910201600301805460ff1916911515919091179055806124b38161390b565b91505061224a565b508a8a90508360040160008282546124d39190613742565b90915550506000898152600284016020526040812080548c92906124f8908490613742565b90915550506001830154890361252757600383015460ff16156125225760038301805460ff191690555b6125a0565b60018301546000908152600284016020526040808220548b83529120540361256957600383015460ff166125225760038301805460ff191660011790556125a0565b60018301546000908152600284016020526040808220548b835291205411156125a0576001830189905560038301805460ff191690555b88336001600160a01b03168d7fa000893c71384499023d2d7b21234f7b9e80c78e0330f357dcd667ff578bd3a48e8e8c6040516125df93929190613a26565b60405180910390a4505050505050505050505050565b6000546001600160a01b0316331461261f5760405162461bcd60e51b81526004016108469061397a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60008060008060006002600360008a8152602001908152602001600020548154811061266f5761266f6135e5565b600091825260208083208a84526003600590930201918201905260408220548154919350839181106126a3576126a36135e5565b90600052602060002090600c020160000187815481106126c5576126c56135e5565b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169c909b5091995060ff16975095505050505050565b6001546001600160a01b031633146127315760405162461bcd60e51b815260040161084690613a56565b60028054600181018255600091909152600581027f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf81018690557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace8101907f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad2016127bc858783613ae8565b50805460018054604051637e37c78b60e11b8152600481018b9052600385019260009290916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa158015612813573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061283791906137b0565b6128419190613611565b81526020808201929092526040908101600090812093909355835460018181018655858552838520600b600c909302019182018890556003808301805460ff19169092179091558b855290925291829020849055905188907fd3106f74c2d30a4b9230e756a3e78bde53865d40f6af4c479bb010ebaab58108906128ca908a908a908a90613ba8565b60405180910390a25050505050505050565b600083815260036020526040812054600280548392908110612900576129006135e5565b60009182526020808320878452600360059093020191820190526040822054815491935083918110612934576129346135e5565b90600052602060002090600c02016000018481548110612956576129566135e5565b600091825260209091206004909102016003015460ff169695505050505050565b6001546000906001600160a01b031633146129a45760405162461bcd60e51b815260040161084690613a56565b6000838152600360205260409020546002805485929081106129c8576129c86135e5565b600091825260209091206002600590920201015460ff16156129fc5760405162461bcd60e51b815260040161084690613755565b600084815260036020526040812054600280549091908110612a2057612a206135e5565b60009182526020822060059091020180549092508290612a4290600190613611565b81548110612a5257612a526135e5565b90600052602060002090600c020190506000600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ab7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612adb9190613bde565b60015460405163564a565d60e01b8152600481018a90529192506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612b2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b4e9190613650565b5050604051632638506b60e11b81526001600160601b03841660048201819052602482018d9052604482018c90529394506001600160a01b0386169250634c70a0d69150606401602060405180830381865afa158015612bb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd69190613bde565b9650612be28988612e4c565b15612c6f57604080516080810182526001600160a01b03898116825260006020808401828152948401828152606085018381528a5460018082018d558c8652939094209551600490940290950180546001600160a01b0319169390941692909217835593519382019390935591516002830155516003909101805460ff1916911515919091179055612c74565b600096505b50505050505092915050565b600082815260036020526040812054600280548392908110612ca457612ca46135e5565b60009182526020808320868452600360059093020191820190526040822054815491935083918110612cd857612cd86135e5565b600091825260208220600154604051631c3db16d60e01b8152600481018a9052600c93909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa158015612d37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d5b91906136cd565b5091509150826004015460001480612d8a575080158015612d8a57506000828152600284016020526040902054155b15612d9c576000945050505050612dcd565b8015612db1575050600401549150612dcd9050565b506000908152600290910160205260409020549150612dcd9050565b92915050565b6000546001600160a01b03163314612dfd5760405162461bcd60e51b81526004016108469061397a565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314612e495760405162461bcd60e51b81526004016108469061397a565b50565b60015460405163564a565d60e01b81526004810184905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612e9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ebe9190613650565b505060018054604051637e37c78b60e11b8152600481018a90529495506000946001600160a01b039091169350638a9bb02a9250889190849063fc6f8f1690602401602060405180830381865afa158015612f1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f4191906137b0565b612f4b9190613611565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381865afa158015612f8c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612fb49190810190613c8e565b602001519050600080600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613010573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130349190613bde565b604051631a383be960e31b81526001600160a01b0388811660048301526001600160601b0387166024830152919091169063d1c1df4890604401608060405180830381865afa15801561308b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130af9190613d6f565b50509150915082816130c19190613742565b909110159695505050505050565b6000602082840312156130e157600080fd5b5035919050565b6001600160a01b0381168114612e4957600080fd5b6000806000806080858703121561311357600080fd5b843593506020850135613125816130e8565b93969395505050506040820135916060013590565b6000806040838503121561314d57600080fd5b8235613158816130e8565b91506020830135613168816130e8565b809150509250929050565b6000806040838503121561318657600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b60405161016081016001600160401b03811182821017156131ce576131ce613195565b60405290565b604051601f8201601f191681016001600160401b03811182821017156131fc576131fc613195565b604052919050565b60006001600160401b0383111561321d5761321d613195565b613230601f8401601f19166020016131d4565b905082815283838301111561324457600080fd5b828260208301376000602084830101529392505050565b600082601f83011261326c57600080fd5b61182383833560208501613204565b6000806040838503121561328e57600080fd5b8235613299816130e8565b915060208301356001600160401b038111156132b457600080fd5b6132c08582860161325b565b9150509250929050565b6000806000606084860312156132df57600080fd5b505081359360208301359350604090920135919050565b60005b838110156133115781810151838201526020016132f9565b50506000910152565b600081518084526133328160208601602086016132f6565b601f01601f19169290920160200192915050565b8381528215156020820152606060408201526000613367606083018461331a565b95945050505050565b60008083601f84011261338257600080fd5b5081356001600160401b0381111561339957600080fd5b6020830191508360208260051b85010111156133b457600080fd5b9250929050565b600080600080606085870312156133d157600080fd5b8435935060208501356001600160401b038111156133ee57600080fd5b6133fa87828801613370565b9598909750949560400135949350505050565b6020808252825182820181905260009190848201906040850190845b8181101561344557835183529284019291840191600101613429565b50909695505050505050565b60008060006060848603121561346657600080fd5b8335613471816130e8565b92506020840135915060408401356001600160401b0381111561349357600080fd5b61349f8682870161325b565b9150509250925092565b60008060008060008060a087890312156134c257600080fd5b8635955060208701356001600160401b03808211156134e057600080fd5b6134ec8a838b01613370565b90975095506040890135945060608901359350608089013591508082111561351357600080fd5b508701601f8101891361352557600080fd5b61353489823560208401613204565b9150509295509295509295565b60006020828403121561355357600080fd5b8135611823816130e8565b60008060008060006080868803121561357657600080fd5b853594506020860135935060408601356001600160401b038082111561359b57600080fd5b818801915088601f8301126135af57600080fd5b8135818111156135be57600080fd5b8960208285010111156135d057600080fd5b96999598505060200195606001359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115612dcd57612dcd6135fb565b80516001600160601b038116811461363b57600080fd5b919050565b8051801515811461363b57600080fd5b600080600080600060a0868803121561366857600080fd5b61367186613624565b94506020860151613681816130e8565b60408701519094506005811061369657600080fd5b92506136a460608701613640565b9150608086015190509295509295909350565b634e487b7160e01b600052602160045260246000fd5b6000806000606084860312156136e257600080fd5b835192506136f260208501613640565b915061370060408501613640565b90509250925092565b8082028115828204841417612dcd57612dcd6135fb565b60008261373d57634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115612dcd57612dcd6135fb565b6020808252601e908201527f44697370757465206a756d70656420746f206120706172656e7420444b210000604082015260600190565b6000806040838503121561379f57600080fd5b505080516020909101519092909150565b6000602082840312156137c257600080fd5b5051919050565b6000602082840312156137db57600080fd5b61182382613640565b600181811c908216806137f857607f821691505b60208210810361381857634e487b7160e01b600052602260045260246000fd5b50919050565b838152600060208481840152606060408401526000845461383e816137e4565b8060608701526080600180841660008114613860576001811461387a576138a8565b60ff1985168984015283151560051b8901830195506138a8565b896000528660002060005b858110156138a05781548b8201860152908301908801613885565b8a0184019650505b50939a9950505050505050505050565b600082516138ca8184602087016132f6565b9190910192915050565b6020808252601f908201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e00604082015260600190565b60006001820161391d5761391d6135fb565b5060010190565b81835260006001600160fb1b0383111561393d57600080fd5b8260051b80836020870137939093016020019392505050565b60408152600061396a604083018587613924565b9050826020830152949350505050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600080600080600080600060e0888a0312156139d757600080fd5b6139e088613624565b96506139ee60208901613640565b955060408801519450606088015193506080880151925060a08801519150613a1860c08901613640565b905092959891949750929550565b604081526000613a3a604083018587613924565b8281036020840152613a4c818561331a565b9695505050505050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b601f8211156116e257600081815260208120601f850160051c81016020861015613ac15750805b601f850160051c820191505b81811015613ae057828155600101613acd565b505050505050565b6001600160401b03831115613aff57613aff613195565b613b1383613b0d83546137e4565b83613a9a565b6000601f841160018114613b475760008515613b2f5750838201355b600019600387901b1c1916600186901b178355613ba1565b600083815260209020601f19861690835b82811015613b785786850135825560209485019460019092019101613b58565b5086821015613b955760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215613bf057600080fd5b8151611823816130e8565b600082601f830112613c0c57600080fd5b815160206001600160401b03821115613c2757613c27613195565b8160051b613c368282016131d4565b9283528481018201928281019087851115613c5057600080fd5b83870192505b84831015613c78578251613c69816130e8565b82529183019190830190613c56565b979650505050505050565b805161363b816130e8565b600060208284031215613ca057600080fd5b81516001600160401b0380821115613cb757600080fd5b908301906101608286031215613ccc57600080fd5b613cd46131ab565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015182811115613d1c57600080fd5b613d2887828601613bfb565b60c08301525060e0838101519082015261010080840151908201526101209150613d53828401613c83565b9181019190915261014091820151918101919091529392505050565b60008060008060808587031215613d8557600080fd5b50508251602084015160408501516060909501519196909550909250905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220cf67677608150ea7a2825f63646a3379b88eceb65b969ea68bd4dc1289ac3b9864736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106101825760003560e01c80636d4cd8ea116100d7578063b6ede54011610085578063b6ede540146104ca578063ba66fde7146104ea578063be4676041461050a578063d2b8035a14610520578063da3beb8c14610540578063e349ad3014610412578063e4c0aaf414610560578063f2f4eb261461058057600080fd5b80636d4cd8ea146103d2578063751accd0146103f2578063796490f9146104125780637c04034e146104285780638e42646014610448578063a7cc08fe14610468578063b34bfaa8146104b457600080fd5b80634f1ef286116101345780634f1ef286146102c15780634fe264fb146102d457806352d1902d146102f4578063564a565d146103095780635c92e2f61461033857806365540b961461035857806369f3f0411461038557600080fd5b80630baa64d1146101875780630c340a24146101bc5780631200aabc146101f45780631c3db16d1461022f578063362c34791461026c578063485cc9551461028c5780634b2f0ea0146102ae575b600080fd5b34801561019357600080fd5b506101a76101a23660046130cf565b6105a0565b60405190151581526020015b60405180910390f35b3480156101c857600080fd5b506000546101dc906001600160a01b031681565b6040516001600160a01b0390911681526020016101b3565b34801561020057600080fd5b5061022161020f3660046130cf565b60036020526000908152604090205481565b6040519081526020016101b3565b34801561023b57600080fd5b5061024f61024a3660046130cf565b610617565b6040805193845291151560208401521515908201526060016101b3565b34801561027857600080fd5b506102216102873660046130fd565b610785565b34801561029857600080fd5b506102ac6102a736600461313a565b610b5b565b005b6102ac6102bc366004613173565b610c58565b6102ac6102cf36600461327b565b6114bf565b3480156102e057600080fd5b506102216102ef3660046132ca565b6116e7565b34801561030057600080fd5b5061022161182a565b34801561031557600080fd5b506103296103243660046130cf565b611888565b6040516101b393929190613346565b34801561034457600080fd5b506102ac6103533660046133bb565b61194e565b34801561036457600080fd5b506103786103733660046130cf565b611c5b565b6040516101b3919061340d565b34801561039157600080fd5b506103a56103a03660046132ca565b611d1f565b604080519687529415156020870152938501929092526060840152608083015260a082015260c0016101b3565b3480156103de57600080fd5b506101a76103ed3660046130cf565b611dd7565b3480156103fe57600080fd5b506102ac61040d366004613451565b611e4e565b34801561041e57600080fd5b5061022161271081565b34801561043457600080fd5b506102ac6104433660046134a9565b611f1a565b34801561045457600080fd5b506102ac610463366004613541565b6125f5565b34801561047457600080fd5b506104886104833660046132ca565b612641565b604080516001600160a01b039095168552602085019390935291830152151560608201526080016101b3565b3480156104c057600080fd5b50610221614e2081565b3480156104d657600080fd5b506102ac6104e536600461355e565b612707565b3480156104f657600080fd5b506101a76105053660046132ca565b6128dc565b34801561051657600080fd5b5061022161138881565b34801561052c57600080fd5b506101dc61053b366004613173565b612977565b34801561054c57600080fd5b5061022161055b366004613173565b612c80565b34801561056c57600080fd5b506102ac61057b366004613541565b612dd3565b34801561058c57600080fd5b506001546101dc906001600160a01b031681565b6000818152600360205260408120546002805483929081106105c4576105c46135e5565b600091825260208220600590910201805490925082906105e690600190613611565b815481106105f6576105f66135e5565b60009182526020909120600c90910201805460059091015414949350505050565b6000806000806002600360008781526020019081526020016000205481548110610643576106436135e5565b6000918252602082206005909102018054909250829061066590600190613611565b81548110610675576106756135e5565b60009182526020909120600c90910201600381015460ff1694509050836106a05780600101546106a3565b60005b60015460405163564a565d60e01b8152600481018990529196506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156106f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107169190613650565b5090935060049250610726915050565b816004811115610738576107386136b7565b0361077b57600061074888611c5b565b905080516001036107795780600081518110610766576107666135e5565b6020026020010151965060009550600194505b505b5050509193909250565b60015460405163564a565d60e01b81526004810186905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156107d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f79190613650565b5093505050508061084f5760405162461bcd60e51b815260206004820152601b60248201527f446973707574652073686f756c64206265207265736f6c7665642e000000000060448201526064015b60405180910390fd5b600086815260036020526040812054600280549091908110610873576108736135e5565b600091825260208083208884526003600590930201918201905260408220548154919350839181106108a7576108a76135e5565b600091825260208220600154604051631c3db16d60e01b8152600481018d9052600c9390930290910193506001600160a01b031690631c3db16d90602401606060405180830381865afa158015610902573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092691906136cd565b5050600087815260078401602052604090205490915060ff16610970576001600160a01b038816600090815260088301602090815260408083208984529091529020549450610ab5565b8086036109e55760008681526006830160205260409020546109935760006109de565b600086815260068301602090815260408083205460098601546001600160a01b038d1685526008870184528285208b86529093529220546109d49190613709565b6109de9190613720565b9450610ab5565b600081815260078301602052604090205460ff16610ab55781600601600083600a01600181548110610a1957610a196135e5565b906000526020600020015481526020019081526020016000205482600601600084600a01600081548110610a4f57610a4f6135e5565b9060005260206000200154815260200190815260200160002054610a739190613742565b60098301546001600160a01b038a16600090815260088501602090815260408083208b8452909152902054610aa89190613709565b610ab29190613720565b94505b6001600160a01b038816600090815260088301602090815260408083208984529091528120558415610b4f576040516001600160a01b0389169086156108fc029087906000818181858888f15050604080518a8152602081018a90526001600160a01b038d1694508b93508d92507f54b3cab3cb5c4aca3209db1151caff092e878011202e43a36782d4ebe0b963ae910160405180910390a45b50505050949350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff1680610ba4575080546001600160401b03808416911610155b15610bc15760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b038316908117600160401b178255600080546001600160a01b038781166001600160a01b0319928316179092556001805492871692909116919091179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b600082815260036020526040902054600280548492908110610c7c57610c7c6135e5565b600091825260209091206002600590920201015460ff1615610cb05760405162461bcd60e51b815260040161084690613755565b600083815260036020526040812054600280549091908110610cd457610cd46135e5565b906000526020600020906005020190508060010154831115610d385760405162461bcd60e51b815260206004820181905260248201527f5468657265206973206e6f20737563682072756c696e6720746f2066756e642e6044820152606401610846565b60015460405163afe15cfb60e01b81526004810186905260009182916001600160a01b039091169063afe15cfb906024016040805180830381865afa158015610d85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da9919061378c565b91509150814210158015610dbc57508042105b610e015760405162461bcd60e51b815260206004820152601660248201527520b83832b0b6103832b934b7b21034b99037bb32b91760511b6044820152606401610846565b604051631c3db16d60e01b81526004810187905260009081903090631c3db16d90602401606060405180830381865afa158015610e42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6691906136cd565b50509050868103610e7b576127109150610efc565b612710611388610e8b8686613611565b610e959190613709565b610e9f9190613720565b610ea98542613611565b10610ef65760405162461bcd60e51b815260206004820152601f60248201527f41707065616c20706572696f64206973206f76657220666f72206c6f736572006044820152606401610846565b614e2091505b84546000908690610f0f90600190613611565b81548110610f1f57610f1f6135e5565b60009182526020822060018054604051637e37c78b60e11b8152600481018f9052600c949094029092019450916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa158015610f7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa291906137b0565b610fac9190613611565b60008a815260078401602052604090205490915060ff16156110105760405162461bcd60e51b815260206004820152601b60248201527f41707065616c2066656520697320616c726561647920706169642e00000000006044820152606401610846565b600154604051632cf6413f60e11b8152600481018c90526000916001600160a01b0316906359ec827e90602401602060405180830381865afa15801561105a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107e91906137b0565b9050600061271061108f8784613709565b6110999190613720565b6110a39083613742565b60008c8152600686016020526040812054919250908211156111545760008c815260068601602052604090205434906110dc9084613611565b116111015760008c81526006860160205260409020546110fc9083613611565b611103565b345b9050336001600160a01b0316848e7fcae597f39a3ad75c2e10d46b031f023c5c2babcd58ca0491b122acda3968d4c08f8560405161114b929190918252602082015260400190565b60405180910390a45b33600090815260088601602090815260408083208f845290915281208054839290611180908490613742565b909155505060008c8152600686016020526040812080548392906111a5908490613742565b909155505060008c815260068601602052604090205482116112775760008c8152600686016020526040812054600987018054919290916111e7908490613742565b9250508190555084600a018c908060018154018082558091505060019003906000526020600020016000909190919091505560018560070160008e815260200190815260200160002060006101000a81548160ff0219169083151502179055508b848e7fed764996238e4c1c873ae3af7ae2f00f1f6f4f10b9ac7d4bbea4a764c5dea00960405160405180910390a45b600a85015460011015611482578285600901546112949190613611565b60098601556001546040516319b8152960e01b8152600481018f90526001600160a01b03909116906319b8152990602401602060405180830381865afa1580156112e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130691906137c9565b1561131f5760028a01805460ff19166001179055611402565b895460038b016000611332876001613742565b81526020019081526020016000208190555060008a6000016001816001815401808255809150500390600052602060002090600c02019050600160009054906101000a90046001600160a01b03166001600160a01b031663c71f42538f6040518263ffffffff1660e01b81526004016113ad91815260200190565b602060405180830381865afa1580156113ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ee91906137b0565b600b820155600301805460ff191660011790555b600160009054906101000a90046001600160a01b03166001600160a01b031663c3569902848f8d600101548e6004016040518563ffffffff1660e01b815260040161144f9392919061381e565b6000604051808303818588803b15801561146857600080fd5b505af115801561147c573d6000803e3d6000fd5b50505050505b803411156114b057336108fc6114988334613611565b6040518115909202916000818181858888f150505050505b50505050505050505050505050565b6114c882612e1f565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061154657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661153a600080516020613da68339815191525490565b6001600160a01b031614155b156115645760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156115be575060408051601f3d908101601f191682019092526115bb918101906137b0565b60015b6115e657604051630c76093760e01b81526001600160a01b0383166004820152602401610846565b600080516020613da6833981519152811461161757604051632a87526960e21b815260048101829052602401610846565b600080516020613da68339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28151156116e2576000836001600160a01b03168360405161167e91906138b8565b600060405180830381855af49150503d80600081146116b9576040519150601f19603f3d011682016040523d82523d6000602084013e6116be565b606091505b50509050806116e0576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b60008381526003602052604081205460028054839290811061170b5761170b6135e5565b6000918252602080832087845260036005909302019182019052604082205481549193508391811061173f5761173f6135e5565b90600052602060002090600c02016000018481548110611761576117616135e5565b600091825260208220600154604051631c3db16d60e01b815260048082018c905293909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa1580156117bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e391906136cd565b506003850154919350915060ff168015611807575081836002015414806118075750805b1561181a57612710945050505050611823565b60009450505050505b9392505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118755760405163703e46dd60e11b815260040160405180910390fd5b50600080516020613da683398151915290565b6002818154811061189857600080fd5b600091825260209091206005909102016001810154600282015460048301805492945060ff90911692916118cb906137e4565b80601f01602080910402602001604051908101604052809291908181526020018280546118f7906137e4565b80156119445780601f1061191957610100808354040283529160200191611944565b820191906000526020600020905b81548152906001019060200180831161192757829003601f168201915b5050505050905083565b600084815260036020526040902054600280548692908110611972576119726135e5565b600091825260209091206002600590920201015460ff16156119a65760405162461bcd60e51b815260040161084690613755565b60015460405163564a565d60e01b8152600481018790526000916001600160a01b03169063564a565d9060240160a060405180830381865afa1580156119f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a149190613650565b5090935060019250611a24915050565b816004811115611a3657611a366136b7565b14611a935760405162461bcd60e51b815260206004820152602760248201527f54686520646973707574652073686f756c6420626520696e20436f6d6d6974206044820152663832b934b7b21760c91b6064820152608401610846565b82611ad05760405162461bcd60e51b815260206004820152600d60248201526c22b6b83a3c9031b7b6b6b4ba1760991b6044820152606401610846565b600086815260036020526040812054600280549091908110611af457611af46135e5565b60009182526020822060059091020180549092508290611b1690600190613611565b81548110611b2657611b266135e5565b90600052602060002090600c0201905060005b86811015611bf4573382898984818110611b5557611b556135e5565b9050602002013581548110611b6c57611b6c6135e5565b60009182526020909120600490910201546001600160a01b031614611ba35760405162461bcd60e51b8152600401610846906138d4565b8582898984818110611bb757611bb76135e5565b9050602002013581548110611bce57611bce6135e5565b600091825260209091206001600490920201015580611bec8161390b565b915050611b39565b5086869050816005016000828254611c0c9190613742565b9091555050604051339089907f05cc2f1c94966f1c961b410a50f3d3ffb64501346753a258177097ea23707f0890611c49908b908b908b90613956565b60405180910390a35050505050505050565b6000818152600360205260408120546002805460609392908110611c8157611c816135e5565b60009182526020822060059091020180549092508290611ca390600190613611565b81548110611cb357611cb36135e5565b90600052602060002090600c0201905080600a01805480602002602001604051908101604052809291908181526020018280548015611d1157602002820191906000526020600020905b815481526020019060010190808311611cfd575b505050505092505050919050565b60008060008060008060006002600360008c81526020019081526020016000205481548110611d5057611d506135e5565b600091825260208083208c8452600360059093020191820190526040822054815491935083918110611d8457611d846135e5565b600091825260208083206001600c909302019182015460038301546004840154600585015485549f87526002909501909352604090942054909f60ff9094169e50909c50909a9950975095505050505050565b600081815260036020526040812054600280548392908110611dfb57611dfb6135e5565b60009182526020822060059091020180549092508290611e1d90600190613611565b81548110611e2d57611e2d6135e5565b60009182526020909120600c90910201805460049091015414949350505050565b6000546001600160a01b03163314611e785760405162461bcd60e51b81526004016108469061397a565b6000836001600160a01b03168383604051611e9391906138b8565b60006040518083038185875af1925050503d8060008114611ed0576040519150601f19603f3d011682016040523d82523d6000602084013e611ed5565b606091505b50509050806116e05760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b6044820152606401610846565b600086815260036020526040902054600280548892908110611f3e57611f3e6135e5565b600091825260209091206002600590920201015460ff1615611f725760405162461bcd60e51b815260040161084690613755565b60015460405163564a565d60e01b8152600481018990526000916001600160a01b03169063564a565d9060240160a060405180830381865afa158015611fbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fe09190613650565b5090935060029250611ff0915050565b816004811115612002576120026136b7565b1461205d5760405162461bcd60e51b815260206004820152602560248201527f54686520646973707574652073686f756c6420626520696e20566f74652070656044820152643934b7b21760d91b6064820152608401610846565b8561209f5760405162461bcd60e51b8152602060048201526012602482015271139bc81d9bdd195251081c1c9bdd9a59195960721b6044820152606401610846565b6000888152600360205260408120546002805490919081106120c3576120c36135e5565b90600052602060002090600502019050806001015486111561211e5760405162461bcd60e51b815260206004820152601460248201527343686f696365206f7574206f6620626f756e647360601b6044820152606401610846565b8054600090829061213190600190613611565b81548110612141576121416135e5565b60009182526020822060015460405163564a565d60e01b8152600481018f9052600c9390930290910193506001600160a01b03169063564a565d9060240160a060405180830381865afa15801561219c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121c09190613650565b5050600154604051630fad06e960e11b81526001600160601b03851660048201529394506000936001600160a01b039091169250631f5a0dd2915060240160e060405180830381865afa15801561221b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061223f91906139bc565b505050505091505060005b8a8110156124bb5733848d8d84818110612266576122666135e5565b905060200201358154811061227d5761227d6135e5565b60009182526020909120600490910201546001600160a01b0316146122b45760405162461bcd60e51b8152600401610846906138d4565b811580612327575060408051602081018c90529081018a905260600160405160208183030381529060405280519060200120846000018d8d848181106122fc576122fc6135e5565b9050602002013581548110612313576123136135e5565b906000526020600020906004020160010154145b6123995760405162461bcd60e51b815260206004820152603d60248201527f54686520636f6d6d6974206d757374206d61746368207468652063686f69636560448201527f20696e20636f7572747320776974682068696464656e20766f7465732e0000006064820152608401610846565b838c8c838181106123ac576123ac6135e5565b90506020020135815481106123c3576123c36135e5565b600091825260209091206003600490920201015460ff161561241c5760405162461bcd60e51b81526020600482015260126024820152712b37ba329030b63932b0b23c9031b0b9ba1760711b6044820152606401610846565b89848d8d84818110612430576124306135e5565b9050602002013581548110612447576124476135e5565b60009182526020909120600260049092020101556001848d8d84818110612470576124706135e5565b9050602002013581548110612487576124876135e5565b60009182526020909120600490910201600301805460ff1916911515919091179055806124b38161390b565b91505061224a565b508a8a90508360040160008282546124d39190613742565b90915550506000898152600284016020526040812080548c92906124f8908490613742565b90915550506001830154890361252757600383015460ff16156125225760038301805460ff191690555b6125a0565b60018301546000908152600284016020526040808220548b83529120540361256957600383015460ff166125225760038301805460ff191660011790556125a0565b60018301546000908152600284016020526040808220548b835291205411156125a0576001830189905560038301805460ff191690555b88336001600160a01b03168d7fa000893c71384499023d2d7b21234f7b9e80c78e0330f357dcd667ff578bd3a48e8e8c6040516125df93929190613a26565b60405180910390a4505050505050505050505050565b6000546001600160a01b0316331461261f5760405162461bcd60e51b81526004016108469061397a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60008060008060006002600360008a8152602001908152602001600020548154811061266f5761266f6135e5565b600091825260208083208a84526003600590930201918201905260408220548154919350839181106126a3576126a36135e5565b90600052602060002090600c020160000187815481106126c5576126c56135e5565b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169c909b5091995060ff16975095505050505050565b6001546001600160a01b031633146127315760405162461bcd60e51b815260040161084690613a56565b60028054600181018255600091909152600581027f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf81018690557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace8101907f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad2016127bc858783613ae8565b50805460018054604051637e37c78b60e11b8152600481018b9052600385019260009290916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa158015612813573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061283791906137b0565b6128419190613611565b81526020808201929092526040908101600090812093909355835460018181018655858552838520600b600c909302019182018890556003808301805460ff19169092179091558b855290925291829020849055905188907fd3106f74c2d30a4b9230e756a3e78bde53865d40f6af4c479bb010ebaab58108906128ca908a908a908a90613ba8565b60405180910390a25050505050505050565b600083815260036020526040812054600280548392908110612900576129006135e5565b60009182526020808320878452600360059093020191820190526040822054815491935083918110612934576129346135e5565b90600052602060002090600c02016000018481548110612956576129566135e5565b600091825260209091206004909102016003015460ff169695505050505050565b6001546000906001600160a01b031633146129a45760405162461bcd60e51b815260040161084690613a56565b6000838152600360205260409020546002805485929081106129c8576129c86135e5565b600091825260209091206002600590920201015460ff16156129fc5760405162461bcd60e51b815260040161084690613755565b600084815260036020526040812054600280549091908110612a2057612a206135e5565b60009182526020822060059091020180549092508290612a4290600190613611565b81548110612a5257612a526135e5565b90600052602060002090600c020190506000600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ab7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612adb9190613bde565b60015460405163564a565d60e01b8152600481018a90529192506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612b2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b4e9190613650565b5050604051632638506b60e11b81526001600160601b03841660048201819052602482018d9052604482018c90529394506001600160a01b0386169250634c70a0d69150606401602060405180830381865afa158015612bb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd69190613bde565b9650612be28988612e4c565b15612c6f57604080516080810182526001600160a01b03898116825260006020808401828152948401828152606085018381528a5460018082018d558c8652939094209551600490940290950180546001600160a01b0319169390941692909217835593519382019390935591516002830155516003909101805460ff1916911515919091179055612c74565b600096505b50505050505092915050565b600082815260036020526040812054600280548392908110612ca457612ca46135e5565b60009182526020808320868452600360059093020191820190526040822054815491935083918110612cd857612cd86135e5565b600091825260208220600154604051631c3db16d60e01b8152600481018a9052600c93909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa158015612d37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d5b91906136cd565b5091509150826004015460001480612d8a575080158015612d8a57506000828152600284016020526040902054155b15612d9c576000945050505050612dcd565b8015612db1575050600401549150612dcd9050565b506000908152600290910160205260409020549150612dcd9050565b92915050565b6000546001600160a01b03163314612dfd5760405162461bcd60e51b81526004016108469061397a565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314612e495760405162461bcd60e51b81526004016108469061397a565b50565b60015460405163564a565d60e01b81526004810184905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612e9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ebe9190613650565b505060018054604051637e37c78b60e11b8152600481018a90529495506000946001600160a01b039091169350638a9bb02a9250889190849063fc6f8f1690602401602060405180830381865afa158015612f1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f4191906137b0565b612f4b9190613611565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381865afa158015612f8c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612fb49190810190613c8e565b602001519050600080600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613010573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130349190613bde565b604051631a383be960e31b81526001600160a01b0388811660048301526001600160601b0387166024830152919091169063d1c1df4890604401608060405180830381865afa15801561308b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130af9190613d6f565b50509150915082816130c19190613742565b909110159695505050505050565b6000602082840312156130e157600080fd5b5035919050565b6001600160a01b0381168114612e4957600080fd5b6000806000806080858703121561311357600080fd5b843593506020850135613125816130e8565b93969395505050506040820135916060013590565b6000806040838503121561314d57600080fd5b8235613158816130e8565b91506020830135613168816130e8565b809150509250929050565b6000806040838503121561318657600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b60405161016081016001600160401b03811182821017156131ce576131ce613195565b60405290565b604051601f8201601f191681016001600160401b03811182821017156131fc576131fc613195565b604052919050565b60006001600160401b0383111561321d5761321d613195565b613230601f8401601f19166020016131d4565b905082815283838301111561324457600080fd5b828260208301376000602084830101529392505050565b600082601f83011261326c57600080fd5b61182383833560208501613204565b6000806040838503121561328e57600080fd5b8235613299816130e8565b915060208301356001600160401b038111156132b457600080fd5b6132c08582860161325b565b9150509250929050565b6000806000606084860312156132df57600080fd5b505081359360208301359350604090920135919050565b60005b838110156133115781810151838201526020016132f9565b50506000910152565b600081518084526133328160208601602086016132f6565b601f01601f19169290920160200192915050565b8381528215156020820152606060408201526000613367606083018461331a565b95945050505050565b60008083601f84011261338257600080fd5b5081356001600160401b0381111561339957600080fd5b6020830191508360208260051b85010111156133b457600080fd5b9250929050565b600080600080606085870312156133d157600080fd5b8435935060208501356001600160401b038111156133ee57600080fd5b6133fa87828801613370565b9598909750949560400135949350505050565b6020808252825182820181905260009190848201906040850190845b8181101561344557835183529284019291840191600101613429565b50909695505050505050565b60008060006060848603121561346657600080fd5b8335613471816130e8565b92506020840135915060408401356001600160401b0381111561349357600080fd5b61349f8682870161325b565b9150509250925092565b60008060008060008060a087890312156134c257600080fd5b8635955060208701356001600160401b03808211156134e057600080fd5b6134ec8a838b01613370565b90975095506040890135945060608901359350608089013591508082111561351357600080fd5b508701601f8101891361352557600080fd5b61353489823560208401613204565b9150509295509295509295565b60006020828403121561355357600080fd5b8135611823816130e8565b60008060008060006080868803121561357657600080fd5b853594506020860135935060408601356001600160401b038082111561359b57600080fd5b818801915088601f8301126135af57600080fd5b8135818111156135be57600080fd5b8960208285010111156135d057600080fd5b96999598505060200195606001359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115612dcd57612dcd6135fb565b80516001600160601b038116811461363b57600080fd5b919050565b8051801515811461363b57600080fd5b600080600080600060a0868803121561366857600080fd5b61367186613624565b94506020860151613681816130e8565b60408701519094506005811061369657600080fd5b92506136a460608701613640565b9150608086015190509295509295909350565b634e487b7160e01b600052602160045260246000fd5b6000806000606084860312156136e257600080fd5b835192506136f260208501613640565b915061370060408501613640565b90509250925092565b8082028115828204841417612dcd57612dcd6135fb565b60008261373d57634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115612dcd57612dcd6135fb565b6020808252601e908201527f44697370757465206a756d70656420746f206120706172656e7420444b210000604082015260600190565b6000806040838503121561379f57600080fd5b505080516020909101519092909150565b6000602082840312156137c257600080fd5b5051919050565b6000602082840312156137db57600080fd5b61182382613640565b600181811c908216806137f857607f821691505b60208210810361381857634e487b7160e01b600052602260045260246000fd5b50919050565b838152600060208481840152606060408401526000845461383e816137e4565b8060608701526080600180841660008114613860576001811461387a576138a8565b60ff1985168984015283151560051b8901830195506138a8565b896000528660002060005b858110156138a05781548b8201860152908301908801613885565b8a0184019650505b50939a9950505050505050505050565b600082516138ca8184602087016132f6565b9190910192915050565b6020808252601f908201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e00604082015260600190565b60006001820161391d5761391d6135fb565b5060010190565b81835260006001600160fb1b0383111561393d57600080fd5b8260051b80836020870137939093016020019392505050565b60408152600061396a604083018587613924565b9050826020830152949350505050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600080600080600080600060e0888a0312156139d757600080fd5b6139e088613624565b96506139ee60208901613640565b955060408801519450606088015193506080880151925060a08801519150613a1860c08901613640565b905092959891949750929550565b604081526000613a3a604083018587613924565b8281036020840152613a4c818561331a565b9695505050505050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b601f8211156116e257600081815260208120601f850160051c81016020861015613ac15750805b601f850160051c820191505b81811015613ae057828155600101613acd565b505050505050565b6001600160401b03831115613aff57613aff613195565b613b1383613b0d83546137e4565b83613a9a565b6000601f841160018114613b475760008515613b2f5750838201355b600019600387901b1c1916600186901b178355613ba1565b600083815260209020601f19861690835b82811015613b785786850135825560209485019460019092019101613b58565b5086821015613b955760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215613bf057600080fd5b8151611823816130e8565b600082601f830112613c0c57600080fd5b815160206001600160401b03821115613c2757613c27613195565b8160051b613c368282016131d4565b9283528481018201928281019087851115613c5057600080fd5b83870192505b84831015613c78578251613c69816130e8565b82529183019190830190613c56565b979650505050505050565b805161363b816130e8565b600060208284031215613ca057600080fd5b81516001600160401b0380821115613cb757600080fd5b908301906101608286031215613ccc57600080fd5b613cd46131ab565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015182811115613d1c57600080fd5b613d2887828601613bfb565b60c08301525060e0838101519082015261010080840151908201526101209150613d53828401613c83565b9181019190915261014091820151918101919091529392505050565b60008060008060808587031215613d8557600080fd5b50508251602084015160408501516060909501519196909550909250905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220cf67677608150ea7a2825f63646a3379b88eceb65b969ea68bd4dc1289ac3b9864736f6c63430008120033", + "devdoc": { + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "ChoiceFunded(uint256,uint256,uint256)": { + "details": "To be emitted when a choice is fully funded for an appeal.", + "params": { + "_choice": "The choice that is being funded.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_coreRoundID": "The identifier of the round in the Arbitrator contract." + } + }, + "CommitCast(uint256,address,uint256[],bytes32)": { + "details": "To be emitted when a vote commitment is cast.", + "params": { + "_commit": "The commitment of the juror.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_juror": "The address of the juror casting the vote commitment.", + "_voteIDs": "The identifiers of the votes in the dispute." + } + }, + "Contribution(uint256,uint256,uint256,address,uint256)": { + "details": "To be emitted when a funding contribution is made.", + "params": { + "_amount": "The amount contributed.", + "_choice": "The choice that is being funded.", + "_contributor": "The address of the contributor.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_coreRoundID": "The identifier of the round in the Arbitrator contract." + } + }, + "DisputeCreation(uint256,uint256,bytes)": { + "details": "To be emitted when a dispute is created.", + "params": { + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_extraData": "The extra data for the dispute.", + "_numberOfChoices": "The number of choices available in the dispute." + } + }, + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + }, + "VoteCast(uint256,address,uint256[],uint256,string)": { + "details": "Emitted when casting a vote to provide the justification of juror's choice.", + "params": { + "_choice": "The choice juror voted for.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_juror": "Address of the juror.", + "_justification": "Justification of the choice.", + "_voteIDs": "The identifiers of the votes in the dispute." + } + }, + "Withdrawal(uint256,uint256,uint256,address,uint256)": { + "details": "To be emitted when the contributed funds are withdrawn.", + "params": { + "_amount": "The amount withdrawn.", + "_choice": "The choice that is being funded.", + "_contributor": "The address of the contributor.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_coreRoundID": "The identifier of the round in the Arbitrator contract." + } + } + }, + "kind": "dev", + "methods": { + "areCommitsAllCast(uint256)": { + "details": "Returns true if all of the jurors have cast their commits for the last round.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core." + }, + "returns": { + "_0": "Whether all of the jurors have cast their commits for the last round." + } + }, + "areVotesAllCast(uint256)": { + "details": "Returns true if all of the jurors have cast their votes for the last round.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core." + }, + "returns": { + "_0": "Whether all of the jurors have cast their votes for the last round." + } + }, + "castCommit(uint256,uint256[],bytes32)": { + "details": "Sets the caller's commit for the specified votes. It can be called multiple times during the commit period, each call overrides the commits of the previous one. `O(n)` where `n` is the number of votes.", + "params": { + "_commit": "The commit. Note that justification string is a part of the commit.", + "_coreDisputeID": "The ID of the dispute in Kleros Core.", + "_voteIDs": "The IDs of the votes." + } + }, + "castVote(uint256,uint256[],uint256,uint256,string)": { + "details": "Sets the caller's choices for the specified votes. `O(n)` where `n` is the number of votes.", + "params": { + "_choice": "The choice.", + "_coreDisputeID": "The ID of the dispute in Kleros Core.", + "_justification": "Justification of the choice.", + "_salt": "The salt for the commit if the votes were hidden.", + "_voteIDs": "The IDs of the votes." + } + }, + "changeCore(address)": { + "details": "Changes the `core` storage variable.", + "params": { + "_core": "The new value for the `core` storage variable." + } + }, + "changeGovernor(address)": { + "details": "Changes the `governor` storage variable.", + "params": { + "_governor": "The new value for the `governor` storage variable." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "createDispute(uint256,uint256,bytes,uint256)": { + "details": "Creates a local dispute and maps it to the dispute ID in the Core contract. Note: Access restricted to Kleros Core only.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core.", + "_extraData": "Additional info about the dispute, for possible use in future dispute kits.", + "_nbVotes": "Number of votes for this dispute.", + "_numberOfChoices": "Number of choices of the dispute" + } + }, + "currentRuling(uint256)": { + "details": "Gets the current ruling of a specified dispute.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core." + }, + "returns": { + "overridden": "Whether the ruling was overridden by appeal funding or not.", + "ruling": "The current ruling.", + "tied": "Whether it's a tie or not." + } + }, + "draw(uint256,uint256)": { + "details": "Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core. Note: Access restricted to Kleros Core only.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core.", + "_nonce": "Nonce of the drawing iteration." + }, + "returns": { + "drawnAddress": "The drawn address." + } + }, + "executeGovernorProposal(address,uint256,bytes)": { + "details": "Allows the governor to call anything on behalf of the contract.", + "params": { + "_amount": "The value sent with the call.", + "_data": "The data sent with the call.", + "_destination": "The destination of the call." + } + }, + "fundAppeal(uint256,uint256)": { + "details": "Manages contributions, and appeals a dispute if at least two choices are fully funded. Note that the surplus deposit will be reimbursed.", + "params": { + "_choice": "A choice that receives funding.", + "_coreDisputeID": "Index of the dispute in Kleros Core." + } + }, + "getCoherentCount(uint256,uint256)": { + "details": "Gets the number of jurors who are eligible to a reward in this round.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core, not in the Dispute Kit.", + "_coreRoundID": "The ID of the round in Kleros Core, not in the Dispute Kit." + }, + "returns": { + "_0": "The number of coherent jurors." + } + }, + "getDegreeOfCoherence(uint256,uint256,uint256)": { + "details": "Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core, not in the Dispute Kit.", + "_coreRoundID": "The ID of the round in Kleros Core, not in the Dispute Kit.", + "_voteID": "The ID of the vote." + }, + "returns": { + "_0": "The degree of coherence in basis points." + } + }, + "initialize(address,address)": { + "details": "Initializer.", + "params": { + "_core": "The KlerosCore arbitrator.", + "_governor": "The governor's address." + } + }, + "isVoteActive(uint256,uint256,uint256)": { + "details": "Returns true if the specified voter was active in this round.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core, not in the Dispute Kit.", + "_coreRoundID": "The ID of the round in Kleros Core, not in the Dispute Kit.", + "_voteID": "The ID of the voter." + }, + "returns": { + "_0": "Whether the voter was active or not." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + }, + "withdrawFeesAndRewards(uint256,address,uint256,uint256)": { + "details": "Allows those contributors who attempted to fund an appeal round to withdraw any reimbursable fees or rewards after the dispute gets resolved.", + "params": { + "_beneficiary": "The address whose rewards to withdraw.", + "_choice": "The ruling option that the caller wants to withdraw from.", + "_coreDisputeID": "Index of the dispute in Kleros Core contract.", + "_coreRoundID": "The round in the Kleros Core contract the caller wants to withdraw from." + }, + "returns": { + "amount": "The withdrawn amount." + } + } + }, + "title": "DisputeKitClassic Dispute kit implementation of the Kleros v1 features including: - a drawing system: proportional to staked PNK, - a vote aggregation system: plurality, - an incentive system: equal split between coherent votes, - an appeal system: fund 2 choices only, vote on any choice.", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 11765, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 11768, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "core", + "offset": 0, + "slot": "1", + "type": "t_contract(KlerosCore)6383" + }, + { + "astId": 11772, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "disputes", + "offset": 0, + "slot": "2", + "type": "t_array(t_struct(Dispute)11704_storage)dyn_storage" + }, + { + "astId": 11776, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "coreDisputeIDToLocal", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint256,t_uint256)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(Dispute)11704_storage)dyn_storage": { + "base": "t_struct(Dispute)11704_storage", + "encoding": "dynamic_array", + "label": "struct DisputeKitClassic.Dispute[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Round)11742_storage)dyn_storage": { + "base": "t_struct(Round)11742_storage", + "encoding": "dynamic_array", + "label": "struct DisputeKitClassic.Round[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Vote)11751_storage)dyn_storage": { + "base": "t_struct(Vote)11751_storage", + "encoding": "dynamic_array", + "label": "struct DisputeKitClassic.Vote[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(KlerosCore)6383": { + "encoding": "inplace", + "label": "contract KlerosCore", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_uint256,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(uint256 => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_uint256)" + }, + "t_mapping(t_uint256,t_bool)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(Dispute)11704_storage": { + "encoding": "inplace", + "label": "struct DisputeKitClassic.Dispute", + "members": [ + { + "astId": 11693, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "rounds", + "offset": 0, + "slot": "0", + "type": "t_array(t_struct(Round)11742_storage)dyn_storage" + }, + { + "astId": 11695, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "numberOfChoices", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 11697, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "jumped", + "offset": 0, + "slot": "2", + "type": "t_bool" + }, + { + "astId": 11701, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "coreRoundIDToLocal", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 11703, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "extraData", + "offset": 0, + "slot": "4", + "type": "t_bytes_storage" + } + ], + "numberOfBytes": "160" + }, + "t_struct(Round)11742_storage": { + "encoding": "inplace", + "label": "struct DisputeKitClassic.Round", + "members": [ + { + "astId": 11708, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "votes", + "offset": 0, + "slot": "0", + "type": "t_array(t_struct(Vote)11751_storage)dyn_storage" + }, + { + "astId": 11710, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "winningChoice", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 11714, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "counts", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 11716, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "tied", + "offset": 0, + "slot": "3", + "type": "t_bool" + }, + { + "astId": 11718, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "totalVoted", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 11720, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "totalCommitted", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 11724, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "paidFees", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 11728, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "hasPaid", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_uint256,t_bool)" + }, + { + "astId": 11734, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "contributions", + "offset": 0, + "slot": "8", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))" + }, + { + "astId": 11736, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "feeRewards", + "offset": 0, + "slot": "9", + "type": "t_uint256" + }, + { + "astId": 11739, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "fundedChoices", + "offset": 0, + "slot": "10", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 11741, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "nbVotes", + "offset": 0, + "slot": "11", + "type": "t_uint256" + } + ], + "numberOfBytes": "384" + }, + "t_struct(Vote)11751_storage": { + "encoding": "inplace", + "label": "struct DisputeKitClassic.Vote", + "members": [ + { + "astId": 11744, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "account", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 11746, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "commit", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + }, + { + "astId": 11748, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "choice", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 11750, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "voted", + "offset": 0, + "slot": "3", + "type": "t_bool" + } + ], + "numberOfBytes": "128" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic_Proxy.json b/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic_Proxy.json new file mode 100644 index 000000000..2646f99a0 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x3d8b4b6c62d6ca8ab1c6ccd5fd16bbf9894db1e11575d1e075fd1e335bd9d3c4", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + "transactionIndex": 1, + "gasUsed": "177903", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x9f7975c49e1f36319c3912d8040ec70fa39232d7c8416bce33dd3bf578803044", + "transactionHash": "0x3d8b4b6c62d6ca8ab1c6ccd5fd16bbf9894db1e11575d1e075fd1e335bd9d3c4", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084586, + "transactionHash": "0x3d8b4b6c62d6ca8ab1c6ccd5fd16bbf9894db1e11575d1e075fd1e335bd9d3c4", + "address": "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x9f7975c49e1f36319c3912d8040ec70fa39232d7c8416bce33dd3bf578803044" + } + ], + "blockNumber": 3084586, + "cumulativeGasUsed": "177903", + "status": 1, + "byzantium": true + }, + "args": [ + "0xC3dB344755b15c8Edfd834db79af4f8860029FB4", + "0x485cc955000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c590000000000000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule.json b/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule.json new file mode 100644 index 000000000..90d20a3b4 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule.json @@ -0,0 +1,268 @@ +{ + "address": "0x827411b3e98bAe8c441efBf26842A1670f8f378F", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_party", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "Evidence", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "submitEvidence", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0xf3744a46e16a2e55fbb84e35431af26d4c482f2965d69f2886ef43fa1ae4af43", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x827411b3e98bAe8c441efBf26842A1670f8f378F", + "transactionIndex": 1, + "gasUsed": "175189", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000008000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x96ea242e7e56b0df653f1ac8472119c051e890b8c2e4c79b92655fa01c845f09", + "transactionHash": "0xf3744a46e16a2e55fbb84e35431af26d4c482f2965d69f2886ef43fa1ae4af43", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084571, + "transactionHash": "0xf3744a46e16a2e55fbb84e35431af26d4c482f2965d69f2886ef43fa1ae4af43", + "address": "0x827411b3e98bAe8c441efBf26842A1670f8f378F", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x96ea242e7e56b0df653f1ac8472119c051e890b8c2e4c79b92655fa01c845f09" + } + ], + "blockNumber": 3084571, + "cumulativeGasUsed": "175189", + "status": 1, + "byzantium": true + }, + "args": [ + "0x26c1980120F1C82cF611D666CE81D2b54d018547", + "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59" + ] + }, + "implementation": "0x26c1980120F1C82cF611D666CE81D2b54d018547", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule_Implementation.json b/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule_Implementation.json new file mode 100644 index 000000000..4203b0f6d --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule_Implementation.json @@ -0,0 +1,327 @@ +{ + "address": "0x26c1980120F1C82cF611D666CE81D2b54d018547", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_party", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "Evidence", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "submitEvidence", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x118e78306ecb68456d04b5eab509764e9f55712fa053b49eb704f4703d2f99e3", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x26c1980120F1C82cF611D666CE81D2b54d018547", + "transactionIndex": 1, + "gasUsed": "495528", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080010000000000000000000000000000000000000000000000000000800000000000000000000000000000000010000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x396ddfdc729aad3ff96029dbe9c4feb677db6c5274490685281f354169b00c72", + "transactionHash": "0x118e78306ecb68456d04b5eab509764e9f55712fa053b49eb704f4703d2f99e3", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084570, + "transactionHash": "0x118e78306ecb68456d04b5eab509764e9f55712fa053b49eb704f4703d2f99e3", + "address": "0x26c1980120F1C82cF611D666CE81D2b54d018547", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 0, + "blockHash": "0x396ddfdc729aad3ff96029dbe9c4feb677db6c5274490685281f354169b00c72" + } + ], + "blockNumber": 3084570, + "cumulativeGasUsed": "495528", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_party\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"Evidence\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"submitEvidence\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"Evidence(uint256,address,string)\":{\"details\":\"To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\",\"params\":{\"_evidence\":\"IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'\",\"_externalDisputeID\":\"Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right external dispute ID.\",\"_party\":\"The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"initialize(address)\":{\"details\":\"Initializer.\",\"params\":{\"_governor\":\"The governor's address.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"submitEvidence(uint256,string)\":{\"details\":\"Submits evidence for a dispute.\",\"params\":{\"_evidence\":\"IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.\",\"_externalDisputeID\":\"Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID.\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"Evidence Module\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/evidence/EvidenceModule.sol\":\"EvidenceModule\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/evidence/EvidenceModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@jaybuidl, @fnanni-0]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n/// @custom:tools: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"../interfaces/IArbitratorV2.sol\\\";\\nimport \\\"../interfaces/IEvidence.sol\\\";\\nimport \\\"../../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../../proxy/Initializable.sol\\\";\\n\\n/// @title Evidence Module\\ncontract EvidenceModule is IEvidence, Initializable, UUPSProxiable {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The governor of the contract.\\n\\n // ************************************* //\\n // * Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer.\\n /// @param _governor The governor's address.\\n function initialize(address _governor) external reinitializer(1) {\\n governor = _governor;\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /**\\n * @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n /// @dev Submits evidence for a dispute.\\n /// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID.\\n /// @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.\\n function submitEvidence(uint256 _externalDisputeID, string calldata _evidence) external {\\n emit Evidence(_externalDisputeID, msg.sender, _evidence);\\n }\\n}\\n\",\"keccak256\":\"0x32d2c14255a266083094597f009f557e2db62727fb8a8fa9cf3f1760be58300c\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IEvidence.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n/// @title IEvidence\\ninterface IEvidence {\\n /// @dev To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\\n /// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right external dispute ID.\\n /// @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\\n /// @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'\\n event Evidence(uint256 indexed _externalDisputeID, address indexed _party, string _evidence);\\n}\\n\",\"keccak256\":\"0x3350da62267a5dad4616dafd9916fe3bfa4cdabfce124709ac3b7d087361e8c4\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060805234801561001457600080fd5b5061001d610022565b6100d3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff16156100715760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b03908116146100d05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6080516107896100fc6000396000818161011801528181610141015261033e01526107896000f3fe60806040526004361061004a5760003560e01c80630c340a241461004f5780634f1ef2861461008c57806352d1902d146100a1578063a6a7f0eb146100c4578063c4d66de8146100e4575b600080fd5b34801561005b57600080fd5b5060005461006f906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61009f61009a36600461055c565b610104565b005b3480156100ad57600080fd5b506100b6610331565b604051908152602001610083565b3480156100d057600080fd5b5061009f6100df36600461061e565b61038f565b3480156100f057600080fd5b5061009f6100ff36600461069a565b6103d8565b61010d826104c2565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061018b57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661017f6000805160206107348339815191525490565b6001600160a01b031614155b156101a95760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610203575060408051601f3d908101601f19168201909252610200918101906106bc565b60015b61023057604051630c76093760e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610734833981519152811461026157604051632a87526960e21b815260048101829052602401610227565b6000805160206107348339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a281511561032c576000836001600160a01b0316836040516102c891906106d5565b600060405180830381855af49150503d8060008114610303576040519150601f19603f3d011682016040523d82523d6000602084013e610308565b606091505b505090508061032a576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461037c5760405163703e46dd60e11b815260040160405180910390fd5b5060008051602061073483398151915290565b336001600160a01b0316837f39935cf45244bc296a03d6aef1cf17779033ee27090ce9c68d432367ce10699684846040516103cb929190610704565b60405180910390a3505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806104225750805467ffffffffffffffff808416911610155b1561043f5760405162dc149f60e41b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6000546001600160a01b031633146105275760405162461bcd60e51b815260206004820152602260248201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6044820152613c9760f11b6064820152608401610227565b50565b80356001600160a01b038116811461054157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561056f57600080fd5b6105788361052a565b9150602083013567ffffffffffffffff8082111561059557600080fd5b818501915085601f8301126105a957600080fd5b8135818111156105bb576105bb610546565b604051601f8201601f19908116603f011681019083821181831017156105e3576105e3610546565b816040528281528860208487010111156105fc57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008060006040848603121561063357600080fd5b83359250602084013567ffffffffffffffff8082111561065257600080fd5b818601915086601f83011261066657600080fd5b81358181111561067557600080fd5b87602082850101111561068757600080fd5b6020830194508093505050509250925092565b6000602082840312156106ac57600080fd5b6106b58261052a565b9392505050565b6000602082840312156106ce57600080fd5b5051919050565b6000825160005b818110156106f657602081860181015185830152016106dc565b506000920191825250919050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f1916010191905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220ca354c10b2e92a7809e892ebe3420a0270fe6b7b1718bfcaea15c6aba0a706ae64736f6c63430008120033", + "deployedBytecode": "0x60806040526004361061004a5760003560e01c80630c340a241461004f5780634f1ef2861461008c57806352d1902d146100a1578063a6a7f0eb146100c4578063c4d66de8146100e4575b600080fd5b34801561005b57600080fd5b5060005461006f906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61009f61009a36600461055c565b610104565b005b3480156100ad57600080fd5b506100b6610331565b604051908152602001610083565b3480156100d057600080fd5b5061009f6100df36600461061e565b61038f565b3480156100f057600080fd5b5061009f6100ff36600461069a565b6103d8565b61010d826104c2565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061018b57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661017f6000805160206107348339815191525490565b6001600160a01b031614155b156101a95760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610203575060408051601f3d908101601f19168201909252610200918101906106bc565b60015b61023057604051630c76093760e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610734833981519152811461026157604051632a87526960e21b815260048101829052602401610227565b6000805160206107348339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a281511561032c576000836001600160a01b0316836040516102c891906106d5565b600060405180830381855af49150503d8060008114610303576040519150601f19603f3d011682016040523d82523d6000602084013e610308565b606091505b505090508061032a576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461037c5760405163703e46dd60e11b815260040160405180910390fd5b5060008051602061073483398151915290565b336001600160a01b0316837f39935cf45244bc296a03d6aef1cf17779033ee27090ce9c68d432367ce10699684846040516103cb929190610704565b60405180910390a3505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806104225750805467ffffffffffffffff808416911610155b1561043f5760405162dc149f60e41b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6000546001600160a01b031633146105275760405162461bcd60e51b815260206004820152602260248201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6044820152613c9760f11b6064820152608401610227565b50565b80356001600160a01b038116811461054157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561056f57600080fd5b6105788361052a565b9150602083013567ffffffffffffffff8082111561059557600080fd5b818501915085601f8301126105a957600080fd5b8135818111156105bb576105bb610546565b604051601f8201601f19908116603f011681019083821181831017156105e3576105e3610546565b816040528281528860208487010111156105fc57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008060006040848603121561063357600080fd5b83359250602084013567ffffffffffffffff8082111561065257600080fd5b818601915086601f83011261066657600080fd5b81358181111561067557600080fd5b87602082850101111561068757600080fd5b6020830194508093505050509250925092565b6000602082840312156106ac57600080fd5b6106b58261052a565b9392505050565b6000602082840312156106ce57600080fd5b5051919050565b6000825160005b818110156106f657602081860181015185830152016106dc565b506000920191825250919050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f1916010191905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220ca354c10b2e92a7809e892ebe3420a0270fe6b7b1718bfcaea15c6aba0a706ae64736f6c63430008120033", + "devdoc": { + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "Evidence(uint256,address,string)": { + "details": "To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).", + "params": { + "_evidence": "IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'", + "_externalDisputeID": "Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right external dispute ID.", + "_party": "The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party." + } + }, + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "initialize(address)": { + "details": "Initializer.", + "params": { + "_governor": "The governor's address." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "submitEvidence(uint256,string)": { + "details": "Submits evidence for a dispute.", + "params": { + "_evidence": "IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.", + "_externalDisputeID": "Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "title": "Evidence Module", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 15567, + "contract": "src/arbitration/evidence/EvidenceModule.sol:EvidenceModule", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule_Proxy.json b/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule_Proxy.json new file mode 100644 index 000000000..e5aad48d1 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0x827411b3e98bAe8c441efBf26842A1670f8f378F", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xf3744a46e16a2e55fbb84e35431af26d4c482f2965d69f2886ef43fa1ae4af43", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x827411b3e98bAe8c441efBf26842A1670f8f378F", + "transactionIndex": 1, + "gasUsed": "175189", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000008000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x96ea242e7e56b0df653f1ac8472119c051e890b8c2e4c79b92655fa01c845f09", + "transactionHash": "0xf3744a46e16a2e55fbb84e35431af26d4c482f2965d69f2886ef43fa1ae4af43", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084571, + "transactionHash": "0xf3744a46e16a2e55fbb84e35431af26d4c482f2965d69f2886ef43fa1ae4af43", + "address": "0x827411b3e98bAe8c441efBf26842A1670f8f378F", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x96ea242e7e56b0df653f1ac8472119c051e890b8c2e4c79b92655fa01c845f09" + } + ], + "blockNumber": 3084571, + "cumulativeGasUsed": "175189", + "status": 1, + "byzantium": true + }, + "args": [ + "0x26c1980120F1C82cF611D666CE81D2b54d018547", + "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore.json b/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore.json new file mode 100644 index 000000000..b24a41cf0 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore.json @@ -0,0 +1,1905 @@ +{ + "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "AppealFeesNotEnough", + "type": "error" + }, + { + "inputs": [], + "name": "AppealPeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "ArbitrationFeesNotEnough", + "type": "error" + }, + { + "inputs": [], + "name": "ArraysLengthMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "CannotDisableClassicDK", + "type": "error" + }, + { + "inputs": [], + "name": "CommitPeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "DepthLevelMax", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeKitNotSupportedByCourt", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeKitOnly", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeNotAppealable", + "type": "error" + }, + { + "inputs": [], + "name": "DisputePeriodIsFinal", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeStillDrawing", + "type": "error" + }, + { + "inputs": [], + "name": "EvidenceNotPassedAndNotAppeal", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorOnly", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDisputKitParent", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidForkingCourtAsParent", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "MinStakeLowerThanParentCourt", + "type": "error" + }, + { + "inputs": [], + "name": "MustSupportDisputeKitClassic", + "type": "error" + }, + { + "inputs": [], + "name": "NotEvidencePeriod", + "type": "error" + }, + { + "inputs": [], + "name": "NotExecutionPeriod", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "RulingAlreadyExecuted", + "type": "error" + }, + { + "inputs": [], + "name": "SortitionModuleOnly", + "type": "error" + }, + { + "inputs": [], + "name": "StakingFailed", + "type": "error" + }, + { + "inputs": [], + "name": "TokenNotAccepted", + "type": "error" + }, + { + "inputs": [], + "name": "TransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "inputs": [], + "name": "UnsuccessfulCall", + "type": "error" + }, + { + "inputs": [], + "name": "UnsupportedDisputeKit", + "type": "error" + }, + { + "inputs": [], + "name": "VotePeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "WrongDisputeKitIndex", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "_accepted", + "type": "bool" + } + ], + "name": "AcceptedFeeToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "AppealDecision", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "AppealPossible", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_parent", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_supportedDisputeKits", + "type": "uint256[]" + } + ], + "name": "CourtCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_fromCourtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "_toCourtID", + "type": "uint96" + } + ], + "name": "CourtJump", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + } + ], + "name": "CourtModified", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IDisputeKit", + "name": "_disputeKitAddress", + "type": "address" + } + ], + "name": "DisputeKitCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bool", + "name": "_enable", + "type": "bool" + } + ], + "name": "DisputeKitEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_fromDisputeKitID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_toDisputeKitID", + "type": "uint256" + } + ], + "name": "DisputeKitJump", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "Draw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_pnkAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "LeftoverRewardSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "_rateInEth", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "_rateDecimals", + "type": "uint8" + } + ], + "name": "NewCurrencyRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum KlerosCore.Period", + "name": "_period", + "type": "uint8" + } + ], + "name": "NewPeriod", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_degreeOfCoherency", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "_pnkAmount", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "_feeAmount", + "type": "int256" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "TokenAndETHShift", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract IDisputeKit", + "name": "_disputeKitAddress", + "type": "address" + } + ], + "name": "addNewDisputeKit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "appeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "appealCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "appealPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_accepted", + "type": "bool" + } + ], + "name": "changeAcceptedFeeTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + } + ], + "name": "changeCourtParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "uint64", + "name": "_rateInEth", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "_rateDecimals", + "type": "uint8" + } + ], + "name": "changeCurrencyRates", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_jurorProsecutionModule", + "type": "address" + } + ], + "name": "changeJurorProsecutionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_pinakion", + "type": "address" + } + ], + "name": "changePinakion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISortitionModule", + "name": "_sortitionModule", + "type": "address" + } + ], + "name": "changeSortitionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_toToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountInEth", + "type": "uint256" + } + ], + "name": "convertEthToTokenAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "courts", + "outputs": [ + { + "internalType": "uint96", + "name": "parent", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_parent", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "internalType": "bytes", + "name": "_sortitionExtraData", + "type": "bytes" + }, + { + "internalType": "uint256[]", + "name": "_supportedDisputeKits", + "type": "uint256[]" + } + ], + "name": "createCourt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_feeAmount", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "currencyRates", + "outputs": [ + { + "internalType": "bool", + "name": "feePaymentAccepted", + "type": "bool" + }, + { + "internalType": "uint64", + "name": "rateInEth", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "rateDecimals", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "currentRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "bool", + "name": "overridden", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputeKits", + "outputs": [ + { + "internalType": "contract IDisputeKit", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "uint96", + "name": "courtID", + "type": "uint96" + }, + { + "internalType": "contract IArbitrableV2", + "name": "arbitrated", + "type": "address" + }, + { + "internalType": "enum KlerosCore.Period", + "name": "period", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "ruled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "lastPeriodChange", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256[]", + "name": "_disputeKitIDs", + "type": "uint256[]" + }, + { + "internalType": "bool", + "name": "_enable", + "type": "bool" + } + ], + "name": "enableDisputeKits", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "execute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeGovernorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "executeRuling", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getDisputeKitsLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "getNumberOfRounds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "getNumberOfVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_round", + "type": "uint256" + } + ], + "name": "getRoundInfo", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "disputeKitID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkAtStakePerJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalFeesForJurors", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "repartitions", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkPenalties", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "drawnJurors", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "sumFeeRewardPaid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sumPnkRewardPaid", + "type": "uint256" + }, + { + "internalType": "contract IERC20", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "drawIterations", + "type": "uint256" + } + ], + "internalType": "struct KlerosCore.Round", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "getTimesPerPeriod", + "outputs": [ + { + "internalType": "uint256[4]", + "name": "timesPerPeriod", + "type": "uint256[4]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_pinakion", + "type": "address" + }, + { + "internalType": "address", + "name": "_jurorProsecutionModule", + "type": "address" + }, + { + "internalType": "contract IDisputeKit", + "name": "_disputeKit", + "type": "address" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256[4]", + "name": "_courtParameters", + "type": "uint256[4]" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "internalType": "bytes", + "name": "_sortitionExtraData", + "type": "bytes" + }, + { + "internalType": "contract ISortitionModule", + "name": "_sortitionModuleAddress", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "isDisputeKitJumping", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + } + ], + "name": "isSupported", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "jurorProsecutionModule", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "passPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pinakion", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + } + ], + "name": "setStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_alreadyTransferred", + "type": "bool" + } + ], + "name": "setStakeBySortitionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sortitionModule", + "outputs": [ + { + "internalType": "contract ISortitionModule", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "transactionIndex": 1, + "gasUsed": "555971", + "logsBloom": "0x00000000000000000000000020000000000000000000000000000100020000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000040000000000000000000000000000020000000000000010000800402000000000000008000000000000000000000000000000000800000000000000000000000080000000000000800000000000000000000008000000000000000080000000000000000000000000000000000000000000000000000000000000000000000004000000000000000060000004001001000000000000001000000000000000000000000000000020000000", + "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4", + "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084598, + "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", + "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "topics": [ + "0x44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb2", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x00000000000000000000000086ac67e5550f837a650b4b0cd4778d4293a2bde3" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4" + }, + { + "transactionIndex": 1, + "blockNumber": 3084598, + "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", + "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "topics": [ + "0x3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000", + "logIndex": 1, + "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4" + }, + { + "transactionIndex": 1, + "blockNumber": 3084598, + "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", + "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "topics": [ + "0xb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc79", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000001" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4" + }, + { + "transactionIndex": 1, + "blockNumber": 3084598, + "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", + "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 3, + "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4" + } + ], + "blockNumber": 3084598, + "cumulativeGasUsed": "555971", + "status": 1, + "byzantium": true + }, + "args": [ + "0x614498118850184c62f82d08261109334bFB050f", + "0x994b27af000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c5900000000000000000000000034b944d42cacfc8266955d07a80181d2054aa225000000000000000000000000000000000000000000000000000000000000000000000000000000000000000086ac67e5550f837a650b4b0cd4778d4293a2bde3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000f327200420f21baafce8f1c03b1eedf926074b9500000000000000000000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "0x34B944D42cAcfC8266955D07A80181D2054aa225", + "0x0000000000000000000000000000000000000000", + "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + false, + [ + { + "type": "BigNumber", + "hex": "0x0ad78ebc5ac6200000" + }, + 10000, + { + "type": "BigNumber", + "hex": "0x016345785d8a0000" + }, + 256 + ], + [ + 0, + 0, + 0, + 10 + ], + "0x05", + "0xf327200420F21BAafce8F1C03B1EEdF926074B95" + ] + }, + "implementation": "0x614498118850184c62f82d08261109334bFB050f", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore_Implementation.json b/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore_Implementation.json new file mode 100644 index 000000000..9c7e0d2d8 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore_Implementation.json @@ -0,0 +1,2571 @@ +{ + "address": "0x614498118850184c62f82d08261109334bFB050f", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "AppealFeesNotEnough", + "type": "error" + }, + { + "inputs": [], + "name": "AppealPeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "ArbitrationFeesNotEnough", + "type": "error" + }, + { + "inputs": [], + "name": "ArraysLengthMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "CannotDisableClassicDK", + "type": "error" + }, + { + "inputs": [], + "name": "CommitPeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "DepthLevelMax", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeKitNotSupportedByCourt", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeKitOnly", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeNotAppealable", + "type": "error" + }, + { + "inputs": [], + "name": "DisputePeriodIsFinal", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeStillDrawing", + "type": "error" + }, + { + "inputs": [], + "name": "EvidenceNotPassedAndNotAppeal", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorOnly", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDisputKitParent", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidForkingCourtAsParent", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "MinStakeLowerThanParentCourt", + "type": "error" + }, + { + "inputs": [], + "name": "MustSupportDisputeKitClassic", + "type": "error" + }, + { + "inputs": [], + "name": "NotEvidencePeriod", + "type": "error" + }, + { + "inputs": [], + "name": "NotExecutionPeriod", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "RulingAlreadyExecuted", + "type": "error" + }, + { + "inputs": [], + "name": "SortitionModuleOnly", + "type": "error" + }, + { + "inputs": [], + "name": "StakingFailed", + "type": "error" + }, + { + "inputs": [], + "name": "TokenNotAccepted", + "type": "error" + }, + { + "inputs": [], + "name": "TransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "inputs": [], + "name": "UnsuccessfulCall", + "type": "error" + }, + { + "inputs": [], + "name": "UnsupportedDisputeKit", + "type": "error" + }, + { + "inputs": [], + "name": "VotePeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "WrongDisputeKitIndex", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "_accepted", + "type": "bool" + } + ], + "name": "AcceptedFeeToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "AppealDecision", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "AppealPossible", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_parent", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_supportedDisputeKits", + "type": "uint256[]" + } + ], + "name": "CourtCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_fromCourtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "_toCourtID", + "type": "uint96" + } + ], + "name": "CourtJump", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + } + ], + "name": "CourtModified", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IDisputeKit", + "name": "_disputeKitAddress", + "type": "address" + } + ], + "name": "DisputeKitCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bool", + "name": "_enable", + "type": "bool" + } + ], + "name": "DisputeKitEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_fromDisputeKitID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_toDisputeKitID", + "type": "uint256" + } + ], + "name": "DisputeKitJump", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "Draw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_pnkAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "LeftoverRewardSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "_rateInEth", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "_rateDecimals", + "type": "uint8" + } + ], + "name": "NewCurrencyRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum KlerosCore.Period", + "name": "_period", + "type": "uint8" + } + ], + "name": "NewPeriod", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_degreeOfCoherency", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "_pnkAmount", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "_feeAmount", + "type": "int256" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "TokenAndETHShift", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract IDisputeKit", + "name": "_disputeKitAddress", + "type": "address" + } + ], + "name": "addNewDisputeKit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "appeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "appealCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "appealPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_accepted", + "type": "bool" + } + ], + "name": "changeAcceptedFeeTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + } + ], + "name": "changeCourtParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "uint64", + "name": "_rateInEth", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "_rateDecimals", + "type": "uint8" + } + ], + "name": "changeCurrencyRates", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_jurorProsecutionModule", + "type": "address" + } + ], + "name": "changeJurorProsecutionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_pinakion", + "type": "address" + } + ], + "name": "changePinakion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISortitionModule", + "name": "_sortitionModule", + "type": "address" + } + ], + "name": "changeSortitionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_toToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountInEth", + "type": "uint256" + } + ], + "name": "convertEthToTokenAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "courts", + "outputs": [ + { + "internalType": "uint96", + "name": "parent", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_parent", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "internalType": "bytes", + "name": "_sortitionExtraData", + "type": "bytes" + }, + { + "internalType": "uint256[]", + "name": "_supportedDisputeKits", + "type": "uint256[]" + } + ], + "name": "createCourt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_feeAmount", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "currencyRates", + "outputs": [ + { + "internalType": "bool", + "name": "feePaymentAccepted", + "type": "bool" + }, + { + "internalType": "uint64", + "name": "rateInEth", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "rateDecimals", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "currentRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "bool", + "name": "overridden", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputeKits", + "outputs": [ + { + "internalType": "contract IDisputeKit", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "uint96", + "name": "courtID", + "type": "uint96" + }, + { + "internalType": "contract IArbitrableV2", + "name": "arbitrated", + "type": "address" + }, + { + "internalType": "enum KlerosCore.Period", + "name": "period", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "ruled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "lastPeriodChange", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256[]", + "name": "_disputeKitIDs", + "type": "uint256[]" + }, + { + "internalType": "bool", + "name": "_enable", + "type": "bool" + } + ], + "name": "enableDisputeKits", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "execute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeGovernorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "executeRuling", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getDisputeKitsLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "getNumberOfRounds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "getNumberOfVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_round", + "type": "uint256" + } + ], + "name": "getRoundInfo", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "disputeKitID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkAtStakePerJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalFeesForJurors", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "repartitions", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkPenalties", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "drawnJurors", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "sumFeeRewardPaid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sumPnkRewardPaid", + "type": "uint256" + }, + { + "internalType": "contract IERC20", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "drawIterations", + "type": "uint256" + } + ], + "internalType": "struct KlerosCore.Round", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "getTimesPerPeriod", + "outputs": [ + { + "internalType": "uint256[4]", + "name": "timesPerPeriod", + "type": "uint256[4]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_pinakion", + "type": "address" + }, + { + "internalType": "address", + "name": "_jurorProsecutionModule", + "type": "address" + }, + { + "internalType": "contract IDisputeKit", + "name": "_disputeKit", + "type": "address" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256[4]", + "name": "_courtParameters", + "type": "uint256[4]" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "internalType": "bytes", + "name": "_sortitionExtraData", + "type": "bytes" + }, + { + "internalType": "contract ISortitionModule", + "name": "_sortitionModuleAddress", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "isDisputeKitJumping", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + } + ], + "name": "isSupported", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "jurorProsecutionModule", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "passPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pinakion", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + } + ], + "name": "setStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_alreadyTransferred", + "type": "bool" + } + ], + "name": "setStakeBySortitionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sortitionModule", + "outputs": [ + { + "internalType": "contract ISortitionModule", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0xc58467c2d89a4e5bab96ead4d8547f3d82d56d9297651316c278d410987a1fd6", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x614498118850184c62f82d08261109334bFB050f", + "transactionIndex": 1, + "gasUsed": "4776582", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000002000000000000000000000000000000000000000000000000", + "blockHash": "0x94238b9c3e2400e396e91cb51431c0762b70494568245c2e450c4d65aba2e180", + "transactionHash": "0xc58467c2d89a4e5bab96ead4d8547f3d82d56d9297651316c278d410987a1fd6", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084595, + "transactionHash": "0xc58467c2d89a4e5bab96ead4d8547f3d82d56d9297651316c278d410987a1fd6", + "address": "0x614498118850184c62f82d08261109334bFB050f", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 0, + "blockHash": "0x94238b9c3e2400e396e91cb51431c0762b70494568245c2e450c4d65aba2e180" + } + ], + "blockNumber": 3084595, + "cumulativeGasUsed": "4776582", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AppealFeesNotEnough\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AppealPeriodNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ArbitrationFeesNotEnough\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ArraysLengthMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotDisableClassicDK\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CommitPeriodNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DepthLevelMax\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeKitNotSupportedByCourt\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeKitOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeNotAppealable\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputePeriodIsFinal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeStillDrawing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EvidenceNotPassedAndNotAppeal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDisputKitParent\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidForkingCourtAsParent\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MinStakeLowerThanParentCourt\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustSupportDisputeKitClassic\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotEvidencePeriod\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotExecutionPeriod\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RulingAlreadyExecuted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SortitionModuleOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StakingFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenNotAccepted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnsuccessfulCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnsupportedDisputeKit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VotePeriodNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongDisputeKitIndex\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"_accepted\",\"type\":\"bool\"}],\"name\":\"AcceptedFeeToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"AppealDecision\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"AppealPossible\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_parent\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"_supportedDisputeKits\",\"type\":\"uint256[]\"}],\"name\":\"CourtCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_fromCourtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"_toCourtID\",\"type\":\"uint96\"}],\"name\":\"CourtJump\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"}],\"name\":\"CourtModified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"DisputeCreation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IDisputeKit\",\"name\":\"_disputeKitAddress\",\"type\":\"address\"}],\"name\":\"DisputeKitCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"_enable\",\"type\":\"bool\"}],\"name\":\"DisputeKitEnabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_fromDisputeKitID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_toDisputeKitID\",\"type\":\"uint256\"}],\"name\":\"DisputeKitJump\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"Draw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_pnkAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"}],\"name\":\"LeftoverRewardSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"_rateInEth\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"_rateDecimals\",\"type\":\"uint8\"}],\"name\":\"NewCurrencyRate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum KlerosCore.Period\",\"name\":\"_period\",\"type\":\"uint8\"}],\"name\":\"NewPeriod\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_degreeOfCoherency\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"_pnkAmount\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"_feeAmount\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"}],\"name\":\"TokenAndETHShift\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"contract IDisputeKit\",\"name\":\"_disputeKitAddress\",\"type\":\"address\"}],\"name\":\"addNewDisputeKit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"appeal\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"appealCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"appealPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"start\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"}],\"name\":\"arbitrationCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"arbitrationCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"_accepted\",\"type\":\"bool\"}],\"name\":\"changeAcceptedFeeTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"}],\"name\":\"changeCourtParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_rateInEth\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"_rateDecimals\",\"type\":\"uint8\"}],\"name\":\"changeCurrencyRates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_jurorProsecutionModule\",\"type\":\"address\"}],\"name\":\"changeJurorProsecutionModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_pinakion\",\"type\":\"address\"}],\"name\":\"changePinakion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISortitionModule\",\"name\":\"_sortitionModule\",\"type\":\"address\"}],\"name\":\"changeSortitionModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_toToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amountInEth\",\"type\":\"uint256\"}],\"name\":\"convertEthToTokenAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"courts\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"parent\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"minStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"alpha\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeForJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"jurorsForCourtJump\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"disabled\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_parent\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"internalType\":\"bytes\",\"name\":\"_sortitionExtraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256[]\",\"name\":\"_supportedDisputeKits\",\"type\":\"uint256[]\"}],\"name\":\"createCourt\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_feeAmount\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"currencyRates\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"feePaymentAccepted\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"rateInEth\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"rateDecimals\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"currentRuling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"overridden\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputeKits\",\"outputs\":[{\"internalType\":\"contract IDisputeKit\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"courtID\",\"type\":\"uint96\"},{\"internalType\":\"contract IArbitrableV2\",\"name\":\"arbitrated\",\"type\":\"address\"},{\"internalType\":\"enum KlerosCore.Period\",\"name\":\"period\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"ruled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"lastPeriodChange\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256[]\",\"name\":\"_disputeKitIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"bool\",\"name\":\"_enable\",\"type\":\"bool\"}],\"name\":\"enableDisputeKits\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"execute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_destination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"executeGovernorProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"executeRuling\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDisputeKitsLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"getNumberOfRounds\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"getNumberOfVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"getRoundInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"disputeKitID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pnkAtStakePerJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalFeesForJurors\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"repartitions\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pnkPenalties\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"drawnJurors\",\"type\":\"address[]\"},{\"internalType\":\"uint256\",\"name\":\"sumFeeRewardPaid\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sumPnkRewardPaid\",\"type\":\"uint256\"},{\"internalType\":\"contract IERC20\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"drawIterations\",\"type\":\"uint256\"}],\"internalType\":\"struct KlerosCore.Round\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"getTimesPerPeriod\",\"outputs\":[{\"internalType\":\"uint256[4]\",\"name\":\"timesPerPeriod\",\"type\":\"uint256[4]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"_pinakion\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_jurorProsecutionModule\",\"type\":\"address\"},{\"internalType\":\"contract IDisputeKit\",\"name\":\"_disputeKit\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256[4]\",\"name\":\"_courtParameters\",\"type\":\"uint256[4]\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"internalType\":\"bytes\",\"name\":\"_sortitionExtraData\",\"type\":\"bytes\"},{\"internalType\":\"contract ISortitionModule\",\"name\":\"_sortitionModuleAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"isDisputeKitJumping\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"}],\"name\":\"isSupported\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"jurorProsecutionModule\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"passPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pinakion\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_newStake\",\"type\":\"uint256\"}],\"name\":\"setStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_newStake\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"_alreadyTransferred\",\"type\":\"bool\"}],\"name\":\"setStakeBySortitionModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sortitionModule\",\"outputs\":[{\"internalType\":\"contract ISortitionModule\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"AcceptedFeeToken(address,bool)\":{\"details\":\"To be emitted when an ERC20 token is added or removed as a method to pay fees.\",\"params\":{\"_accepted\":\"Whether the token is accepted or not.\",\"_token\":\"The ERC20 token.\"}},\"DisputeCreation(uint256,address)\":{\"details\":\"To be emitted when a dispute is created.\",\"params\":{\"_arbitrable\":\"The contract which created the dispute.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"NewCurrencyRate(address,uint64,uint8)\":{\"details\":\"To be emitted when the fee for a particular ERC20 token is updated.\",\"params\":{\"_feeToken\":\"The ERC20 token.\",\"_rateDecimals\":\"The new decimals of the fee token rate.\",\"_rateInEth\":\"The new rate of the fee token in ETH.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrable\":\"The arbitrable receiving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"addNewDisputeKit(address)\":{\"details\":\"Add a new supported dispute kit module to the court.\",\"params\":{\"_disputeKitAddress\":\"The address of the dispute kit contract.\"}},\"appeal(uint256,uint256,bytes)\":{\"details\":\"Appeals the ruling of a specified dispute. Note: Access restricted to the Dispute Kit for this `disputeID`.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_extraData\":\"Extradata for the dispute. Can be required during court jump.\",\"_numberOfChoices\":\"Number of choices for the dispute. Can be required during court jump.\"}},\"appealCost(uint256)\":{\"details\":\"Gets the cost of appealing a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"cost\":\"The appeal cost.\"}},\"appealPeriod(uint256)\":{\"details\":\"Gets the start and the end of a specified dispute's current appeal period.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"end\":\"The end of the appeal period.\",\"start\":\"The start of the appeal period.\"}},\"arbitrationCost(bytes)\":{\"details\":\"Compute the cost of arbitration denominated in ETH. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\"},\"returns\":{\"cost\":\"The arbitration cost in ETH.\"}},\"arbitrationCost(bytes,address)\":{\"details\":\"Compute the cost of arbitration denominated in `_feeToken`. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\",\"_feeToken\":\"The ERC20 token used to pay fees.\"},\"returns\":{\"cost\":\"The arbitration cost in `_feeToken`.\"}},\"changeAcceptedFeeTokens(address,bool)\":{\"details\":\"Changes the supported fee tokens.\",\"params\":{\"_accepted\":\"Whether the token is supported or not as a method of fee payment.\",\"_feeToken\":\"The fee token.\"}},\"changeCurrencyRates(address,uint64,uint8)\":{\"details\":\"Changes the currency rate of a fee token.\",\"params\":{\"_feeToken\":\"The fee token.\",\"_rateDecimals\":\"The new decimals of the fee token rate.\",\"_rateInEth\":\"The new rate of the fee token in ETH.\"}},\"changeGovernor(address)\":{\"details\":\"Changes the `governor` storage variable.\",\"params\":{\"_governor\":\"The new value for the `governor` storage variable.\"}},\"changeJurorProsecutionModule(address)\":{\"details\":\"Changes the `jurorProsecutionModule` storage variable.\",\"params\":{\"_jurorProsecutionModule\":\"The new value for the `jurorProsecutionModule` storage variable.\"}},\"changePinakion(address)\":{\"details\":\"Changes the `pinakion` storage variable.\",\"params\":{\"_pinakion\":\"The new value for the `pinakion` storage variable.\"}},\"changeSortitionModule(address)\":{\"details\":\"Changes the `_sortitionModule` storage variable. Note that the new module should be initialized for all courts.\",\"params\":{\"_sortitionModule\":\"The new value for the `sortitionModule` storage variable.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"createCourt(uint96,bool,uint256,uint256,uint256,uint256,uint256[4],bytes,uint256[])\":{\"details\":\"Creates a court under a specified parent court.\",\"params\":{\"_alpha\":\"The `alpha` property value of the court.\",\"_feeForJuror\":\"The `feeForJuror` property value of the court.\",\"_hiddenVotes\":\"The `hiddenVotes` property value of the court.\",\"_jurorsForCourtJump\":\"The `jurorsForCourtJump` property value of the court.\",\"_minStake\":\"The `minStake` property value of the court.\",\"_parent\":\"The `parent` property value of the court.\",\"_sortitionExtraData\":\"Extra data for sortition module.\",\"_supportedDisputeKits\":\"Indexes of dispute kits that this court will support.\",\"_timesPerPeriod\":\"The `timesPerPeriod` property value of the court.\"}},\"createDispute(uint256,bytes)\":{\"details\":\"Create a dispute and pay for the fees in the native currency, typically ETH. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\",\"_numberOfChoices\":\"The number of choices the arbitrator can choose from in this dispute.\"},\"returns\":{\"disputeID\":\"The identifier of the dispute created.\"}},\"createDispute(uint256,bytes,address,uint256)\":{\"details\":\"Create a dispute and pay for the fees in a supported ERC20 token. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\",\"_feeAmount\":\"Amount of the ERC20 token used to pay fees.\",\"_feeToken\":\"The ERC20 token used to pay fees.\",\"_numberOfChoices\":\"The number of choices the arbitrator can choose from in this dispute.\"},\"returns\":{\"disputeID\":\"The identifier of the dispute created.\"}},\"currentRuling(uint256)\":{\"details\":\"Gets the current ruling of a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"overridden\":\"Whether the ruling was overridden by appeal funding or not.\",\"ruling\":\"The current ruling.\",\"tied\":\"Whether it's a tie or not.\"}},\"draw(uint256,uint256)\":{\"details\":\"Draws jurors for the dispute. Can be called in parts.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_iterations\":\"The number of iterations to run.\"}},\"enableDisputeKits(uint96,uint256[],bool)\":{\"details\":\"Adds/removes court's support for specified dispute kits.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_disputeKitIDs\":\"The IDs of dispute kits which support should be added/removed.\",\"_enable\":\"Whether add or remove the dispute kits from the court.\"}},\"execute(uint256,uint256,uint256)\":{\"details\":\"Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_iterations\":\"The number of iterations to run.\",\"_round\":\"The appeal round.\"}},\"executeGovernorProposal(address,uint256,bytes)\":{\"details\":\"Allows the governor to call anything on behalf of the contract.\",\"params\":{\"_amount\":\"The value sent with the call.\",\"_data\":\"The data sent with the call.\",\"_destination\":\"The destination of the call.\"}},\"executeRuling(uint256)\":{\"details\":\"Executes a specified dispute's ruling.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"getNumberOfVotes(uint256)\":{\"details\":\"Gets the number of votes permitted for the specified dispute in the latest round.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"getTimesPerPeriod(uint96)\":{\"details\":\"Gets the timesPerPeriod array for a given court.\",\"params\":{\"_courtID\":\"The ID of the court to get the times from.\"},\"returns\":{\"timesPerPeriod\":\"The timesPerPeriod array for the given court.\"}},\"initialize(address,address,address,address,bool,uint256[4],uint256[4],bytes,address)\":{\"details\":\"Initializer (constructor equivalent for upgradable contracts).\",\"params\":{\"_courtParameters\":\"Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\",\"_disputeKit\":\"The address of the default dispute kit.\",\"_governor\":\"The governor's address.\",\"_hiddenVotes\":\"The `hiddenVotes` property value of the general court.\",\"_jurorProsecutionModule\":\"The address of the juror prosecution module.\",\"_pinakion\":\"The address of the token contract.\",\"_sortitionExtraData\":\"The extra data for sortition module.\",\"_sortitionModuleAddress\":\"The sortition module responsible for sortition of the jurors.\",\"_timesPerPeriod\":\"The `timesPerPeriod` property value of the general court.\"}},\"isDisputeKitJumping(uint256)\":{\"details\":\"Returns true if the dispute kit will be switched to a parent DK.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"_0\":\"Whether DK will be switched or not.\"}},\"passPeriod(uint256)\":{\"details\":\"Passes the period of a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"setStake(uint96,uint256)\":{\"details\":\"Sets the caller's stake in a court.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_newStake\":\"The new stake. Note that the existing delayed stake will be nullified as non-relevant.\"}},\"setStakeBySortitionModule(address,uint96,uint256,bool)\":{\"details\":\"Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.\",\"params\":{\"_account\":\"The account whose stake is being set.\",\"_alreadyTransferred\":\"Whether the PNKs have already been transferred to the contract.\",\"_courtID\":\"The ID of the court.\",\"_newStake\":\"The new stake.\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"KlerosCore Core arbitrator contract for Kleros v2. Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/KlerosCore.sol\":\"KlerosCore\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/KlerosCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"./interfaces/IArbitratorV2.sol\\\";\\nimport {IDisputeKit} from \\\"./interfaces/IDisputeKit.sol\\\";\\nimport {ISortitionModule} from \\\"./interfaces/ISortitionModule.sol\\\";\\nimport {SafeERC20, IERC20} from \\\"../libraries/SafeERC20.sol\\\";\\nimport {Constants} from \\\"../libraries/Constants.sol\\\";\\nimport {OnError} from \\\"../libraries/Types.sol\\\";\\nimport {UUPSProxiable} from \\\"../proxy/UUPSProxiable.sol\\\";\\nimport {Initializable} from \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title KlerosCore\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\ncontract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum PNKs needed to stake in the court.\\n uint256 alpha; // Basis point of PNKs that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court. Note that each court must support classic dispute kit.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrableV2 arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 pnkAtStakePerJuror; // The amount of PNKs at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 pnkPenalties; // The amount of PNKs collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumFeeRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumPnkRewardPaid; // Total sum of PNK paid to coherent jurors as a reward in this round.\\n IERC20 feeToken; // The token used for paying fees in this round.\\n uint256 drawIterations; // The number of iterations passed drawing the jurors for this round.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 pnkPenaltiesInRound; // The amount of PNKs collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n struct CurrencyRate {\\n bool feePaymentAccepted;\\n uint64 rateInEth;\\n uint8 rateDecimals;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 private constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 private constant NON_PAYABLE_AMOUNT = (2 ** 256 - 2) / 2; // An amount higher than the supply of ETH.\\n\\n address public governor; // The governor of the contract.\\n IERC20 public pinakion; // The Pinakion token contract.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n Court[] public courts; // The courts.\\n IDisputeKit[] public disputeKits; // Array of dispute kits.\\n Dispute[] public disputes; // The disputes.\\n mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(\\n uint96 indexed _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod\\n );\\n event DisputeKitCreated(uint256 indexed _disputeKitID, IDisputeKit indexed _disputeKitAddress);\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _pnkAmount,\\n int256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _pnkAmount,\\n uint256 _feeAmount,\\n IERC20 _feeToken\\n );\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _governor The governor's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n function initialize(\\n address _governor,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) external reinitializer(1) {\\n governor = _governor;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a dispute kit is not supported.\\n disputeKits.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKits.push(_disputeKit);\\n\\n emit DisputeKitCreated(Constants.DISPUTE_KIT_CLASSIC, _disputeKit);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(Constants.FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = Constants.FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(Constants.GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(Constants.GENERAL_COURT, Constants.DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /* @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n if (!success) revert UnsuccessfulCall();\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress) external onlyByGovernor {\\n uint256 disputeKitID = disputeKits.length;\\n disputeKits.push(_disputeKitAddress);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress);\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt();\\n if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit();\\n if (_parent == Constants.FORKING_COURT) revert InvalidForkingCourtAsParent();\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n // Check that Classic DK support was added.\\n if (!court.supportedDisputeKits[Constants.DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic();\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n function changeCourtParameters(\\n uint96 _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod\\n ) external onlyByGovernor {\\n Court storage court = courts[_courtID];\\n if (_courtID != Constants.GENERAL_COURT && courts[court.parent].minStake > _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n for (uint256 i = 0; i < court.children.length; i++) {\\n if (courts[court.children[i]].minStake < _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n }\\n court.minStake = _minStake;\\n court.hiddenVotes = _hiddenVotes;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(\\n _courtID,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod\\n );\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n // Classic dispute kit must be supported by all courts.\\n if (_disputeKitIDs[i] == Constants.DISPUTE_KIT_CLASSIC) {\\n revert CannotDisableClassicDK();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n /// @dev Changes the supported fee tokens.\\n /// @param _feeToken The fee token.\\n /// @param _accepted Whether the token is supported or not as a method of fee payment.\\n function changeAcceptedFeeTokens(IERC20 _feeToken, bool _accepted) external onlyByGovernor {\\n currencyRates[_feeToken].feePaymentAccepted = _accepted;\\n emit AcceptedFeeToken(_feeToken, _accepted);\\n }\\n\\n /// @dev Changes the currency rate of a fee token.\\n /// @param _feeToken The fee token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n function changeCurrencyRates(IERC20 _feeToken, uint64 _rateInEth, uint8 _rateDecimals) external onlyByGovernor {\\n currencyRates[_feeToken].rateInEth = _rateInEth;\\n currencyRates[_feeToken].rateDecimals = _rateDecimals;\\n emit NewCurrencyRate(_feeToken, _rateInEth, _rateDecimals);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// Note that the existing delayed stake will be nullified as non-relevant.\\n function setStake(uint96 _courtID, uint256 _newStake) external {\\n _setStake(msg.sender, _courtID, _newStake, false, OnError.Revert);\\n }\\n\\n /// @dev Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.\\n /// @param _account The account whose stake is being set.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs have already been transferred to the contract.\\n function setStakeBySortitionModule(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external {\\n if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly();\\n _setStake(_account, _courtID, _newStake, _alreadyTransferred, OnError.Return);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough();\\n\\n return _createDispute(_numberOfChoices, _extraData, Constants.NATIVE_CURRENCY, msg.value);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external override returns (uint256 disputeID) {\\n if (!currencyRates[_feeToken].feePaymentAccepted) revert TokenNotAccepted();\\n if (_feeAmount < arbitrationCost(_extraData, _feeToken)) revert ArbitrationFeesNotEnough();\\n\\n if (!_feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount)) revert TransferFailed();\\n return _createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount);\\n }\\n\\n function _createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) internal returns (uint256 disputeID) {\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n if (!courts[courtID].supportedDisputeKits[disputeKitID]) revert DisputeKitNotSupportedByCourt();\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrableV2(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKits[disputeKitID];\\n Court storage court = courts[dispute.courtID];\\n Round storage round = dispute.rounds.push();\\n\\n // Obtain the feeForJuror in the same currency as the _feeAmount\\n uint256 feeForJuror = (_feeToken == Constants.NATIVE_CURRENCY)\\n ? court.feeForJuror\\n : convertEthToTokenAmount(_feeToken, court.feeForJuror);\\n round.nbVotes = _feeAmount / feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = _feeAmount;\\n round.feeToken = IERC20(_feeToken);\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrableV2(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n if (\\n currentRound == 0 &&\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]\\n ) {\\n revert EvidenceNotPassedAndNotAppeal();\\n }\\n if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing();\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areCommitsAllCast(_disputeID)\\n ) {\\n revert CommitPeriodNotPassed();\\n }\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areVotesAllCast(_disputeID)\\n ) {\\n revert VotePeriodNotPassed();\\n }\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) {\\n revert AppealPeriodNotPassed();\\n }\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert DisputePeriodIsFinal();\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period != Period.evidence) revert NotEvidencePeriod();\\n\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 startIndex = round.drawIterations; // for gas: less storage reads\\n uint256 i;\\n while (i < _iterations && round.drawnJurors.length < round.nbVotes) {\\n address drawnAddress = disputeKit.draw(_disputeID, startIndex + i++);\\n if (drawnAddress == address(0)) {\\n continue;\\n }\\n sortitionModule.lockStake(drawnAddress, round.pnkAtStakePerJuror);\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n round.drawIterations += i;\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n if (msg.value < appealCost(_disputeID)) revert AppealFeesNotEnough();\\n\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.appeal) revert DisputeNotAppealable();\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n if (msg.sender != address(disputeKits[round.disputeKitID])) revert DisputeKitOnly();\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n // Switch to classic dispute kit if parent court doesn't support the current one.\\n newDisputeKitID = Constants.DISPUTE_KIT_CLASSIC;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKits[extraRound.disputeKitID].createDispute(\\n _disputeID,\\n _numberOfChoices,\\n _extraData,\\n extraRound.nbVotes\\n );\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n\\n Round storage round = dispute.rounds[_round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 pnkPenaltiesInRoundCache = round.pnkPenalties; // For saving gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect the PNK penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n pnkPenaltiesInRoundCache = _executePenalties(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n }\\n }\\n if (round.pnkPenalties != pnkPenaltiesInRoundCache) {\\n round.pnkPenalties = pnkPenaltiesInRoundCache; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return pnkPenaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.pnkAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.pnkPenaltiesInRound += penalty;\\n\\n // Unlock the PNKs affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n sortitionModule.unlockStake(account, penalty);\\n\\n // Apply the penalty to the staked PNKs.\\n sortitionModule.penalizeStake(account, penalty);\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n -int256(penalty),\\n 0,\\n round.feeToken\\n );\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(round.totalFeesForJurors);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, round.totalFeesForJurors);\\n }\\n pinakion.safeTransfer(governor, _params.pnkPenaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.pnkPenaltiesInRound,\\n round.totalFeesForJurors,\\n round.feeToken\\n );\\n }\\n return _params.pnkPenaltiesInRound;\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the PNKs of the juror for this round.\\n sortitionModule.unlockStake(account, pnkLocked);\\n\\n // Give back the locked PNKs in case the juror fully unstaked earlier.\\n if (!sortitionModule.isJurorStaked(account)) {\\n pinakion.safeTransfer(account, pnkLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumPnkRewardPaid += pnkReward;\\n uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumFeeRewardPaid += feeReward;\\n pinakion.safeTransfer(account, pnkReward);\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(account).send(feeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(account, feeReward);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(pnkReward),\\n int256(feeReward),\\n round.feeToken\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverPnkReward = _params.pnkPenaltiesInRound - round.sumPnkRewardPaid;\\n uint256 leftoverFeeReward = round.totalFeesForJurors - round.sumFeeRewardPaid;\\n if (leftoverPnkReward != 0 || leftoverFeeReward != 0) {\\n if (leftoverPnkReward != 0) {\\n pinakion.safeTransfer(governor, leftoverPnkReward);\\n }\\n if (leftoverFeeReward != 0) {\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(leftoverFeeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, leftoverFeeReward);\\n }\\n }\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n leftoverPnkReward,\\n leftoverFeeReward,\\n round.feeToken\\n );\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n if (dispute.ruled) revert RulingAlreadyExecuted();\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Compute the cost of arbitration denominated in ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) public view override returns (uint256 cost) {\\n cost = convertEthToTokenAmount(_feeToken, arbitrationCost(_extraData));\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == Constants.GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(uint256 _disputeID, uint256 _round) external view returns (Round memory) {\\n return disputes[_disputeID].rounds[_round];\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n timesPerPeriod = courts[_courtID].timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitsLength() external view returns (uint256) {\\n return disputeKits.length;\\n }\\n\\n function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) {\\n return (_amountInEth * 10 ** currencyRates[_toToken].rateDecimals) / currencyRates[_toToken].rateInEth;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support. Note that classic dispute kit should always be enabled.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev If called only once then set _onError to Revert, otherwise set it to Return\\n /// @param _account The account to set the stake for.\\n /// @param _courtID The ID of the court to set the stake for.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs were already transferred to/from the staking contract.\\n /// @param _onError Whether to revert or return false on error.\\n /// @return Whether the stake was successfully set or not.\\n function _setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred,\\n OnError _onError\\n ) internal returns (bool) {\\n if (_courtID == Constants.FORKING_COURT || _courtID > courts.length) {\\n _stakingFailed(_onError); // Staking directly into the forking court is not allowed.\\n return false;\\n }\\n if (_newStake != 0 && _newStake < courts[_courtID].minStake) {\\n _stakingFailed(_onError); // Staking less than the minimum stake is not allowed.\\n return false;\\n }\\n (uint256 pnkDeposit, uint256 pnkWithdrawal, bool sortitionSuccess) = sortitionModule.setStake(\\n _account,\\n _courtID,\\n _newStake,\\n _alreadyTransferred\\n );\\n if (!sortitionSuccess) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n if (pnkDeposit > 0) {\\n if (!pinakion.safeTransferFrom(_account, address(this), pnkDeposit)) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n }\\n if (pnkWithdrawal > 0) {\\n if (!pinakion.safeTransfer(_account, pnkWithdrawal)) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @dev It may revert depending on the _onError parameter.\\n function _stakingFailed(OnError _onError) internal pure {\\n if (_onError == OnError.Return) return;\\n revert StakingFailed();\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == Constants.FORKING_COURT || courtID >= courts.length) {\\n courtID = Constants.GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = Constants.DEFAULT_NB_OF_JURORS;\\n }\\n if (disputeKitID == Constants.NULL_DISPUTE_KIT || disputeKitID >= disputeKits.length) {\\n disputeKitID = Constants.DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = Constants.GENERAL_COURT;\\n minJurors = Constants.DEFAULT_NB_OF_JURORS;\\n disputeKitID = Constants.DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error DisputeKitOnly();\\n error SortitionModuleOnly();\\n error UnsuccessfulCall();\\n error InvalidDisputKitParent();\\n error DepthLevelMax();\\n error MinStakeLowerThanParentCourt();\\n error UnsupportedDisputeKit();\\n error InvalidForkingCourtAsParent();\\n error WrongDisputeKitIndex();\\n error CannotDisableClassicDK();\\n error ArraysLengthMismatch();\\n error StakingFailed();\\n error ArbitrationFeesNotEnough();\\n error DisputeKitNotSupportedByCourt();\\n error MustSupportDisputeKitClassic();\\n error TokenNotAccepted();\\n error EvidenceNotPassedAndNotAppeal();\\n error DisputeStillDrawing();\\n error CommitPeriodNotPassed();\\n error VotePeriodNotPassed();\\n error AppealPeriodNotPassed();\\n error NotEvidencePeriod();\\n error AppealFeesNotEnough();\\n error DisputeNotAppealable();\\n error NotExecutionPeriod();\\n error RulingAlreadyExecuted();\\n error DisputePeriodIsFinal();\\n error TransferFailed();\\n}\\n\",\"keccak256\":\"0x43205bc90f6965b5c1380effd2c29994f6dfea074696e39d5df037343a768d6b\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _juror Address of the juror.\\n /// @param _voteIDs The identifiers of the votes in the dispute.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event VoteCast(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256[] _voteIDs,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _nonce Nonce.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID, uint256 _nonce) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0x7fe6b1d9b991cc327cc5895f34208a7b1e3b6ebf8efb20fcb9f3ff0f40d2d209\",\"license\":\"MIT\"},\"src/arbitration/interfaces/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external returns (uint256 pnkDeposit, uint256 pnkWithdrawal, bool succeeded);\\n\\n function setJurorInactive(address _account) external;\\n\\n function lockStake(address _account, uint256 _relativeAmount) external;\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external;\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _nonce) external view returns (address);\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts);\\n\\n function getJurorCourtIDs(address _juror) external view returns (uint96[] memory);\\n\\n function isJurorStaked(address _juror) external view returns (bool);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0xa6d79053edfe04f7d3c8ad9b9ce3f182e45f2f74be40a77a304a93168549c474\",\"license\":\"MIT\"},\"src/libraries/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title Constants\\nlibrary Constants {\\n // Courts\\n uint96 public constant FORKING_COURT = 0; // Index of the forking court.\\n uint96 public constant GENERAL_COURT = 1; // Index of the default (general) court.\\n\\n // Dispute Kits\\n uint256 public constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\n uint256 public constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n\\n // Defaults\\n uint256 public constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute.\\n IERC20 public constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1.\\n}\\n\",\"keccak256\":\"0xde8fd28a18669261b052aebb00bf09ec592bb9298fa5efc76ca8606e0c7dbb25\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"},\"src/libraries/Types.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nenum OnError {\\n Revert,\\n Return\\n}\\n\",\"keccak256\":\"0xc7deebd8227dfaa46a36ae8d2c24fe1b5d5c776ab963b44943829ab4058b5701\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000d9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff1615620000765760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b0390811614620000d65780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6080516154fb62000103600039600081816115020152818161152b015261172101526154fb6000f3fe6080604052600436106102665760003560e01c80638bb0487511610144578063d07368bd116100b6578063f6506db41161007a578063f6506db414610811578063f7434ea914610831578063fbb519e714610851578063fbf405b014610871578063fc6f8f1614610891578063fe524c39146108b157600080fd5b8063d07368bd1461077c578063d2b8035a1461079c578063d4d1d76a146107bc578063d98493f6146107d1578063e4c0aaf4146107f157600080fd5b8063b004963711610108578063b0049637146106d6578063c13517e1146106f6578063c258bb1914610709578063c356990214610729578063c71f42531461073c578063cf0c38f81461075c57600080fd5b80638bb0487514610621578063994b27af14610641578063a072b86c14610661578063acdbf51d14610681578063afe15cfb146106a157600080fd5b80633cfd1184116101dd578063751accd0116101a1578063751accd0146105545780637717a6e8146105745780637934c0be1461059457806382d02237146105b457806386541b24146105d45780638a9bb02a146105f457600080fd5b80633cfd1184146104ae5780634f1ef286146104db57806352d1902d146104ee578063564a565d1461050357806359ec827e1461053457600080fd5b80631860592b1161022f5780631860592b1461037257806319b81529146103a05780631c3db16d146103d05780631f5a0dd21461040d5780632d29a47b1461046e5780632e1daf2f1461048e57600080fd5b8062f5822c1461026b5780630219da791461028d5780630b7414bc146103055780630c340a2414610325578063115d537614610352575b600080fd5b34801561027757600080fd5b5061028b61028636600461467f565b6108d1565b005b34801561029957600080fd5b506102d86102a836600461467f565b60076020526000908152604090205460ff808216916001600160401b0361010082041691600160481b9091041683565b6040805193151584526001600160401b03909216602084015260ff16908201526060015b60405180910390f35b34801561031157600080fd5b5061028b610320366004614787565b61091e565b34801561033157600080fd5b50600054610345906001600160a01b031681565b6040516102fc91906147e8565b34801561035e57600080fd5b5061028b61036d3660046147fc565b610a5f565b34801561037e57600080fd5b5061039261038d366004614815565b610f91565b6040519081526020016102fc565b3480156103ac57600080fd5b506103c06103bb3660046147fc565b610feb565b60405190151581526020016102fc565b3480156103dc57600080fd5b506103f06103eb3660046147fc565b6110e4565b6040805193845291151560208401521515908201526060016102fc565b34801561041957600080fd5b5061042d6104283660046147fc565b6111e5565b604080516001600160601b0390981688529515156020880152948601939093526060850191909152608084015260a0830152151560c082015260e0016102fc565b34801561047a57600080fd5b5061028b610489366004614841565b611244565b34801561049a57600080fd5b50600354610345906001600160a01b031681565b3480156104ba57600080fd5b506104ce6104c936600461486d565b611484565b6040516102fc91906148ab565b61028b6104e9366004614928565b6114ee565b3480156104fa57600080fd5b50610392611714565b34801561050f57600080fd5b5061052361051e3660046147fc565b611772565b6040516102fc9594939291906149af565b34801561054057600080fd5b5061039261054f3660046147fc565b6117ce565b34801561056057600080fd5b5061028b61056f3660046149ee565b611923565b34801561058057600080fd5b5061028b61058f366004614a46565b6119cd565b3480156105a057600080fd5b5061028b6105af366004614a62565b6119db565b3480156105c057600080fd5b5061028b6105cf366004614a9b565b611a5a565b3480156105e057600080fd5b5061028b6105ef366004614b5a565b611b17565b34801561060057600080fd5b5061061461060f366004614bc8565b611cfe565b6040516102fc9190614c2e565b34801561062d57600080fd5b5061028b61063c3660046147fc565b611e8a565b34801561064d57600080fd5b5061028b61065c366004614cd3565b611fee565b34801561066d57600080fd5b5061028b61067c366004614da7565b6123a8565b34801561068d57600080fd5b5061034561069c3660046147fc565b61271a565b3480156106ad57600080fd5b506106c16106bc3660046147fc565b612744565b604080519283526020830191909152016102fc565b3480156106e257600080fd5b5061028b6106f136600461467f565b6127f0565b610392610704366004614e67565b61283d565b34801561071557600080fd5b5061028b61072436600461467f565b612875565b61028b610737366004614e97565b6128c2565b34801561074857600080fd5b506103926107573660046147fc565b612d96565b34801561076857600080fd5b50600254610345906001600160a01b031681565b34801561078857600080fd5b5061028b61079736600461467f565b612dfe565b3480156107a857600080fd5b5061028b6107b7366004614bc8565b612ea7565b3480156107c857600080fd5b50600554610392565b3480156107dd57600080fd5b506103926107ec366004614f18565b6131be565b3480156107fd57600080fd5b5061028b61080c36600461467f565b61320b565b34801561081d57600080fd5b5061039261082c366004614f63565b613258565b34801561083d57600080fd5b5061039261084c366004614fc9565b61333e565b34801561085d57600080fd5b5061028b61086c366004614ffd565b61338a565b34801561087d57600080fd5b50600154610345906001600160a01b031681565b34801561089d57600080fd5b506103926108ac3660046147fc565b6133ca565b3480156108bd57600080fd5b506103c06108cc366004614a46565b6133f9565b6000546001600160a01b031633146108fc5760405163c383977560e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146109495760405163c383977560e01b815260040160405180910390fd5b60005b8251811015610a595781156109e85782818151811061096d5761096d61504e565b6020026020010151600014806109a0575060055483518490839081106109955761099561504e565b602002602001015110155b156109be57604051633d58a98960e11b815260040160405180910390fd5b6109e3848483815181106109d4576109d461504e565b60200260200101516001613441565b610a47565b60018382815181106109fc576109fc61504e565b602002602001015103610a22576040516356d111fd60e11b815260040160405180910390fd5b610a4784848381518110610a3857610a3861504e565b60200260200101516000613441565b80610a518161507a565b91505061094c565b50505050565b600060068281548110610a7457610a7461504e565b600091825260208220600491820201805482549194506001600160601b0316908110610aa257610aa261504e565b6000918252602082206003850154600c909202019250610ac490600190615093565b90506000836003018281548110610add57610add61504e565b600091825260208220600b909102019150600185015460ff166004811115610b0757610b07614977565b03610be25781158015610b5657506001840154600684019060ff166004811115610b3357610b33614977565b60048110610b4357610b4361504e565b01546002850154610b549042615093565b105b15610b7457604051633e9727df60e01b815260040160405180910390fd5b6003810154600682015414610b9c576040516309e4486b60e41b815260040160405180910390fd5b8254600160601b900460ff16610bb3576002610bb6565b60015b60018086018054909160ff1990911690836004811115610bd857610bd8614977565b0217905550610f43565b60018085015460ff166004811115610bfc57610bfc614977565b03610d0c576001840154600684019060ff166004811115610c1f57610c1f614977565b60048110610c2f57610c2f61504e565b01546002850154610c409042615093565b108015610cd757506005816000015481548110610c5f57610c5f61504e565b600091825260209091200154604051630baa64d160e01b8152600481018790526001600160a01b0390911690630baa64d190602401602060405180830381865afa158015610cb1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd591906150a6565b155b15610cf557604051634dfa578560e11b815260040160405180910390fd5b6001808501805460029260ff199091169083610bd8565b6002600185015460ff166004811115610d2757610d27614977565b03610e75576001840154600684019060ff166004811115610d4a57610d4a614977565b60048110610d5a57610d5a61504e565b01546002850154610d6b9042615093565b108015610e0257506005816000015481548110610d8a57610d8a61504e565b6000918252602090912001546040516336a66c7560e11b8152600481018790526001600160a01b0390911690636d4cd8ea90602401602060405180830381865afa158015610ddc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0091906150a6565b155b15610e2057604051631988dead60e31b815260040160405180910390fd5b600184018054600360ff199091161790558354604051600160601b9091046001600160a01b03169086907fa5d41b970d849372be1da1481ffd78d162bfe57a7aa2fe4e5fb73481fa5ac24f90600090a3610f43565b6003600185015460ff166004811115610e9057610e90614977565b03610f0a576001840154600684019060ff166004811115610eb357610eb3614977565b60048110610ec357610ec361504e565b01546002850154610ed49042615093565b1015610ef357604051632f4dfd8760e01b815260040160405180910390fd5b6001808501805460049260ff199091169083610bd8565b6004600185015460ff166004811115610f2557610f25614977565b03610f43576040516307f38c8f60e11b815260040160405180910390fd5b426002850155600184015460405186917f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b9191610f829160ff16906150c3565b60405180910390a25050505050565b6001600160a01b03821660009081526007602052604081205461010081046001600160401b031690610fce90600160481b900460ff16600a6151b5565b610fd890846151c4565b610fe291906151f1565b90505b92915050565b600080600683815481106110015761100161504e565b600091825260208220600360049092020190810180549193509061102790600190615093565b815481106110375761103761504e565b600091825260208220845460048054600b909402909201945090916001600160601b0390911690811061106c5761106c61504e565b90600052602060002090600c0201905080600501548260030154101561109757506000949350505050565b80546004805490916001600160601b03169081106110b7576110b761504e565b6000918252602080832094548352600a600c9092029094010190925250604090205460ff16159392505050565b600080600080600685815481106110fd576110fd61504e565b600091825260208220600360049092020190810180549193509061112390600190615093565b815481106111335761113361504e565b90600052602060002090600b020190506000600582600001548154811061115c5761115c61504e565b600091825260209091200154604051631c3db16d60e01b8152600481018990526001600160a01b0390911691508190631c3db16d90602401606060405180830381865afa1580156111b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d59190615205565b9199909850909650945050505050565b600481815481106111f557600080fd5b60009182526020909120600c9091020180546002820154600383015460048401546005850154600b909501546001600160601b038516965060ff600160601b9095048516959394929391921687565b6000600684815481106112595761125961504e565b600091825260209091206004918202019150600182015460ff16600481111561128457611284614977565b146112a257604051638794ce4b60e01b815260040160405180910390fd5b60008160030184815481106112b9576112b961504e565b90600052602060002090600b02019050600060058260000154815481106112e2576112e261504e565b600091825260208220015460048401546001600160a01b0390911692509061130a868361523d565b6005850154600686015460405163368efae360e21b8152600481018c9052602481018b905292935090916000906001600160a01b0387169063da3beb8c90604401602060405180830381865afa158015611368573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138c9190615250565b9050806000036113a757818411156113a2578193505b6113c7565b6113b28260026151c4565b8411156113c7576113c48260026151c4565b93505b60048701849055845b84811015611463578281101561141c576114156040518060c001604052808e81526020018d8152602001848152602001858152602001868152602001838152506134c9565b9350611451565b6114516040518060c001604052808e81526020018d815260200184815260200185815260200186815260200183815250613986565b8061145b8161507a565b9150506113d0565b508287600501541461147757600587018390555b5050505050505050505050565b61148c6145bf565b6004826001600160601b0316815481106114a8576114a861504e565b6000918252602090912060408051608081019182905292600c029091016006019060049082845b8154815260200190600101908083116114cf5750505050509050919050565b6114f782613ea9565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061157557507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166115696000805160206154a68339815191525490565b6001600160a01b031614155b156115935760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156115ed575060408051601f3d908101601f191682019092526115ea91810190615250565b60015b6116155781604051630c76093760e01b815260040161160c91906147e8565b60405180910390fd5b6000805160206154a6833981519152811461164657604051632a87526960e21b81526004810182905260240161160c565b6000805160206154a68339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a281511561170f576000836001600160a01b0316836040516116ad919061528d565b600060405180830381855af49150503d80600081146116e8576040519150601f19603f3d011682016040523d82523d6000602084013e6116ed565b606091505b5050905080610a59576040516339b21b5d60e11b815260040160405180910390fd5b505050565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461175f5760405163703e46dd60e11b815260040160405180910390fd5b506000805160206154a683398151915290565b6006818154811061178257600080fd5b60009182526020909120600490910201805460018201546002909201546001600160601b0382169350600160601b9091046001600160a01b03169160ff80821692610100909204169085565b600080600683815481106117e4576117e461504e565b600091825260208220600360049092020190810180549193509061180a90600190615093565b8154811061181a5761181a61504e565b600091825260208220845460048054600b909402909201945090916001600160601b0390911690811061184f5761184f61504e565b90600052602060002090600c0201905080600501548260030154106118ee5782546001600160601b031660001901611890576001600160ff1b03935061191b565b60038201546118a09060026151c4565b6118ab90600161523d565b81546004805490916001600160601b03169081106118cb576118cb61504e565b90600052602060002090600c0201600401546118e791906151c4565b935061191b565b60038201546118fe9060026151c4565b61190990600161523d565b816004015461191891906151c4565b93505b505050919050565b6000546001600160a01b0316331461194e5760405163c383977560e01b815260040160405180910390fd5b6000836001600160a01b03168383604051611969919061528d565b60006040518083038185875af1925050503d80600081146119a6576040519150601f19603f3d011682016040523d82523d6000602084013e6119ab565b606091505b5050905080610a59576040516322092f2f60e11b815260040160405180910390fd5b61170f338383600080613ed7565b6000546001600160a01b03163314611a065760405163c383977560e01b815260040160405180910390fd5b6001600160a01b038216600081815260076020526040808220805460ff191685151590811790915590519092917f541615e167511d757a7067a700eb54431b256bb458dfdce0ac58bf2ed0aefd4491a35050565b6000546001600160a01b03163314611a855760405163c383977560e01b815260040160405180910390fd5b6001600160a01b038316600081815260076020908152604091829020805469ffffffffffffffffff0019166101006001600160401b03881690810260ff60481b191691909117600160481b60ff8816908102919091179092558351908152918201527fe6996b7f03e9bd02228b99d3d946932e3197f505f60542c4cfbc919441d8a4e6910160405180910390a2505050565b6000546001600160a01b03163314611b425760405163c383977560e01b815260040160405180910390fd5b60006004886001600160601b031681548110611b6057611b6061504e565b90600052602060002090600c0201905060016001600160601b0316886001600160601b031614158015611bc2575080546004805488926001600160601b0316908110611bae57611bae61504e565b90600052602060002090600c020160020154115b15611be057604051639717078960e01b815260040160405180910390fd5b60005b6001820154811015611c6557866004836001018381548110611c0757611c0761504e565b906000526020600020015481548110611c2257611c2261504e565b90600052602060002090600c0201600201541015611c5357604051639717078960e01b815260040160405180910390fd5b80611c5d8161507a565b915050611be3565b5060028101869055805460ff60601b1916600160601b8815150217815560038101859055600480820185905560058201849055611ca890600683019084906145dd565b50876001600160601b03167f709b1f5fda58af9a4f52dacd1ec404840a8148455700cce155a2bd8cf127ef1a888888888888604051611cec969594939291906152a9565b60405180910390a25050505050505050565b611d6460405180610160016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160608152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b60068381548110611d7757611d7761504e565b90600052602060002090600402016003018281548110611d9957611d9961504e565b90600052602060002090600b02016040518061016001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482015481526020016005820154815260200160068201805480602002602001604051908101604052809291908181526020018280548015611e4857602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611e2a575b5050509183525050600782015460208201526008820154604082015260098201546001600160a01b03166060820152600a909101546080909101529392505050565b600060068281548110611e9f57611e9f61504e565b600091825260209091206004918202019150600182015460ff166004811115611eca57611eca614977565b14611ee857604051638794ce4b60e01b815260040160405180910390fd5b6001810154610100900460ff1615611f135760405163c977f8d360e01b815260040160405180910390fd5b6000611f1e836110e4565b505060018301805461010061ff001990911617905582546040518281529192508491600160601b9091046001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a3815460405163188d362b60e11b81526004810185905260248101839052600160601b9091046001600160a01b03169063311a6c5690604401600060405180830381600087803b158015611fd157600080fd5b505af1158015611fe5573d6000803e3d6000fd5b50505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff1680612037575080546001600160401b03808416911610155b156120545760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b03831617600160401b178155600080546001600160a01b03808e166001600160a01b0319928316178355600180548e8316908416178155600280548e8416908516178155600380548985169086161790556005805481875291820190557f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db1018054928d1692909316821790925560405190927f44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb291a360048054600101815560008181526003546040516311de995760e21b81526001600160a01b039091169263477a655c9261215c929091899101615308565b600060405180830381600087803b15801561217657600080fd5b505af115801561218a573d6000803e3d6000fd5b5050600480546001810182556000918252600c027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160601b0319168155604080518381526020810190915290935091505080516121f891600184019160209091019061461b565b50805460ff60601b1916600160601b89151502178155865160028201556020870151600382015560408701516004808301919091556060880151600583015561224790600683019088906145dd565b506003546040516311de995760e21b81526001600160a01b039091169063477a655c9061227b906001908990600401615308565b600060405180830381600087803b15801561229557600080fd5b505af11580156122a9573d6000803e3d6000fd5b505082546001600160601b03169150600190507f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d8a8a600060200201518b600160200201518c600260200201518d600360200201518d600060405190808252806020026020018201604052801561232a578160200160208202803683370190505b5060405161233e9796959493929190615321565b60405180910390a36123536001806001613441565b50805460ff60401b191681556040516001600160401b03831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050505050505050565b6000546001600160a01b031633146123d35760405163c383977560e01b815260040160405180910390fd5b8660048a6001600160601b0316815481106123f0576123f061504e565b90600052602060002090600c020160020154111561242157604051639717078960e01b815260040160405180910390fd5b80516000036124435760405163402585f560e01b815260040160405180910390fd5b6001600160601b03891661246a57604051631ef4f64960e01b815260040160405180910390fd5b60048054600181018255600091825290600c82027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01905b8351811015612568578381815181106124bd576124bd61504e565b6020026020010151600014806124f0575060055484518590839081106124e5576124e561504e565b602002602001015110155b1561250e57604051633d58a98960e11b815260040160405180910390fd5b600182600a0160008684815181106125285761252861504e565b6020026020010151815260200190815260200160002060006101000a81548160ff02191690831515021790555080806125609061507a565b9150506124a2565b5060016000908152600a8201602052604090205460ff1661259c576040516306351b3d60e31b815260040160405180910390fd5b80546001600160601b0319166001600160601b038c1617815560408051600081526020810191829052516125d491600184019161461b565b50805460ff60601b1916600160601b8b151502178155600281018990556003810188905560048082018890556005820187905561261790600683019087906145dd565b506003546040516311de995760e21b81526001600160a01b039091169063477a655c9061264a9085908890600401615308565b600060405180830381600087803b15801561266457600080fd5b505af1158015612678573d6000803e3d6000fd5b5050505060048b6001600160601b0316815481106126985761269861504e565b600091825260208083206001600c909302018201805492830181558352909120018290556040516001600160601b038c169083907f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d90612705908e908e908e908e908e908e908d90615321565b60405180910390a35050505050505050505050565b6005818154811061272a57600080fd5b6000918252602090912001546001600160a01b0316905081565b60008060006006848154811061275c5761275c61504e565b6000918252602090912060049091020190506003600182015460ff16600481111561278957612789614977565b036127e1576002810154815460048054929550916001600160601b039091169081106127b7576127b761504e565b600091825260209091206009600c90920201015460028201546127da919061523d565b91506127ea565b60009250600091505b50915091565b6000546001600160a01b0316331461281b5760405163c383977560e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b60006128488261333e565b34101561286857604051630e3360f160e21b815260040160405180910390fd5b610fe28383600034614071565b6000546001600160a01b031633146128a05760405163c383977560e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6128cb836117ce565b3410156128eb57604051633191f8f160e01b815260040160405180910390fd5b6000600684815481106129005761290061504e565b6000918252602090912060049091020190506003600182015460ff16600481111561292d5761292d614977565b1461294b576040516337cdefcb60e21b815260040160405180910390fd5b6003810180546000919061296190600190615093565b815481106129715761297161504e565b90600052602060002090600b0201905060058160000154815481106129985761299861504e565b6000918252602090912001546001600160a01b031633146129cc5760405163065f245f60e01b815260040160405180910390fd5b8154815460038401805460018101825560009182526020909120600480546001600160601b0390951694600b9093029091019184908110612a0f57612a0f61504e565b90600052602060002090600c020160050154846003015410612b18576004836001600160601b031681548110612a4757612a4761504e565b60009182526020909120600c9091020154600480546001600160601b0390921694509084908110612a7a57612a7a61504e565b60009182526020808320858452600a600c90930201919091019052604090205460ff16612aa657600191505b84546001600160601b03848116911614612b1857845460038601546001600160601b0390911690612ad990600190615093565b6040516001600160601b03861681528a907f736e3f52761298c8c0823e1ebf482ed3c5ecb304f743d2d91a7c006e8e8d7a1f9060200160405180910390a45b84546001600160601b0319166001600160601b038416908117865560018601805460ff1916905542600287015560048054600092908110612b5b57612b5b61504e565b90600052602060002090600c02019050806004015434612b7b91906151f1565b826003018190555061271081600301548260020154612b9a91906151c4565b612ba491906151f1565b60018084019190915534600284015583835560038054908801546001600160a01b039091169163d09f392d918c91612bdb91615093565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381600087803b158015612c1957600080fd5b505af1158015612c2d573d6000803e3d6000fd5b505086548454149150612d1390505784546003870154612c4f90600190615093565b83546040519081528b907fcbe7939a71f0b369c7471d760a0a99b60b7bb010ee0406cba8a46679d1ea77569060200160405180910390a46005826000015481548110612c9d57612c9d61504e565b60009182526020909120015460038301546040516302dbb79560e61b81526001600160a01b039092169163b6ede54091612ce0918d918d918d919060040161539e565b600060405180830381600087803b158015612cfa57600080fd5b505af1158015612d0e573d6000803e3d6000fd5b505050505b8554604051600160601b9091046001600160a01b0316908a907f9c9b64db9e130f48381bf697abf638e73117dbfbfd7a4484f2da3ba188f4187d90600090a3887f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b916000604051612d8391906150c3565b60405180910390a2505050505050505050565b60008060068381548110612dac57612dac61504e565b906000526020600020906004020190508060030160018260030180549050612dd49190615093565b81548110612de457612de461504e565b90600052602060002090600b020160030154915050919050565b6000546001600160a01b03163314612e295760405163c383977560e01b815260040160405180910390fd5b6005805460018101825560009182527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0810180546001600160a01b0319166001600160a01b0385169081179091556040519192909183917f44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb291a35050565b600060068381548110612ebc57612ebc61504e565b90600052602060002090600402019050600060018260030180549050612ee29190615093565b90506000826003018281548110612efb57612efb61504e565b600091825260208220600b909102019150600184015460ff166004811115612f2557612f25614977565b14612f4357604051638285c4ef60e01b815260040160405180910390fd5b60006005826000015481548110612f5c57612f5c61504e565b6000918252602082200154600a8401546001600160a01b039091169250905b8681108015612f91575060038401546006850154105b1561319b5760006001600160a01b03841663d2b8035a8a84612fb28161507a565b9550612fbe908761523d565b6040516001600160e01b031960e085901b168152600481019290925260248201526044016020604051808303816000875af1158015613001573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061302591906153ce565b90506001600160a01b03811661303b5750612f7b565b60035460018601546040516310f0b12f60e11b81526001600160a01b03909216916321e1625e91613071918591906004016153eb565b600060405180830381600087803b15801561308b57600080fd5b505af115801561309f573d6000803e3d6000fd5b50505060068601546040518b92506001600160a01b038416917f6119cf536152c11e0a9a6c22f3953ce4ecc93ee54fa72ffa326ffabded21509b916130ec918b8252602082015260400190565b60405180910390a36006850180546001810182556000828152602090200180546001600160a01b0319166001600160a01b038416179055600386015490540361319557600354604051632e96bc2360e11b8152600481018b9052602481018890526001600160a01b0390911690635d2d784690604401600060405180830381600087803b15801561317c57600080fd5b505af1158015613190573d6000803e3d6000fd5b505050505b50612f7b565b8084600a0160008282546131af919061523d565b90915550505050505050505050565b60006132038261038d86868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061333e92505050565b949350505050565b6000546001600160a01b031633146132365760405163c383977560e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03821660009081526007602052604081205460ff166132915760405163e51cf7bf60e01b815260040160405180910390fd5b61329c8585856131be565b8210156132bc57604051630e3360f160e21b815260040160405180910390fd5b6132d16001600160a01b03841633308561435a565b6132ee576040516312171d8360e31b815260040160405180910390fd5b6133328686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508892508791506140719050565b90505b95945050505050565b600080600061334c84614436565b5091509150806004836001600160601b03168154811061336e5761336e61504e565b90600052602060002090600c02016004015461320391906151c4565b6003546001600160a01b031633146133b557604051639d6cab9960e01b815260040160405180910390fd5b6133c3848484846001613ed7565b5050505050565b6000600682815481106133df576133df61504e565b600091825260209091206003600490920201015492915050565b60006004836001600160601b0316815481106134175761341761504e565b60009182526020808320948352600c91909102909301600a0190925250604090205460ff16919050565b806004846001600160601b03168154811061345e5761345e61504e565b60009182526020808320868452600c92909202909101600a0190526040808220805460ff19169315159390931790925590518215159184916001600160601b038716917fb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc7991a4505050565b60008060068360000151815481106134e3576134e361504e565b9060005260206000209060040201905060008160030184602001518154811061350e5761350e61504e565b90600052602060002090600b02019050600060058260000154815481106135375761353761504e565b60009182526020808320919091015487519188015160a0890151604051634fe264fb60e01b81526004810194909452602484019190915260448301526001600160a01b031692508290634fe264fb90606401602060405180830381865afa1580156135a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135ca9190615250565b90506127108111156135db57506127105b60006127106135ea8382615093565b85600101546135f991906151c4565b61360391906151f1565b90508087608001818151613617919061523d565b90525060a08701516006850180546000929081106136375761363761504e565b60009182526020909120015460035460405163965af6c760e01b81526001600160a01b03928316935091169063965af6c79061367990849086906004016153eb565b600060405180830381600087803b15801561369357600080fd5b505af11580156136a7573d6000803e3d6000fd5b5050600354604051633c85b79360e21b81526001600160a01b03909116925063f216de4c91506136dd90849086906004016153eb565b600060405180830381600087803b1580156136f757600080fd5b505af115801561370b573d6000803e3d6000fd5b50505050602088015188516001600160a01b0383167f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e78661374b87615404565b60098b015460405161376d9392916000916001600160a01b0390911690615420565b60405180910390a48751602089015160a08a015160405163ba66fde760e01b81526004810193909352602483019190915260448201526001600160a01b0385169063ba66fde790606401602060405180830381865afa1580156137d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137f891906150a6565b61385f5760035460405163b5d69e9960e01b81526001600160a01b039091169063b5d69e999061382c9084906004016147e8565b600060405180830381600087803b15801561384657600080fd5b505af115801561385a573d6000803e3d6000fd5b505050505b600188606001516138709190615093565b8860a0015114801561388457506040880151155b156139755760098501546001600160a01b03166138cd576000805460028701546040516001600160a01b039092169281156108fc029290818181858888f19350505050506138f4565b600054600286015460098701546138f2926001600160a01b03918216929116906144bd565b505b6000546080890151600154613917926001600160a01b03918216929116906144bd565b506020880151885160808a0151600288015460098901546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf49361396c93909290916001600160a01b0390911690615444565b60405180910390a35b505050608090940151949350505050565b6000600682600001518154811061399f5761399f61504e565b906000526020600020906004020190506000816003018360200151815481106139ca576139ca61504e565b90600052602060002090600b02019050600060058260000154815481106139f3576139f361504e565b6000918252602080832090910154865191870151606088015160a08901516001600160a01b0390931695508593634fe264fb93909291613a3291615463565b6040516001600160e01b031960e086901b168152600481019390935260248301919091526044820152606401602060405180830381865afa158015613a7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a9f9190615250565b9050612710811115613ab057506127105b60008360060186606001518760a00151613aca9190615463565b81548110613ada57613ada61504e565b600091825260208220015460018601546001600160a01b03909116925061271090613b069085906151c4565b613b1091906151f1565b60035460405163965af6c760e01b81529192506001600160a01b03169063965af6c790613b4390859085906004016153eb565b600060405180830381600087803b158015613b5d57600080fd5b505af1158015613b71573d6000803e3d6000fd5b5050600354604051636624192f60e01b81526001600160a01b039091169250636624192f9150613ba59085906004016147e8565b602060405180830381865afa158015613bc2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613be691906150a6565b613c0357600154613c01906001600160a01b031683836144bd565b505b60006127108489604001518a60800151613c1d91906151f1565b613c2791906151c4565b613c3191906151f1565b905080866008016000828254613c47919061523d565b925050819055506000612710858a604001518960020154613c6891906151f1565b613c7291906151c4565b613c7c91906151f1565b905080876007016000828254613c92919061523d565b9091555050600154613cae906001600160a01b031685846144bd565b5060098701546001600160a01b0316613cec576040516001600160a01b0385169082156108fc029083906000818181858888f1935050505050613d07565b6009870154613d05906001600160a01b031685836144bd565b505b6020890151895160098901546040516001600160a01b03888116927f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e792613d57928c928a928a9290911690615420565b60405180910390a4600189606001516002613d7291906151c4565b613d7c9190615093565b8960a0015103613e9e57600087600801548a60800151613d9c9190615093565b9050600088600701548960020154613db49190615093565b905081151580613dc357508015155b15611477578115613ded57600054600154613deb916001600160a01b039182169116846144bd565b505b8015613e545760098901546001600160a01b0316613e3357600080546040516001600160a01b039091169183156108fc02918491818181858888f1935050505050613e54565b60005460098a0154613e52916001600160a01b039182169116836144bd565b505b60208b01518b5160098b01546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf49161270591879187916001600160a01b0390911690615444565b505050505050505050565b6000546001600160a01b03163314613ed45760405163c383977560e01b815260040160405180910390fd5b50565b60006001600160601b0385161580613ef957506004546001600160601b038616115b15613f0f57613f078261458a565b506000613335565b8315801590613f4a57506004856001600160601b031681548110613f3557613f3561504e565b90600052602060002090600c02016002015484105b15613f5857613f078261458a565b600354604051630a5861b960e41b81526001600160a01b0388811660048301526001600160601b0388166024830152604482018790528515156064830152600092839283929091169063a5861b90906084016060604051808303816000875af1158015613fc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fed9190615477565b9250925092508061400d576140018561458a565b60009350505050613335565b82156140385760015461402b906001600160a01b03168a308661435a565b614038576140018561458a565b811561406257600154614055906001600160a01b03168a846144bd565b614062576140018561458a565b50600198975050505050505050565b600080600061407f86614436565b92505091506004826001600160601b0316815481106140a0576140a061504e565b60009182526020808320848452600a600c90930201919091019052604090205460ff166140e05760405163b34eb75d60e01b815260040160405180910390fd5b600680546001810182556000918252600160601b33026001600160601b03851617600482027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f8101918255427ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d4190910155600580549296509092918490811061416b5761416b61504e565b60009182526020822001548354600480546001600160a01b039093169450916001600160601b039091169081106141a4576141a461504e565b60009182526020808320600387018054600181018255908552918420600c909302019350600b0201906001600160a01b038a16156141ef576141ea8a8460040154610f91565b6141f5565b82600401545b9050614201818a6151f1565b600380840191909155868355830154600284015461271091614222916151c4565b61422c91906151f1565b6001830155600282018990556009820180546001600160a01b0319166001600160a01b038c81169190911790915560035460405163d09f392d60e01b8152600481018b90526000602482015291169063d09f392d90604401600060405180830381600087803b15801561429e57600080fd5b505af11580156142b2573d6000803e3d6000fd5b50505050836001600160a01b031663b6ede540898e8e86600301546040518563ffffffff1660e01b81526004016142ec949392919061539e565b600060405180830381600087803b15801561430657600080fd5b505af115801561431a573d6000803e3d6000fd5b50506040513392508a91507f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a350505050505050949350505050565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b179052516143bf919061528d565b6000604051808303816000865af19150503d80600081146143fc576040519150601f19603f3d011682016040523d82523d6000602084013e614401565b606091505b509150915081801561442b57508051158061442b57508080602001905181019061442b91906150a6565b979650505050505050565b600080600060408451106144ab575050506020810151604082015160608301516001600160601b038316158061447757506004546001600160601b03841610155b1561448157600192505b8160000361448e57600391505b80158061449d57506005548110155b156144a6575060015b6144b6565b506001915060039050815b9193909250565b6000806000856001600160a01b031685856040516024016144df9291906153eb565b60408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b17905251614514919061528d565b6000604051808303816000865af19150503d8060008114614551576040519150601f19603f3d011682016040523d82523d6000602084013e614556565b606091505b509150915081801561458057508051158061458057508080602001905181019061458091906150a6565b9695505050505050565b600181600181111561459e5761459e614977565b036145a65750565b60405163a437293760e01b815260040160405180910390fd5b60405180608001604052806004906020820280368337509192915050565b826004810192821561460b579160200282015b8281111561460b5782518255916020019190600101906145f0565b50614617929150614655565b5090565b82805482825590600052602060002090810192821561460b579160200282018281111561460b5782518255916020019190600101906145f0565b5b808211156146175760008155600101614656565b6001600160a01b0381168114613ed457600080fd5b60006020828403121561469157600080fd5b813561469c8161466a565b9392505050565b80356001600160601b03811681146146ba57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156146fd576146fd6146bf565b604052919050565b600082601f83011261471657600080fd5b813560206001600160401b03821115614731576147316146bf565b8160051b6147408282016146d5565b928352848101820192828101908785111561475a57600080fd5b83870192505b8483101561442b57823582529183019190830190614760565b8015158114613ed457600080fd5b60008060006060848603121561479c57600080fd5b6147a5846146a3565b925060208401356001600160401b038111156147c057600080fd5b6147cc86828701614705565b92505060408401356147dd81614779565b809150509250925092565b6001600160a01b0391909116815260200190565b60006020828403121561480e57600080fd5b5035919050565b6000806040838503121561482857600080fd5b82356148338161466a565b946020939093013593505050565b60008060006060848603121561485657600080fd5b505081359360208301359350604090920135919050565b60006020828403121561487f57600080fd5b610fe2826146a3565b8060005b6004811015610a5957815184526020938401939091019060010161488c565b60808101610fe58284614888565b600082601f8301126148ca57600080fd5b81356001600160401b038111156148e3576148e36146bf565b6148f6601f8201601f19166020016146d5565b81815284602083860101111561490b57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561493b57600080fd5b82356149468161466a565b915060208301356001600160401b0381111561496157600080fd5b61496d858286016148b9565b9150509250929050565b634e487b7160e01b600052602160045260246000fd5b600581106149ab57634e487b7160e01b600052602160045260246000fd5b9052565b6001600160601b03861681526001600160a01b038516602082015260a081016149db604083018661498d565b9215156060820152608001529392505050565b600080600060608486031215614a0357600080fd5b8335614a0e8161466a565b92506020840135915060408401356001600160401b03811115614a3057600080fd5b614a3c868287016148b9565b9150509250925092565b60008060408385031215614a5957600080fd5b614833836146a3565b60008060408385031215614a7557600080fd5b8235614a808161466a565b91506020830135614a9081614779565b809150509250929050565b600080600060608486031215614ab057600080fd5b8335614abb8161466a565b925060208401356001600160401b0381168114614ad757600080fd5b9150604084013560ff811681146147dd57600080fd5b600082601f830112614afe57600080fd5b604051608081018181106001600160401b0382111715614b2057614b206146bf565b604052806080840185811115614b3557600080fd5b845b81811015614b4f578035835260209283019201614b37565b509195945050505050565b6000806000806000806000610140888a031215614b7657600080fd5b614b7f886146a3565b96506020880135614b8f81614779565b955060408801359450606088013593506080880135925060a08801359150614bba8960c08a01614aed565b905092959891949750929550565b60008060408385031215614bdb57600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b83811015614c235781516001600160a01b031687529582019590820190600101614bfe565b509495945050505050565b6020815281516020820152602082015160408201526040820151606082015260608201516080820152608082015160a082015260a082015160c0820152600060c08301516101608060e0850152614c89610180850183614bea565b60e08601516101008681019190915286015161012080870191909152860151909250610140614cc2818701836001600160a01b03169052565b959095015193019290925250919050565b60008060008060008060008060006101e08a8c031215614cf257600080fd5b8935614cfd8161466a565b985060208a0135614d0d8161466a565b975060408a0135614d1d8161466a565b965060608a0135614d2d8161466a565b955060808a0135614d3d81614779565b9450614d4c8b60a08c01614aed565b9350614d5c8b6101208c01614aed565b92506101a08a01356001600160401b03811115614d7857600080fd5b614d848c828d016148b9565b9250506101c08a0135614d968161466a565b809150509295985092959850929598565b60008060008060008060008060006101808a8c031215614dc657600080fd5b614dcf8a6146a3565b985060208a0135614ddf81614779565b975060408a0135965060608a0135955060808a0135945060a08a01359350614e0a8b60c08c01614aed565b92506101408a01356001600160401b0380821115614e2757600080fd5b614e338d838e016148b9565b93506101608c0135915080821115614e4a57600080fd5b50614e578c828d01614705565b9150509295985092959850929598565b60008060408385031215614e7a57600080fd5b8235915060208301356001600160401b0381111561496157600080fd5b600080600060608486031215614eac57600080fd5b833592506020840135915060408401356001600160401b03811115614a3057600080fd5b60008083601f840112614ee257600080fd5b5081356001600160401b03811115614ef957600080fd5b602083019150836020828501011115614f1157600080fd5b9250929050565b600080600060408486031215614f2d57600080fd5b83356001600160401b03811115614f4357600080fd5b614f4f86828701614ed0565b90945092505060208401356147dd8161466a565b600080600080600060808688031215614f7b57600080fd5b8535945060208601356001600160401b03811115614f9857600080fd5b614fa488828901614ed0565b9095509350506040860135614fb88161466a565b949793965091946060013592915050565b600060208284031215614fdb57600080fd5b81356001600160401b03811115614ff157600080fd5b613203848285016148b9565b6000806000806080858703121561501357600080fd5b843561501e8161466a565b935061502c602086016146a3565b925060408501359150606085013561504381614779565b939692955090935050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161508c5761508c615064565b5060010190565b81810381811115610fe557610fe5615064565b6000602082840312156150b857600080fd5b815161469c81614779565b60208101610fe5828461498d565b600181815b8085111561510c5781600019048211156150f2576150f2615064565b808516156150ff57918102915b93841c93908002906150d6565b509250929050565b60008261512357506001610fe5565b8161513057506000610fe5565b816001811461514657600281146151505761516c565b6001915050610fe5565b60ff84111561516157615161615064565b50506001821b610fe5565b5060208310610133831016604e8410600b841016171561518f575081810a610fe5565b61519983836150d1565b80600019048211156151ad576151ad615064565b029392505050565b6000610fe260ff841683615114565b8082028115828204841417610fe557610fe5615064565b634e487b7160e01b600052601260045260246000fd5b600082615200576152006151db565b500490565b60008060006060848603121561521a57600080fd5b83519250602084015161522c81614779565b60408501519092506147dd81614779565b80820180821115610fe557610fe5615064565b60006020828403121561526257600080fd5b5051919050565b60005b8381101561528457818101518382015260200161526c565b50506000910152565b6000825161529f818460208701615269565b9190910192915050565b600061012082019050871515825286602083015285604083015284606083015283608083015261442b60a0830184614888565b600081518084526152f4816020860160208601615269565b601f01601f19169290920160200192915050565b82815260406020820152600061320360408301846152dc565b60006101408083018a1515845260208a8186015289604086015288606086015287608086015261535460a0860188614888565b6101208501929092528451908190526101608401918086019160005b8181101561538c57835185529382019392820192600101615370565b50929c9b505050505050505050505050565b8481528360208201526080604082015260006153bd60808301856152dc565b905082606083015295945050505050565b6000602082840312156153e057600080fd5b815161469c8161466a565b6001600160a01b03929092168252602082015260400190565b6000600160ff1b820161541957615419615064565b5060000390565b938452602084019290925260408301526001600160a01b0316606082015260800190565b92835260208301919091526001600160a01b0316604082015260600190565b600082615472576154726151db565b500690565b60008060006060848603121561548c57600080fd5b835192506020840151915060408401516147dd8161477956fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122058616b04888240cc8d37ba1cf4119a0c7b9f8bb808137ebdb313ab46eaa623ad64736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106102665760003560e01c80638bb0487511610144578063d07368bd116100b6578063f6506db41161007a578063f6506db414610811578063f7434ea914610831578063fbb519e714610851578063fbf405b014610871578063fc6f8f1614610891578063fe524c39146108b157600080fd5b8063d07368bd1461077c578063d2b8035a1461079c578063d4d1d76a146107bc578063d98493f6146107d1578063e4c0aaf4146107f157600080fd5b8063b004963711610108578063b0049637146106d6578063c13517e1146106f6578063c258bb1914610709578063c356990214610729578063c71f42531461073c578063cf0c38f81461075c57600080fd5b80638bb0487514610621578063994b27af14610641578063a072b86c14610661578063acdbf51d14610681578063afe15cfb146106a157600080fd5b80633cfd1184116101dd578063751accd0116101a1578063751accd0146105545780637717a6e8146105745780637934c0be1461059457806382d02237146105b457806386541b24146105d45780638a9bb02a146105f457600080fd5b80633cfd1184146104ae5780634f1ef286146104db57806352d1902d146104ee578063564a565d1461050357806359ec827e1461053457600080fd5b80631860592b1161022f5780631860592b1461037257806319b81529146103a05780631c3db16d146103d05780631f5a0dd21461040d5780632d29a47b1461046e5780632e1daf2f1461048e57600080fd5b8062f5822c1461026b5780630219da791461028d5780630b7414bc146103055780630c340a2414610325578063115d537614610352575b600080fd5b34801561027757600080fd5b5061028b61028636600461467f565b6108d1565b005b34801561029957600080fd5b506102d86102a836600461467f565b60076020526000908152604090205460ff808216916001600160401b0361010082041691600160481b9091041683565b6040805193151584526001600160401b03909216602084015260ff16908201526060015b60405180910390f35b34801561031157600080fd5b5061028b610320366004614787565b61091e565b34801561033157600080fd5b50600054610345906001600160a01b031681565b6040516102fc91906147e8565b34801561035e57600080fd5b5061028b61036d3660046147fc565b610a5f565b34801561037e57600080fd5b5061039261038d366004614815565b610f91565b6040519081526020016102fc565b3480156103ac57600080fd5b506103c06103bb3660046147fc565b610feb565b60405190151581526020016102fc565b3480156103dc57600080fd5b506103f06103eb3660046147fc565b6110e4565b6040805193845291151560208401521515908201526060016102fc565b34801561041957600080fd5b5061042d6104283660046147fc565b6111e5565b604080516001600160601b0390981688529515156020880152948601939093526060850191909152608084015260a0830152151560c082015260e0016102fc565b34801561047a57600080fd5b5061028b610489366004614841565b611244565b34801561049a57600080fd5b50600354610345906001600160a01b031681565b3480156104ba57600080fd5b506104ce6104c936600461486d565b611484565b6040516102fc91906148ab565b61028b6104e9366004614928565b6114ee565b3480156104fa57600080fd5b50610392611714565b34801561050f57600080fd5b5061052361051e3660046147fc565b611772565b6040516102fc9594939291906149af565b34801561054057600080fd5b5061039261054f3660046147fc565b6117ce565b34801561056057600080fd5b5061028b61056f3660046149ee565b611923565b34801561058057600080fd5b5061028b61058f366004614a46565b6119cd565b3480156105a057600080fd5b5061028b6105af366004614a62565b6119db565b3480156105c057600080fd5b5061028b6105cf366004614a9b565b611a5a565b3480156105e057600080fd5b5061028b6105ef366004614b5a565b611b17565b34801561060057600080fd5b5061061461060f366004614bc8565b611cfe565b6040516102fc9190614c2e565b34801561062d57600080fd5b5061028b61063c3660046147fc565b611e8a565b34801561064d57600080fd5b5061028b61065c366004614cd3565b611fee565b34801561066d57600080fd5b5061028b61067c366004614da7565b6123a8565b34801561068d57600080fd5b5061034561069c3660046147fc565b61271a565b3480156106ad57600080fd5b506106c16106bc3660046147fc565b612744565b604080519283526020830191909152016102fc565b3480156106e257600080fd5b5061028b6106f136600461467f565b6127f0565b610392610704366004614e67565b61283d565b34801561071557600080fd5b5061028b61072436600461467f565b612875565b61028b610737366004614e97565b6128c2565b34801561074857600080fd5b506103926107573660046147fc565b612d96565b34801561076857600080fd5b50600254610345906001600160a01b031681565b34801561078857600080fd5b5061028b61079736600461467f565b612dfe565b3480156107a857600080fd5b5061028b6107b7366004614bc8565b612ea7565b3480156107c857600080fd5b50600554610392565b3480156107dd57600080fd5b506103926107ec366004614f18565b6131be565b3480156107fd57600080fd5b5061028b61080c36600461467f565b61320b565b34801561081d57600080fd5b5061039261082c366004614f63565b613258565b34801561083d57600080fd5b5061039261084c366004614fc9565b61333e565b34801561085d57600080fd5b5061028b61086c366004614ffd565b61338a565b34801561087d57600080fd5b50600154610345906001600160a01b031681565b34801561089d57600080fd5b506103926108ac3660046147fc565b6133ca565b3480156108bd57600080fd5b506103c06108cc366004614a46565b6133f9565b6000546001600160a01b031633146108fc5760405163c383977560e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146109495760405163c383977560e01b815260040160405180910390fd5b60005b8251811015610a595781156109e85782818151811061096d5761096d61504e565b6020026020010151600014806109a0575060055483518490839081106109955761099561504e565b602002602001015110155b156109be57604051633d58a98960e11b815260040160405180910390fd5b6109e3848483815181106109d4576109d461504e565b60200260200101516001613441565b610a47565b60018382815181106109fc576109fc61504e565b602002602001015103610a22576040516356d111fd60e11b815260040160405180910390fd5b610a4784848381518110610a3857610a3861504e565b60200260200101516000613441565b80610a518161507a565b91505061094c565b50505050565b600060068281548110610a7457610a7461504e565b600091825260208220600491820201805482549194506001600160601b0316908110610aa257610aa261504e565b6000918252602082206003850154600c909202019250610ac490600190615093565b90506000836003018281548110610add57610add61504e565b600091825260208220600b909102019150600185015460ff166004811115610b0757610b07614977565b03610be25781158015610b5657506001840154600684019060ff166004811115610b3357610b33614977565b60048110610b4357610b4361504e565b01546002850154610b549042615093565b105b15610b7457604051633e9727df60e01b815260040160405180910390fd5b6003810154600682015414610b9c576040516309e4486b60e41b815260040160405180910390fd5b8254600160601b900460ff16610bb3576002610bb6565b60015b60018086018054909160ff1990911690836004811115610bd857610bd8614977565b0217905550610f43565b60018085015460ff166004811115610bfc57610bfc614977565b03610d0c576001840154600684019060ff166004811115610c1f57610c1f614977565b60048110610c2f57610c2f61504e565b01546002850154610c409042615093565b108015610cd757506005816000015481548110610c5f57610c5f61504e565b600091825260209091200154604051630baa64d160e01b8152600481018790526001600160a01b0390911690630baa64d190602401602060405180830381865afa158015610cb1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd591906150a6565b155b15610cf557604051634dfa578560e11b815260040160405180910390fd5b6001808501805460029260ff199091169083610bd8565b6002600185015460ff166004811115610d2757610d27614977565b03610e75576001840154600684019060ff166004811115610d4a57610d4a614977565b60048110610d5a57610d5a61504e565b01546002850154610d6b9042615093565b108015610e0257506005816000015481548110610d8a57610d8a61504e565b6000918252602090912001546040516336a66c7560e11b8152600481018790526001600160a01b0390911690636d4cd8ea90602401602060405180830381865afa158015610ddc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0091906150a6565b155b15610e2057604051631988dead60e31b815260040160405180910390fd5b600184018054600360ff199091161790558354604051600160601b9091046001600160a01b03169086907fa5d41b970d849372be1da1481ffd78d162bfe57a7aa2fe4e5fb73481fa5ac24f90600090a3610f43565b6003600185015460ff166004811115610e9057610e90614977565b03610f0a576001840154600684019060ff166004811115610eb357610eb3614977565b60048110610ec357610ec361504e565b01546002850154610ed49042615093565b1015610ef357604051632f4dfd8760e01b815260040160405180910390fd5b6001808501805460049260ff199091169083610bd8565b6004600185015460ff166004811115610f2557610f25614977565b03610f43576040516307f38c8f60e11b815260040160405180910390fd5b426002850155600184015460405186917f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b9191610f829160ff16906150c3565b60405180910390a25050505050565b6001600160a01b03821660009081526007602052604081205461010081046001600160401b031690610fce90600160481b900460ff16600a6151b5565b610fd890846151c4565b610fe291906151f1565b90505b92915050565b600080600683815481106110015761100161504e565b600091825260208220600360049092020190810180549193509061102790600190615093565b815481106110375761103761504e565b600091825260208220845460048054600b909402909201945090916001600160601b0390911690811061106c5761106c61504e565b90600052602060002090600c0201905080600501548260030154101561109757506000949350505050565b80546004805490916001600160601b03169081106110b7576110b761504e565b6000918252602080832094548352600a600c9092029094010190925250604090205460ff16159392505050565b600080600080600685815481106110fd576110fd61504e565b600091825260208220600360049092020190810180549193509061112390600190615093565b815481106111335761113361504e565b90600052602060002090600b020190506000600582600001548154811061115c5761115c61504e565b600091825260209091200154604051631c3db16d60e01b8152600481018990526001600160a01b0390911691508190631c3db16d90602401606060405180830381865afa1580156111b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d59190615205565b9199909850909650945050505050565b600481815481106111f557600080fd5b60009182526020909120600c9091020180546002820154600383015460048401546005850154600b909501546001600160601b038516965060ff600160601b9095048516959394929391921687565b6000600684815481106112595761125961504e565b600091825260209091206004918202019150600182015460ff16600481111561128457611284614977565b146112a257604051638794ce4b60e01b815260040160405180910390fd5b60008160030184815481106112b9576112b961504e565b90600052602060002090600b02019050600060058260000154815481106112e2576112e261504e565b600091825260208220015460048401546001600160a01b0390911692509061130a868361523d565b6005850154600686015460405163368efae360e21b8152600481018c9052602481018b905292935090916000906001600160a01b0387169063da3beb8c90604401602060405180830381865afa158015611368573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138c9190615250565b9050806000036113a757818411156113a2578193505b6113c7565b6113b28260026151c4565b8411156113c7576113c48260026151c4565b93505b60048701849055845b84811015611463578281101561141c576114156040518060c001604052808e81526020018d8152602001848152602001858152602001868152602001838152506134c9565b9350611451565b6114516040518060c001604052808e81526020018d815260200184815260200185815260200186815260200183815250613986565b8061145b8161507a565b9150506113d0565b508287600501541461147757600587018390555b5050505050505050505050565b61148c6145bf565b6004826001600160601b0316815481106114a8576114a861504e565b6000918252602090912060408051608081019182905292600c029091016006019060049082845b8154815260200190600101908083116114cf5750505050509050919050565b6114f782613ea9565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061157557507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166115696000805160206154a68339815191525490565b6001600160a01b031614155b156115935760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156115ed575060408051601f3d908101601f191682019092526115ea91810190615250565b60015b6116155781604051630c76093760e01b815260040161160c91906147e8565b60405180910390fd5b6000805160206154a6833981519152811461164657604051632a87526960e21b81526004810182905260240161160c565b6000805160206154a68339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a281511561170f576000836001600160a01b0316836040516116ad919061528d565b600060405180830381855af49150503d80600081146116e8576040519150601f19603f3d011682016040523d82523d6000602084013e6116ed565b606091505b5050905080610a59576040516339b21b5d60e11b815260040160405180910390fd5b505050565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461175f5760405163703e46dd60e11b815260040160405180910390fd5b506000805160206154a683398151915290565b6006818154811061178257600080fd5b60009182526020909120600490910201805460018201546002909201546001600160601b0382169350600160601b9091046001600160a01b03169160ff80821692610100909204169085565b600080600683815481106117e4576117e461504e565b600091825260208220600360049092020190810180549193509061180a90600190615093565b8154811061181a5761181a61504e565b600091825260208220845460048054600b909402909201945090916001600160601b0390911690811061184f5761184f61504e565b90600052602060002090600c0201905080600501548260030154106118ee5782546001600160601b031660001901611890576001600160ff1b03935061191b565b60038201546118a09060026151c4565b6118ab90600161523d565b81546004805490916001600160601b03169081106118cb576118cb61504e565b90600052602060002090600c0201600401546118e791906151c4565b935061191b565b60038201546118fe9060026151c4565b61190990600161523d565b816004015461191891906151c4565b93505b505050919050565b6000546001600160a01b0316331461194e5760405163c383977560e01b815260040160405180910390fd5b6000836001600160a01b03168383604051611969919061528d565b60006040518083038185875af1925050503d80600081146119a6576040519150601f19603f3d011682016040523d82523d6000602084013e6119ab565b606091505b5050905080610a59576040516322092f2f60e11b815260040160405180910390fd5b61170f338383600080613ed7565b6000546001600160a01b03163314611a065760405163c383977560e01b815260040160405180910390fd5b6001600160a01b038216600081815260076020526040808220805460ff191685151590811790915590519092917f541615e167511d757a7067a700eb54431b256bb458dfdce0ac58bf2ed0aefd4491a35050565b6000546001600160a01b03163314611a855760405163c383977560e01b815260040160405180910390fd5b6001600160a01b038316600081815260076020908152604091829020805469ffffffffffffffffff0019166101006001600160401b03881690810260ff60481b191691909117600160481b60ff8816908102919091179092558351908152918201527fe6996b7f03e9bd02228b99d3d946932e3197f505f60542c4cfbc919441d8a4e6910160405180910390a2505050565b6000546001600160a01b03163314611b425760405163c383977560e01b815260040160405180910390fd5b60006004886001600160601b031681548110611b6057611b6061504e565b90600052602060002090600c0201905060016001600160601b0316886001600160601b031614158015611bc2575080546004805488926001600160601b0316908110611bae57611bae61504e565b90600052602060002090600c020160020154115b15611be057604051639717078960e01b815260040160405180910390fd5b60005b6001820154811015611c6557866004836001018381548110611c0757611c0761504e565b906000526020600020015481548110611c2257611c2261504e565b90600052602060002090600c0201600201541015611c5357604051639717078960e01b815260040160405180910390fd5b80611c5d8161507a565b915050611be3565b5060028101869055805460ff60601b1916600160601b8815150217815560038101859055600480820185905560058201849055611ca890600683019084906145dd565b50876001600160601b03167f709b1f5fda58af9a4f52dacd1ec404840a8148455700cce155a2bd8cf127ef1a888888888888604051611cec969594939291906152a9565b60405180910390a25050505050505050565b611d6460405180610160016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160608152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b60068381548110611d7757611d7761504e565b90600052602060002090600402016003018281548110611d9957611d9961504e565b90600052602060002090600b02016040518061016001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482015481526020016005820154815260200160068201805480602002602001604051908101604052809291908181526020018280548015611e4857602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611e2a575b5050509183525050600782015460208201526008820154604082015260098201546001600160a01b03166060820152600a909101546080909101529392505050565b600060068281548110611e9f57611e9f61504e565b600091825260209091206004918202019150600182015460ff166004811115611eca57611eca614977565b14611ee857604051638794ce4b60e01b815260040160405180910390fd5b6001810154610100900460ff1615611f135760405163c977f8d360e01b815260040160405180910390fd5b6000611f1e836110e4565b505060018301805461010061ff001990911617905582546040518281529192508491600160601b9091046001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a3815460405163188d362b60e11b81526004810185905260248101839052600160601b9091046001600160a01b03169063311a6c5690604401600060405180830381600087803b158015611fd157600080fd5b505af1158015611fe5573d6000803e3d6000fd5b50505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff1680612037575080546001600160401b03808416911610155b156120545760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b03831617600160401b178155600080546001600160a01b03808e166001600160a01b0319928316178355600180548e8316908416178155600280548e8416908516178155600380548985169086161790556005805481875291820190557f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db1018054928d1692909316821790925560405190927f44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb291a360048054600101815560008181526003546040516311de995760e21b81526001600160a01b039091169263477a655c9261215c929091899101615308565b600060405180830381600087803b15801561217657600080fd5b505af115801561218a573d6000803e3d6000fd5b5050600480546001810182556000918252600c027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160601b0319168155604080518381526020810190915290935091505080516121f891600184019160209091019061461b565b50805460ff60601b1916600160601b89151502178155865160028201556020870151600382015560408701516004808301919091556060880151600583015561224790600683019088906145dd565b506003546040516311de995760e21b81526001600160a01b039091169063477a655c9061227b906001908990600401615308565b600060405180830381600087803b15801561229557600080fd5b505af11580156122a9573d6000803e3d6000fd5b505082546001600160601b03169150600190507f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d8a8a600060200201518b600160200201518c600260200201518d600360200201518d600060405190808252806020026020018201604052801561232a578160200160208202803683370190505b5060405161233e9796959493929190615321565b60405180910390a36123536001806001613441565b50805460ff60401b191681556040516001600160401b03831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050505050505050565b6000546001600160a01b031633146123d35760405163c383977560e01b815260040160405180910390fd5b8660048a6001600160601b0316815481106123f0576123f061504e565b90600052602060002090600c020160020154111561242157604051639717078960e01b815260040160405180910390fd5b80516000036124435760405163402585f560e01b815260040160405180910390fd5b6001600160601b03891661246a57604051631ef4f64960e01b815260040160405180910390fd5b60048054600181018255600091825290600c82027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01905b8351811015612568578381815181106124bd576124bd61504e565b6020026020010151600014806124f0575060055484518590839081106124e5576124e561504e565b602002602001015110155b1561250e57604051633d58a98960e11b815260040160405180910390fd5b600182600a0160008684815181106125285761252861504e565b6020026020010151815260200190815260200160002060006101000a81548160ff02191690831515021790555080806125609061507a565b9150506124a2565b5060016000908152600a8201602052604090205460ff1661259c576040516306351b3d60e31b815260040160405180910390fd5b80546001600160601b0319166001600160601b038c1617815560408051600081526020810191829052516125d491600184019161461b565b50805460ff60601b1916600160601b8b151502178155600281018990556003810188905560048082018890556005820187905561261790600683019087906145dd565b506003546040516311de995760e21b81526001600160a01b039091169063477a655c9061264a9085908890600401615308565b600060405180830381600087803b15801561266457600080fd5b505af1158015612678573d6000803e3d6000fd5b5050505060048b6001600160601b0316815481106126985761269861504e565b600091825260208083206001600c909302018201805492830181558352909120018290556040516001600160601b038c169083907f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d90612705908e908e908e908e908e908e908d90615321565b60405180910390a35050505050505050505050565b6005818154811061272a57600080fd5b6000918252602090912001546001600160a01b0316905081565b60008060006006848154811061275c5761275c61504e565b6000918252602090912060049091020190506003600182015460ff16600481111561278957612789614977565b036127e1576002810154815460048054929550916001600160601b039091169081106127b7576127b761504e565b600091825260209091206009600c90920201015460028201546127da919061523d565b91506127ea565b60009250600091505b50915091565b6000546001600160a01b0316331461281b5760405163c383977560e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b60006128488261333e565b34101561286857604051630e3360f160e21b815260040160405180910390fd5b610fe28383600034614071565b6000546001600160a01b031633146128a05760405163c383977560e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6128cb836117ce565b3410156128eb57604051633191f8f160e01b815260040160405180910390fd5b6000600684815481106129005761290061504e565b6000918252602090912060049091020190506003600182015460ff16600481111561292d5761292d614977565b1461294b576040516337cdefcb60e21b815260040160405180910390fd5b6003810180546000919061296190600190615093565b815481106129715761297161504e565b90600052602060002090600b0201905060058160000154815481106129985761299861504e565b6000918252602090912001546001600160a01b031633146129cc5760405163065f245f60e01b815260040160405180910390fd5b8154815460038401805460018101825560009182526020909120600480546001600160601b0390951694600b9093029091019184908110612a0f57612a0f61504e565b90600052602060002090600c020160050154846003015410612b18576004836001600160601b031681548110612a4757612a4761504e565b60009182526020909120600c9091020154600480546001600160601b0390921694509084908110612a7a57612a7a61504e565b60009182526020808320858452600a600c90930201919091019052604090205460ff16612aa657600191505b84546001600160601b03848116911614612b1857845460038601546001600160601b0390911690612ad990600190615093565b6040516001600160601b03861681528a907f736e3f52761298c8c0823e1ebf482ed3c5ecb304f743d2d91a7c006e8e8d7a1f9060200160405180910390a45b84546001600160601b0319166001600160601b038416908117865560018601805460ff1916905542600287015560048054600092908110612b5b57612b5b61504e565b90600052602060002090600c02019050806004015434612b7b91906151f1565b826003018190555061271081600301548260020154612b9a91906151c4565b612ba491906151f1565b60018084019190915534600284015583835560038054908801546001600160a01b039091169163d09f392d918c91612bdb91615093565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381600087803b158015612c1957600080fd5b505af1158015612c2d573d6000803e3d6000fd5b505086548454149150612d1390505784546003870154612c4f90600190615093565b83546040519081528b907fcbe7939a71f0b369c7471d760a0a99b60b7bb010ee0406cba8a46679d1ea77569060200160405180910390a46005826000015481548110612c9d57612c9d61504e565b60009182526020909120015460038301546040516302dbb79560e61b81526001600160a01b039092169163b6ede54091612ce0918d918d918d919060040161539e565b600060405180830381600087803b158015612cfa57600080fd5b505af1158015612d0e573d6000803e3d6000fd5b505050505b8554604051600160601b9091046001600160a01b0316908a907f9c9b64db9e130f48381bf697abf638e73117dbfbfd7a4484f2da3ba188f4187d90600090a3887f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b916000604051612d8391906150c3565b60405180910390a2505050505050505050565b60008060068381548110612dac57612dac61504e565b906000526020600020906004020190508060030160018260030180549050612dd49190615093565b81548110612de457612de461504e565b90600052602060002090600b020160030154915050919050565b6000546001600160a01b03163314612e295760405163c383977560e01b815260040160405180910390fd5b6005805460018101825560009182527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0810180546001600160a01b0319166001600160a01b0385169081179091556040519192909183917f44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb291a35050565b600060068381548110612ebc57612ebc61504e565b90600052602060002090600402019050600060018260030180549050612ee29190615093565b90506000826003018281548110612efb57612efb61504e565b600091825260208220600b909102019150600184015460ff166004811115612f2557612f25614977565b14612f4357604051638285c4ef60e01b815260040160405180910390fd5b60006005826000015481548110612f5c57612f5c61504e565b6000918252602082200154600a8401546001600160a01b039091169250905b8681108015612f91575060038401546006850154105b1561319b5760006001600160a01b03841663d2b8035a8a84612fb28161507a565b9550612fbe908761523d565b6040516001600160e01b031960e085901b168152600481019290925260248201526044016020604051808303816000875af1158015613001573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061302591906153ce565b90506001600160a01b03811661303b5750612f7b565b60035460018601546040516310f0b12f60e11b81526001600160a01b03909216916321e1625e91613071918591906004016153eb565b600060405180830381600087803b15801561308b57600080fd5b505af115801561309f573d6000803e3d6000fd5b50505060068601546040518b92506001600160a01b038416917f6119cf536152c11e0a9a6c22f3953ce4ecc93ee54fa72ffa326ffabded21509b916130ec918b8252602082015260400190565b60405180910390a36006850180546001810182556000828152602090200180546001600160a01b0319166001600160a01b038416179055600386015490540361319557600354604051632e96bc2360e11b8152600481018b9052602481018890526001600160a01b0390911690635d2d784690604401600060405180830381600087803b15801561317c57600080fd5b505af1158015613190573d6000803e3d6000fd5b505050505b50612f7b565b8084600a0160008282546131af919061523d565b90915550505050505050505050565b60006132038261038d86868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061333e92505050565b949350505050565b6000546001600160a01b031633146132365760405163c383977560e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03821660009081526007602052604081205460ff166132915760405163e51cf7bf60e01b815260040160405180910390fd5b61329c8585856131be565b8210156132bc57604051630e3360f160e21b815260040160405180910390fd5b6132d16001600160a01b03841633308561435a565b6132ee576040516312171d8360e31b815260040160405180910390fd5b6133328686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508892508791506140719050565b90505b95945050505050565b600080600061334c84614436565b5091509150806004836001600160601b03168154811061336e5761336e61504e565b90600052602060002090600c02016004015461320391906151c4565b6003546001600160a01b031633146133b557604051639d6cab9960e01b815260040160405180910390fd5b6133c3848484846001613ed7565b5050505050565b6000600682815481106133df576133df61504e565b600091825260209091206003600490920201015492915050565b60006004836001600160601b0316815481106134175761341761504e565b60009182526020808320948352600c91909102909301600a0190925250604090205460ff16919050565b806004846001600160601b03168154811061345e5761345e61504e565b60009182526020808320868452600c92909202909101600a0190526040808220805460ff19169315159390931790925590518215159184916001600160601b038716917fb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc7991a4505050565b60008060068360000151815481106134e3576134e361504e565b9060005260206000209060040201905060008160030184602001518154811061350e5761350e61504e565b90600052602060002090600b02019050600060058260000154815481106135375761353761504e565b60009182526020808320919091015487519188015160a0890151604051634fe264fb60e01b81526004810194909452602484019190915260448301526001600160a01b031692508290634fe264fb90606401602060405180830381865afa1580156135a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135ca9190615250565b90506127108111156135db57506127105b60006127106135ea8382615093565b85600101546135f991906151c4565b61360391906151f1565b90508087608001818151613617919061523d565b90525060a08701516006850180546000929081106136375761363761504e565b60009182526020909120015460035460405163965af6c760e01b81526001600160a01b03928316935091169063965af6c79061367990849086906004016153eb565b600060405180830381600087803b15801561369357600080fd5b505af11580156136a7573d6000803e3d6000fd5b5050600354604051633c85b79360e21b81526001600160a01b03909116925063f216de4c91506136dd90849086906004016153eb565b600060405180830381600087803b1580156136f757600080fd5b505af115801561370b573d6000803e3d6000fd5b50505050602088015188516001600160a01b0383167f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e78661374b87615404565b60098b015460405161376d9392916000916001600160a01b0390911690615420565b60405180910390a48751602089015160a08a015160405163ba66fde760e01b81526004810193909352602483019190915260448201526001600160a01b0385169063ba66fde790606401602060405180830381865afa1580156137d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137f891906150a6565b61385f5760035460405163b5d69e9960e01b81526001600160a01b039091169063b5d69e999061382c9084906004016147e8565b600060405180830381600087803b15801561384657600080fd5b505af115801561385a573d6000803e3d6000fd5b505050505b600188606001516138709190615093565b8860a0015114801561388457506040880151155b156139755760098501546001600160a01b03166138cd576000805460028701546040516001600160a01b039092169281156108fc029290818181858888f19350505050506138f4565b600054600286015460098701546138f2926001600160a01b03918216929116906144bd565b505b6000546080890151600154613917926001600160a01b03918216929116906144bd565b506020880151885160808a0151600288015460098901546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf49361396c93909290916001600160a01b0390911690615444565b60405180910390a35b505050608090940151949350505050565b6000600682600001518154811061399f5761399f61504e565b906000526020600020906004020190506000816003018360200151815481106139ca576139ca61504e565b90600052602060002090600b02019050600060058260000154815481106139f3576139f361504e565b6000918252602080832090910154865191870151606088015160a08901516001600160a01b0390931695508593634fe264fb93909291613a3291615463565b6040516001600160e01b031960e086901b168152600481019390935260248301919091526044820152606401602060405180830381865afa158015613a7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a9f9190615250565b9050612710811115613ab057506127105b60008360060186606001518760a00151613aca9190615463565b81548110613ada57613ada61504e565b600091825260208220015460018601546001600160a01b03909116925061271090613b069085906151c4565b613b1091906151f1565b60035460405163965af6c760e01b81529192506001600160a01b03169063965af6c790613b4390859085906004016153eb565b600060405180830381600087803b158015613b5d57600080fd5b505af1158015613b71573d6000803e3d6000fd5b5050600354604051636624192f60e01b81526001600160a01b039091169250636624192f9150613ba59085906004016147e8565b602060405180830381865afa158015613bc2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613be691906150a6565b613c0357600154613c01906001600160a01b031683836144bd565b505b60006127108489604001518a60800151613c1d91906151f1565b613c2791906151c4565b613c3191906151f1565b905080866008016000828254613c47919061523d565b925050819055506000612710858a604001518960020154613c6891906151f1565b613c7291906151c4565b613c7c91906151f1565b905080876007016000828254613c92919061523d565b9091555050600154613cae906001600160a01b031685846144bd565b5060098701546001600160a01b0316613cec576040516001600160a01b0385169082156108fc029083906000818181858888f1935050505050613d07565b6009870154613d05906001600160a01b031685836144bd565b505b6020890151895160098901546040516001600160a01b03888116927f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e792613d57928c928a928a9290911690615420565b60405180910390a4600189606001516002613d7291906151c4565b613d7c9190615093565b8960a0015103613e9e57600087600801548a60800151613d9c9190615093565b9050600088600701548960020154613db49190615093565b905081151580613dc357508015155b15611477578115613ded57600054600154613deb916001600160a01b039182169116846144bd565b505b8015613e545760098901546001600160a01b0316613e3357600080546040516001600160a01b039091169183156108fc02918491818181858888f1935050505050613e54565b60005460098a0154613e52916001600160a01b039182169116836144bd565b505b60208b01518b5160098b01546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf49161270591879187916001600160a01b0390911690615444565b505050505050505050565b6000546001600160a01b03163314613ed45760405163c383977560e01b815260040160405180910390fd5b50565b60006001600160601b0385161580613ef957506004546001600160601b038616115b15613f0f57613f078261458a565b506000613335565b8315801590613f4a57506004856001600160601b031681548110613f3557613f3561504e565b90600052602060002090600c02016002015484105b15613f5857613f078261458a565b600354604051630a5861b960e41b81526001600160a01b0388811660048301526001600160601b0388166024830152604482018790528515156064830152600092839283929091169063a5861b90906084016060604051808303816000875af1158015613fc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fed9190615477565b9250925092508061400d576140018561458a565b60009350505050613335565b82156140385760015461402b906001600160a01b03168a308661435a565b614038576140018561458a565b811561406257600154614055906001600160a01b03168a846144bd565b614062576140018561458a565b50600198975050505050505050565b600080600061407f86614436565b92505091506004826001600160601b0316815481106140a0576140a061504e565b60009182526020808320848452600a600c90930201919091019052604090205460ff166140e05760405163b34eb75d60e01b815260040160405180910390fd5b600680546001810182556000918252600160601b33026001600160601b03851617600482027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f8101918255427ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d4190910155600580549296509092918490811061416b5761416b61504e565b60009182526020822001548354600480546001600160a01b039093169450916001600160601b039091169081106141a4576141a461504e565b60009182526020808320600387018054600181018255908552918420600c909302019350600b0201906001600160a01b038a16156141ef576141ea8a8460040154610f91565b6141f5565b82600401545b9050614201818a6151f1565b600380840191909155868355830154600284015461271091614222916151c4565b61422c91906151f1565b6001830155600282018990556009820180546001600160a01b0319166001600160a01b038c81169190911790915560035460405163d09f392d60e01b8152600481018b90526000602482015291169063d09f392d90604401600060405180830381600087803b15801561429e57600080fd5b505af11580156142b2573d6000803e3d6000fd5b50505050836001600160a01b031663b6ede540898e8e86600301546040518563ffffffff1660e01b81526004016142ec949392919061539e565b600060405180830381600087803b15801561430657600080fd5b505af115801561431a573d6000803e3d6000fd5b50506040513392508a91507f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a350505050505050949350505050565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b179052516143bf919061528d565b6000604051808303816000865af19150503d80600081146143fc576040519150601f19603f3d011682016040523d82523d6000602084013e614401565b606091505b509150915081801561442b57508051158061442b57508080602001905181019061442b91906150a6565b979650505050505050565b600080600060408451106144ab575050506020810151604082015160608301516001600160601b038316158061447757506004546001600160601b03841610155b1561448157600192505b8160000361448e57600391505b80158061449d57506005548110155b156144a6575060015b6144b6565b506001915060039050815b9193909250565b6000806000856001600160a01b031685856040516024016144df9291906153eb565b60408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b17905251614514919061528d565b6000604051808303816000865af19150503d8060008114614551576040519150601f19603f3d011682016040523d82523d6000602084013e614556565b606091505b509150915081801561458057508051158061458057508080602001905181019061458091906150a6565b9695505050505050565b600181600181111561459e5761459e614977565b036145a65750565b60405163a437293760e01b815260040160405180910390fd5b60405180608001604052806004906020820280368337509192915050565b826004810192821561460b579160200282015b8281111561460b5782518255916020019190600101906145f0565b50614617929150614655565b5090565b82805482825590600052602060002090810192821561460b579160200282018281111561460b5782518255916020019190600101906145f0565b5b808211156146175760008155600101614656565b6001600160a01b0381168114613ed457600080fd5b60006020828403121561469157600080fd5b813561469c8161466a565b9392505050565b80356001600160601b03811681146146ba57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156146fd576146fd6146bf565b604052919050565b600082601f83011261471657600080fd5b813560206001600160401b03821115614731576147316146bf565b8160051b6147408282016146d5565b928352848101820192828101908785111561475a57600080fd5b83870192505b8483101561442b57823582529183019190830190614760565b8015158114613ed457600080fd5b60008060006060848603121561479c57600080fd5b6147a5846146a3565b925060208401356001600160401b038111156147c057600080fd5b6147cc86828701614705565b92505060408401356147dd81614779565b809150509250925092565b6001600160a01b0391909116815260200190565b60006020828403121561480e57600080fd5b5035919050565b6000806040838503121561482857600080fd5b82356148338161466a565b946020939093013593505050565b60008060006060848603121561485657600080fd5b505081359360208301359350604090920135919050565b60006020828403121561487f57600080fd5b610fe2826146a3565b8060005b6004811015610a5957815184526020938401939091019060010161488c565b60808101610fe58284614888565b600082601f8301126148ca57600080fd5b81356001600160401b038111156148e3576148e36146bf565b6148f6601f8201601f19166020016146d5565b81815284602083860101111561490b57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561493b57600080fd5b82356149468161466a565b915060208301356001600160401b0381111561496157600080fd5b61496d858286016148b9565b9150509250929050565b634e487b7160e01b600052602160045260246000fd5b600581106149ab57634e487b7160e01b600052602160045260246000fd5b9052565b6001600160601b03861681526001600160a01b038516602082015260a081016149db604083018661498d565b9215156060820152608001529392505050565b600080600060608486031215614a0357600080fd5b8335614a0e8161466a565b92506020840135915060408401356001600160401b03811115614a3057600080fd5b614a3c868287016148b9565b9150509250925092565b60008060408385031215614a5957600080fd5b614833836146a3565b60008060408385031215614a7557600080fd5b8235614a808161466a565b91506020830135614a9081614779565b809150509250929050565b600080600060608486031215614ab057600080fd5b8335614abb8161466a565b925060208401356001600160401b0381168114614ad757600080fd5b9150604084013560ff811681146147dd57600080fd5b600082601f830112614afe57600080fd5b604051608081018181106001600160401b0382111715614b2057614b206146bf565b604052806080840185811115614b3557600080fd5b845b81811015614b4f578035835260209283019201614b37565b509195945050505050565b6000806000806000806000610140888a031215614b7657600080fd5b614b7f886146a3565b96506020880135614b8f81614779565b955060408801359450606088013593506080880135925060a08801359150614bba8960c08a01614aed565b905092959891949750929550565b60008060408385031215614bdb57600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b83811015614c235781516001600160a01b031687529582019590820190600101614bfe565b509495945050505050565b6020815281516020820152602082015160408201526040820151606082015260608201516080820152608082015160a082015260a082015160c0820152600060c08301516101608060e0850152614c89610180850183614bea565b60e08601516101008681019190915286015161012080870191909152860151909250610140614cc2818701836001600160a01b03169052565b959095015193019290925250919050565b60008060008060008060008060006101e08a8c031215614cf257600080fd5b8935614cfd8161466a565b985060208a0135614d0d8161466a565b975060408a0135614d1d8161466a565b965060608a0135614d2d8161466a565b955060808a0135614d3d81614779565b9450614d4c8b60a08c01614aed565b9350614d5c8b6101208c01614aed565b92506101a08a01356001600160401b03811115614d7857600080fd5b614d848c828d016148b9565b9250506101c08a0135614d968161466a565b809150509295985092959850929598565b60008060008060008060008060006101808a8c031215614dc657600080fd5b614dcf8a6146a3565b985060208a0135614ddf81614779565b975060408a0135965060608a0135955060808a0135945060a08a01359350614e0a8b60c08c01614aed565b92506101408a01356001600160401b0380821115614e2757600080fd5b614e338d838e016148b9565b93506101608c0135915080821115614e4a57600080fd5b50614e578c828d01614705565b9150509295985092959850929598565b60008060408385031215614e7a57600080fd5b8235915060208301356001600160401b0381111561496157600080fd5b600080600060608486031215614eac57600080fd5b833592506020840135915060408401356001600160401b03811115614a3057600080fd5b60008083601f840112614ee257600080fd5b5081356001600160401b03811115614ef957600080fd5b602083019150836020828501011115614f1157600080fd5b9250929050565b600080600060408486031215614f2d57600080fd5b83356001600160401b03811115614f4357600080fd5b614f4f86828701614ed0565b90945092505060208401356147dd8161466a565b600080600080600060808688031215614f7b57600080fd5b8535945060208601356001600160401b03811115614f9857600080fd5b614fa488828901614ed0565b9095509350506040860135614fb88161466a565b949793965091946060013592915050565b600060208284031215614fdb57600080fd5b81356001600160401b03811115614ff157600080fd5b613203848285016148b9565b6000806000806080858703121561501357600080fd5b843561501e8161466a565b935061502c602086016146a3565b925060408501359150606085013561504381614779565b939692955090935050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161508c5761508c615064565b5060010190565b81810381811115610fe557610fe5615064565b6000602082840312156150b857600080fd5b815161469c81614779565b60208101610fe5828461498d565b600181815b8085111561510c5781600019048211156150f2576150f2615064565b808516156150ff57918102915b93841c93908002906150d6565b509250929050565b60008261512357506001610fe5565b8161513057506000610fe5565b816001811461514657600281146151505761516c565b6001915050610fe5565b60ff84111561516157615161615064565b50506001821b610fe5565b5060208310610133831016604e8410600b841016171561518f575081810a610fe5565b61519983836150d1565b80600019048211156151ad576151ad615064565b029392505050565b6000610fe260ff841683615114565b8082028115828204841417610fe557610fe5615064565b634e487b7160e01b600052601260045260246000fd5b600082615200576152006151db565b500490565b60008060006060848603121561521a57600080fd5b83519250602084015161522c81614779565b60408501519092506147dd81614779565b80820180821115610fe557610fe5615064565b60006020828403121561526257600080fd5b5051919050565b60005b8381101561528457818101518382015260200161526c565b50506000910152565b6000825161529f818460208701615269565b9190910192915050565b600061012082019050871515825286602083015285604083015284606083015283608083015261442b60a0830184614888565b600081518084526152f4816020860160208601615269565b601f01601f19169290920160200192915050565b82815260406020820152600061320360408301846152dc565b60006101408083018a1515845260208a8186015289604086015288606086015287608086015261535460a0860188614888565b6101208501929092528451908190526101608401918086019160005b8181101561538c57835185529382019392820192600101615370565b50929c9b505050505050505050505050565b8481528360208201526080604082015260006153bd60808301856152dc565b905082606083015295945050505050565b6000602082840312156153e057600080fd5b815161469c8161466a565b6001600160a01b03929092168252602082015260400190565b6000600160ff1b820161541957615419615064565b5060000390565b938452602084019290925260408301526001600160a01b0316606082015260800190565b92835260208301919091526001600160a01b0316604082015260600190565b600082615472576154726151db565b500690565b60008060006060848603121561548c57600080fd5b835192506020840151915060408401516147dd8161477956fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122058616b04888240cc8d37ba1cf4119a0c7b9f8bb808137ebdb313ab46eaa623ad64736f6c63430008120033", + "devdoc": { + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "AcceptedFeeToken(address,bool)": { + "details": "To be emitted when an ERC20 token is added or removed as a method to pay fees.", + "params": { + "_accepted": "Whether the token is accepted or not.", + "_token": "The ERC20 token." + } + }, + "DisputeCreation(uint256,address)": { + "details": "To be emitted when a dispute is created.", + "params": { + "_arbitrable": "The contract which created the dispute.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract." + } + }, + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "NewCurrencyRate(address,uint64,uint8)": { + "details": "To be emitted when the fee for a particular ERC20 token is updated.", + "params": { + "_feeToken": "The ERC20 token.", + "_rateDecimals": "The new decimals of the fee token rate.", + "_rateInEth": "The new rate of the fee token in ETH." + } + }, + "Ruling(address,uint256,uint256)": { + "details": "To be raised when a ruling is given.", + "params": { + "_arbitrable": "The arbitrable receiving the ruling.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract.", + "_ruling": "The ruling which was given." + } + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "addNewDisputeKit(address)": { + "details": "Add a new supported dispute kit module to the court.", + "params": { + "_disputeKitAddress": "The address of the dispute kit contract." + } + }, + "appeal(uint256,uint256,bytes)": { + "details": "Appeals the ruling of a specified dispute. Note: Access restricted to the Dispute Kit for this `disputeID`.", + "params": { + "_disputeID": "The ID of the dispute.", + "_extraData": "Extradata for the dispute. Can be required during court jump.", + "_numberOfChoices": "Number of choices for the dispute. Can be required during court jump." + } + }, + "appealCost(uint256)": { + "details": "Gets the cost of appealing a specified dispute.", + "params": { + "_disputeID": "The ID of the dispute." + }, + "returns": { + "cost": "The appeal cost." + } + }, + "appealPeriod(uint256)": { + "details": "Gets the start and the end of a specified dispute's current appeal period.", + "params": { + "_disputeID": "The ID of the dispute." + }, + "returns": { + "end": "The end of the appeal period.", + "start": "The start of the appeal period." + } + }, + "arbitrationCost(bytes)": { + "details": "Compute the cost of arbitration denominated in ETH. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes)." + }, + "returns": { + "cost": "The arbitration cost in ETH." + } + }, + "arbitrationCost(bytes,address)": { + "details": "Compute the cost of arbitration denominated in `_feeToken`. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).", + "_feeToken": "The ERC20 token used to pay fees." + }, + "returns": { + "cost": "The arbitration cost in `_feeToken`." + } + }, + "changeAcceptedFeeTokens(address,bool)": { + "details": "Changes the supported fee tokens.", + "params": { + "_accepted": "Whether the token is supported or not as a method of fee payment.", + "_feeToken": "The fee token." + } + }, + "changeCurrencyRates(address,uint64,uint8)": { + "details": "Changes the currency rate of a fee token.", + "params": { + "_feeToken": "The fee token.", + "_rateDecimals": "The new decimals of the fee token rate.", + "_rateInEth": "The new rate of the fee token in ETH." + } + }, + "changeGovernor(address)": { + "details": "Changes the `governor` storage variable.", + "params": { + "_governor": "The new value for the `governor` storage variable." + } + }, + "changeJurorProsecutionModule(address)": { + "details": "Changes the `jurorProsecutionModule` storage variable.", + "params": { + "_jurorProsecutionModule": "The new value for the `jurorProsecutionModule` storage variable." + } + }, + "changePinakion(address)": { + "details": "Changes the `pinakion` storage variable.", + "params": { + "_pinakion": "The new value for the `pinakion` storage variable." + } + }, + "changeSortitionModule(address)": { + "details": "Changes the `_sortitionModule` storage variable. Note that the new module should be initialized for all courts.", + "params": { + "_sortitionModule": "The new value for the `sortitionModule` storage variable." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "createCourt(uint96,bool,uint256,uint256,uint256,uint256,uint256[4],bytes,uint256[])": { + "details": "Creates a court under a specified parent court.", + "params": { + "_alpha": "The `alpha` property value of the court.", + "_feeForJuror": "The `feeForJuror` property value of the court.", + "_hiddenVotes": "The `hiddenVotes` property value of the court.", + "_jurorsForCourtJump": "The `jurorsForCourtJump` property value of the court.", + "_minStake": "The `minStake` property value of the court.", + "_parent": "The `parent` property value of the court.", + "_sortitionExtraData": "Extra data for sortition module.", + "_supportedDisputeKits": "Indexes of dispute kits that this court will support.", + "_timesPerPeriod": "The `timesPerPeriod` property value of the court." + } + }, + "createDispute(uint256,bytes)": { + "details": "Create a dispute and pay for the fees in the native currency, typically ETH. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).", + "_numberOfChoices": "The number of choices the arbitrator can choose from in this dispute." + }, + "returns": { + "disputeID": "The identifier of the dispute created." + } + }, + "createDispute(uint256,bytes,address,uint256)": { + "details": "Create a dispute and pay for the fees in a supported ERC20 token. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).", + "_feeAmount": "Amount of the ERC20 token used to pay fees.", + "_feeToken": "The ERC20 token used to pay fees.", + "_numberOfChoices": "The number of choices the arbitrator can choose from in this dispute." + }, + "returns": { + "disputeID": "The identifier of the dispute created." + } + }, + "currentRuling(uint256)": { + "details": "Gets the current ruling of a specified dispute.", + "params": { + "_disputeID": "The ID of the dispute." + }, + "returns": { + "overridden": "Whether the ruling was overridden by appeal funding or not.", + "ruling": "The current ruling.", + "tied": "Whether it's a tie or not." + } + }, + "draw(uint256,uint256)": { + "details": "Draws jurors for the dispute. Can be called in parts.", + "params": { + "_disputeID": "The ID of the dispute.", + "_iterations": "The number of iterations to run." + } + }, + "enableDisputeKits(uint96,uint256[],bool)": { + "details": "Adds/removes court's support for specified dispute kits.", + "params": { + "_courtID": "The ID of the court.", + "_disputeKitIDs": "The IDs of dispute kits which support should be added/removed.", + "_enable": "Whether add or remove the dispute kits from the court." + } + }, + "execute(uint256,uint256,uint256)": { + "details": "Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.", + "params": { + "_disputeID": "The ID of the dispute.", + "_iterations": "The number of iterations to run.", + "_round": "The appeal round." + } + }, + "executeGovernorProposal(address,uint256,bytes)": { + "details": "Allows the governor to call anything on behalf of the contract.", + "params": { + "_amount": "The value sent with the call.", + "_data": "The data sent with the call.", + "_destination": "The destination of the call." + } + }, + "executeRuling(uint256)": { + "details": "Executes a specified dispute's ruling.", + "params": { + "_disputeID": "The ID of the dispute." + } + }, + "getNumberOfVotes(uint256)": { + "details": "Gets the number of votes permitted for the specified dispute in the latest round.", + "params": { + "_disputeID": "The ID of the dispute." + } + }, + "getTimesPerPeriod(uint96)": { + "details": "Gets the timesPerPeriod array for a given court.", + "params": { + "_courtID": "The ID of the court to get the times from." + }, + "returns": { + "timesPerPeriod": "The timesPerPeriod array for the given court." + } + }, + "initialize(address,address,address,address,bool,uint256[4],uint256[4],bytes,address)": { + "details": "Initializer (constructor equivalent for upgradable contracts).", + "params": { + "_courtParameters": "Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).", + "_disputeKit": "The address of the default dispute kit.", + "_governor": "The governor's address.", + "_hiddenVotes": "The `hiddenVotes` property value of the general court.", + "_jurorProsecutionModule": "The address of the juror prosecution module.", + "_pinakion": "The address of the token contract.", + "_sortitionExtraData": "The extra data for sortition module.", + "_sortitionModuleAddress": "The sortition module responsible for sortition of the jurors.", + "_timesPerPeriod": "The `timesPerPeriod` property value of the general court." + } + }, + "isDisputeKitJumping(uint256)": { + "details": "Returns true if the dispute kit will be switched to a parent DK.", + "params": { + "_disputeID": "The ID of the dispute." + }, + "returns": { + "_0": "Whether DK will be switched or not." + } + }, + "passPeriod(uint256)": { + "details": "Passes the period of a specified dispute.", + "params": { + "_disputeID": "The ID of the dispute." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "setStake(uint96,uint256)": { + "details": "Sets the caller's stake in a court.", + "params": { + "_courtID": "The ID of the court.", + "_newStake": "The new stake. Note that the existing delayed stake will be nullified as non-relevant." + } + }, + "setStakeBySortitionModule(address,uint96,uint256,bool)": { + "details": "Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.", + "params": { + "_account": "The account whose stake is being set.", + "_alreadyTransferred": "Whether the PNKs have already been transferred to the contract.", + "_courtID": "The ID of the court.", + "_newStake": "The new stake." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "title": "KlerosCore Core arbitrator contract for Kleros v2. Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 3081, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3084, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "pinakion", + "offset": 0, + "slot": "1", + "type": "t_contract(IERC20)1042" + }, + { + "astId": 3086, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "jurorProsecutionModule", + "offset": 0, + "slot": "2", + "type": "t_address" + }, + { + "astId": 3089, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "sortitionModule", + "offset": 0, + "slot": "3", + "type": "t_contract(ISortitionModule)17351" + }, + { + "astId": 3093, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "courts", + "offset": 0, + "slot": "4", + "type": "t_array(t_struct(Court)3004_storage)dyn_storage" + }, + { + "astId": 3097, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "disputeKits", + "offset": 0, + "slot": "5", + "type": "t_array(t_contract(IDisputeKit)17190)dyn_storage" + }, + { + "astId": 3101, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "disputes", + "offset": 0, + "slot": "6", + "type": "t_array(t_struct(Dispute)3021_storage)dyn_storage" + }, + { + "astId": 3107, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "currencyRates", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_contract(IERC20)1042,t_struct(CurrencyRate)3066_storage)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_address)dyn_storage": { + "base": "t_address", + "encoding": "dynamic_array", + "label": "address[]", + "numberOfBytes": "32" + }, + "t_array(t_contract(IDisputeKit)17190)dyn_storage": { + "base": "t_contract(IDisputeKit)17190", + "encoding": "dynamic_array", + "label": "contract IDisputeKit[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Court)3004_storage)dyn_storage": { + "base": "t_struct(Court)3004_storage", + "encoding": "dynamic_array", + "label": "struct KlerosCore.Court[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Dispute)3021_storage)dyn_storage": { + "base": "t_struct(Dispute)3021_storage", + "encoding": "dynamic_array", + "label": "struct KlerosCore.Dispute[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Round)3046_storage)dyn_storage": { + "base": "t_struct(Round)3046_storage", + "encoding": "dynamic_array", + "label": "struct KlerosCore.Round[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)4_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[4]", + "numberOfBytes": "128" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IArbitrableV2)16951": { + "encoding": "inplace", + "label": "contract IArbitrableV2", + "numberOfBytes": "20" + }, + "t_contract(IDisputeKit)17190": { + "encoding": "inplace", + "label": "contract IDisputeKit", + "numberOfBytes": "20" + }, + "t_contract(IERC20)1042": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(ISortitionModule)17351": { + "encoding": "inplace", + "label": "contract ISortitionModule", + "numberOfBytes": "20" + }, + "t_enum(Period)2978": { + "encoding": "inplace", + "label": "enum KlerosCore.Period", + "numberOfBytes": "1" + }, + "t_mapping(t_contract(IERC20)1042,t_struct(CurrencyRate)3066_storage)": { + "encoding": "mapping", + "key": "t_contract(IERC20)1042", + "label": "mapping(contract IERC20 => struct KlerosCore.CurrencyRate)", + "numberOfBytes": "32", + "value": "t_struct(CurrencyRate)3066_storage" + }, + "t_mapping(t_uint256,t_bool)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_struct(Court)3004_storage": { + "encoding": "inplace", + "label": "struct KlerosCore.Court", + "members": [ + { + "astId": 2980, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "parent", + "offset": 0, + "slot": "0", + "type": "t_uint96" + }, + { + "astId": 2982, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "hiddenVotes", + "offset": 12, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 2985, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "children", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 2987, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "minStake", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 2989, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "alpha", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 2991, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "feeForJuror", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 2993, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "jurorsForCourtJump", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 2997, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "timesPerPeriod", + "offset": 0, + "slot": "6", + "type": "t_array(t_uint256)4_storage" + }, + { + "astId": 3001, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "supportedDisputeKits", + "offset": 0, + "slot": "10", + "type": "t_mapping(t_uint256,t_bool)" + }, + { + "astId": 3003, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "disabled", + "offset": 0, + "slot": "11", + "type": "t_bool" + } + ], + "numberOfBytes": "384" + }, + "t_struct(CurrencyRate)3066_storage": { + "encoding": "inplace", + "label": "struct KlerosCore.CurrencyRate", + "members": [ + { + "astId": 3061, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "feePaymentAccepted", + "offset": 0, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 3063, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "rateInEth", + "offset": 1, + "slot": "0", + "type": "t_uint64" + }, + { + "astId": 3065, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "rateDecimals", + "offset": 9, + "slot": "0", + "type": "t_uint8" + } + ], + "numberOfBytes": "32" + }, + "t_struct(Dispute)3021_storage": { + "encoding": "inplace", + "label": "struct KlerosCore.Dispute", + "members": [ + { + "astId": 3006, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "courtID", + "offset": 0, + "slot": "0", + "type": "t_uint96" + }, + { + "astId": 3009, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "arbitrated", + "offset": 12, + "slot": "0", + "type": "t_contract(IArbitrableV2)16951" + }, + { + "astId": 3012, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "period", + "offset": 0, + "slot": "1", + "type": "t_enum(Period)2978" + }, + { + "astId": 3014, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "ruled", + "offset": 1, + "slot": "1", + "type": "t_bool" + }, + { + "astId": 3016, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "lastPeriodChange", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 3020, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "rounds", + "offset": 0, + "slot": "3", + "type": "t_array(t_struct(Round)3046_storage)dyn_storage" + } + ], + "numberOfBytes": "128" + }, + "t_struct(Round)3046_storage": { + "encoding": "inplace", + "label": "struct KlerosCore.Round", + "members": [ + { + "astId": 3023, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "disputeKitID", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 3025, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "pnkAtStakePerJuror", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 3027, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "totalFeesForJurors", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 3029, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "nbVotes", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 3031, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "repartitions", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 3033, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "pnkPenalties", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 3036, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "drawnJurors", + "offset": 0, + "slot": "6", + "type": "t_array(t_address)dyn_storage" + }, + { + "astId": 3038, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "sumFeeRewardPaid", + "offset": 0, + "slot": "7", + "type": "t_uint256" + }, + { + "astId": 3040, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "sumPnkRewardPaid", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 3043, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "feeToken", + "offset": 0, + "slot": "9", + "type": "t_contract(IERC20)1042" + }, + { + "astId": 3045, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "drawIterations", + "offset": 0, + "slot": "10", + "type": "t_uint256" + } + ], + "numberOfBytes": "352" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + }, + "t_uint96": { + "encoding": "inplace", + "label": "uint96", + "numberOfBytes": "12" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore_Proxy.json b/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore_Proxy.json new file mode 100644 index 000000000..d995b2434 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore_Proxy.json @@ -0,0 +1,136 @@ +{ + "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "transactionIndex": 1, + "gasUsed": "555971", + "logsBloom": "0x00000000000000000000000020000000000000000000000000000100020000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000040000000000000000000000000000020000000000000010000800402000000000000008000000000000000000000000000000000800000000000000000000000080000000000000800000000000000000000008000000000000000080000000000000000000000000000000000000000000000000000000000000000000000004000000000000000060000004001001000000000000001000000000000000000000000000000020000000", + "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4", + "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084598, + "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", + "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "topics": [ + "0x44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb2", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x00000000000000000000000086ac67e5550f837a650b4b0cd4778d4293a2bde3" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4" + }, + { + "transactionIndex": 1, + "blockNumber": 3084598, + "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", + "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "topics": [ + "0x3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000", + "logIndex": 1, + "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4" + }, + { + "transactionIndex": 1, + "blockNumber": 3084598, + "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", + "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "topics": [ + "0xb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc79", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000001" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4" + }, + { + "transactionIndex": 1, + "blockNumber": 3084598, + "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", + "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 3, + "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4" + } + ], + "blockNumber": 3084598, + "cumulativeGasUsed": "555971", + "status": 1, + "byzantium": true + }, + "args": [ + "0x614498118850184c62f82d08261109334bFB050f", + "0x994b27af000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c5900000000000000000000000034b944d42cacfc8266955d07a80181d2054aa225000000000000000000000000000000000000000000000000000000000000000000000000000000000000000086ac67e5550f837a650b4b0cd4778d4293a2bde3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000f327200420f21baafce8f1c03b1eedf926074b9500000000000000000000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/PolicyRegistry.json b/contracts/deployments/arbitrumSepoliaDevnet/PolicyRegistry.json new file mode 100644 index 000000000..a48f542b4 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/PolicyRegistry.json @@ -0,0 +1,305 @@ +{ + "address": "0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_courtName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "_policy", + "type": "string" + } + ], + "name": "PolicyUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "policies", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_courtName", + "type": "string" + }, + { + "internalType": "string", + "name": "_policy", + "type": "string" + } + ], + "name": "setPolicy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0xef6e43f7d3ea2175f5e10670a58a8df80a1ac1c55d189d0a27608ab5dd166b2a", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da", + "transactionIndex": 1, + "gasUsed": "175189", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000008000080000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000004000000000000000000000000000000000000000", + "blockHash": "0xbe53ead690ecc30663a1500d067ac05b04ccd082bff5f4bf43e72a6df95e4969", + "transactionHash": "0xef6e43f7d3ea2175f5e10670a58a8df80a1ac1c55d189d0a27608ab5dd166b2a", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084568, + "transactionHash": "0xef6e43f7d3ea2175f5e10670a58a8df80a1ac1c55d189d0a27608ab5dd166b2a", + "address": "0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0xbe53ead690ecc30663a1500d067ac05b04ccd082bff5f4bf43e72a6df95e4969" + } + ], + "blockNumber": 3084568, + "cumulativeGasUsed": "175189", + "status": 1, + "byzantium": true + }, + "args": [ + "0xAA637C9E2831614158d7eB193D03af4a7223C56E", + "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59" + ] + }, + "implementation": "0xAA637C9E2831614158d7eB193D03af4a7223C56E", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/PolicyRegistry_Implementation.json b/contracts/deployments/arbitrumSepoliaDevnet/PolicyRegistry_Implementation.json new file mode 100644 index 000000000..f21e42dbc --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/PolicyRegistry_Implementation.json @@ -0,0 +1,397 @@ +{ + "address": "0xAA637C9E2831614158d7eB193D03af4a7223C56E", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_courtName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "_policy", + "type": "string" + } + ], + "name": "PolicyUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "policies", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_courtName", + "type": "string" + }, + { + "internalType": "string", + "name": "_policy", + "type": "string" + } + ], + "name": "setPolicy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x9b5099b7a7d302303636f3a2bc16e684266c9c7a9d000747f82e6826678906a7", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xAA637C9E2831614158d7eB193D03af4a7223C56E", + "transactionIndex": 1, + "gasUsed": "718485", + "logsBloom": "0x00000000010000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000002000000000000000000000000000000000000000000000", + "blockHash": "0x255f541ed416c77581e2bcd3af75c554f9489216329a580fefe93c7730ff222f", + "transactionHash": "0x9b5099b7a7d302303636f3a2bc16e684266c9c7a9d000747f82e6826678906a7", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084567, + "transactionHash": "0x9b5099b7a7d302303636f3a2bc16e684266c9c7a9d000747f82e6826678906a7", + "address": "0xAA637C9E2831614158d7eB193D03af4a7223C56E", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 0, + "blockHash": "0x255f541ed416c77581e2bcd3af75c554f9489216329a580fefe93c7730ff222f" + } + ], + "blockNumber": 3084567, + "cumulativeGasUsed": "718485", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_courtName\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_policy\",\"type\":\"string\"}],\"name\":\"PolicyUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"policies\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_courtName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_policy\",\"type\":\"string\"}],\"name\":\"setPolicy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"A contract to maintain a policy for each court.\",\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"PolicyUpdate(uint256,string,string)\":{\"details\":\"Emitted when a policy is updated.\",\"params\":{\"_courtID\":\"The ID of the policy's court.\",\"_courtName\":\"The name of the policy's court.\",\"_policy\":\"The URI of the policy JSON.\"}},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"changeGovernor(address)\":{\"details\":\"Changes the `governor` storage variable.\",\"params\":{\"_governor\":\"The new value for the `governor` storage variable.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"initialize(address)\":{\"details\":\"Constructs the `PolicyRegistry` contract.\",\"params\":{\"_governor\":\"The governor's address.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"setPolicy(uint256,string,string)\":{\"details\":\"Sets the policy for the specified court.\",\"params\":{\"_courtID\":\"The ID of the specified court.\",\"_courtName\":\"The name of the specified court.\",\"_policy\":\"The URI of the policy JSON.\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"PolicyRegistry\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/PolicyRegistry.sol\":\"PolicyRegistry\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/arbitration/PolicyRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\nimport \\\"../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title PolicyRegistry\\n/// @dev A contract to maintain a policy for each court.\\ncontract PolicyRegistry is UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n /// @dev Emitted when a policy is updated.\\n /// @param _courtID The ID of the policy's court.\\n /// @param _courtName The name of the policy's court.\\n /// @param _policy The URI of the policy JSON.\\n event PolicyUpdate(uint256 indexed _courtID, string _courtName, string _policy);\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor;\\n mapping(uint256 => string) public policies;\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n /// @dev Requires that the sender is the governor.\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"No allowed: governor only\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Constructs the `PolicyRegistry` contract.\\n /// @param _governor The governor's address.\\n function initialize(address _governor) external reinitializer(1) {\\n governor = _governor;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the policy for the specified court.\\n /// @param _courtID The ID of the specified court.\\n /// @param _courtName The name of the specified court.\\n /// @param _policy The URI of the policy JSON.\\n function setPolicy(uint256 _courtID, string calldata _courtName, string calldata _policy) external onlyByGovernor {\\n policies[_courtID] = _policy;\\n emit PolicyUpdate(_courtID, _courtName, policies[_courtID]);\\n }\\n}\\n\",\"keccak256\":\"0x24154360b94aa45b0699b65d31087e475f9d43b42771c62440f3d5741f7419a4\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060805234801561001457600080fd5b5061001d610022565b6100d3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff16156100715760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b03908116146100d05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051610b926100fc6000396000818161017b015281816101a401526103a10152610b926000f3fe6080604052600436106100605760003560e01c80630c340a24146100655780634f1ef286146100a257806352d1902d146100b7578063bdf73780146100da578063c4d66de8146100fa578063d3e894831461011a578063e4c0aaf414610147575b600080fd5b34801561007157600080fd5b50600054610085906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100b56100b03660046106ba565b610167565b005b3480156100c357600080fd5b506100cc610394565b604051908152602001610099565b3480156100e657600080fd5b506100b56100f53660046107c5565b6103f2565b34801561010657600080fd5b506100b561011536600461083f565b61048b565b34801561012657600080fd5b5061013a610135366004610861565b610575565b604051610099919061089e565b34801561015357600080fd5b506100b561016236600461083f565b61060f565b6101708261065b565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806101ee57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166101e2600080516020610b3d8339815191525490565b6001600160a01b031614155b1561020c5760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610266575060408051601f3d908101601f19168201909252610263918101906108d1565b60015b61029357604051630c76093760e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610b3d83398151915281146102c457604051632a87526960e21b81526004810182905260240161028a565b600080516020610b3d8339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a281511561038f576000836001600160a01b03168360405161032b91906108ea565b600060405180830381855af49150503d8060008114610366576040519150601f19603f3d011682016040523d82523d6000602084013e61036b565b606091505b505090508061038d576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103df5760405163703e46dd60e11b815260040160405180910390fd5b50600080516020610b3d83398151915290565b6000546001600160a01b0316331461041c5760405162461bcd60e51b815260040161028a90610906565b60008581526001602052604090206104358284836109c1565b50847f61f7110245e82eddd3b134d1e1607420d4a4dcdab30f5abdbbc9c3485b5dd2a48585600160008a815260200190815260200160002060405161047c93929190610a82565b60405180910390a25050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806104d55750805467ffffffffffffffff808416911610155b156104f25760405162dc149f60e41b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6001602052600090815260409020805461058e90610939565b80601f01602080910402602001604051908101604052809291908181526020018280546105ba90610939565b80156106075780601f106105dc57610100808354040283529160200191610607565b820191906000526020600020905b8154815290600101906020018083116105ea57829003601f168201915b505050505081565b6000546001600160a01b031633146106395760405162461bcd60e51b815260040161028a90610906565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146106855760405162461bcd60e51b815260040161028a90610906565b50565b80356001600160a01b038116811461069f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156106cd57600080fd5b6106d683610688565b9150602083013567ffffffffffffffff808211156106f357600080fd5b818501915085601f83011261070757600080fd5b813581811115610719576107196106a4565b604051601f8201601f19908116603f01168101908382118183101715610741576107416106a4565b8160405282815288602084870101111561075a57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008083601f84011261078e57600080fd5b50813567ffffffffffffffff8111156107a657600080fd5b6020830191508360208285010111156107be57600080fd5b9250929050565b6000806000806000606086880312156107dd57600080fd5b85359450602086013567ffffffffffffffff808211156107fc57600080fd5b61080889838a0161077c565b9096509450604088013591508082111561082157600080fd5b5061082e8882890161077c565b969995985093965092949392505050565b60006020828403121561085157600080fd5b61085a82610688565b9392505050565b60006020828403121561087357600080fd5b5035919050565b60005b8381101561089557818101518382015260200161087d565b50506000910152565b60208152600082518060208401526108bd81604085016020870161087a565b601f01601f19169190910160400192915050565b6000602082840312156108e357600080fd5b5051919050565b600082516108fc81846020870161087a565b9190910192915050565b6020808252601990820152784e6f20616c6c6f7765643a20676f7665726e6f72206f6e6c7960381b604082015260600190565b600181811c9082168061094d57607f821691505b60208210810361096d57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561038f57600081815260208120601f850160051c8101602086101561099a5750805b601f850160051c820191505b818110156109b9578281556001016109a6565b505050505050565b67ffffffffffffffff8311156109d9576109d96106a4565b6109ed836109e78354610939565b83610973565b6000601f841160018114610a215760008515610a095750838201355b600019600387901b1c1916600186901b178355610a7b565b600083815260209020601f19861690835b82811015610a525786850135825560209485019460019092019101610a32565b5086821015610a6f5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b60408152826040820152828460608301376000606084830101526000601f19601f850116820160206060848303018185015260008554610ac181610939565b8060608601526080600180841660008114610ae35760018114610afd57610b2b565b60ff1985168884015283151560051b880183019550610b2b565b8a6000528660002060005b85811015610b235781548a8201860152908301908801610b08565b890184019650505b50939b9a505050505050505050505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122013474a11eb4f083f97a82a4223662ae3b08f8ebecfcac55156e710f84b21048b64736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106100605760003560e01c80630c340a24146100655780634f1ef286146100a257806352d1902d146100b7578063bdf73780146100da578063c4d66de8146100fa578063d3e894831461011a578063e4c0aaf414610147575b600080fd5b34801561007157600080fd5b50600054610085906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100b56100b03660046106ba565b610167565b005b3480156100c357600080fd5b506100cc610394565b604051908152602001610099565b3480156100e657600080fd5b506100b56100f53660046107c5565b6103f2565b34801561010657600080fd5b506100b561011536600461083f565b61048b565b34801561012657600080fd5b5061013a610135366004610861565b610575565b604051610099919061089e565b34801561015357600080fd5b506100b561016236600461083f565b61060f565b6101708261065b565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806101ee57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166101e2600080516020610b3d8339815191525490565b6001600160a01b031614155b1561020c5760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610266575060408051601f3d908101601f19168201909252610263918101906108d1565b60015b61029357604051630c76093760e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610b3d83398151915281146102c457604051632a87526960e21b81526004810182905260240161028a565b600080516020610b3d8339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a281511561038f576000836001600160a01b03168360405161032b91906108ea565b600060405180830381855af49150503d8060008114610366576040519150601f19603f3d011682016040523d82523d6000602084013e61036b565b606091505b505090508061038d576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103df5760405163703e46dd60e11b815260040160405180910390fd5b50600080516020610b3d83398151915290565b6000546001600160a01b0316331461041c5760405162461bcd60e51b815260040161028a90610906565b60008581526001602052604090206104358284836109c1565b50847f61f7110245e82eddd3b134d1e1607420d4a4dcdab30f5abdbbc9c3485b5dd2a48585600160008a815260200190815260200160002060405161047c93929190610a82565b60405180910390a25050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806104d55750805467ffffffffffffffff808416911610155b156104f25760405162dc149f60e41b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6001602052600090815260409020805461058e90610939565b80601f01602080910402602001604051908101604052809291908181526020018280546105ba90610939565b80156106075780601f106105dc57610100808354040283529160200191610607565b820191906000526020600020905b8154815290600101906020018083116105ea57829003601f168201915b505050505081565b6000546001600160a01b031633146106395760405162461bcd60e51b815260040161028a90610906565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146106855760405162461bcd60e51b815260040161028a90610906565b50565b80356001600160a01b038116811461069f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156106cd57600080fd5b6106d683610688565b9150602083013567ffffffffffffffff808211156106f357600080fd5b818501915085601f83011261070757600080fd5b813581811115610719576107196106a4565b604051601f8201601f19908116603f01168101908382118183101715610741576107416106a4565b8160405282815288602084870101111561075a57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008083601f84011261078e57600080fd5b50813567ffffffffffffffff8111156107a657600080fd5b6020830191508360208285010111156107be57600080fd5b9250929050565b6000806000806000606086880312156107dd57600080fd5b85359450602086013567ffffffffffffffff808211156107fc57600080fd5b61080889838a0161077c565b9096509450604088013591508082111561082157600080fd5b5061082e8882890161077c565b969995985093965092949392505050565b60006020828403121561085157600080fd5b61085a82610688565b9392505050565b60006020828403121561087357600080fd5b5035919050565b60005b8381101561089557818101518382015260200161087d565b50506000910152565b60208152600082518060208401526108bd81604085016020870161087a565b601f01601f19169190910160400192915050565b6000602082840312156108e357600080fd5b5051919050565b600082516108fc81846020870161087a565b9190910192915050565b6020808252601990820152784e6f20616c6c6f7765643a20676f7665726e6f72206f6e6c7960381b604082015260600190565b600181811c9082168061094d57607f821691505b60208210810361096d57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561038f57600081815260208120601f850160051c8101602086101561099a5750805b601f850160051c820191505b818110156109b9578281556001016109a6565b505050505050565b67ffffffffffffffff8311156109d9576109d96106a4565b6109ed836109e78354610939565b83610973565b6000601f841160018114610a215760008515610a095750838201355b600019600387901b1c1916600186901b178355610a7b565b600083815260209020601f19861690835b82811015610a525786850135825560209485019460019092019101610a32565b5086821015610a6f5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b60408152826040820152828460608301376000606084830101526000601f19601f850116820160206060848303018185015260008554610ac181610939565b8060608601526080600180841660008114610ae35760018114610afd57610b2b565b60ff1985168884015283151560051b880183019550610b2b565b8a6000528660002060005b85811015610b235781548a8201860152908301908801610b08565b890184019650505b50939b9a505050505050505050505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122013474a11eb4f083f97a82a4223662ae3b08f8ebecfcac55156e710f84b21048b64736f6c63430008120033", + "devdoc": { + "details": "A contract to maintain a policy for each court.", + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "PolicyUpdate(uint256,string,string)": { + "details": "Emitted when a policy is updated.", + "params": { + "_courtID": "The ID of the policy's court.", + "_courtName": "The name of the policy's court.", + "_policy": "The URI of the policy JSON." + } + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "changeGovernor(address)": { + "details": "Changes the `governor` storage variable.", + "params": { + "_governor": "The new value for the `governor` storage variable." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "initialize(address)": { + "details": "Constructs the `PolicyRegistry` contract.", + "params": { + "_governor": "The governor's address." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "setPolicy(uint256,string,string)": { + "details": "Sets the policy for the specified court.", + "params": { + "_courtID": "The ID of the specified court.", + "_courtName": "The name of the specified court.", + "_policy": "The URI of the policy JSON." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "title": "PolicyRegistry", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 7764, + "contract": "src/arbitration/PolicyRegistry.sol:PolicyRegistry", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 7768, + "contract": "src/arbitration/PolicyRegistry.sol:PolicyRegistry", + "label": "policies", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint256,t_string_storage)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_mapping(t_uint256,t_string_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => string)", + "numberOfBytes": "32", + "value": "t_string_storage" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/PolicyRegistry_Proxy.json b/contracts/deployments/arbitrumSepoliaDevnet/PolicyRegistry_Proxy.json new file mode 100644 index 000000000..b27e100f1 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/PolicyRegistry_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xef6e43f7d3ea2175f5e10670a58a8df80a1ac1c55d189d0a27608ab5dd166b2a", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da", + "transactionIndex": 1, + "gasUsed": "175189", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000008000080000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000004000000000000000000000000000000000000000", + "blockHash": "0xbe53ead690ecc30663a1500d067ac05b04ccd082bff5f4bf43e72a6df95e4969", + "transactionHash": "0xef6e43f7d3ea2175f5e10670a58a8df80a1ac1c55d189d0a27608ab5dd166b2a", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084568, + "transactionHash": "0xef6e43f7d3ea2175f5e10670a58a8df80a1ac1c55d189d0a27608ab5dd166b2a", + "address": "0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0xbe53ead690ecc30663a1500d067ac05b04ccd082bff5f4bf43e72a6df95e4969" + } + ], + "blockNumber": 3084568, + "cumulativeGasUsed": "175189", + "status": 1, + "byzantium": true + }, + "args": [ + "0xAA637C9E2831614158d7eB193D03af4a7223C56E", + "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/RandomizerOracle.json b/contracts/deployments/arbitrumSepoliaDevnet/RandomizerOracle.json new file mode 100644 index 000000000..0ed65f9d1 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/RandomizerOracle.json @@ -0,0 +1,4 @@ +{ + "address": "0xE775D7fde1d0D09ae627C0131040012ccBcC4b9b", + "abi": [] +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/RandomizerRNG.json b/contracts/deployments/arbitrumSepoliaDevnet/RandomizerRNG.json new file mode 100644 index 000000000..d00c25a5a --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/RandomizerRNG.json @@ -0,0 +1,397 @@ +{ + "address": "0xA995C172d286f8F4eE137CC662e2844E59Cf4836", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "callbackGasLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IRandomizer", + "name": "_randomizer", + "type": "address" + }, + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "randomNumbers", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomizer", + "outputs": [ + { + "internalType": "contract IRandomizer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_id", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_value", + "type": "bytes32" + } + ], + "name": "randomizerCallback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "randomizerWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "receiveRandomness", + "outputs": [ + { + "internalType": "uint256", + "name": "randomNumber", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "requestRandomness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "requesterToID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_callbackGasLimit", + "type": "uint256" + } + ], + "name": "setCallbackGasLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_randomizer", + "type": "address" + } + ], + "name": "setRandomizer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0xf543e62b3b8ad026e5b00f0976d46b3d1410cd3d1512c6aea9be565d4c859160", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xA995C172d286f8F4eE137CC662e2844E59Cf4836", + "transactionIndex": 1, + "gasUsed": "220058", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400020000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x9a62b4f9fef98d5cbf41d8efe1729176416007c156509d9bc2c995f4329500d2", + "transactionHash": "0xf543e62b3b8ad026e5b00f0976d46b3d1410cd3d1512c6aea9be565d4c859160", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084582, + "transactionHash": "0xf543e62b3b8ad026e5b00f0976d46b3d1410cd3d1512c6aea9be565d4c859160", + "address": "0xA995C172d286f8F4eE137CC662e2844E59Cf4836", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x9a62b4f9fef98d5cbf41d8efe1729176416007c156509d9bc2c995f4329500d2" + } + ], + "blockNumber": 3084582, + "cumulativeGasUsed": "220058", + "status": 1, + "byzantium": true + }, + "args": [ + "0xe62B776498F48061ef9425fCEf30F3d1370DB005", + "0x485cc955000000000000000000000000e775d7fde1d0d09ae627c0131040012ccbcc4b9b000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xE775D7fde1d0D09ae627C0131040012ccBcC4b9b", + "0xf1C7c037891525E360C59f708739Ac09A7670c59" + ] + }, + "implementation": "0xe62B776498F48061ef9425fCEf30F3d1370DB005", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/RandomizerRNG_Implementation.json b/contracts/deployments/arbitrumSepoliaDevnet/RandomizerRNG_Implementation.json new file mode 100644 index 000000000..b91e04100 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/RandomizerRNG_Implementation.json @@ -0,0 +1,533 @@ +{ + "address": "0xe62B776498F48061ef9425fCEf30F3d1370DB005", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "callbackGasLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IRandomizer", + "name": "_randomizer", + "type": "address" + }, + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "randomNumbers", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomizer", + "outputs": [ + { + "internalType": "contract IRandomizer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_id", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_value", + "type": "bytes32" + } + ], + "name": "randomizerCallback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "randomizerWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "receiveRandomness", + "outputs": [ + { + "internalType": "uint256", + "name": "randomNumber", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "requestRandomness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "requesterToID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_callbackGasLimit", + "type": "uint256" + } + ], + "name": "setCallbackGasLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_randomizer", + "type": "address" + } + ], + "name": "setRandomizer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0xd0495671b6a89573df16c54469800afc1e2c7b143523f906292f51f9efab6014", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xe62B776498F48061ef9425fCEf30F3d1370DB005", + "transactionIndex": 1, + "gasUsed": "699434", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000400000000000000000000000000000100000000000080", + "blockHash": "0xf38a5e092f244d67d971ea16f5ef80b728c5767c6cbc2b9a91893eb40cb4d361", + "transactionHash": "0xd0495671b6a89573df16c54469800afc1e2c7b143523f906292f51f9efab6014", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084575, + "transactionHash": "0xd0495671b6a89573df16c54469800afc1e2c7b143523f906292f51f9efab6014", + "address": "0xe62B776498F48061ef9425fCEf30F3d1370DB005", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 0, + "blockHash": "0xf38a5e092f244d67d971ea16f5ef80b728c5767c6cbc2b9a91893eb40cb4d361" + } + ], + "blockNumber": 3084575, + "cumulativeGasUsed": "699434", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"callbackGasLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IRandomizer\",\"name\":\"_randomizer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"randomNumbers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomizer\",\"outputs\":[{\"internalType\":\"contract IRandomizer\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_value\",\"type\":\"bytes32\"}],\"name\":\"randomizerCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"randomizerWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"receiveRandomness\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"randomNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"requestRandomness\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"requesterToID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_callbackGasLimit\",\"type\":\"uint256\"}],\"name\":\"setCallbackGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_randomizer\",\"type\":\"address\"}],\"name\":\"setRandomizer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"changeGovernor(address)\":{\"details\":\"Changes the governor of the contract.\",\"params\":{\"_governor\":\"The new governor.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"initialize(address,address)\":{\"details\":\"Initializer\",\"params\":{\"_governor\":\"Governor of the contract.\",\"_randomizer\":\"Randomizer contract.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"randomizerCallback(uint256,bytes32)\":{\"details\":\"Callback function called by the randomizer contract when the random value is generated.\"},\"randomizerWithdraw(uint256)\":{\"details\":\"Allows the governor to withdraw randomizer funds.\",\"params\":{\"_amount\":\"Amount to withdraw in wei.\"}},\"receiveRandomness(uint256)\":{\"details\":\"Return the random number.\",\"returns\":{\"randomNumber\":\"The random number or 0 if it is not ready or has not been requested.\"}},\"requestRandomness(uint256)\":{\"details\":\"Request a random number. The id of the request is tied to the sender.\"},\"setCallbackGasLimit(uint256)\":{\"details\":\"Change the Randomizer callback gas limit.\",\"params\":{\"_callbackGasLimit\":\"the new limit.\"}},\"setRandomizer(address)\":{\"details\":\"Change the Randomizer address.\",\"params\":{\"_randomizer\":\"the new Randomizer address.\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"Random Number Generator that uses Randomizer.ai https://randomizer.ai/\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/rng/RandomizerRNG.sol\":\"RandomizerRNG\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"},\"src/rng/IRandomizer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n// Randomizer protocol interface\\ninterface IRandomizer {\\n function request(uint256 callbackGasLimit) external returns (uint256);\\n\\n function clientWithdrawTo(address _to, uint256 _amount) external;\\n}\\n\",\"keccak256\":\"0xe71bbdd9470eeb89f5d10aee07fda95b6ccc13aa845c0d8c0bc7a9ec20b6356e\",\"license\":\"MIT\"},\"src/rng/RNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\ninterface RNG {\\n /// @dev Request a random number.\\n /// @param _block Block linked to the request.\\n function requestRandomness(uint256 _block) external;\\n\\n /// @dev Receive the random number.\\n /// @param _block Block the random number is linked to.\\n /// @return randomNumber Random Number. If the number is not ready or has not been required 0 instead.\\n function receiveRandomness(uint256 _block) external returns (uint256 randomNumber);\\n}\\n\",\"keccak256\":\"0x5afe7121f49aebe72218df356bd91b66c2171b9ad15e7945a15a091784291a43\",\"license\":\"MIT\"},\"src/rng/RandomizerRNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./RNG.sol\\\";\\nimport \\\"./IRandomizer.sol\\\";\\nimport \\\"../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title Random Number Generator that uses Randomizer.ai\\n/// https://randomizer.ai/\\ncontract RandomizerRNG is RNG, UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The address that can withdraw funds.\\n uint256 public callbackGasLimit; // Gas limit for the randomizer callback\\n IRandomizer public randomizer; // Randomizer address.\\n mapping(uint256 => uint256) public randomNumbers; // randomNumbers[requestID] is the random number for this request id, 0 otherwise.\\n mapping(address => uint256) public requesterToID; // Maps the requester to his latest request ID.\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Governor only\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer\\n /// @param _randomizer Randomizer contract.\\n /// @param _governor Governor of the contract.\\n function initialize(IRandomizer _randomizer, address _governor) external reinitializer(1) {\\n randomizer = _randomizer;\\n governor = _governor;\\n callbackGasLimit = 50000;\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /**\\n * @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Changes the governor of the contract.\\n /// @param _governor The new governor.\\n function changeGovernor(address _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Change the Randomizer callback gas limit.\\n /// @param _callbackGasLimit the new limit.\\n function setCallbackGasLimit(uint256 _callbackGasLimit) external onlyByGovernor {\\n callbackGasLimit = _callbackGasLimit;\\n }\\n\\n /// @dev Change the Randomizer address.\\n /// @param _randomizer the new Randomizer address.\\n function setRandomizer(address _randomizer) external onlyByGovernor {\\n randomizer = IRandomizer(_randomizer);\\n }\\n\\n /// @dev Allows the governor to withdraw randomizer funds.\\n /// @param _amount Amount to withdraw in wei.\\n function randomizerWithdraw(uint256 _amount) external onlyByGovernor {\\n randomizer.clientWithdrawTo(msg.sender, _amount);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Request a random number. The id of the request is tied to the sender.\\n function requestRandomness(uint256 /*_block*/) external override {\\n uint256 id = randomizer.request(callbackGasLimit);\\n requesterToID[msg.sender] = id;\\n }\\n\\n /// @dev Callback function called by the randomizer contract when the random value is generated.\\n function randomizerCallback(uint256 _id, bytes32 _value) external {\\n require(msg.sender == address(randomizer), \\\"Randomizer only\\\");\\n randomNumbers[_id] = uint256(_value);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Return the random number.\\n /// @return randomNumber The random number or 0 if it is not ready or has not been requested.\\n function receiveRandomness(uint256 /*_block*/) external view override returns (uint256 randomNumber) {\\n // Get the latest request ID for this requester.\\n uint256 id = requesterToID[msg.sender];\\n randomNumber = randomNumbers[id];\\n }\\n}\\n\",\"keccak256\":\"0x4285391be2975df0c7d1fa2fcdcd8abe8458e3228961ba32dec1e97325598df0\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060805234801561001457600080fd5b5061001d610022565b6100d3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff16156100715760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b03908116146100d05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051610b396100fc600039600081816104a1015281816104ca01526106c20152610b396000f3fe6080604052600436106100c85760003560e01c806352d1902d1161007a57806352d1902d146101ec57806371d4b00b146102015780637363ae1f1461022e578063767bcab51461024e5780638a54942f1461026e578063e4c0aaf41461028e578063ebe93caf146102ae578063f10fb584146102ce57600080fd5b80630c340a24146100cd57806313cf90541461010a57806324f7469714610154578063485cc9551461016a5780634e07c9391461018c5780634f1ef286146101ac5780635257cd90146101bf575b600080fd5b3480156100d957600080fd5b506000546100ed906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011657600080fd5b506101466101253660046108ed565b50336000908152600460209081526040808320548352600390915290205490565b604051908152602001610101565b34801561016057600080fd5b5061014660015481565b34801561017657600080fd5b5061018a61018536600461091b565b6102ee565b005b34801561019857600080fd5b5061018a6101a73660046108ed565b6103f3565b61018a6101ba36600461096a565b61048d565b3480156101cb57600080fd5b506101466101da3660046108ed565b60036020526000908152604090205481565b3480156101f857600080fd5b506101466106b5565b34801561020d57600080fd5b5061014661021c366004610a2e565b60046020526000908152604090205481565b34801561023a57600080fd5b5061018a6102493660046108ed565b610713565b34801561025a57600080fd5b5061018a610269366004610a2e565b61079b565b34801561027a57600080fd5b5061018a6102893660046108ed565b6107e7565b34801561029a57600080fd5b5061018a6102a9366004610a2e565b610816565b3480156102ba57600080fd5b5061018a6102c9366004610a52565b610862565b3480156102da57600080fd5b506002546100ed906001600160a01b031681565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806103385750805467ffffffffffffffff808416911610155b156103555760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff8316908117600160401b178255600280546001600160a01b038781166001600160a01b031992831617909255600080549287169290911691909117905561c350600155815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b6000546001600160a01b031633146104265760405162461bcd60e51b815260040161041d90610a74565b60405180910390fd5b600254604051632465f8f560e01b8152336004820152602481018390526001600160a01b0390911690632465f8f590604401600060405180830381600087803b15801561047257600080fd5b505af1158015610486573d6000803e3d6000fd5b5050505050565b610496826108c0565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061051457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610508600080516020610ae48339815191525490565b6001600160a01b031614155b156105325760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561058c575060408051601f3d908101601f1916820190925261058991810190610a9b565b60015b6105b457604051630c76093760e01b81526001600160a01b038316600482015260240161041d565b600080516020610ae483398151915281146105e557604051632a87526960e21b81526004810182905260240161041d565b600080516020610ae48339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28151156106b0576000836001600160a01b03168360405161064c9190610ab4565b600060405180830381855af49150503d8060008114610687576040519150601f19603f3d011682016040523d82523d6000602084013e61068c565b606091505b50509050806106ae576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146107005760405163703e46dd60e11b815260040160405180910390fd5b50600080516020610ae483398151915290565b60025460015460405163d845a4b360e01b815260048101919091526000916001600160a01b03169063d845a4b3906024016020604051808303816000875af1158015610763573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107879190610a9b565b336000908152600460205260409020555050565b6000546001600160a01b031633146107c55760405162461bcd60e51b815260040161041d90610a74565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146108115760405162461bcd60e51b815260040161041d90610a74565b600155565b6000546001600160a01b031633146108405760405162461bcd60e51b815260040161041d90610a74565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031633146108ae5760405162461bcd60e51b815260206004820152600f60248201526e52616e646f6d697a6572206f6e6c7960881b604482015260640161041d565b60009182526003602052604090912055565b6000546001600160a01b031633146108ea5760405162461bcd60e51b815260040161041d90610a74565b50565b6000602082840312156108ff57600080fd5b5035919050565b6001600160a01b03811681146108ea57600080fd5b6000806040838503121561092e57600080fd5b823561093981610906565b9150602083013561094981610906565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561097d57600080fd5b823561098881610906565b9150602083013567ffffffffffffffff808211156109a557600080fd5b818501915085601f8301126109b957600080fd5b8135818111156109cb576109cb610954565b604051601f8201601f19908116603f011681019083821181831017156109f3576109f3610954565b81604052828152886020848701011115610a0c57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600060208284031215610a4057600080fd5b8135610a4b81610906565b9392505050565b60008060408385031215610a6557600080fd5b50508035926020909101359150565b6020808252600d908201526c476f7665726e6f72206f6e6c7960981b604082015260600190565b600060208284031215610aad57600080fd5b5051919050565b6000825160005b81811015610ad55760208186018101518583015201610abb565b50600092019182525091905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220aec03dad51a46b09534bed3ffa73b065bf3cda8ee37f8b3126efdc48f7db06ed64736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106100c85760003560e01c806352d1902d1161007a57806352d1902d146101ec57806371d4b00b146102015780637363ae1f1461022e578063767bcab51461024e5780638a54942f1461026e578063e4c0aaf41461028e578063ebe93caf146102ae578063f10fb584146102ce57600080fd5b80630c340a24146100cd57806313cf90541461010a57806324f7469714610154578063485cc9551461016a5780634e07c9391461018c5780634f1ef286146101ac5780635257cd90146101bf575b600080fd5b3480156100d957600080fd5b506000546100ed906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011657600080fd5b506101466101253660046108ed565b50336000908152600460209081526040808320548352600390915290205490565b604051908152602001610101565b34801561016057600080fd5b5061014660015481565b34801561017657600080fd5b5061018a61018536600461091b565b6102ee565b005b34801561019857600080fd5b5061018a6101a73660046108ed565b6103f3565b61018a6101ba36600461096a565b61048d565b3480156101cb57600080fd5b506101466101da3660046108ed565b60036020526000908152604090205481565b3480156101f857600080fd5b506101466106b5565b34801561020d57600080fd5b5061014661021c366004610a2e565b60046020526000908152604090205481565b34801561023a57600080fd5b5061018a6102493660046108ed565b610713565b34801561025a57600080fd5b5061018a610269366004610a2e565b61079b565b34801561027a57600080fd5b5061018a6102893660046108ed565b6107e7565b34801561029a57600080fd5b5061018a6102a9366004610a2e565b610816565b3480156102ba57600080fd5b5061018a6102c9366004610a52565b610862565b3480156102da57600080fd5b506002546100ed906001600160a01b031681565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806103385750805467ffffffffffffffff808416911610155b156103555760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff8316908117600160401b178255600280546001600160a01b038781166001600160a01b031992831617909255600080549287169290911691909117905561c350600155815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b6000546001600160a01b031633146104265760405162461bcd60e51b815260040161041d90610a74565b60405180910390fd5b600254604051632465f8f560e01b8152336004820152602481018390526001600160a01b0390911690632465f8f590604401600060405180830381600087803b15801561047257600080fd5b505af1158015610486573d6000803e3d6000fd5b5050505050565b610496826108c0565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061051457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610508600080516020610ae48339815191525490565b6001600160a01b031614155b156105325760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561058c575060408051601f3d908101601f1916820190925261058991810190610a9b565b60015b6105b457604051630c76093760e01b81526001600160a01b038316600482015260240161041d565b600080516020610ae483398151915281146105e557604051632a87526960e21b81526004810182905260240161041d565b600080516020610ae48339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28151156106b0576000836001600160a01b03168360405161064c9190610ab4565b600060405180830381855af49150503d8060008114610687576040519150601f19603f3d011682016040523d82523d6000602084013e61068c565b606091505b50509050806106ae576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146107005760405163703e46dd60e11b815260040160405180910390fd5b50600080516020610ae483398151915290565b60025460015460405163d845a4b360e01b815260048101919091526000916001600160a01b03169063d845a4b3906024016020604051808303816000875af1158015610763573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107879190610a9b565b336000908152600460205260409020555050565b6000546001600160a01b031633146107c55760405162461bcd60e51b815260040161041d90610a74565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146108115760405162461bcd60e51b815260040161041d90610a74565b600155565b6000546001600160a01b031633146108405760405162461bcd60e51b815260040161041d90610a74565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031633146108ae5760405162461bcd60e51b815260206004820152600f60248201526e52616e646f6d697a6572206f6e6c7960881b604482015260640161041d565b60009182526003602052604090912055565b6000546001600160a01b031633146108ea5760405162461bcd60e51b815260040161041d90610a74565b50565b6000602082840312156108ff57600080fd5b5035919050565b6001600160a01b03811681146108ea57600080fd5b6000806040838503121561092e57600080fd5b823561093981610906565b9150602083013561094981610906565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561097d57600080fd5b823561098881610906565b9150602083013567ffffffffffffffff808211156109a557600080fd5b818501915085601f8301126109b957600080fd5b8135818111156109cb576109cb610954565b604051601f8201601f19908116603f011681019083821181831017156109f3576109f3610954565b81604052828152886020848701011115610a0c57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600060208284031215610a4057600080fd5b8135610a4b81610906565b9392505050565b60008060408385031215610a6557600080fd5b50508035926020909101359150565b6020808252600d908201526c476f7665726e6f72206f6e6c7960981b604082015260600190565b600060208284031215610aad57600080fd5b5051919050565b6000825160005b81811015610ad55760208186018101518583015201610abb565b50600092019182525091905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220aec03dad51a46b09534bed3ffa73b065bf3cda8ee37f8b3126efdc48f7db06ed64736f6c63430008120033", + "devdoc": { + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "changeGovernor(address)": { + "details": "Changes the governor of the contract.", + "params": { + "_governor": "The new governor." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "initialize(address,address)": { + "details": "Initializer", + "params": { + "_governor": "Governor of the contract.", + "_randomizer": "Randomizer contract." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "randomizerCallback(uint256,bytes32)": { + "details": "Callback function called by the randomizer contract when the random value is generated." + }, + "randomizerWithdraw(uint256)": { + "details": "Allows the governor to withdraw randomizer funds.", + "params": { + "_amount": "Amount to withdraw in wei." + } + }, + "receiveRandomness(uint256)": { + "details": "Return the random number.", + "returns": { + "randomNumber": "The random number or 0 if it is not ready or has not been requested." + } + }, + "requestRandomness(uint256)": { + "details": "Request a random number. The id of the request is tied to the sender." + }, + "setCallbackGasLimit(uint256)": { + "details": "Change the Randomizer callback gas limit.", + "params": { + "_callbackGasLimit": "the new limit." + } + }, + "setRandomizer(address)": { + "details": "Change the Randomizer address.", + "params": { + "_randomizer": "the new Randomizer address." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "title": "Random Number Generator that uses Randomizer.ai https://randomizer.ai/", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 24301, + "contract": "src/rng/RandomizerRNG.sol:RandomizerRNG", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 24303, + "contract": "src/rng/RandomizerRNG.sol:RandomizerRNG", + "label": "callbackGasLimit", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 24306, + "contract": "src/rng/RandomizerRNG.sol:RandomizerRNG", + "label": "randomizer", + "offset": 0, + "slot": "2", + "type": "t_contract(IRandomizer)24229" + }, + { + "astId": 24310, + "contract": "src/rng/RandomizerRNG.sol:RandomizerRNG", + "label": "randomNumbers", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 24314, + "contract": "src/rng/RandomizerRNG.sol:RandomizerRNG", + "label": "requesterToID", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_address,t_uint256)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_contract(IRandomizer)24229": { + "encoding": "inplace", + "label": "contract IRandomizer", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/RandomizerRNG_Proxy.json b/contracts/deployments/arbitrumSepoliaDevnet/RandomizerRNG_Proxy.json new file mode 100644 index 000000000..39c2ea724 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/RandomizerRNG_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0xA995C172d286f8F4eE137CC662e2844E59Cf4836", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xf543e62b3b8ad026e5b00f0976d46b3d1410cd3d1512c6aea9be565d4c859160", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xA995C172d286f8F4eE137CC662e2844E59Cf4836", + "transactionIndex": 1, + "gasUsed": "220058", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400020000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x9a62b4f9fef98d5cbf41d8efe1729176416007c156509d9bc2c995f4329500d2", + "transactionHash": "0xf543e62b3b8ad026e5b00f0976d46b3d1410cd3d1512c6aea9be565d4c859160", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084582, + "transactionHash": "0xf543e62b3b8ad026e5b00f0976d46b3d1410cd3d1512c6aea9be565d4c859160", + "address": "0xA995C172d286f8F4eE137CC662e2844E59Cf4836", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x9a62b4f9fef98d5cbf41d8efe1729176416007c156509d9bc2c995f4329500d2" + } + ], + "blockNumber": 3084582, + "cumulativeGasUsed": "220058", + "status": 1, + "byzantium": true + }, + "args": [ + "0xe62B776498F48061ef9425fCEf30F3d1370DB005", + "0x485cc955000000000000000000000000e775d7fde1d0d09ae627c0131040012ccbcc4b9b000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule.json b/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule.json new file mode 100644 index 000000000..23b22c36b --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule.json @@ -0,0 +1,1053 @@ +{ + "address": "0xf327200420F21BAafce8F1C03B1EEdF926074B95", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum ISortitionModule.Phase", + "name": "_phase", + "type": "uint8" + } + ], + "name": "NewPhase", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedAlreadyTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedAlreadyTransferredWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedNotTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_unlock", + "type": "bool" + } + ], + "name": "StakeLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_K", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_STAKE_PATHS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxDrawingTime", + "type": "uint256" + } + ], + "name": "changeMaxDrawingTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minStakingTime", + "type": "uint256" + } + ], + "name": "changeMinStakingTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract RNG", + "name": "_rng", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_rngLookahead", + "type": "uint256" + } + ], + "name": "changeRandomNumberGenerator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "core", + "outputs": [ + { + "internalType": "contract KlerosCore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "createDisputeHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "createTree", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "delayedStakeReadIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "delayedStakeWriteIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "delayedStakes", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "stake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "alreadyTransferred", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disputesWithoutJurors", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [ + { + "internalType": "address", + "name": "drawnAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "executeDelayedStakes", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "getJurorBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "totalStaked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalLocked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakedInCourt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbCourts", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + } + ], + "name": "getJurorCourtIDs", + "outputs": [ + { + "internalType": "uint96[]", + "name": "", + "type": "uint96[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract KlerosCore", + "name": "_core", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minStakingTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxDrawingTime", + "type": "uint256" + }, + { + "internalType": "contract RNG", + "name": "_rng", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_rngLookahead", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + } + ], + "name": "isJurorStaked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "jurors", + "outputs": [ + { + "internalType": "uint256", + "name": "stakedPnk", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockedPnk", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastPhaseChange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "name": "latestDelayedStakeIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "lockStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxDrawingTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minStakingTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_randomNumber", + "type": "uint256" + } + ], + "name": "notifyRandomNumber", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "passPhase", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "penalizeStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "phase", + "outputs": [ + { + "internalType": "enum ISortitionModule.Phase", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "postDrawHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomNumberRequestBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rng", + "outputs": [ + { + "internalType": "contract RNG", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rngLookahead", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "setJurorInactive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_alreadyTransferred", + "type": "bool" + } + ], + "name": "setStake", + "outputs": [ + { + "internalType": "uint256", + "name": "pnkDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkWithdrawal", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "succeeded", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_ID", + "type": "bytes32" + } + ], + "name": "stakeOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "stakeOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "unlockStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0x586f56da98113e584a9355075402333309687bf056333595d5407301acfa14c0", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xf327200420F21BAafce8F1C03B1EEdF926074B95", + "transactionIndex": 1, + "gasUsed": "332147", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000100000000000400000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xd68a4f4bfb4408a7c73c9b14bea1403fa89ec354d86f7e85df074b9104d9b6f7", + "transactionHash": "0x586f56da98113e584a9355075402333309687bf056333595d5407301acfa14c0", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084593, + "transactionHash": "0x586f56da98113e584a9355075402333309687bf056333595d5407301acfa14c0", + "address": "0xf327200420F21BAafce8F1C03B1EEdF926074B95", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0xd68a4f4bfb4408a7c73c9b14bea1403fa89ec354d86f7e85df074b9104d9b6f7" + } + ], + "blockNumber": 3084593, + "cumulativeGasUsed": "332147", + "status": 1, + "byzantium": true + }, + "args": [ + "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9", + "0x54812d17000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c590000000000000000000000004dd8b69958ef1d7d5da9347e9d9f57adfc3dc28400000000000000000000000000000000000000000000000000000000000000b40000000000000000000000000000000000000000000000000000000000000258000000000000000000000000a995c172d286f8f4ee137cc662e2844e59cf48360000000000000000000000000000000000000000000000000000000000000014" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + 180, + 600, + "0xA995C172d286f8F4eE137CC662e2844E59Cf4836", + 20 + ] + }, + "implementation": "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule_Implementation.json b/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule_Implementation.json new file mode 100644 index 000000000..ab953de22 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule_Implementation.json @@ -0,0 +1,1533 @@ +{ + "address": "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum ISortitionModule.Phase", + "name": "_phase", + "type": "uint8" + } + ], + "name": "NewPhase", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedAlreadyTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedAlreadyTransferredWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedNotTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_unlock", + "type": "bool" + } + ], + "name": "StakeLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_K", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_STAKE_PATHS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxDrawingTime", + "type": "uint256" + } + ], + "name": "changeMaxDrawingTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minStakingTime", + "type": "uint256" + } + ], + "name": "changeMinStakingTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract RNG", + "name": "_rng", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_rngLookahead", + "type": "uint256" + } + ], + "name": "changeRandomNumberGenerator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "core", + "outputs": [ + { + "internalType": "contract KlerosCore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "createDisputeHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "createTree", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "delayedStakeReadIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "delayedStakeWriteIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "delayedStakes", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "stake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "alreadyTransferred", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disputesWithoutJurors", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [ + { + "internalType": "address", + "name": "drawnAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "executeDelayedStakes", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "getJurorBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "totalStaked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalLocked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakedInCourt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbCourts", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + } + ], + "name": "getJurorCourtIDs", + "outputs": [ + { + "internalType": "uint96[]", + "name": "", + "type": "uint96[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract KlerosCore", + "name": "_core", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minStakingTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxDrawingTime", + "type": "uint256" + }, + { + "internalType": "contract RNG", + "name": "_rng", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_rngLookahead", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + } + ], + "name": "isJurorStaked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "jurors", + "outputs": [ + { + "internalType": "uint256", + "name": "stakedPnk", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockedPnk", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastPhaseChange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "name": "latestDelayedStakeIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "lockStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxDrawingTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minStakingTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_randomNumber", + "type": "uint256" + } + ], + "name": "notifyRandomNumber", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "passPhase", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "penalizeStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "phase", + "outputs": [ + { + "internalType": "enum ISortitionModule.Phase", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "postDrawHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomNumberRequestBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rng", + "outputs": [ + { + "internalType": "contract RNG", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rngLookahead", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "setJurorInactive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_alreadyTransferred", + "type": "bool" + } + ], + "name": "setStake", + "outputs": [ + { + "internalType": "uint256", + "name": "pnkDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkWithdrawal", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "succeeded", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_ID", + "type": "bytes32" + } + ], + "name": "stakeOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "stakeOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "unlockStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x1aa215a0d368b34755088e1f44fe0ef55824f2ed0ee75344e9b164a1befedfb6", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9", + "transactionIndex": 1, + "gasUsed": "2648721", + "logsBloom": "0x00000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xe98200ae0d91356076f06e1c16aedfa7cecf01eadb579192dd18aa160dfd3627", + "transactionHash": "0x1aa215a0d368b34755088e1f44fe0ef55824f2ed0ee75344e9b164a1befedfb6", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084588, + "transactionHash": "0x1aa215a0d368b34755088e1f44fe0ef55824f2ed0ee75344e9b164a1befedfb6", + "address": "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 0, + "blockHash": "0xe98200ae0d91356076f06e1c16aedfa7cecf01eadb579192dd18aa160dfd3627" + } + ], + "blockNumber": 3084588, + "cumulativeGasUsed": "2648721", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"enum ISortitionModule.Phase\",\"name\":\"_phase\",\"type\":\"uint8\"}],\"name\":\"NewPhase\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeDelayedAlreadyTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeDelayedAlreadyTransferredWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeDelayedNotTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_unlock\",\"type\":\"bool\"}],\"name\":\"StakeLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_K\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_STAKE_PATHS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxDrawingTime\",\"type\":\"uint256\"}],\"name\":\"changeMaxDrawingTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minStakingTime\",\"type\":\"uint256\"}],\"name\":\"changeMinStakingTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_rngLookahead\",\"type\":\"uint256\"}],\"name\":\"changeRandomNumberGenerator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"core\",\"outputs\":[{\"internalType\":\"contract KlerosCore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"createDisputeHook\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createTree\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"delayedStakeReadIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"delayedStakeWriteIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"delayedStakes\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"alreadyTransferred\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disputesWithoutJurors\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"drawnAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"executeDelayedStakes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"getJurorBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalStaked\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalLocked\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"stakedInCourt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbCourts\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"}],\"name\":\"getJurorCourtIDs\",\"outputs\":[{\"internalType\":\"uint96[]\",\"name\":\"\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract KlerosCore\",\"name\":\"_core\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_minStakingTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxDrawingTime\",\"type\":\"uint256\"},{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_rngLookahead\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"}],\"name\":\"isJurorStaked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"jurors\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"stakedPnk\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lockedPnk\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastPhaseChange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"name\":\"latestDelayedStakeIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"}],\"name\":\"lockStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxDrawingTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minStakingTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_randomNumber\",\"type\":\"uint256\"}],\"name\":\"notifyRandomNumber\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passPhase\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"}],\"name\":\"penalizeStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"phase\",\"outputs\":[{\"internalType\":\"enum ISortitionModule.Phase\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"postDrawHook\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomNumberRequestBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rng\",\"outputs\":[{\"internalType\":\"contract RNG\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rngLookahead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"setJurorInactive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_newStake\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"_alreadyTransferred\",\"type\":\"bool\"}],\"name\":\"setStake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"pnkDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pnkWithdrawal\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"succeeded\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_ID\",\"type\":\"bytes32\"}],\"name\":\"stakeOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"stakeOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"}],\"name\":\"unlockStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"A factory of trees that keeps track of staked values for sortition.\",\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"changeMaxDrawingTime(uint256)\":{\"details\":\"Changes the `maxDrawingTime` storage variable.\",\"params\":{\"_maxDrawingTime\":\"The new value for the `maxDrawingTime` storage variable.\"}},\"changeMinStakingTime(uint256)\":{\"details\":\"Changes the `minStakingTime` storage variable.\",\"params\":{\"_minStakingTime\":\"The new value for the `minStakingTime` storage variable.\"}},\"changeRandomNumberGenerator(address,uint256)\":{\"details\":\"Changes the `_rng` and `_rngLookahead` storage variables.\",\"params\":{\"_rng\":\"The new value for the `RNGenerator` storage variable.\",\"_rngLookahead\":\"The new value for the `rngLookahead` storage variable.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"createTree(bytes32,bytes)\":{\"details\":\"Create a sortition sum tree at the specified key.\",\"params\":{\"_extraData\":\"Extra data that contains the number of children each node in the tree should have.\",\"_key\":\"The key of the new tree.\"}},\"draw(bytes32,uint256,uint256)\":{\"details\":\"Draw an ID from a tree using a number. Note that this function reverts if the sum of all values in the tree is 0.\",\"params\":{\"_coreDisputeID\":\"Index of the dispute in Kleros Core.\",\"_key\":\"The key of the tree.\",\"_nonce\":\"Nonce to hash with random number.\"},\"returns\":{\"drawnAddress\":\"The drawn address. `O(k * log_k(n))` where `k` is the maximum number of children per node in the tree, and `n` is the maximum number of nodes ever appended.\"}},\"executeDelayedStakes(uint256)\":{\"details\":\"Executes the next delayed stakes.\",\"params\":{\"_iterations\":\"The number of delayed stakes to execute.\"}},\"getJurorCourtIDs(address)\":{\"details\":\"Gets the court identifiers where a specific `_juror` has staked.\",\"params\":{\"_juror\":\"The address of the juror.\"}},\"initialize(address,address,uint256,uint256,address,uint256)\":{\"details\":\"Initializer (constructor equivalent for upgradable contracts).\",\"params\":{\"_core\":\"The KlerosCore.\",\"_maxDrawingTime\":\"Time after which the drawing phase can be switched\",\"_minStakingTime\":\"Minimal time to stake\",\"_rng\":\"The random number generator.\",\"_rngLookahead\":\"Lookahead value for rng.\"}},\"notifyRandomNumber(uint256)\":{\"details\":\"Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().\",\"params\":{\"_randomNumber\":\"Random number returned by RNG contract.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"setJurorInactive(address)\":{\"details\":\"Unstakes the inactive juror from all courts. `O(n * (p * log_k(j)) )` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\",\"params\":{\"_account\":\"The juror to unstake.\"}},\"setStake(address,uint96,uint256,bool)\":{\"details\":\"Sets the specified juror's stake in a court. `O(n + p * log_k(j))` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\",\"params\":{\"_account\":\"The address of the juror.\",\"_alreadyTransferred\":\"True if the tokens were already transferred from juror. Only relevant for delayed stakes.\",\"_courtID\":\"The ID of the court.\",\"_newStake\":\"The new stake.\"},\"returns\":{\"pnkDeposit\":\"The amount of PNK to be deposited.\",\"pnkWithdrawal\":\"The amount of PNK to be withdrawn.\",\"succeeded\":\"True if the call succeeded, false otherwise.\"}},\"stakeOf(address,uint96)\":{\"details\":\"Get the stake of a juror in a court.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_juror\":\"The address of the juror.\"},\"returns\":{\"_0\":\"value The stake of the juror in the court.\"}},\"stakeOf(bytes32,bytes32)\":{\"details\":\"Get the stake of a juror in a court.\",\"params\":{\"_ID\":\"The stake path ID, corresponding to a juror.\",\"_key\":\"The key of the tree, corresponding to a court.\"},\"returns\":{\"_0\":\"The stake of the juror in the court.\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"SortitionModule\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/SortitionModule.sol\":\"SortitionModule\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/KlerosCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"./interfaces/IArbitratorV2.sol\\\";\\nimport {IDisputeKit} from \\\"./interfaces/IDisputeKit.sol\\\";\\nimport {ISortitionModule} from \\\"./interfaces/ISortitionModule.sol\\\";\\nimport {SafeERC20, IERC20} from \\\"../libraries/SafeERC20.sol\\\";\\nimport {Constants} from \\\"../libraries/Constants.sol\\\";\\nimport {OnError} from \\\"../libraries/Types.sol\\\";\\nimport {UUPSProxiable} from \\\"../proxy/UUPSProxiable.sol\\\";\\nimport {Initializable} from \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title KlerosCore\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\ncontract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum PNKs needed to stake in the court.\\n uint256 alpha; // Basis point of PNKs that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court. Note that each court must support classic dispute kit.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrableV2 arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 pnkAtStakePerJuror; // The amount of PNKs at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 pnkPenalties; // The amount of PNKs collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumFeeRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumPnkRewardPaid; // Total sum of PNK paid to coherent jurors as a reward in this round.\\n IERC20 feeToken; // The token used for paying fees in this round.\\n uint256 drawIterations; // The number of iterations passed drawing the jurors for this round.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 pnkPenaltiesInRound; // The amount of PNKs collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n struct CurrencyRate {\\n bool feePaymentAccepted;\\n uint64 rateInEth;\\n uint8 rateDecimals;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 private constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 private constant NON_PAYABLE_AMOUNT = (2 ** 256 - 2) / 2; // An amount higher than the supply of ETH.\\n\\n address public governor; // The governor of the contract.\\n IERC20 public pinakion; // The Pinakion token contract.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n Court[] public courts; // The courts.\\n IDisputeKit[] public disputeKits; // Array of dispute kits.\\n Dispute[] public disputes; // The disputes.\\n mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(\\n uint96 indexed _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod\\n );\\n event DisputeKitCreated(uint256 indexed _disputeKitID, IDisputeKit indexed _disputeKitAddress);\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _pnkAmount,\\n int256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _pnkAmount,\\n uint256 _feeAmount,\\n IERC20 _feeToken\\n );\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _governor The governor's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n function initialize(\\n address _governor,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) external reinitializer(1) {\\n governor = _governor;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a dispute kit is not supported.\\n disputeKits.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKits.push(_disputeKit);\\n\\n emit DisputeKitCreated(Constants.DISPUTE_KIT_CLASSIC, _disputeKit);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(Constants.FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = Constants.FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(Constants.GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(Constants.GENERAL_COURT, Constants.DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /* @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n if (!success) revert UnsuccessfulCall();\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress) external onlyByGovernor {\\n uint256 disputeKitID = disputeKits.length;\\n disputeKits.push(_disputeKitAddress);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress);\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt();\\n if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit();\\n if (_parent == Constants.FORKING_COURT) revert InvalidForkingCourtAsParent();\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n // Check that Classic DK support was added.\\n if (!court.supportedDisputeKits[Constants.DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic();\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n function changeCourtParameters(\\n uint96 _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod\\n ) external onlyByGovernor {\\n Court storage court = courts[_courtID];\\n if (_courtID != Constants.GENERAL_COURT && courts[court.parent].minStake > _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n for (uint256 i = 0; i < court.children.length; i++) {\\n if (courts[court.children[i]].minStake < _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n }\\n court.minStake = _minStake;\\n court.hiddenVotes = _hiddenVotes;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(\\n _courtID,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod\\n );\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n // Classic dispute kit must be supported by all courts.\\n if (_disputeKitIDs[i] == Constants.DISPUTE_KIT_CLASSIC) {\\n revert CannotDisableClassicDK();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n /// @dev Changes the supported fee tokens.\\n /// @param _feeToken The fee token.\\n /// @param _accepted Whether the token is supported or not as a method of fee payment.\\n function changeAcceptedFeeTokens(IERC20 _feeToken, bool _accepted) external onlyByGovernor {\\n currencyRates[_feeToken].feePaymentAccepted = _accepted;\\n emit AcceptedFeeToken(_feeToken, _accepted);\\n }\\n\\n /// @dev Changes the currency rate of a fee token.\\n /// @param _feeToken The fee token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n function changeCurrencyRates(IERC20 _feeToken, uint64 _rateInEth, uint8 _rateDecimals) external onlyByGovernor {\\n currencyRates[_feeToken].rateInEth = _rateInEth;\\n currencyRates[_feeToken].rateDecimals = _rateDecimals;\\n emit NewCurrencyRate(_feeToken, _rateInEth, _rateDecimals);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// Note that the existing delayed stake will be nullified as non-relevant.\\n function setStake(uint96 _courtID, uint256 _newStake) external {\\n _setStake(msg.sender, _courtID, _newStake, false, OnError.Revert);\\n }\\n\\n /// @dev Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.\\n /// @param _account The account whose stake is being set.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs have already been transferred to the contract.\\n function setStakeBySortitionModule(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external {\\n if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly();\\n _setStake(_account, _courtID, _newStake, _alreadyTransferred, OnError.Return);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough();\\n\\n return _createDispute(_numberOfChoices, _extraData, Constants.NATIVE_CURRENCY, msg.value);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external override returns (uint256 disputeID) {\\n if (!currencyRates[_feeToken].feePaymentAccepted) revert TokenNotAccepted();\\n if (_feeAmount < arbitrationCost(_extraData, _feeToken)) revert ArbitrationFeesNotEnough();\\n\\n if (!_feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount)) revert TransferFailed();\\n return _createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount);\\n }\\n\\n function _createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) internal returns (uint256 disputeID) {\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n if (!courts[courtID].supportedDisputeKits[disputeKitID]) revert DisputeKitNotSupportedByCourt();\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrableV2(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKits[disputeKitID];\\n Court storage court = courts[dispute.courtID];\\n Round storage round = dispute.rounds.push();\\n\\n // Obtain the feeForJuror in the same currency as the _feeAmount\\n uint256 feeForJuror = (_feeToken == Constants.NATIVE_CURRENCY)\\n ? court.feeForJuror\\n : convertEthToTokenAmount(_feeToken, court.feeForJuror);\\n round.nbVotes = _feeAmount / feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = _feeAmount;\\n round.feeToken = IERC20(_feeToken);\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrableV2(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n if (\\n currentRound == 0 &&\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]\\n ) {\\n revert EvidenceNotPassedAndNotAppeal();\\n }\\n if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing();\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areCommitsAllCast(_disputeID)\\n ) {\\n revert CommitPeriodNotPassed();\\n }\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areVotesAllCast(_disputeID)\\n ) {\\n revert VotePeriodNotPassed();\\n }\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) {\\n revert AppealPeriodNotPassed();\\n }\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert DisputePeriodIsFinal();\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period != Period.evidence) revert NotEvidencePeriod();\\n\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 startIndex = round.drawIterations; // for gas: less storage reads\\n uint256 i;\\n while (i < _iterations && round.drawnJurors.length < round.nbVotes) {\\n address drawnAddress = disputeKit.draw(_disputeID, startIndex + i++);\\n if (drawnAddress == address(0)) {\\n continue;\\n }\\n sortitionModule.lockStake(drawnAddress, round.pnkAtStakePerJuror);\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n round.drawIterations += i;\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n if (msg.value < appealCost(_disputeID)) revert AppealFeesNotEnough();\\n\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.appeal) revert DisputeNotAppealable();\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n if (msg.sender != address(disputeKits[round.disputeKitID])) revert DisputeKitOnly();\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n // Switch to classic dispute kit if parent court doesn't support the current one.\\n newDisputeKitID = Constants.DISPUTE_KIT_CLASSIC;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKits[extraRound.disputeKitID].createDispute(\\n _disputeID,\\n _numberOfChoices,\\n _extraData,\\n extraRound.nbVotes\\n );\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n\\n Round storage round = dispute.rounds[_round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 pnkPenaltiesInRoundCache = round.pnkPenalties; // For saving gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect the PNK penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n pnkPenaltiesInRoundCache = _executePenalties(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n }\\n }\\n if (round.pnkPenalties != pnkPenaltiesInRoundCache) {\\n round.pnkPenalties = pnkPenaltiesInRoundCache; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return pnkPenaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.pnkAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.pnkPenaltiesInRound += penalty;\\n\\n // Unlock the PNKs affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n sortitionModule.unlockStake(account, penalty);\\n\\n // Apply the penalty to the staked PNKs.\\n sortitionModule.penalizeStake(account, penalty);\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n -int256(penalty),\\n 0,\\n round.feeToken\\n );\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(round.totalFeesForJurors);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, round.totalFeesForJurors);\\n }\\n pinakion.safeTransfer(governor, _params.pnkPenaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.pnkPenaltiesInRound,\\n round.totalFeesForJurors,\\n round.feeToken\\n );\\n }\\n return _params.pnkPenaltiesInRound;\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the PNKs of the juror for this round.\\n sortitionModule.unlockStake(account, pnkLocked);\\n\\n // Give back the locked PNKs in case the juror fully unstaked earlier.\\n if (!sortitionModule.isJurorStaked(account)) {\\n pinakion.safeTransfer(account, pnkLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumPnkRewardPaid += pnkReward;\\n uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumFeeRewardPaid += feeReward;\\n pinakion.safeTransfer(account, pnkReward);\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(account).send(feeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(account, feeReward);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(pnkReward),\\n int256(feeReward),\\n round.feeToken\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverPnkReward = _params.pnkPenaltiesInRound - round.sumPnkRewardPaid;\\n uint256 leftoverFeeReward = round.totalFeesForJurors - round.sumFeeRewardPaid;\\n if (leftoverPnkReward != 0 || leftoverFeeReward != 0) {\\n if (leftoverPnkReward != 0) {\\n pinakion.safeTransfer(governor, leftoverPnkReward);\\n }\\n if (leftoverFeeReward != 0) {\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(leftoverFeeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, leftoverFeeReward);\\n }\\n }\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n leftoverPnkReward,\\n leftoverFeeReward,\\n round.feeToken\\n );\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n if (dispute.ruled) revert RulingAlreadyExecuted();\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Compute the cost of arbitration denominated in ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) public view override returns (uint256 cost) {\\n cost = convertEthToTokenAmount(_feeToken, arbitrationCost(_extraData));\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == Constants.GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(uint256 _disputeID, uint256 _round) external view returns (Round memory) {\\n return disputes[_disputeID].rounds[_round];\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n timesPerPeriod = courts[_courtID].timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitsLength() external view returns (uint256) {\\n return disputeKits.length;\\n }\\n\\n function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) {\\n return (_amountInEth * 10 ** currencyRates[_toToken].rateDecimals) / currencyRates[_toToken].rateInEth;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support. Note that classic dispute kit should always be enabled.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev If called only once then set _onError to Revert, otherwise set it to Return\\n /// @param _account The account to set the stake for.\\n /// @param _courtID The ID of the court to set the stake for.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs were already transferred to/from the staking contract.\\n /// @param _onError Whether to revert or return false on error.\\n /// @return Whether the stake was successfully set or not.\\n function _setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred,\\n OnError _onError\\n ) internal returns (bool) {\\n if (_courtID == Constants.FORKING_COURT || _courtID > courts.length) {\\n _stakingFailed(_onError); // Staking directly into the forking court is not allowed.\\n return false;\\n }\\n if (_newStake != 0 && _newStake < courts[_courtID].minStake) {\\n _stakingFailed(_onError); // Staking less than the minimum stake is not allowed.\\n return false;\\n }\\n (uint256 pnkDeposit, uint256 pnkWithdrawal, bool sortitionSuccess) = sortitionModule.setStake(\\n _account,\\n _courtID,\\n _newStake,\\n _alreadyTransferred\\n );\\n if (!sortitionSuccess) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n if (pnkDeposit > 0) {\\n if (!pinakion.safeTransferFrom(_account, address(this), pnkDeposit)) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n }\\n if (pnkWithdrawal > 0) {\\n if (!pinakion.safeTransfer(_account, pnkWithdrawal)) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @dev It may revert depending on the _onError parameter.\\n function _stakingFailed(OnError _onError) internal pure {\\n if (_onError == OnError.Return) return;\\n revert StakingFailed();\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == Constants.FORKING_COURT || courtID >= courts.length) {\\n courtID = Constants.GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = Constants.DEFAULT_NB_OF_JURORS;\\n }\\n if (disputeKitID == Constants.NULL_DISPUTE_KIT || disputeKitID >= disputeKits.length) {\\n disputeKitID = Constants.DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = Constants.GENERAL_COURT;\\n minJurors = Constants.DEFAULT_NB_OF_JURORS;\\n disputeKitID = Constants.DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error DisputeKitOnly();\\n error SortitionModuleOnly();\\n error UnsuccessfulCall();\\n error InvalidDisputKitParent();\\n error DepthLevelMax();\\n error MinStakeLowerThanParentCourt();\\n error UnsupportedDisputeKit();\\n error InvalidForkingCourtAsParent();\\n error WrongDisputeKitIndex();\\n error CannotDisableClassicDK();\\n error ArraysLengthMismatch();\\n error StakingFailed();\\n error ArbitrationFeesNotEnough();\\n error DisputeKitNotSupportedByCourt();\\n error MustSupportDisputeKitClassic();\\n error TokenNotAccepted();\\n error EvidenceNotPassedAndNotAppeal();\\n error DisputeStillDrawing();\\n error CommitPeriodNotPassed();\\n error VotePeriodNotPassed();\\n error AppealPeriodNotPassed();\\n error NotEvidencePeriod();\\n error AppealFeesNotEnough();\\n error DisputeNotAppealable();\\n error NotExecutionPeriod();\\n error RulingAlreadyExecuted();\\n error DisputePeriodIsFinal();\\n error TransferFailed();\\n}\\n\",\"keccak256\":\"0x43205bc90f6965b5c1380effd2c29994f6dfea074696e39d5df037343a768d6b\",\"license\":\"MIT\"},\"src/arbitration/SortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @custom:authors: [@epiqueras, @unknownunknown1, @shotaronowhere]\\n * @custom:reviewers: []\\n * @custom:auditors: []\\n * @custom:bounties: []\\n * @custom:deployments: []\\n */\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./KlerosCore.sol\\\";\\nimport \\\"./interfaces/ISortitionModule.sol\\\";\\nimport \\\"./interfaces/IDisputeKit.sol\\\";\\nimport \\\"../rng/RNG.sol\\\";\\nimport \\\"../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../proxy/Initializable.sol\\\";\\nimport \\\"../libraries/Constants.sol\\\";\\n\\n/// @title SortitionModule\\n/// @dev A factory of trees that keeps track of staked values for sortition.\\ncontract SortitionModule is ISortitionModule, UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum PreStakeHookResult {\\n ok, // Correct phase. All checks are passed.\\n stakeDelayedAlreadyTransferred, // Wrong phase but stake is increased, so transfer the tokens without updating the drawing chance.\\n stakeDelayedNotTransferred, // Wrong phase and stake is decreased. Delay the token transfer and drawing chance update.\\n failed // Checks didn't pass. Do no changes.\\n }\\n\\n struct SortitionSumTree {\\n uint256 K; // The maximum number of children per node.\\n // We use this to keep track of vacant positions in the tree after removing a leaf. This is for keeping the tree as balanced as possible without spending gas on moving nodes around.\\n uint256[] stack;\\n uint256[] nodes;\\n // Two-way mapping of IDs to node indexes. Note that node index 0 is reserved for the root node, and means the ID does not have a node.\\n mapping(bytes32 => uint256) IDsToNodeIndexes;\\n mapping(uint256 => bytes32) nodeIndexesToIDs;\\n }\\n\\n struct DelayedStake {\\n address account; // The address of the juror.\\n uint96 courtID; // The ID of the court.\\n uint256 stake; // The new stake.\\n bool alreadyTransferred; // True if tokens were already transferred before delayed stake's execution.\\n }\\n\\n struct Juror {\\n uint96[] courtIDs; // The IDs of courts where the juror's stake path ends. A stake path is a path from the general court to a court the juror directly staked in using `_setStake`.\\n uint256 stakedPnk; // The juror's total amount of tokens staked in subcourts. Reflects actual pnk balance.\\n uint256 lockedPnk; // The juror's total amount of tokens locked in disputes. Can reflect actual pnk balance when stakedPnk are fully withdrawn.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant MAX_STAKE_PATHS = 4; // The maximum number of stake paths a juror can have.\\n uint256 public constant DEFAULT_K = 6; // Default number of children per node.\\n\\n address public governor; // The governor of the contract.\\n KlerosCore public core; // The core arbitrator contract.\\n Phase public phase; // The current phase.\\n uint256 public minStakingTime; // The time after which the phase can be switched to Drawing if there are open disputes.\\n uint256 public maxDrawingTime; // The time after which the phase can be switched back to Staking.\\n uint256 public lastPhaseChange; // The last time the phase was changed.\\n uint256 public randomNumberRequestBlock; // Number of the block when RNG request was made.\\n uint256 public disputesWithoutJurors; // The number of disputes that have not finished drawing jurors.\\n RNG public rng; // The random number generator.\\n uint256 public randomNumber; // Random number returned by RNG.\\n uint256 public rngLookahead; // Minimal block distance between requesting and obtaining a random number.\\n uint256 public delayedStakeWriteIndex; // The index of the last `delayedStake` item that was written to the array. 0 index is skipped.\\n uint256 public delayedStakeReadIndex; // The index of the next `delayedStake` item that should be processed. Starts at 1 because 0 index is skipped.\\n mapping(bytes32 => SortitionSumTree) sortitionSumTrees; // The mapping trees by keys.\\n mapping(address => Juror) public jurors; // The jurors.\\n mapping(uint256 => DelayedStake) public delayedStakes; // Stores the stakes that were changed during Drawing phase, to update them when the phase is switched to Staking.\\n mapping(address => mapping(uint96 => uint256)) public latestDelayedStakeIndex; // Maps the juror to its latest delayed stake. If there is already a delayed stake for this juror then it'll be replaced. latestDelayedStakeIndex[juror][courtID].\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event StakeSet(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayedNotTransferred(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayedAlreadyTransferred(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayedAlreadyTransferredWithdrawn(address indexed _address, uint96 indexed _courtID, uint256 _amount);\\n event StakeLocked(address indexed _address, uint256 _relativeAmount, bool _unlock);\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(address(governor) == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n modifier onlyByCore() {\\n require(address(core) == msg.sender, \\\"Access not allowed: KlerosCore only.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _core The KlerosCore.\\n /// @param _minStakingTime Minimal time to stake\\n /// @param _maxDrawingTime Time after which the drawing phase can be switched\\n /// @param _rng The random number generator.\\n /// @param _rngLookahead Lookahead value for rng.\\n function initialize(\\n address _governor,\\n KlerosCore _core,\\n uint256 _minStakingTime,\\n uint256 _maxDrawingTime,\\n RNG _rng,\\n uint256 _rngLookahead\\n ) external reinitializer(1) {\\n governor = _governor;\\n core = _core;\\n minStakingTime = _minStakingTime;\\n maxDrawingTime = _maxDrawingTime;\\n lastPhaseChange = block.timestamp;\\n rng = _rng;\\n rngLookahead = _rngLookahead;\\n delayedStakeReadIndex = 1;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Changes the `minStakingTime` storage variable.\\n /// @param _minStakingTime The new value for the `minStakingTime` storage variable.\\n function changeMinStakingTime(uint256 _minStakingTime) external onlyByGovernor {\\n minStakingTime = _minStakingTime;\\n }\\n\\n /// @dev Changes the `maxDrawingTime` storage variable.\\n /// @param _maxDrawingTime The new value for the `maxDrawingTime` storage variable.\\n function changeMaxDrawingTime(uint256 _maxDrawingTime) external onlyByGovernor {\\n maxDrawingTime = _maxDrawingTime;\\n }\\n\\n /// @dev Changes the `_rng` and `_rngLookahead` storage variables.\\n /// @param _rng The new value for the `RNGenerator` storage variable.\\n /// @param _rngLookahead The new value for the `rngLookahead` storage variable.\\n function changeRandomNumberGenerator(RNG _rng, uint256 _rngLookahead) external onlyByGovernor {\\n rng = _rng;\\n rngLookahead = _rngLookahead;\\n if (phase == Phase.generating) {\\n rng.requestRandomness(block.number + rngLookahead);\\n randomNumberRequestBlock = block.number;\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function passPhase() external {\\n if (phase == Phase.staking) {\\n require(\\n block.timestamp - lastPhaseChange >= minStakingTime,\\n \\\"The minimum staking time has not passed yet.\\\"\\n );\\n require(disputesWithoutJurors > 0, \\\"There are no disputes that need jurors.\\\");\\n rng.requestRandomness(block.number + rngLookahead);\\n randomNumberRequestBlock = block.number;\\n phase = Phase.generating;\\n } else if (phase == Phase.generating) {\\n randomNumber = rng.receiveRandomness(randomNumberRequestBlock + rngLookahead);\\n require(randomNumber != 0, \\\"Random number is not ready yet\\\");\\n phase = Phase.drawing;\\n } else if (phase == Phase.drawing) {\\n require(\\n disputesWithoutJurors == 0 || block.timestamp - lastPhaseChange >= maxDrawingTime,\\n \\\"There are still disputes without jurors and the maximum drawing time has not passed yet.\\\"\\n );\\n phase = Phase.staking;\\n }\\n\\n lastPhaseChange = block.timestamp;\\n emit NewPhase(phase);\\n }\\n\\n /// @dev Create a sortition sum tree at the specified key.\\n /// @param _key The key of the new tree.\\n /// @param _extraData Extra data that contains the number of children each node in the tree should have.\\n function createTree(bytes32 _key, bytes memory _extraData) external override onlyByCore {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint256 K = _extraDataToTreeK(_extraData);\\n require(tree.K == 0, \\\"Tree already exists.\\\");\\n require(K > 1, \\\"K must be greater than one.\\\");\\n tree.K = K;\\n tree.nodes.push(0);\\n }\\n\\n /// @dev Executes the next delayed stakes.\\n /// @param _iterations The number of delayed stakes to execute.\\n function executeDelayedStakes(uint256 _iterations) external {\\n require(phase == Phase.staking, \\\"Should be in Staking phase.\\\");\\n\\n uint256 actualIterations = (delayedStakeReadIndex + _iterations) - 1 > delayedStakeWriteIndex\\n ? (delayedStakeWriteIndex - delayedStakeReadIndex) + 1\\n : _iterations;\\n uint256 newDelayedStakeReadIndex = delayedStakeReadIndex + actualIterations;\\n\\n for (uint256 i = delayedStakeReadIndex; i < newDelayedStakeReadIndex; i++) {\\n DelayedStake storage delayedStake = delayedStakes[i];\\n // Delayed stake could've been manually removed already. In this case simply move on to the next item.\\n if (delayedStake.account != address(0)) {\\n core.setStakeBySortitionModule(\\n delayedStake.account,\\n delayedStake.courtID,\\n delayedStake.stake,\\n delayedStake.alreadyTransferred\\n );\\n delete latestDelayedStakeIndex[delayedStake.account][delayedStake.courtID];\\n delete delayedStakes[i];\\n }\\n }\\n delayedStakeReadIndex = newDelayedStakeReadIndex;\\n }\\n\\n function createDisputeHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore {\\n disputesWithoutJurors++;\\n }\\n\\n function postDrawHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore {\\n disputesWithoutJurors--;\\n }\\n\\n /// @dev Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().\\n /// @param _randomNumber Random number returned by RNG contract.\\n function notifyRandomNumber(uint256 _randomNumber) public override {}\\n\\n /// @dev Sets the specified juror's stake in a court.\\n /// `O(n + p * log_k(j))` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The address of the juror.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred True if the tokens were already transferred from juror. Only relevant for delayed stakes.\\n /// @return pnkDeposit The amount of PNK to be deposited.\\n /// @return pnkWithdrawal The amount of PNK to be withdrawn.\\n /// @return succeeded True if the call succeeded, false otherwise.\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external override onlyByCore returns (uint256 pnkDeposit, uint256 pnkWithdrawal, bool succeeded) {\\n Juror storage juror = jurors[_account];\\n uint256 currentStake = stakeOf(_account, _courtID);\\n\\n uint256 nbCourts = juror.courtIDs.length;\\n if (_newStake == 0 && (nbCourts >= MAX_STAKE_PATHS || currentStake == 0)) {\\n return (0, 0, false); // Prevent staking beyond MAX_STAKE_PATHS but unstaking is always allowed.\\n }\\n\\n pnkWithdrawal = _deleteDelayedStake(_courtID, _account);\\n\\n if (phase != Phase.staking) {\\n // Store the stake change as delayed, to be applied when the phase switches back to Staking.\\n DelayedStake storage delayedStake = delayedStakes[++delayedStakeWriteIndex];\\n delayedStake.account = _account;\\n delayedStake.courtID = _courtID;\\n delayedStake.stake = _newStake;\\n latestDelayedStakeIndex[_account][_courtID] = delayedStakeWriteIndex;\\n if (_newStake > currentStake) {\\n // PNK deposit: tokens are transferred now.\\n delayedStake.alreadyTransferred = true;\\n pnkDeposit = _increaseStake(juror, _courtID, _newStake, currentStake);\\n emit StakeDelayedAlreadyTransferred(_account, _courtID, _newStake);\\n } else {\\n // PNK withdrawal: tokens are not transferred yet.\\n emit StakeDelayedNotTransferred(_account, _courtID, _newStake);\\n }\\n return (pnkDeposit, pnkWithdrawal, true);\\n }\\n\\n // Staking phase: set normal stakes or delayed stakes (which may have been already transferred).\\n if (_newStake >= currentStake) {\\n if (!_alreadyTransferred) {\\n pnkDeposit = _increaseStake(juror, _courtID, _newStake, currentStake);\\n }\\n } else {\\n pnkWithdrawal += _decreaseStake(juror, _courtID, _newStake, currentStake);\\n }\\n\\n bytes32 stakePathID = _accountAndCourtIDToStakePathID(_account, _courtID);\\n bool finished = false;\\n uint96 currenCourtID = _courtID;\\n while (!finished) {\\n // Tokens are also implicitly staked in parent courts through sortition module to increase the chance of being drawn.\\n _set(bytes32(uint256(currenCourtID)), _newStake, stakePathID);\\n if (currenCourtID == Constants.GENERAL_COURT) {\\n finished = true;\\n } else {\\n (currenCourtID, , , , , , ) = core.courts(currenCourtID);\\n }\\n }\\n emit StakeSet(_account, _courtID, _newStake);\\n return (pnkDeposit, pnkWithdrawal, true);\\n }\\n\\n /// @dev Checks if there is already a delayed stake. In this case consider it irrelevant and remove it.\\n /// @param _courtID ID of the court.\\n /// @param _juror Juror whose stake to check.\\n function _deleteDelayedStake(uint96 _courtID, address _juror) internal returns (uint256 actualAmountToWithdraw) {\\n uint256 latestIndex = latestDelayedStakeIndex[_juror][_courtID];\\n if (latestIndex != 0) {\\n DelayedStake storage delayedStake = delayedStakes[latestIndex];\\n if (delayedStake.alreadyTransferred) {\\n // Sortition stake represents the stake value that was last updated during Staking phase.\\n uint256 sortitionStake = stakeOf(_juror, _courtID);\\n\\n // Withdraw the tokens that were added with the latest delayed stake.\\n uint256 amountToWithdraw = delayedStake.stake - sortitionStake;\\n actualAmountToWithdraw = amountToWithdraw;\\n Juror storage juror = jurors[_juror];\\n if (juror.stakedPnk <= actualAmountToWithdraw) {\\n actualAmountToWithdraw = juror.stakedPnk;\\n }\\n\\n // StakePnk can become lower because of penalty.\\n juror.stakedPnk -= actualAmountToWithdraw;\\n emit StakeDelayedAlreadyTransferredWithdrawn(_juror, _courtID, amountToWithdraw);\\n\\n if (sortitionStake == 0) {\\n // Delete the court otherwise it will be duplicated after staking.\\n for (uint256 i = juror.courtIDs.length; i > 0; i--) {\\n if (juror.courtIDs[i - 1] == _courtID) {\\n juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1];\\n juror.courtIDs.pop();\\n break;\\n }\\n }\\n }\\n }\\n delete delayedStakes[latestIndex];\\n delete latestDelayedStakeIndex[_juror][_courtID];\\n }\\n }\\n\\n function _increaseStake(\\n Juror storage juror,\\n uint96 _courtID,\\n uint256 _newStake,\\n uint256 _currentStake\\n ) internal returns (uint256 transferredAmount) {\\n // Stake increase\\n // When stakedPnk becomes lower than lockedPnk count the locked tokens in when transferring tokens from juror.\\n // (E.g. stakedPnk = 0, lockedPnk = 150) which can happen if the juror unstaked fully while having some tokens locked.\\n uint256 previouslyLocked = (juror.lockedPnk >= juror.stakedPnk) ? juror.lockedPnk - juror.stakedPnk : 0; // underflow guard\\n transferredAmount = (_newStake >= _currentStake + previouslyLocked) // underflow guard\\n ? _newStake - _currentStake - previouslyLocked\\n : 0;\\n if (_currentStake == 0) {\\n juror.courtIDs.push(_courtID);\\n }\\n // stakedPnk can become async with _currentStake (e.g. after penalty).\\n juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake;\\n }\\n\\n function _decreaseStake(\\n Juror storage juror,\\n uint96 _courtID,\\n uint256 _newStake,\\n uint256 _currentStake\\n ) internal returns (uint256 transferredAmount) {\\n // Stakes can be partially delayed only when stake is increased.\\n // Stake decrease: make sure locked tokens always stay in the contract. They can only be released during Execution.\\n if (juror.stakedPnk >= _currentStake - _newStake + juror.lockedPnk) {\\n // We have enough pnk staked to afford withdrawal while keeping locked tokens.\\n transferredAmount = _currentStake - _newStake;\\n } else if (juror.stakedPnk >= juror.lockedPnk) {\\n // Can't afford withdrawing the current stake fully. Take whatever is available while keeping locked tokens.\\n transferredAmount = juror.stakedPnk - juror.lockedPnk;\\n }\\n if (_newStake == 0) {\\n for (uint256 i = juror.courtIDs.length; i > 0; i--) {\\n if (juror.courtIDs[i - 1] == _courtID) {\\n juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1];\\n juror.courtIDs.pop();\\n break;\\n }\\n }\\n }\\n // stakedPnk can become async with _currentStake (e.g. after penalty).\\n juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake;\\n }\\n\\n function lockStake(address _account, uint256 _relativeAmount) external override onlyByCore {\\n jurors[_account].lockedPnk += _relativeAmount;\\n emit StakeLocked(_account, _relativeAmount, false);\\n }\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external override onlyByCore {\\n jurors[_account].lockedPnk -= _relativeAmount;\\n emit StakeLocked(_account, _relativeAmount, true);\\n }\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external override onlyByCore {\\n Juror storage juror = jurors[_account];\\n if (juror.stakedPnk >= _relativeAmount) {\\n juror.stakedPnk -= _relativeAmount;\\n } else {\\n juror.stakedPnk = 0; // stakedPnk might become lower after manual unstaking, but lockedPnk will always cover the difference.\\n }\\n }\\n\\n /// @dev Unstakes the inactive juror from all courts.\\n /// `O(n * (p * log_k(j)) )` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The juror to unstake.\\n function setJurorInactive(address _account) external override onlyByCore {\\n uint96[] memory courtIDs = getJurorCourtIDs(_account);\\n for (uint256 j = courtIDs.length; j > 0; j--) {\\n core.setStakeBySortitionModule(_account, courtIDs[j - 1], 0, false);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Draw an ID from a tree using a number.\\n /// Note that this function reverts if the sum of all values in the tree is 0.\\n /// @param _key The key of the tree.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core.\\n /// @param _nonce Nonce to hash with random number.\\n /// @return drawnAddress The drawn address.\\n /// `O(k * log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function draw(\\n bytes32 _key,\\n uint256 _coreDisputeID,\\n uint256 _nonce\\n ) public view override returns (address drawnAddress) {\\n require(phase == Phase.drawing, \\\"Wrong phase.\\\");\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n\\n if (tree.nodes[0] == 0) {\\n return address(0); // No jurors staked.\\n }\\n\\n uint256 currentDrawnNumber = uint256(keccak256(abi.encodePacked(randomNumber, _coreDisputeID, _nonce))) %\\n tree.nodes[0];\\n\\n // While it still has children\\n uint256 treeIndex = 0;\\n while ((tree.K * treeIndex) + 1 < tree.nodes.length) {\\n for (uint256 i = 1; i <= tree.K; i++) {\\n // Loop over children.\\n uint256 nodeIndex = (tree.K * treeIndex) + i;\\n uint256 nodeValue = tree.nodes[nodeIndex];\\n\\n if (currentDrawnNumber >= nodeValue) {\\n // Go to the next child.\\n currentDrawnNumber -= nodeValue;\\n } else {\\n // Pick this child.\\n treeIndex = nodeIndex;\\n break;\\n }\\n }\\n }\\n drawnAddress = _stakePathIDToAccount(tree.nodeIndexesToIDs[treeIndex]);\\n }\\n\\n /// @dev Get the stake of a juror in a court.\\n /// @param _juror The address of the juror.\\n /// @param _courtID The ID of the court.\\n /// @return value The stake of the juror in the court.\\n function stakeOf(address _juror, uint96 _courtID) public view returns (uint256) {\\n bytes32 stakePathID = _accountAndCourtIDToStakePathID(_juror, _courtID);\\n return stakeOf(bytes32(uint256(_courtID)), stakePathID);\\n }\\n\\n /// @dev Get the stake of a juror in a court.\\n /// @param _key The key of the tree, corresponding to a court.\\n /// @param _ID The stake path ID, corresponding to a juror.\\n /// @return The stake of the juror in the court.\\n function stakeOf(bytes32 _key, bytes32 _ID) public view returns (uint256) {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint treeIndex = tree.IDsToNodeIndexes[_ID];\\n if (treeIndex == 0) {\\n return 0;\\n }\\n return tree.nodes[treeIndex];\\n }\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n )\\n external\\n view\\n override\\n returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts)\\n {\\n Juror storage juror = jurors[_juror];\\n totalStaked = juror.stakedPnk;\\n totalLocked = juror.lockedPnk;\\n stakedInCourt = stakeOf(_juror, _courtID);\\n nbCourts = juror.courtIDs.length;\\n }\\n\\n /// @dev Gets the court identifiers where a specific `_juror` has staked.\\n /// @param _juror The address of the juror.\\n function getJurorCourtIDs(address _juror) public view override returns (uint96[] memory) {\\n return jurors[_juror].courtIDs;\\n }\\n\\n function isJurorStaked(address _juror) external view override returns (bool) {\\n return jurors[_juror].stakedPnk > 0;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Update all the parents of a node.\\n /// @param _key The key of the tree to update.\\n /// @param _treeIndex The index of the node to start from.\\n /// @param _plusOrMinus Whether to add (true) or substract (false).\\n /// @param _value The value to add or substract.\\n /// `O(log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function _updateParents(bytes32 _key, uint256 _treeIndex, bool _plusOrMinus, uint256 _value) private {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n\\n uint256 parentIndex = _treeIndex;\\n while (parentIndex != 0) {\\n parentIndex = (parentIndex - 1) / tree.K;\\n tree.nodes[parentIndex] = _plusOrMinus\\n ? tree.nodes[parentIndex] + _value\\n : tree.nodes[parentIndex] - _value;\\n }\\n }\\n\\n /// @dev Retrieves a juror's address from the stake path ID.\\n /// @param _stakePathID The stake path ID to unpack.\\n /// @return account The account.\\n function _stakePathIDToAccount(bytes32 _stakePathID) internal pure returns (address account) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n let ptr := mload(0x40)\\n for {\\n let i := 0x00\\n } lt(i, 0x14) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(add(ptr, 0x0c), i), byte(i, _stakePathID))\\n }\\n account := mload(ptr)\\n }\\n }\\n\\n function _extraDataToTreeK(bytes memory _extraData) internal pure returns (uint256 K) {\\n if (_extraData.length >= 32) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n K := mload(add(_extraData, 0x20))\\n }\\n } else {\\n K = DEFAULT_K;\\n }\\n }\\n\\n /// @dev Set a value in a tree.\\n /// @param _key The key of the tree.\\n /// @param _value The new value.\\n /// @param _ID The ID of the value.\\n /// `O(log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function _set(bytes32 _key, uint256 _value, bytes32 _ID) internal {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint256 treeIndex = tree.IDsToNodeIndexes[_ID];\\n\\n if (treeIndex == 0) {\\n // No existing node.\\n if (_value != 0) {\\n // Non zero value.\\n // Append.\\n // Add node.\\n if (tree.stack.length == 0) {\\n // No vacant spots.\\n // Get the index and append the value.\\n treeIndex = tree.nodes.length;\\n tree.nodes.push(_value);\\n\\n // Potentially append a new node and make the parent a sum node.\\n if (treeIndex != 1 && (treeIndex - 1) % tree.K == 0) {\\n // Is first child.\\n uint256 parentIndex = treeIndex / tree.K;\\n bytes32 parentID = tree.nodeIndexesToIDs[parentIndex];\\n uint256 newIndex = treeIndex + 1;\\n tree.nodes.push(tree.nodes[parentIndex]);\\n delete tree.nodeIndexesToIDs[parentIndex];\\n tree.IDsToNodeIndexes[parentID] = newIndex;\\n tree.nodeIndexesToIDs[newIndex] = parentID;\\n }\\n } else {\\n // Some vacant spot.\\n // Pop the stack and append the value.\\n treeIndex = tree.stack[tree.stack.length - 1];\\n tree.stack.pop();\\n tree.nodes[treeIndex] = _value;\\n }\\n\\n // Add label.\\n tree.IDsToNodeIndexes[_ID] = treeIndex;\\n tree.nodeIndexesToIDs[treeIndex] = _ID;\\n\\n _updateParents(_key, treeIndex, true, _value);\\n }\\n } else {\\n // Existing node.\\n if (_value == 0) {\\n // Zero value.\\n // Remove.\\n // Remember value and set to 0.\\n uint256 value = tree.nodes[treeIndex];\\n tree.nodes[treeIndex] = 0;\\n\\n // Push to stack.\\n tree.stack.push(treeIndex);\\n\\n // Clear label.\\n delete tree.IDsToNodeIndexes[_ID];\\n delete tree.nodeIndexesToIDs[treeIndex];\\n\\n _updateParents(_key, treeIndex, false, value);\\n } else if (_value != tree.nodes[treeIndex]) {\\n // New, non zero value.\\n // Set.\\n bool plusOrMinus = tree.nodes[treeIndex] <= _value;\\n uint256 plusOrMinusValue = plusOrMinus\\n ? _value - tree.nodes[treeIndex]\\n : tree.nodes[treeIndex] - _value;\\n tree.nodes[treeIndex] = _value;\\n\\n _updateParents(_key, treeIndex, plusOrMinus, plusOrMinusValue);\\n }\\n }\\n }\\n\\n /// @dev Packs an account and a court ID into a stake path ID.\\n /// @param _account The address of the juror to pack.\\n /// @param _courtID The court ID to pack.\\n /// @return stakePathID The stake path ID.\\n function _accountAndCourtIDToStakePathID(\\n address _account,\\n uint96 _courtID\\n ) internal pure returns (bytes32 stakePathID) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n let ptr := mload(0x40)\\n for {\\n let i := 0x00\\n } lt(i, 0x14) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(ptr, i), byte(add(0x0c, i), _account))\\n }\\n for {\\n let i := 0x14\\n } lt(i, 0x20) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(ptr, i), byte(i, _courtID))\\n }\\n stakePathID := mload(ptr)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xe94da92dcc9e4035ecf238233499eb2233f3b6b6ffb1945a682e8e6fc4befdea\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _juror Address of the juror.\\n /// @param _voteIDs The identifiers of the votes in the dispute.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event VoteCast(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256[] _voteIDs,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _nonce Nonce.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID, uint256 _nonce) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0x7fe6b1d9b991cc327cc5895f34208a7b1e3b6ebf8efb20fcb9f3ff0f40d2d209\",\"license\":\"MIT\"},\"src/arbitration/interfaces/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external returns (uint256 pnkDeposit, uint256 pnkWithdrawal, bool succeeded);\\n\\n function setJurorInactive(address _account) external;\\n\\n function lockStake(address _account, uint256 _relativeAmount) external;\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external;\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _nonce) external view returns (address);\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts);\\n\\n function getJurorCourtIDs(address _juror) external view returns (uint96[] memory);\\n\\n function isJurorStaked(address _juror) external view returns (bool);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0xa6d79053edfe04f7d3c8ad9b9ce3f182e45f2f74be40a77a304a93168549c474\",\"license\":\"MIT\"},\"src/libraries/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title Constants\\nlibrary Constants {\\n // Courts\\n uint96 public constant FORKING_COURT = 0; // Index of the forking court.\\n uint96 public constant GENERAL_COURT = 1; // Index of the default (general) court.\\n\\n // Dispute Kits\\n uint256 public constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\n uint256 public constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n\\n // Defaults\\n uint256 public constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute.\\n IERC20 public constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1.\\n}\\n\",\"keccak256\":\"0xde8fd28a18669261b052aebb00bf09ec592bb9298fa5efc76ca8606e0c7dbb25\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"},\"src/libraries/Types.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nenum OnError {\\n Revert,\\n Return\\n}\\n\",\"keccak256\":\"0xc7deebd8227dfaa46a36ae8d2c24fe1b5d5c776ab963b44943829ab4058b5701\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"},\"src/rng/RNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\ninterface RNG {\\n /// @dev Request a random number.\\n /// @param _block Block linked to the request.\\n function requestRandomness(uint256 _block) external;\\n\\n /// @dev Receive the random number.\\n /// @param _block Block the random number is linked to.\\n /// @return randomNumber Random Number. If the number is not ready or has not been required 0 instead.\\n function receiveRandomness(uint256 _block) external returns (uint256 randomNumber);\\n}\\n\",\"keccak256\":\"0x5afe7121f49aebe72218df356bd91b66c2171b9ad15e7945a15a091784291a43\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000d9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff1615620000765760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b0390811614620000d65780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051612e7e62000103600039600081816112550152818161127e01526114760152612e7e6000f3fe6080604052600436106102465760003560e01c80637dc38f1411610139578063c1572618116100b6578063dca5f6b01161007a578063dca5f6b0146106c6578063dd5e5cb514610712578063e534710d14610732578063f216de4c1461076a578063f2f4eb261461078a578063f6b4d82d146107aa57600080fd5b8063c15726181461061a578063ccbac9f514610630578063d09f392d14610646578063d1c1df4814610666578063d605787b146106a657600080fd5b8063b1c9fe6e116100fd578063b1c9fe6e1461058b578063b4a61608146105b9578063b5d69e99146105ce578063b888adfa146105ee578063c057eca71461060457600080fd5b80637dc38f14146104d8578063823cfd70146104ee578063965af6c71461050e578063a2473cc11461052e578063a5861b901461054e57600080fd5b80634c70a0d6116101c757806354812d171161018b57806354812d171461041757806356acb050146104375780635d2d78461461044d5780636624192f1461046d57806376fa9fc5146104b857600080fd5b80634c70a0d6146103825780634dbbebbc146103a25780634f1ef286146103c257806352d1902d146103d5578063543f8a36146103ea57600080fd5b80631b92bbbe1161020e5780631b92bbbe146102ee57806321e1625e1461030457806321ea9b3f1461032457806335975f4a14610342578063477a655c1461036257600080fd5b8063034327441461024b5780630b274f2e146102745780630b51806d1461028b5780630c340a24146102a05780630e083ec9146102d8575b600080fd5b34801561025757600080fd5b5061026160065481565b6040519081526020015b60405180910390f35b34801561028057600080fd5b50610289610814565b005b34801561029757600080fd5b50610261600681565b3480156102ac57600080fd5b506000546102c0906001600160a01b031681565b6040516001600160a01b03909116815260200161026b565b3480156102e457600080fd5b50610261600a5481565b3480156102fa57600080fd5b5061026160035481565b34801561031057600080fd5b5061028961031f366004612852565b610bec565b34801561033057600080fd5b5061028961033f36600461287e565b50565b34801561034e57600080fd5b5061028961035d36600461287e565b610c8f565b34801561036e57600080fd5b5061028961037d36600461293a565b610e7d565b34801561038e57600080fd5b506102c061039d366004612981565b610f74565b3480156103ae57600080fd5b506102896103bd366004612852565b611158565b6102896103d03660046129ad565b611241565b3480156103e157600080fd5b50610261611469565b3480156103f657600080fd5b5061040a6104053660046129e7565b6114c7565b60405161026b9190612a04565b34801561042357600080fd5b50610289610432366004612a51565b611565565b34801561044357600080fd5b50610261600b5481565b34801561045957600080fd5b50610289610468366004612ab8565b61168b565b34801561047957600080fd5b506104a86104883660046129e7565b6001600160a01b03166000908152600d6020526040902060010154151590565b604051901515815260200161026b565b3480156104c457600080fd5b506102616104d3366004612ab8565b6116ce565b3480156104e457600080fd5b5061026160095481565b3480156104fa57600080fd5b5061028961050936600461287e565b611729565b34801561051a57600080fd5b50610289610529366004612852565b611758565b34801561053a57600080fd5b50610261610549366004612aef565b6117f3565b34801561055a57600080fd5b5061056e610569366004612b36565b61181d565b60408051938452602084019290925215159082015260600161026b565b34801561059757600080fd5b506001546105ac90600160a01b900460ff1681565b60405161026b9190612b9f565b3480156105c557600080fd5b50610261600481565b3480156105da57600080fd5b506102896105e93660046129e7565b611be4565b3480156105fa57600080fd5b5061026160045481565b34801561061057600080fd5b5061026160025481565b34801561062657600080fd5b5061026160055481565b34801561063c57600080fd5b5061026160085481565b34801561065257600080fd5b50610289610661366004612ab8565b611cc6565b34801561067257600080fd5b50610686610681366004612aef565b611d00565b60408051948552602085019390935291830152606082015260800161026b565b3480156106b257600080fd5b506007546102c0906001600160a01b031681565b3480156106d257600080fd5b506106fd6106e13660046129e7565b600d602052600090815260409020600181015460029091015482565b6040805192835260208301919091520161026b565b34801561071e57600080fd5b5061028961072d36600461287e565b611d3f565b34801561073e57600080fd5b5061026161074d366004612aef565b600f60209081526000928352604080842090915290825290205481565b34801561077657600080fd5b50610289610785366004612852565b611d6e565b34801561079657600080fd5b506001546102c0906001600160a01b031681565b3480156107b657600080fd5b506108046107c536600461287e565b600e602052600090815260409020805460018201546002909201546001600160a01b03821692600160a01b9092046001600160601b0316919060ff1684565b60405161026b9493929190612bc7565b6000600154600160a01b900460ff16600281111561083457610834612b89565b036109a7576002546004546108499042612c0e565b10156108b15760405162461bcd60e51b815260206004820152602c60248201527f546865206d696e696d756d207374616b696e672074696d6520686173206e6f7460448201526b103830b9b9b2b2103cb2ba1760a11b60648201526084015b60405180910390fd5b6000600654116109135760405162461bcd60e51b815260206004820152602760248201527f546865726520617265206e6f2064697370757465732074686174206e65656420604482015266353ab937b9399760c91b60648201526084016108a8565b6007546009546001600160a01b0390911690637363ae1f906109359043612c21565b6040518263ffffffff1660e01b815260040161095391815260200190565b600060405180830381600087803b15801561096d57600080fd5b505af1158015610981573d6000803e3d6000fd5b505043600555505060018054819060ff60a01b1916600160a01b825b0217905550610ba1565b60018054600160a01b900460ff1660028111156109c6576109c6612b89565b03610abe576007546009546005546001600160a01b03909216916313cf9054916109ef91612c21565b6040518263ffffffff1660e01b8152600401610a0d91815260200190565b6020604051808303816000875af1158015610a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a509190612c34565b6008819055600003610aa45760405162461bcd60e51b815260206004820152601e60248201527f52616e646f6d206e756d626572206973206e6f7420726561647920796574000060448201526064016108a8565b600180546002919060ff60a01b1916600160a01b8361099d565b6002600154600160a01b900460ff166002811115610ade57610ade612b89565b03610ba1576006541580610b005750600354600454610afd9042612c0e565b10155b610b935760405162461bcd60e51b815260206004820152605860248201527f546865726520617265207374696c6c20646973707574657320776974686f757460448201527f206a75726f727320616e6420746865206d6178696d756d2064726177696e67206064820152773a34b6b2903430b9903737ba103830b9b9b2b2103cb2ba1760411b608482015260a4016108a8565b6001805460ff60a01b191690555b426004556001546040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b9391610be291600160a01b90910460ff1690612b9f565b60405180910390a1565b6001546001600160a01b03163314610c165760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d602052604081206002018054839290610c41908490612c21565b909155505060408051828152600060208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b091015b60405180910390a25050565b6000600154600160a01b900460ff166002811115610caf57610caf612b89565b14610cfc5760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520696e205374616b696e672070686173652e000000000060448201526064016108a8565b6000600a54600183600b54610d119190612c21565b610d1b9190612c0e565b11610d265781610d41565b600b54600a54610d369190612c0e565b610d41906001612c21565b9050600081600b54610d539190612c21565b600b549091505b81811015610e75576000818152600e6020526040902080546001600160a01b031615610e625760018054825491830154600284015460405163fbb519e760e01b81526001600160a01b039384169463fbb519e794610dd69490821693600160a01b9092046001600160601b031692909160ff1690600401612bc7565b600060405180830381600087803b158015610df057600080fd5b505af1158015610e04573d6000803e3d6000fd5b505082546001600160a01b0381166000908152600f60209081526040808320600160a01b9094046001600160601b03168352928152828220829055868252600e90529081208181556001810191909155600201805460ff1916905550505b5080610e6d81612c91565b915050610d5a565b50600b555050565b6001546001600160a01b03163314610ea75760405162461bcd60e51b81526004016108a890612c4d565b6000828152600c6020526040812090610ebf83611de6565b825490915015610f085760405162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b60448201526064016108a8565b60018111610f585760405162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e000000000060448201526064016108a8565b8155600201805460018101825560009182526020822001555050565b60006002600154600160a01b900460ff166002811115610f9657610f96612b89565b14610fd25760405162461bcd60e51b815260206004820152600c60248201526b2bb937b73390383430b9b29760a11b60448201526064016108a8565b6000848152600c6020526040812060028101805491929091610ff657610ff6612caa565b9060005260206000200154600003611012576000915050611151565b60008160020160008154811061102a5761102a612caa565b9060005260206000200154600854868660405160200161105d939291909283526020830191909152604082015260600190565b6040516020818303038152906040528051906020012060001c6110809190612cd6565b905060005b60028301548354611097908390612cea565b6110a2906001612c21565b10156111315760015b8354811161112b576000818386600001546110c69190612cea565b6110d09190612c21565b905060008560020182815481106110e9576110e9612caa565b9060005260206000200154905080851061110e576111078186612c0e565b9450611116565b50915061112b565b5050808061112390612c91565b9150506110ab565b50611085565b600081815260048401602052604090205461114b90611e01565b93505050505b9392505050565b6000546001600160a01b031633146111825760405162461bcd60e51b81526004016108a890612d01565b600780546001600160a01b0319166001600160a01b038416179055600981905560018054600160a01b900460ff1660028111156111c1576111c1612b89565b0361123d576007546009546001600160a01b0390911690637363ae1f906111e89043612c21565b6040518263ffffffff1660e01b815260040161120691815260200190565b600060405180830381600087803b15801561122057600080fd5b505af1158015611234573d6000803e3d6000fd5b50504360055550505b5050565b61124a82611e2c565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806112c857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166112bc600080516020612e298339815191525490565b6001600160a01b031614155b156112e65760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611340575060408051601f3d908101601f1916820190925261133d91810190612c34565b60015b61136857604051630c76093760e01b81526001600160a01b03831660048201526024016108a8565b600080516020612e29833981519152811461139957604051632a87526960e21b8152600481018290526024016108a8565b600080516020612e298339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611464576000836001600160a01b0316836040516114009190612d43565b600060405180830381855af49150503d806000811461143b576040519150601f19603f3d011682016040523d82523d6000602084013e611440565b606091505b5050905080611462576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114b45760405163703e46dd60e11b815260040160405180910390fd5b50600080516020612e2983398151915290565b6001600160a01b0381166000908152600d602090815260409182902080548351818402810184019094528084526060939283018282801561155957602002820191906000526020600020906000905b82829054906101000a90046001600160601b03166001600160601b0316815260200190600c0190602082600b010492830192600103820291508084116115165790505b50505050509050919050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806115af5750805467ffffffffffffffff808416911610155b156115cc5760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff8316908117600160401b178255600080546001600160a01b038b81166001600160a01b031992831617909255600180548b841690831617815560028a905560038990554260045560078054938916939092169290921790556009859055600b55815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050505050565b6001546001600160a01b031633146116b55760405162461bcd60e51b81526004016108a890612c4d565b600680549060006116c583612d72565b91905055505050565b6000828152600c60209081526040808320848452600381019092528220548083036116fe57600092505050611723565b81600201818154811061171357611713612caa565b9060005260206000200154925050505b92915050565b6000546001600160a01b031633146117535760405162461bcd60e51b81526004016108a890612d01565b600255565b6001546001600160a01b031633146117825760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d6020526040812060020180548392906117ad908490612c0e565b909155505060408051828152600160208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b09101610c83565b6000806118008484611e56565b90506118156001600160601b038416826116ce565b949350505050565b600154600090819081906001600160a01b0316331461184e5760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0387166000908152600d602052604081209061187189896117f3565b82549091508715801561188d575060048110158061188d575081155b156118a5576000806000955095509550505050611bda565b6118af898b611e9e565b94506000600154600160a01b900460ff1660028111156118d1576118d1612b89565b14611a7f576000600e6000600a600081546118eb90612c91565b919050819055815260200190815260200160002090508a8160000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550898160000160146101000a8154816001600160601b0302191690836001600160601b03160217905550888160010181905550600a54600f60008d6001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160601b03166001600160601b031681526020019081526020016000208190555082891115611a235760028101805460ff191660011790556119ce848b8b86612155565b604080516001600160601b038d168152602081018c90529198506001600160a01b038d16917f792235ed84e4d70219b4fc973c509bbbdc2d3e22578dceea671f48829db949b0910160405180910390a2611a71565b604080516001600160601b038c168152602081018b90526001600160a01b038d16917fe9a844153bbed760d95005e769b4ef97fab26f7b01305c7028a0493b833bdbae910160405180910390a25b5060019350611bda92505050565b818810611a9f5786611a9a57611a97838a8a85612155565b95505b611ab8565b611aab838a8a85612235565b611ab59086612c21565b94505b6000611ac48b8b611e56565b905060008a5b81611b8257611ae36001600160601b0382168c8561242c565b6000196001600160601b03821601611afe5760019150611aca565b600154604051630fad06e960e11b81526001600160601b03831660048201526001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa158015611b4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b739190612d89565b50949550611aca945050505050565b604080516001600160601b038e168152602081018d90526001600160a01b038f16917f4732545d01e38980276a17e6d394f01577ba63f2fea5eba41af0757d9c060c5c910160405180910390a2506001955050505050505b9450945094915050565b6001546001600160a01b03163314611c0e5760405162461bcd60e51b81526004016108a890612c4d565b6000611c19826114c7565b80519091505b801561146457600180546001600160a01b03169063fbb519e79085908590611c479086612c0e565b81518110611c5757611c57612caa565b60200260200101516000806040518563ffffffff1660e01b8152600401611c819493929190612bc7565b600060405180830381600087803b158015611c9b57600080fd5b505af1158015611caf573d6000803e3d6000fd5b505050508080611cbe90612d72565b915050611c1f565b6001546001600160a01b03163314611cf05760405162461bcd60e51b81526004016108a890612c4d565b600680549060006116c583612c91565b6001600160a01b0382166000908152600d6020526040812060018101546002820154909290918190611d3287876117f3565b9054949793965094505050565b6000546001600160a01b03163314611d695760405162461bcd60e51b81526004016108a890612d01565b600355565b6001546001600160a01b03163314611d985760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d6020526040902060018101548211611dda5781816001016000828254611dcf9190612c0e565b909155506114649050565b60006001820155505050565b60006020825110611df957506020015190565b506006919050565b600060405160005b6014811015611e245783811a81600c84010153600101611e09565b505192915050565b6000546001600160a01b0316331461033f5760405162461bcd60e51b81526004016108a890612d01565b600060405160005b6014811015611e79578481600c011a81830153600101611e5e565b5060145b6020811015611e955783811a81830153600101611e7d565b50519392505050565b6001600160a01b0381166000908152600f602090815260408083206001600160601b0386168452909152812054801561214e576000818152600e60205260409020600281015460ff1615612101576000611ef885876117f3565b90506000818360010154611f0c9190612c0e565b6001600160a01b0387166000908152600d602052604090206001810154919650869250908210611f3e57806001015495505b85816001016000828254611f529190612c0e565b90915550506040518281526001600160601b038916906001600160a01b038916907f1222c35b9c82812f1fda75e2b299043b079c0bb3b53d44aee1ae96a97263ca699060200160405180910390a3826000036120fd5780545b80156120fb576001600160601b03891682611fc7600184612c0e565b81548110611fd757611fd7612caa565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036120e9578154829061201390600190612c0e565b8154811061202357612023612caa565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169083906120579084612c0e565b8154811061206757612067612caa565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550816000018054806120b3576120b3612dfe565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556120fb565b806120f381612d72565b915050611fab565b505b5050505b506000818152600e6020908152604080832083815560018101849055600201805460ff191690556001600160a01b0386168352600f82528083206001600160601b03881684529091528120555b5092915050565b60008085600101548660020154101561216f576000612183565b856001015486600201546121839190612c0e565b905061218f8184612c21565b84101561219d5760006121b2565b806121a88486612c0e565b6121b29190612c0e565b9150826000036121f7578554600180820188556000888152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918816021790555b82866001015410156122095783612224565b8383876001015461221a9190612c0e565b6122249190612c21565b866001018190555050949350505050565b60028401546000906122478484612c0e565b6122519190612c21565b85600101541061226c576122658383612c0e565b9050612292565b8460020154856001015410612292578460020154856001015461228f9190612c0e565b90505b826000036123ef5784545b80156123ed576001600160601b038516866122b9600184612c0e565b815481106122c9576122c9612caa565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036123db578554869061230590600190612c0e565b8154811061231557612315612caa565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169087906123499084612c0e565b8154811061235957612359612caa565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550856000018054806123a5576123a5612dfe565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556123ed565b806123e581612d72565b91505061229d565b505b8185600101541015612401578261241c565b828286600101546124129190612c0e565b61241c9190612c21565b8560010181905550949350505050565b6000838152600c602090815260408083208484526003810190925282205490918190036125f95783156125f45760018201546000036125475750600281018054600180820183556000928352602090922081018590559081148015906124a65750815461249a600183612c0e565b6124a49190612cd6565b155b156125425781546000906124ba9083612e14565b60008181526004850160205260408120549192506124d9846001612c21565b9050846002018560020184815481106124f4576124f4612caa565b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b6125c2565b60018083018054909161255991612c0e565b8154811061256957612569612caa565b906000526020600020015490508160010180548061258957612589612dfe565b60019003818190600052602060002001600090559055838260020182815481106125b5576125b5612caa565b6000918252602090912001555b600083815260038301602090815260408083208490558383526004850190915290208390556125f48582600187612780565b612779565b8360000361269757600082600201828154811061261857612618612caa565b90600052602060002001549050600083600201838154811061263c5761263c612caa565b6000918252602080832090910192909255600180860180549182018155825282822001849055858152600385018252604080822082905584825260048601909252908120819055612691908790849084612780565b50612779565b8160020181815481106126ac576126ac612caa565b90600052602060002001548414612779576000848360020183815481106126d5576126d5612caa565b90600052602060002001541115905060008161271b578584600201848154811061270157612701612caa565b90600052602060002001546127169190612c0e565b612746565b83600201838154811061273057612730612caa565b9060005260206000200154866127469190612c0e565b90508584600201848154811061275e5761275e612caa565b60009182526020909120015561277687848484612780565b50505b5050505050565b6000848152600c60205260409020835b80156128355781546127a3600183612c0e565b6127ad9190612e14565b9050836127e457828260020182815481106127ca576127ca612caa565b90600052602060002001546127df9190612c0e565b61280f565b828260020182815481106127fa576127fa612caa565b906000526020600020015461280f9190612c21565b82600201828154811061282457612824612caa565b600091825260209091200155612790565b505050505050565b6001600160a01b038116811461033f57600080fd5b6000806040838503121561286557600080fd5b82356128708161283d565b946020939093013593505050565b60006020828403121561289057600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126128be57600080fd5b813567ffffffffffffffff808211156128d9576128d9612897565b604051601f8301601f19908116603f0116810190828211818310171561290157612901612897565b8160405283815286602085880101111561291a57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561294d57600080fd5b82359150602083013567ffffffffffffffff81111561296b57600080fd5b612977858286016128ad565b9150509250929050565b60008060006060848603121561299657600080fd5b505081359360208301359350604090920135919050565b600080604083850312156129c057600080fd5b82356129cb8161283d565b9150602083013567ffffffffffffffff81111561296b57600080fd5b6000602082840312156129f957600080fd5b81356111518161283d565b6020808252825182820181905260009190848201906040850190845b81811015612a455783516001600160601b031683529284019291840191600101612a20565b50909695505050505050565b60008060008060008060c08789031215612a6a57600080fd5b8635612a758161283d565b95506020870135612a858161283d565b945060408701359350606087013592506080870135612aa38161283d565b8092505060a087013590509295509295509295565b60008060408385031215612acb57600080fd5b50508035926020909101359150565b6001600160601b038116811461033f57600080fd5b60008060408385031215612b0257600080fd5b8235612b0d8161283d565b91506020830135612b1d81612ada565b809150509250929050565b801515811461033f57600080fd5b60008060008060808587031215612b4c57600080fd5b8435612b578161283d565b93506020850135612b6781612ada565b9250604085013591506060850135612b7e81612b28565b939692955090935050565b634e487b7160e01b600052602160045260246000fd5b6020810160038310612bc157634e487b7160e01b600052602160045260246000fd5b91905290565b6001600160a01b039490941684526001600160601b0392909216602084015260408301521515606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561172357611723612bf8565b8082018082111561172357611723612bf8565b600060208284031215612c4657600080fd5b5051919050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600060018201612ca357612ca3612bf8565b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082612ce557612ce5612cc0565b500690565b808202811582820484141761172357611723612bf8565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b6000825160005b81811015612d645760208186018101518583015201612d4a565b506000920191825250919050565b600081612d8157612d81612bf8565b506000190190565b600080600080600080600060e0888a031215612da457600080fd5b8751612daf81612ada565b6020890151909750612dc081612b28565b8096505060408801519450606088015193506080880151925060a0880151915060c0880151612dee81612b28565b8091505092959891949750929550565b634e487b7160e01b600052603160045260246000fd5b600082612e2357612e23612cc0565b50049056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220a033b17b17f53b80ffc9b458b580d8ec4bab3d5c2ab361b7830d67fa9faab2df64736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106102465760003560e01c80637dc38f1411610139578063c1572618116100b6578063dca5f6b01161007a578063dca5f6b0146106c6578063dd5e5cb514610712578063e534710d14610732578063f216de4c1461076a578063f2f4eb261461078a578063f6b4d82d146107aa57600080fd5b8063c15726181461061a578063ccbac9f514610630578063d09f392d14610646578063d1c1df4814610666578063d605787b146106a657600080fd5b8063b1c9fe6e116100fd578063b1c9fe6e1461058b578063b4a61608146105b9578063b5d69e99146105ce578063b888adfa146105ee578063c057eca71461060457600080fd5b80637dc38f14146104d8578063823cfd70146104ee578063965af6c71461050e578063a2473cc11461052e578063a5861b901461054e57600080fd5b80634c70a0d6116101c757806354812d171161018b57806354812d171461041757806356acb050146104375780635d2d78461461044d5780636624192f1461046d57806376fa9fc5146104b857600080fd5b80634c70a0d6146103825780634dbbebbc146103a25780634f1ef286146103c257806352d1902d146103d5578063543f8a36146103ea57600080fd5b80631b92bbbe1161020e5780631b92bbbe146102ee57806321e1625e1461030457806321ea9b3f1461032457806335975f4a14610342578063477a655c1461036257600080fd5b8063034327441461024b5780630b274f2e146102745780630b51806d1461028b5780630c340a24146102a05780630e083ec9146102d8575b600080fd5b34801561025757600080fd5b5061026160065481565b6040519081526020015b60405180910390f35b34801561028057600080fd5b50610289610814565b005b34801561029757600080fd5b50610261600681565b3480156102ac57600080fd5b506000546102c0906001600160a01b031681565b6040516001600160a01b03909116815260200161026b565b3480156102e457600080fd5b50610261600a5481565b3480156102fa57600080fd5b5061026160035481565b34801561031057600080fd5b5061028961031f366004612852565b610bec565b34801561033057600080fd5b5061028961033f36600461287e565b50565b34801561034e57600080fd5b5061028961035d36600461287e565b610c8f565b34801561036e57600080fd5b5061028961037d36600461293a565b610e7d565b34801561038e57600080fd5b506102c061039d366004612981565b610f74565b3480156103ae57600080fd5b506102896103bd366004612852565b611158565b6102896103d03660046129ad565b611241565b3480156103e157600080fd5b50610261611469565b3480156103f657600080fd5b5061040a6104053660046129e7565b6114c7565b60405161026b9190612a04565b34801561042357600080fd5b50610289610432366004612a51565b611565565b34801561044357600080fd5b50610261600b5481565b34801561045957600080fd5b50610289610468366004612ab8565b61168b565b34801561047957600080fd5b506104a86104883660046129e7565b6001600160a01b03166000908152600d6020526040902060010154151590565b604051901515815260200161026b565b3480156104c457600080fd5b506102616104d3366004612ab8565b6116ce565b3480156104e457600080fd5b5061026160095481565b3480156104fa57600080fd5b5061028961050936600461287e565b611729565b34801561051a57600080fd5b50610289610529366004612852565b611758565b34801561053a57600080fd5b50610261610549366004612aef565b6117f3565b34801561055a57600080fd5b5061056e610569366004612b36565b61181d565b60408051938452602084019290925215159082015260600161026b565b34801561059757600080fd5b506001546105ac90600160a01b900460ff1681565b60405161026b9190612b9f565b3480156105c557600080fd5b50610261600481565b3480156105da57600080fd5b506102896105e93660046129e7565b611be4565b3480156105fa57600080fd5b5061026160045481565b34801561061057600080fd5b5061026160025481565b34801561062657600080fd5b5061026160055481565b34801561063c57600080fd5b5061026160085481565b34801561065257600080fd5b50610289610661366004612ab8565b611cc6565b34801561067257600080fd5b50610686610681366004612aef565b611d00565b60408051948552602085019390935291830152606082015260800161026b565b3480156106b257600080fd5b506007546102c0906001600160a01b031681565b3480156106d257600080fd5b506106fd6106e13660046129e7565b600d602052600090815260409020600181015460029091015482565b6040805192835260208301919091520161026b565b34801561071e57600080fd5b5061028961072d36600461287e565b611d3f565b34801561073e57600080fd5b5061026161074d366004612aef565b600f60209081526000928352604080842090915290825290205481565b34801561077657600080fd5b50610289610785366004612852565b611d6e565b34801561079657600080fd5b506001546102c0906001600160a01b031681565b3480156107b657600080fd5b506108046107c536600461287e565b600e602052600090815260409020805460018201546002909201546001600160a01b03821692600160a01b9092046001600160601b0316919060ff1684565b60405161026b9493929190612bc7565b6000600154600160a01b900460ff16600281111561083457610834612b89565b036109a7576002546004546108499042612c0e565b10156108b15760405162461bcd60e51b815260206004820152602c60248201527f546865206d696e696d756d207374616b696e672074696d6520686173206e6f7460448201526b103830b9b9b2b2103cb2ba1760a11b60648201526084015b60405180910390fd5b6000600654116109135760405162461bcd60e51b815260206004820152602760248201527f546865726520617265206e6f2064697370757465732074686174206e65656420604482015266353ab937b9399760c91b60648201526084016108a8565b6007546009546001600160a01b0390911690637363ae1f906109359043612c21565b6040518263ffffffff1660e01b815260040161095391815260200190565b600060405180830381600087803b15801561096d57600080fd5b505af1158015610981573d6000803e3d6000fd5b505043600555505060018054819060ff60a01b1916600160a01b825b0217905550610ba1565b60018054600160a01b900460ff1660028111156109c6576109c6612b89565b03610abe576007546009546005546001600160a01b03909216916313cf9054916109ef91612c21565b6040518263ffffffff1660e01b8152600401610a0d91815260200190565b6020604051808303816000875af1158015610a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a509190612c34565b6008819055600003610aa45760405162461bcd60e51b815260206004820152601e60248201527f52616e646f6d206e756d626572206973206e6f7420726561647920796574000060448201526064016108a8565b600180546002919060ff60a01b1916600160a01b8361099d565b6002600154600160a01b900460ff166002811115610ade57610ade612b89565b03610ba1576006541580610b005750600354600454610afd9042612c0e565b10155b610b935760405162461bcd60e51b815260206004820152605860248201527f546865726520617265207374696c6c20646973707574657320776974686f757460448201527f206a75726f727320616e6420746865206d6178696d756d2064726177696e67206064820152773a34b6b2903430b9903737ba103830b9b9b2b2103cb2ba1760411b608482015260a4016108a8565b6001805460ff60a01b191690555b426004556001546040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b9391610be291600160a01b90910460ff1690612b9f565b60405180910390a1565b6001546001600160a01b03163314610c165760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d602052604081206002018054839290610c41908490612c21565b909155505060408051828152600060208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b091015b60405180910390a25050565b6000600154600160a01b900460ff166002811115610caf57610caf612b89565b14610cfc5760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520696e205374616b696e672070686173652e000000000060448201526064016108a8565b6000600a54600183600b54610d119190612c21565b610d1b9190612c0e565b11610d265781610d41565b600b54600a54610d369190612c0e565b610d41906001612c21565b9050600081600b54610d539190612c21565b600b549091505b81811015610e75576000818152600e6020526040902080546001600160a01b031615610e625760018054825491830154600284015460405163fbb519e760e01b81526001600160a01b039384169463fbb519e794610dd69490821693600160a01b9092046001600160601b031692909160ff1690600401612bc7565b600060405180830381600087803b158015610df057600080fd5b505af1158015610e04573d6000803e3d6000fd5b505082546001600160a01b0381166000908152600f60209081526040808320600160a01b9094046001600160601b03168352928152828220829055868252600e90529081208181556001810191909155600201805460ff1916905550505b5080610e6d81612c91565b915050610d5a565b50600b555050565b6001546001600160a01b03163314610ea75760405162461bcd60e51b81526004016108a890612c4d565b6000828152600c6020526040812090610ebf83611de6565b825490915015610f085760405162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b60448201526064016108a8565b60018111610f585760405162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e000000000060448201526064016108a8565b8155600201805460018101825560009182526020822001555050565b60006002600154600160a01b900460ff166002811115610f9657610f96612b89565b14610fd25760405162461bcd60e51b815260206004820152600c60248201526b2bb937b73390383430b9b29760a11b60448201526064016108a8565b6000848152600c6020526040812060028101805491929091610ff657610ff6612caa565b9060005260206000200154600003611012576000915050611151565b60008160020160008154811061102a5761102a612caa565b9060005260206000200154600854868660405160200161105d939291909283526020830191909152604082015260600190565b6040516020818303038152906040528051906020012060001c6110809190612cd6565b905060005b60028301548354611097908390612cea565b6110a2906001612c21565b10156111315760015b8354811161112b576000818386600001546110c69190612cea565b6110d09190612c21565b905060008560020182815481106110e9576110e9612caa565b9060005260206000200154905080851061110e576111078186612c0e565b9450611116565b50915061112b565b5050808061112390612c91565b9150506110ab565b50611085565b600081815260048401602052604090205461114b90611e01565b93505050505b9392505050565b6000546001600160a01b031633146111825760405162461bcd60e51b81526004016108a890612d01565b600780546001600160a01b0319166001600160a01b038416179055600981905560018054600160a01b900460ff1660028111156111c1576111c1612b89565b0361123d576007546009546001600160a01b0390911690637363ae1f906111e89043612c21565b6040518263ffffffff1660e01b815260040161120691815260200190565b600060405180830381600087803b15801561122057600080fd5b505af1158015611234573d6000803e3d6000fd5b50504360055550505b5050565b61124a82611e2c565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806112c857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166112bc600080516020612e298339815191525490565b6001600160a01b031614155b156112e65760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611340575060408051601f3d908101601f1916820190925261133d91810190612c34565b60015b61136857604051630c76093760e01b81526001600160a01b03831660048201526024016108a8565b600080516020612e29833981519152811461139957604051632a87526960e21b8152600481018290526024016108a8565b600080516020612e298339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611464576000836001600160a01b0316836040516114009190612d43565b600060405180830381855af49150503d806000811461143b576040519150601f19603f3d011682016040523d82523d6000602084013e611440565b606091505b5050905080611462576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114b45760405163703e46dd60e11b815260040160405180910390fd5b50600080516020612e2983398151915290565b6001600160a01b0381166000908152600d602090815260409182902080548351818402810184019094528084526060939283018282801561155957602002820191906000526020600020906000905b82829054906101000a90046001600160601b03166001600160601b0316815260200190600c0190602082600b010492830192600103820291508084116115165790505b50505050509050919050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806115af5750805467ffffffffffffffff808416911610155b156115cc5760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff8316908117600160401b178255600080546001600160a01b038b81166001600160a01b031992831617909255600180548b841690831617815560028a905560038990554260045560078054938916939092169290921790556009859055600b55815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050505050565b6001546001600160a01b031633146116b55760405162461bcd60e51b81526004016108a890612c4d565b600680549060006116c583612d72565b91905055505050565b6000828152600c60209081526040808320848452600381019092528220548083036116fe57600092505050611723565b81600201818154811061171357611713612caa565b9060005260206000200154925050505b92915050565b6000546001600160a01b031633146117535760405162461bcd60e51b81526004016108a890612d01565b600255565b6001546001600160a01b031633146117825760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d6020526040812060020180548392906117ad908490612c0e565b909155505060408051828152600160208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b09101610c83565b6000806118008484611e56565b90506118156001600160601b038416826116ce565b949350505050565b600154600090819081906001600160a01b0316331461184e5760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0387166000908152600d602052604081209061187189896117f3565b82549091508715801561188d575060048110158061188d575081155b156118a5576000806000955095509550505050611bda565b6118af898b611e9e565b94506000600154600160a01b900460ff1660028111156118d1576118d1612b89565b14611a7f576000600e6000600a600081546118eb90612c91565b919050819055815260200190815260200160002090508a8160000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550898160000160146101000a8154816001600160601b0302191690836001600160601b03160217905550888160010181905550600a54600f60008d6001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160601b03166001600160601b031681526020019081526020016000208190555082891115611a235760028101805460ff191660011790556119ce848b8b86612155565b604080516001600160601b038d168152602081018c90529198506001600160a01b038d16917f792235ed84e4d70219b4fc973c509bbbdc2d3e22578dceea671f48829db949b0910160405180910390a2611a71565b604080516001600160601b038c168152602081018b90526001600160a01b038d16917fe9a844153bbed760d95005e769b4ef97fab26f7b01305c7028a0493b833bdbae910160405180910390a25b5060019350611bda92505050565b818810611a9f5786611a9a57611a97838a8a85612155565b95505b611ab8565b611aab838a8a85612235565b611ab59086612c21565b94505b6000611ac48b8b611e56565b905060008a5b81611b8257611ae36001600160601b0382168c8561242c565b6000196001600160601b03821601611afe5760019150611aca565b600154604051630fad06e960e11b81526001600160601b03831660048201526001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa158015611b4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b739190612d89565b50949550611aca945050505050565b604080516001600160601b038e168152602081018d90526001600160a01b038f16917f4732545d01e38980276a17e6d394f01577ba63f2fea5eba41af0757d9c060c5c910160405180910390a2506001955050505050505b9450945094915050565b6001546001600160a01b03163314611c0e5760405162461bcd60e51b81526004016108a890612c4d565b6000611c19826114c7565b80519091505b801561146457600180546001600160a01b03169063fbb519e79085908590611c479086612c0e565b81518110611c5757611c57612caa565b60200260200101516000806040518563ffffffff1660e01b8152600401611c819493929190612bc7565b600060405180830381600087803b158015611c9b57600080fd5b505af1158015611caf573d6000803e3d6000fd5b505050508080611cbe90612d72565b915050611c1f565b6001546001600160a01b03163314611cf05760405162461bcd60e51b81526004016108a890612c4d565b600680549060006116c583612c91565b6001600160a01b0382166000908152600d6020526040812060018101546002820154909290918190611d3287876117f3565b9054949793965094505050565b6000546001600160a01b03163314611d695760405162461bcd60e51b81526004016108a890612d01565b600355565b6001546001600160a01b03163314611d985760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d6020526040902060018101548211611dda5781816001016000828254611dcf9190612c0e565b909155506114649050565b60006001820155505050565b60006020825110611df957506020015190565b506006919050565b600060405160005b6014811015611e245783811a81600c84010153600101611e09565b505192915050565b6000546001600160a01b0316331461033f5760405162461bcd60e51b81526004016108a890612d01565b600060405160005b6014811015611e79578481600c011a81830153600101611e5e565b5060145b6020811015611e955783811a81830153600101611e7d565b50519392505050565b6001600160a01b0381166000908152600f602090815260408083206001600160601b0386168452909152812054801561214e576000818152600e60205260409020600281015460ff1615612101576000611ef885876117f3565b90506000818360010154611f0c9190612c0e565b6001600160a01b0387166000908152600d602052604090206001810154919650869250908210611f3e57806001015495505b85816001016000828254611f529190612c0e565b90915550506040518281526001600160601b038916906001600160a01b038916907f1222c35b9c82812f1fda75e2b299043b079c0bb3b53d44aee1ae96a97263ca699060200160405180910390a3826000036120fd5780545b80156120fb576001600160601b03891682611fc7600184612c0e565b81548110611fd757611fd7612caa565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036120e9578154829061201390600190612c0e565b8154811061202357612023612caa565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169083906120579084612c0e565b8154811061206757612067612caa565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550816000018054806120b3576120b3612dfe565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556120fb565b806120f381612d72565b915050611fab565b505b5050505b506000818152600e6020908152604080832083815560018101849055600201805460ff191690556001600160a01b0386168352600f82528083206001600160601b03881684529091528120555b5092915050565b60008085600101548660020154101561216f576000612183565b856001015486600201546121839190612c0e565b905061218f8184612c21565b84101561219d5760006121b2565b806121a88486612c0e565b6121b29190612c0e565b9150826000036121f7578554600180820188556000888152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918816021790555b82866001015410156122095783612224565b8383876001015461221a9190612c0e565b6122249190612c21565b866001018190555050949350505050565b60028401546000906122478484612c0e565b6122519190612c21565b85600101541061226c576122658383612c0e565b9050612292565b8460020154856001015410612292578460020154856001015461228f9190612c0e565b90505b826000036123ef5784545b80156123ed576001600160601b038516866122b9600184612c0e565b815481106122c9576122c9612caa565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036123db578554869061230590600190612c0e565b8154811061231557612315612caa565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169087906123499084612c0e565b8154811061235957612359612caa565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550856000018054806123a5576123a5612dfe565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556123ed565b806123e581612d72565b91505061229d565b505b8185600101541015612401578261241c565b828286600101546124129190612c0e565b61241c9190612c21565b8560010181905550949350505050565b6000838152600c602090815260408083208484526003810190925282205490918190036125f95783156125f45760018201546000036125475750600281018054600180820183556000928352602090922081018590559081148015906124a65750815461249a600183612c0e565b6124a49190612cd6565b155b156125425781546000906124ba9083612e14565b60008181526004850160205260408120549192506124d9846001612c21565b9050846002018560020184815481106124f4576124f4612caa565b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b6125c2565b60018083018054909161255991612c0e565b8154811061256957612569612caa565b906000526020600020015490508160010180548061258957612589612dfe565b60019003818190600052602060002001600090559055838260020182815481106125b5576125b5612caa565b6000918252602090912001555b600083815260038301602090815260408083208490558383526004850190915290208390556125f48582600187612780565b612779565b8360000361269757600082600201828154811061261857612618612caa565b90600052602060002001549050600083600201838154811061263c5761263c612caa565b6000918252602080832090910192909255600180860180549182018155825282822001849055858152600385018252604080822082905584825260048601909252908120819055612691908790849084612780565b50612779565b8160020181815481106126ac576126ac612caa565b90600052602060002001548414612779576000848360020183815481106126d5576126d5612caa565b90600052602060002001541115905060008161271b578584600201848154811061270157612701612caa565b90600052602060002001546127169190612c0e565b612746565b83600201838154811061273057612730612caa565b9060005260206000200154866127469190612c0e565b90508584600201848154811061275e5761275e612caa565b60009182526020909120015561277687848484612780565b50505b5050505050565b6000848152600c60205260409020835b80156128355781546127a3600183612c0e565b6127ad9190612e14565b9050836127e457828260020182815481106127ca576127ca612caa565b90600052602060002001546127df9190612c0e565b61280f565b828260020182815481106127fa576127fa612caa565b906000526020600020015461280f9190612c21565b82600201828154811061282457612824612caa565b600091825260209091200155612790565b505050505050565b6001600160a01b038116811461033f57600080fd5b6000806040838503121561286557600080fd5b82356128708161283d565b946020939093013593505050565b60006020828403121561289057600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126128be57600080fd5b813567ffffffffffffffff808211156128d9576128d9612897565b604051601f8301601f19908116603f0116810190828211818310171561290157612901612897565b8160405283815286602085880101111561291a57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561294d57600080fd5b82359150602083013567ffffffffffffffff81111561296b57600080fd5b612977858286016128ad565b9150509250929050565b60008060006060848603121561299657600080fd5b505081359360208301359350604090920135919050565b600080604083850312156129c057600080fd5b82356129cb8161283d565b9150602083013567ffffffffffffffff81111561296b57600080fd5b6000602082840312156129f957600080fd5b81356111518161283d565b6020808252825182820181905260009190848201906040850190845b81811015612a455783516001600160601b031683529284019291840191600101612a20565b50909695505050505050565b60008060008060008060c08789031215612a6a57600080fd5b8635612a758161283d565b95506020870135612a858161283d565b945060408701359350606087013592506080870135612aa38161283d565b8092505060a087013590509295509295509295565b60008060408385031215612acb57600080fd5b50508035926020909101359150565b6001600160601b038116811461033f57600080fd5b60008060408385031215612b0257600080fd5b8235612b0d8161283d565b91506020830135612b1d81612ada565b809150509250929050565b801515811461033f57600080fd5b60008060008060808587031215612b4c57600080fd5b8435612b578161283d565b93506020850135612b6781612ada565b9250604085013591506060850135612b7e81612b28565b939692955090935050565b634e487b7160e01b600052602160045260246000fd5b6020810160038310612bc157634e487b7160e01b600052602160045260246000fd5b91905290565b6001600160a01b039490941684526001600160601b0392909216602084015260408301521515606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561172357611723612bf8565b8082018082111561172357611723612bf8565b600060208284031215612c4657600080fd5b5051919050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600060018201612ca357612ca3612bf8565b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082612ce557612ce5612cc0565b500690565b808202811582820484141761172357611723612bf8565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b6000825160005b81811015612d645760208186018101518583015201612d4a565b506000920191825250919050565b600081612d8157612d81612bf8565b506000190190565b600080600080600080600060e0888a031215612da457600080fd5b8751612daf81612ada565b6020890151909750612dc081612b28565b8096505060408801519450606088015193506080880151925060a0880151915060c0880151612dee81612b28565b8091505092959891949750929550565b634e487b7160e01b600052603160045260246000fd5b600082612e2357612e23612cc0565b50049056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220a033b17b17f53b80ffc9b458b580d8ec4bab3d5c2ab361b7830d67fa9faab2df64736f6c63430008120033", + "devdoc": { + "details": "A factory of trees that keeps track of staked values for sortition.", + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "changeMaxDrawingTime(uint256)": { + "details": "Changes the `maxDrawingTime` storage variable.", + "params": { + "_maxDrawingTime": "The new value for the `maxDrawingTime` storage variable." + } + }, + "changeMinStakingTime(uint256)": { + "details": "Changes the `minStakingTime` storage variable.", + "params": { + "_minStakingTime": "The new value for the `minStakingTime` storage variable." + } + }, + "changeRandomNumberGenerator(address,uint256)": { + "details": "Changes the `_rng` and `_rngLookahead` storage variables.", + "params": { + "_rng": "The new value for the `RNGenerator` storage variable.", + "_rngLookahead": "The new value for the `rngLookahead` storage variable." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "createTree(bytes32,bytes)": { + "details": "Create a sortition sum tree at the specified key.", + "params": { + "_extraData": "Extra data that contains the number of children each node in the tree should have.", + "_key": "The key of the new tree." + } + }, + "draw(bytes32,uint256,uint256)": { + "details": "Draw an ID from a tree using a number. Note that this function reverts if the sum of all values in the tree is 0.", + "params": { + "_coreDisputeID": "Index of the dispute in Kleros Core.", + "_key": "The key of the tree.", + "_nonce": "Nonce to hash with random number." + }, + "returns": { + "drawnAddress": "The drawn address. `O(k * log_k(n))` where `k` is the maximum number of children per node in the tree, and `n` is the maximum number of nodes ever appended." + } + }, + "executeDelayedStakes(uint256)": { + "details": "Executes the next delayed stakes.", + "params": { + "_iterations": "The number of delayed stakes to execute." + } + }, + "getJurorCourtIDs(address)": { + "details": "Gets the court identifiers where a specific `_juror` has staked.", + "params": { + "_juror": "The address of the juror." + } + }, + "initialize(address,address,uint256,uint256,address,uint256)": { + "details": "Initializer (constructor equivalent for upgradable contracts).", + "params": { + "_core": "The KlerosCore.", + "_maxDrawingTime": "Time after which the drawing phase can be switched", + "_minStakingTime": "Minimal time to stake", + "_rng": "The random number generator.", + "_rngLookahead": "Lookahead value for rng." + } + }, + "notifyRandomNumber(uint256)": { + "details": "Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().", + "params": { + "_randomNumber": "Random number returned by RNG contract." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "setJurorInactive(address)": { + "details": "Unstakes the inactive juror from all courts. `O(n * (p * log_k(j)) )` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.", + "params": { + "_account": "The juror to unstake." + } + }, + "setStake(address,uint96,uint256,bool)": { + "details": "Sets the specified juror's stake in a court. `O(n + p * log_k(j))` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.", + "params": { + "_account": "The address of the juror.", + "_alreadyTransferred": "True if the tokens were already transferred from juror. Only relevant for delayed stakes.", + "_courtID": "The ID of the court.", + "_newStake": "The new stake." + }, + "returns": { + "pnkDeposit": "The amount of PNK to be deposited.", + "pnkWithdrawal": "The amount of PNK to be withdrawn.", + "succeeded": "True if the call succeeded, false otherwise." + } + }, + "stakeOf(address,uint96)": { + "details": "Get the stake of a juror in a court.", + "params": { + "_courtID": "The ID of the court.", + "_juror": "The address of the juror." + }, + "returns": { + "_0": "value The stake of the juror in the court." + } + }, + "stakeOf(bytes32,bytes32)": { + "details": "Get the stake of a juror in a court.", + "params": { + "_ID": "The stake path ID, corresponding to a juror.", + "_key": "The key of the tree, corresponding to a court." + }, + "returns": { + "_0": "The stake of the juror in the court." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "title": "SortitionModule", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 7917, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 7920, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "core", + "offset": 0, + "slot": "1", + "type": "t_contract(KlerosCore)6383" + }, + { + "astId": 7923, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "phase", + "offset": 20, + "slot": "1", + "type": "t_enum(Phase)17235" + }, + { + "astId": 7925, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "minStakingTime", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 7927, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "maxDrawingTime", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 7929, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "lastPhaseChange", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 7931, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "randomNumberRequestBlock", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 7933, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "disputesWithoutJurors", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 7936, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "rng", + "offset": 0, + "slot": "7", + "type": "t_contract(RNG)24286" + }, + { + "astId": 7938, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "randomNumber", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 7940, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "rngLookahead", + "offset": 0, + "slot": "9", + "type": "t_uint256" + }, + { + "astId": 7942, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "delayedStakeWriteIndex", + "offset": 0, + "slot": "10", + "type": "t_uint256" + }, + { + "astId": 7944, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "delayedStakeReadIndex", + "offset": 0, + "slot": "11", + "type": "t_uint256" + }, + { + "astId": 7949, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "sortitionSumTrees", + "offset": 0, + "slot": "12", + "type": "t_mapping(t_bytes32,t_struct(SortitionSumTree)7892_storage)" + }, + { + "astId": 7954, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "jurors", + "offset": 0, + "slot": "13", + "type": "t_mapping(t_address,t_struct(Juror)7909_storage)" + }, + { + "astId": 7959, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "delayedStakes", + "offset": 0, + "slot": "14", + "type": "t_mapping(t_uint256,t_struct(DelayedStake)7901_storage)" + }, + { + "astId": 7965, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "latestDelayedStakeIndex", + "offset": 0, + "slot": "15", + "type": "t_mapping(t_address,t_mapping(t_uint96,t_uint256))" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_array(t_uint96)dyn_storage": { + "base": "t_uint96", + "encoding": "dynamic_array", + "label": "uint96[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(KlerosCore)6383": { + "encoding": "inplace", + "label": "contract KlerosCore", + "numberOfBytes": "20" + }, + "t_contract(RNG)24286": { + "encoding": "inplace", + "label": "contract RNG", + "numberOfBytes": "20" + }, + "t_enum(Phase)17235": { + "encoding": "inplace", + "label": "enum ISortitionModule.Phase", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_mapping(t_uint96,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(uint96 => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint96,t_uint256)" + }, + "t_mapping(t_address,t_struct(Juror)7909_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct SortitionModule.Juror)", + "numberOfBytes": "32", + "value": "t_struct(Juror)7909_storage" + }, + "t_mapping(t_bytes32,t_struct(SortitionSumTree)7892_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct SortitionModule.SortitionSumTree)", + "numberOfBytes": "32", + "value": "t_struct(SortitionSumTree)7892_storage" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint256,t_bytes32)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => bytes32)", + "numberOfBytes": "32", + "value": "t_bytes32" + }, + "t_mapping(t_uint256,t_struct(DelayedStake)7901_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct SortitionModule.DelayedStake)", + "numberOfBytes": "32", + "value": "t_struct(DelayedStake)7901_storage" + }, + "t_mapping(t_uint96,t_uint256)": { + "encoding": "mapping", + "key": "t_uint96", + "label": "mapping(uint96 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(DelayedStake)7901_storage": { + "encoding": "inplace", + "label": "struct SortitionModule.DelayedStake", + "members": [ + { + "astId": 7894, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "account", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 7896, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "courtID", + "offset": 20, + "slot": "0", + "type": "t_uint96" + }, + { + "astId": 7898, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "stake", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 7900, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "alreadyTransferred", + "offset": 0, + "slot": "2", + "type": "t_bool" + } + ], + "numberOfBytes": "96" + }, + "t_struct(Juror)7909_storage": { + "encoding": "inplace", + "label": "struct SortitionModule.Juror", + "members": [ + { + "astId": 7904, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "courtIDs", + "offset": 0, + "slot": "0", + "type": "t_array(t_uint96)dyn_storage" + }, + { + "astId": 7906, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "stakedPnk", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 7908, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "lockedPnk", + "offset": 0, + "slot": "2", + "type": "t_uint256" + } + ], + "numberOfBytes": "96" + }, + "t_struct(SortitionSumTree)7892_storage": { + "encoding": "inplace", + "label": "struct SortitionModule.SortitionSumTree", + "members": [ + { + "astId": 7877, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "K", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 7880, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "stack", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 7883, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "nodes", + "offset": 0, + "slot": "2", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 7887, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "IDsToNodeIndexes", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_bytes32,t_uint256)" + }, + { + "astId": 7891, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "nodeIndexesToIDs", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_bytes32)" + } + ], + "numberOfBytes": "160" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint96": { + "encoding": "inplace", + "label": "uint96", + "numberOfBytes": "12" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule_Proxy.json b/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule_Proxy.json new file mode 100644 index 000000000..eec613b8e --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0xf327200420F21BAafce8F1C03B1EEdF926074B95", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x586f56da98113e584a9355075402333309687bf056333595d5407301acfa14c0", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xf327200420F21BAafce8F1C03B1EEdF926074B95", + "transactionIndex": 1, + "gasUsed": "332147", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000100000000000400000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xd68a4f4bfb4408a7c73c9b14bea1403fa89ec354d86f7e85df074b9104d9b6f7", + "transactionHash": "0x586f56da98113e584a9355075402333309687bf056333595d5407301acfa14c0", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084593, + "transactionHash": "0x586f56da98113e584a9355075402333309687bf056333595d5407301acfa14c0", + "address": "0xf327200420F21BAafce8F1C03B1EEdF926074B95", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0xd68a4f4bfb4408a7c73c9b14bea1403fa89ec354d86f7e85df074b9104d9b6f7" + } + ], + "blockNumber": 3084593, + "cumulativeGasUsed": "332147", + "status": 1, + "byzantium": true + }, + "args": [ + "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9", + "0x54812d17000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c590000000000000000000000004dd8b69958ef1d7d5da9347e9d9f57adfc3dc28400000000000000000000000000000000000000000000000000000000000000b40000000000000000000000000000000000000000000000000000000000000258000000000000000000000000a995c172d286f8f4ee137cc662e2844e59cf48360000000000000000000000000000000000000000000000000000000000000014" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/WETH.json b/contracts/deployments/arbitrumSepoliaDevnet/WETH.json new file mode 100644 index 000000000..88c25ffd4 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/WETH.json @@ -0,0 +1,458 @@ +{ + "address": "0x3829A2486d53ee984a0ca2D76552715726b77138", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xf0f89ebb30e850b7c573ab0fa6b56ee46381de866cddc3afbaf3dbb60f632e17", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x3829A2486d53ee984a0ca2D76552715726b77138", + "transactionIndex": 1, + "gasUsed": "621542", + "logsBloom": "0x00000020000000000000000000000000000000000040000000000000000008000000000000000000000000000000000000000000000080000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000010000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000002000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x3706ffb00d4b8e4f33496fbf5465bcd47767393e5e57a2d231c98109bed29ad2", + "transactionHash": "0xf0f89ebb30e850b7c573ab0fa6b56ee46381de866cddc3afbaf3dbb60f632e17", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3084557, + "transactionHash": "0xf0f89ebb30e850b7c573ab0fa6b56ee46381de866cddc3afbaf3dbb60f632e17", + "address": "0x3829A2486d53ee984a0ca2D76552715726b77138", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "data": "0x00000000000000000000000000000000000000000000d3c21bcecceda1000000", + "logIndex": 0, + "blockHash": "0x3706ffb00d4b8e4f33496fbf5465bcd47767393e5e57a2d231c98109bed29ad2" + } + ], + "blockNumber": 3084557, + "cumulativeGasUsed": "621542", + "status": 1, + "byzantium": true + }, + "args": [ + "WETH", + "WETH" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/token/TestERC20.sol\":\"TestERC20\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * The default value of {decimals} is 18. To change this, you should override\\n * this function so it returns a different value.\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20 is Context, IERC20, IERC20Metadata {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the default value returned by this function, unless\\n * it's overridden.\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(address from, address to, uint256 amount) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(address owner, address spender, uint256 amount) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\\n}\\n\",\"keccak256\":\"0xa56ca923f70c1748830700250b19c61b70db9a683516dc5e216694a50445d99c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0xa92e4fa126feb6907daa0513ddd816b2eb91f30a808de54f63c17d0e162c3439\",\"license\":\"MIT\"},\"src/token/TestERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\n\\ncontract TestERC20 is ERC20 {\\n constructor(string memory _name, string memory _symbol) ERC20(_name, _symbol) {\\n _mint(msg.sender, 1000000 ether);\\n }\\n}\\n\",\"keccak256\":\"0x9f67e6b63ca87e6c98b2986364ce16a747ce4098e9146fffb17ea13863c0b7e4\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162000c5838038062000c5883398101604081905262000034916200020a565b8181600362000044838262000302565b50600462000053828262000302565b505050620000723369d3c21bcecceda10000006200007a60201b60201c565b5050620003f6565b6001600160a01b038216620000d55760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060026000828254620000e99190620003ce565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b505050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200016d57600080fd5b81516001600160401b03808211156200018a576200018a62000145565b604051601f8301601f19908116603f01168101908282118183101715620001b557620001b562000145565b81604052838152602092508683858801011115620001d257600080fd5b600091505b83821015620001f65785820183015181830184015290820190620001d7565b600093810190920192909252949350505050565b600080604083850312156200021e57600080fd5b82516001600160401b03808211156200023657600080fd5b62000244868387016200015b565b935060208501519150808211156200025b57600080fd5b506200026a858286016200015b565b9150509250929050565b600181811c908216806200028957607f821691505b602082108103620002aa57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200014057600081815260208120601f850160051c81016020861015620002d95750805b601f850160051c820191505b81811015620002fa57828155600101620002e5565b505050505050565b81516001600160401b038111156200031e576200031e62000145565b62000336816200032f845462000274565b84620002b0565b602080601f8311600181146200036e5760008415620003555750858301515b600019600386901b1c1916600185901b178555620002fa565b600085815260208120601f198616915b828110156200039f578886015182559484019460019091019084016200037e565b5085821015620003be5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80820180821115620003f057634e487b7160e01b600052601160045260246000fd5b92915050565b61085280620004066000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b411461015f578063a457c2d714610167578063a9059cbb1461017a578063dd62ed3e1461018d57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101a0565b6040516100c3919061069c565b60405180910390f35b6100df6100da366004610706565b610232565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610730565b61024c565b604051601281526020016100c3565b6100df610131366004610706565b610270565b6100f361014436600461076c565b6001600160a01b031660009081526020819052604090205490565b6100b6610292565b6100df610175366004610706565b6102a1565b6100df610188366004610706565b610321565b6100f361019b36600461078e565b61032f565b6060600380546101af906107c1565b80601f01602080910402602001604051908101604052809291908181526020018280546101db906107c1565b80156102285780601f106101fd57610100808354040283529160200191610228565b820191906000526020600020905b81548152906001019060200180831161020b57829003601f168201915b5050505050905090565b60003361024081858561035a565b60019150505b92915050565b60003361025a85828561047e565b6102658585856104f8565b506001949350505050565b600033610240818585610283838361032f565b61028d91906107fb565b61035a565b6060600480546101af906107c1565b600033816102af828661032f565b9050838110156103145760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b610265828686840361035a565b6000336102408185856104f8565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166103bc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161030b565b6001600160a01b03821661041d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161030b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600061048a848461032f565b905060001981146104f257818110156104e55760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161030b565b6104f2848484840361035a565b50505050565b6001600160a01b03831661055c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161030b565b6001600160a01b0382166105be5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161030b565b6001600160a01b038316600090815260208190526040902054818110156106365760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161030b565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36104f2565b600060208083528351808285015260005b818110156106c9578581018301518582016040015282016106ad565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b038116811461070157600080fd5b919050565b6000806040838503121561071957600080fd5b610722836106ea565b946020939093013593505050565b60008060006060848603121561074557600080fd5b61074e846106ea565b925061075c602085016106ea565b9150604084013590509250925092565b60006020828403121561077e57600080fd5b610787826106ea565b9392505050565b600080604083850312156107a157600080fd5b6107aa836106ea565b91506107b8602084016106ea565b90509250929050565b600181811c908216806107d557607f821691505b6020821081036107f557634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561024657634e487b7160e01b600052601160045260246000fdfea26469706673582212203a956e65a766c03ac95ae037cbdfb51b56810340c98132c2d2482405d386101b64736f6c63430008120033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b411461015f578063a457c2d714610167578063a9059cbb1461017a578063dd62ed3e1461018d57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101a0565b6040516100c3919061069c565b60405180910390f35b6100df6100da366004610706565b610232565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610730565b61024c565b604051601281526020016100c3565b6100df610131366004610706565b610270565b6100f361014436600461076c565b6001600160a01b031660009081526020819052604090205490565b6100b6610292565b6100df610175366004610706565b6102a1565b6100df610188366004610706565b610321565b6100f361019b36600461078e565b61032f565b6060600380546101af906107c1565b80601f01602080910402602001604051908101604052809291908181526020018280546101db906107c1565b80156102285780601f106101fd57610100808354040283529160200191610228565b820191906000526020600020905b81548152906001019060200180831161020b57829003601f168201915b5050505050905090565b60003361024081858561035a565b60019150505b92915050565b60003361025a85828561047e565b6102658585856104f8565b506001949350505050565b600033610240818585610283838361032f565b61028d91906107fb565b61035a565b6060600480546101af906107c1565b600033816102af828661032f565b9050838110156103145760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b610265828686840361035a565b6000336102408185856104f8565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166103bc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161030b565b6001600160a01b03821661041d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161030b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600061048a848461032f565b905060001981146104f257818110156104e55760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161030b565b6104f2848484840361035a565b50505050565b6001600160a01b03831661055c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161030b565b6001600160a01b0382166105be5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161030b565b6001600160a01b038316600090815260208190526040902054818110156106365760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161030b565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36104f2565b600060208083528351808285015260005b818110156106c9578581018301518582016040015282016106ad565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b038116811461070157600080fd5b919050565b6000806040838503121561071957600080fd5b610722836106ea565b946020939093013593505050565b60008060006060848603121561074557600080fd5b61074e846106ea565b925061075c602085016106ea565b9150604084013590509250925092565b60006020828403121561077e57600080fd5b610787826106ea565b9392505050565b600080604083850312156107a157600080fd5b6107aa836106ea565b91506107b8602084016106ea565b90509250929050565b600181811c908216806107d557607f821691505b6020821081036107f557634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561024657634e487b7160e01b600052601160045260246000fdfea26469706673582212203a956e65a766c03ac95ae037cbdfb51b56810340c98132c2d2482405d386101b64736f6c63430008120033", + "devdoc": { + "events": { + "Approval(address,address,uint256)": { + "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." + }, + "Transfer(address,address,uint256)": { + "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." + } + }, + "kind": "dev", + "methods": { + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "decimals()": { + "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." + }, + "decreaseAllowance(address,uint256)": { + "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." + }, + "increaseAllowance(address,uint256)": { + "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." + }, + "name()": { + "details": "Returns the name of the token." + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 393, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_balances", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 399, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_allowances", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 401, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_totalSupply", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 403, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_name", + "offset": 0, + "slot": "3", + "type": "t_string_storage" + }, + { + "astId": 405, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_symbol", + "offset": 0, + "slot": "4", + "type": "t_string_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/WETHFaucet.json b/contracts/deployments/arbitrumSepoliaDevnet/WETHFaucet.json new file mode 100644 index 000000000..fe929d76f --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/WETHFaucet.json @@ -0,0 +1,226 @@ +{ + "address": "0x6F8C10E0030aDf5B8030a5E282F026ADdB6525fd", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "amount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "balance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "changeAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "request", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "withdrewAlready", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x0423f037522d0e7b089888b96380759c03ed6c37194b1430dd9dbb9553bb21f4", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x6F8C10E0030aDf5B8030a5E282F026ADdB6525fd", + "transactionIndex": 1, + "gasUsed": "435555", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x10da554e89dfb82bec4585c6d18d57a32834b446e09bcae17fdc8594e8f3ed81", + "transactionHash": "0x0423f037522d0e7b089888b96380759c03ed6c37194b1430dd9dbb9553bb21f4", + "logs": [], + "blockNumber": 3084559, + "cumulativeGasUsed": "435555", + "status": 1, + "byzantium": true + }, + "args": [ + "0x3829A2486d53ee984a0ca2D76552715726b77138" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"amount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"balance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"changeAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"request\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"withdrewAlready\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/token/Faucet.sol\":\"Faucet\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/token/Faucet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ncontract Faucet {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n IERC20 public token;\\n address public governor;\\n mapping(address => bool) public withdrewAlready;\\n uint256 public amount = 10_000 ether;\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(address(governor) == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n constructor(IERC20 _token) {\\n token = _token;\\n governor = msg.sender;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n function changeGovernor(address _governor) public onlyByGovernor {\\n governor = _governor;\\n }\\n\\n function changeAmount(uint256 _amount) public onlyByGovernor {\\n amount = _amount;\\n }\\n\\n function withdraw() public onlyByGovernor {\\n token.transfer(governor, token.balanceOf(address(this)));\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function request() public {\\n require(\\n !withdrewAlready[msg.sender],\\n \\\"You have used this faucet already. If you need more tokens, please use another address.\\\"\\n );\\n token.transfer(msg.sender, amount);\\n withdrewAlready[msg.sender] = true;\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n function balance() public view returns (uint) {\\n return token.balanceOf(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x3a54681cc304ccbfdb42215104b63809919a432ac5d3986d3021a11fcc7a1cc3\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405269021e19e0c9bab240000060035534801561001e57600080fd5b5060405161065538038061065583398101604081905261003d9161006b565b600080546001600160a01b039092166001600160a01b0319928316179055600180549091163317905561009b565b60006020828403121561007d57600080fd5b81516001600160a01b038116811461009457600080fd5b9392505050565b6105ab806100aa6000396000f3fe608060405234801561001057600080fd5b50600436106100835760003560e01c80630c340a2414610088578063338cdca1146100b15780633ccfd60b146100bb5780635c320516146100c3578063aa8c217c146100d6578063b69ef8a8146100ed578063d61c40dc146100f5578063e4c0aaf414610128578063fc0c546a1461013b575b600080fd5b60015461009b906001600160a01b031681565b6040516100a8919061049b565b60405180910390f35b6100b961014e565b005b6100b961028f565b6100b96100d13660046104af565b6103a9565b6100df60035481565b6040519081526020016100a8565b6100df6103d8565b6101186101033660046104c8565b60026020526000908152604090205460ff1681565b60405190151581526020016100a8565b6100b96101363660046104c8565b61044f565b60005461009b906001600160a01b031681565b3360009081526002602052604090205460ff16156101f95760405162461bcd60e51b815260206004820152605760248201527f596f752068617665207573656420746869732066617563657420616c7265616460448201527f792e20496620796f75206e656564206d6f726520746f6b656e732c20706c656160648201527639b2903ab9b29030b737ba3432b91030b2323932b9b99760491b608482015260a4015b60405180910390fd5b60005460035460405163a9059cbb60e01b815233600482015260248101919091526001600160a01b039091169063a9059cbb906044016020604051808303816000875af115801561024e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027291906104f8565b50336000908152600260205260409020805460ff19166001179055565b6001546001600160a01b031633146102b95760405162461bcd60e51b81526004016101f09061051a565b6000546001546040516370a0823160e01b81526001600160a01b039283169263a9059cbb92169083906370a08231906102f690309060040161049b565b602060405180830381865afa158015610313573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610337919061055c565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a691906104f8565b50565b6001546001600160a01b031633146103d35760405162461bcd60e51b81526004016101f09061051a565b600355565b600080546040516370a0823160e01b81526001600160a01b03909116906370a082319061040990309060040161049b565b602060405180830381865afa158015610426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a919061055c565b905090565b6001546001600160a01b031633146104795760405162461bcd60e51b81526004016101f09061051a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0391909116815260200190565b6000602082840312156104c157600080fd5b5035919050565b6000602082840312156104da57600080fd5b81356001600160a01b03811681146104f157600080fd5b9392505050565b60006020828403121561050a57600080fd5b815180151581146104f157600080fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60006020828403121561056e57600080fd5b505191905056fea26469706673582212204f7fd812260eacd88f23b436eb40b4943480e914005f0a0f2738f0d3c9696a5964736f6c63430008120033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100835760003560e01c80630c340a2414610088578063338cdca1146100b15780633ccfd60b146100bb5780635c320516146100c3578063aa8c217c146100d6578063b69ef8a8146100ed578063d61c40dc146100f5578063e4c0aaf414610128578063fc0c546a1461013b575b600080fd5b60015461009b906001600160a01b031681565b6040516100a8919061049b565b60405180910390f35b6100b961014e565b005b6100b961028f565b6100b96100d13660046104af565b6103a9565b6100df60035481565b6040519081526020016100a8565b6100df6103d8565b6101186101033660046104c8565b60026020526000908152604090205460ff1681565b60405190151581526020016100a8565b6100b96101363660046104c8565b61044f565b60005461009b906001600160a01b031681565b3360009081526002602052604090205460ff16156101f95760405162461bcd60e51b815260206004820152605760248201527f596f752068617665207573656420746869732066617563657420616c7265616460448201527f792e20496620796f75206e656564206d6f726520746f6b656e732c20706c656160648201527639b2903ab9b29030b737ba3432b91030b2323932b9b99760491b608482015260a4015b60405180910390fd5b60005460035460405163a9059cbb60e01b815233600482015260248101919091526001600160a01b039091169063a9059cbb906044016020604051808303816000875af115801561024e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027291906104f8565b50336000908152600260205260409020805460ff19166001179055565b6001546001600160a01b031633146102b95760405162461bcd60e51b81526004016101f09061051a565b6000546001546040516370a0823160e01b81526001600160a01b039283169263a9059cbb92169083906370a08231906102f690309060040161049b565b602060405180830381865afa158015610313573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610337919061055c565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a691906104f8565b50565b6001546001600160a01b031633146103d35760405162461bcd60e51b81526004016101f09061051a565b600355565b600080546040516370a0823160e01b81526001600160a01b03909116906370a082319061040990309060040161049b565b602060405180830381865afa158015610426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a919061055c565b905090565b6001546001600160a01b031633146104795760405162461bcd60e51b81526004016101f09061051a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0391909116815260200190565b6000602082840312156104c157600080fd5b5035919050565b6000602082840312156104da57600080fd5b81356001600160a01b03811681146104f157600080fd5b9392505050565b60006020828403121561050a57600080fd5b815180151581146104f157600080fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60006020828403121561056e57600080fd5b505191905056fea26469706673582212204f7fd812260eacd88f23b436eb40b4943480e914005f0a0f2738f0d3c9696a5964736f6c63430008120033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 24559, + "contract": "src/token/Faucet.sol:Faucet", + "label": "token", + "offset": 0, + "slot": "0", + "type": "t_contract(IERC20)1042" + }, + { + "astId": 24561, + "contract": "src/token/Faucet.sol:Faucet", + "label": "governor", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 24565, + "contract": "src/token/Faucet.sol:Faucet", + "label": "withdrewAlready", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 24568, + "contract": "src/token/Faucet.sol:Faucet", + "label": "amount", + "offset": 0, + "slot": "3", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)1042": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/sepoliaDevnet/.chainId b/contracts/deployments/sepoliaDevnet/.chainId new file mode 100644 index 000000000..bd8d1cd44 --- /dev/null +++ b/contracts/deployments/sepoliaDevnet/.chainId @@ -0,0 +1 @@ +11155111 \ No newline at end of file diff --git a/contracts/deployments/sepoliaDevnet/PinakionV2.json b/contracts/deployments/sepoliaDevnet/PinakionV2.json new file mode 100644 index 000000000..ce9e361f7 --- /dev/null +++ b/contracts/deployments/sepoliaDevnet/PinakionV2.json @@ -0,0 +1,605 @@ +{ + "address": "0x593e89704D285B0c3fbF157c7CF2537456CE64b5", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "recoverTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xc14f8d7b4ea34d9ecef6b9ca621b2fe60a6a23f5d25d1646b2f7470e212c9f9b", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x593e89704D285B0c3fbF157c7CF2537456CE64b5", + "transactionIndex": 74, + "gasUsed": "1020268", + "logsBloom": "0x00000020000000000000000000000000000000000040000006800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000010000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000002000000000000000000000000000000000000000000000080000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x521251c8f56abab468b5c730c8dee5113536bc6ab051ce4201960f84b2cb130b", + "transactionHash": "0xc14f8d7b4ea34d9ecef6b9ca621b2fe60a6a23f5d25d1646b2f7470e212c9f9b", + "logs": [ + { + "transactionIndex": 74, + "blockNumber": 4880097, + "transactionHash": "0xc14f8d7b4ea34d9ecef6b9ca621b2fe60a6a23f5d25d1646b2f7470e212c9f9b", + "address": "0x593e89704D285B0c3fbF157c7CF2537456CE64b5", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "data": "0x", + "logIndex": 95, + "blockHash": "0x521251c8f56abab468b5c730c8dee5113536bc6ab051ce4201960f84b2cb130b" + }, + { + "transactionIndex": 74, + "blockNumber": 4880097, + "transactionHash": "0xc14f8d7b4ea34d9ecef6b9ca621b2fe60a6a23f5d25d1646b2f7470e212c9f9b", + "address": "0x593e89704D285B0c3fbF157c7CF2537456CE64b5", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "data": "0x0000000000000000000000000000000000000000033b2e3c9fd0803ce8000000", + "logIndex": 96, + "blockHash": "0x521251c8f56abab468b5c730c8dee5113536bc6ab051ce4201960f84b2cb130b" + } + ], + "blockNumber": 4880097, + "cumulativeGasUsed": "10131785", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "efecbc06b185b229926f80f198f0ff7d", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burnFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"}],\"name\":\"recoverTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"custom:security-contact\":\"contact@kleros.io\",\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"burn(uint256)\":{\"details\":\"Destroys `amount` tokens from the caller. See {ERC20-_burn}.\"},\"burnFrom(address,uint256)\":{\"details\":\"Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {ERC20-_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for ``accounts``'s tokens of at least `amount`.\"},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"recoverTokens(address)\":{\"params\":{\"_token\":\"The address of the token contract that you want to recover, or set to 0 in case you want to extract ether.\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"recoverTokens(address)\":{\"notice\":\"Recover tokens sent mistakenly to this contract.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/token/PinakionV2.sol\":\"PinakionV2\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xba43b97fba0d32eb4254f6a5a297b39a19a247082a02d6e69349e071e2946218\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * The default value of {decimals} is 18. To change this, you should override\\n * this function so it returns a different value.\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20 is Context, IERC20, IERC20Metadata {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the default value returned by this function, unless\\n * it's overridden.\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(address from, address to, uint256 amount) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(address owner, address spender, uint256 amount) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\\n}\\n\",\"keccak256\":\"0xa56ca923f70c1748830700250b19c61b70db9a683516dc5e216694a50445d99c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC20.sol\\\";\\nimport \\\"../../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Extension of {ERC20} that allows token holders to destroy both their own\\n * tokens and those that they have an allowance for, in a way that can be\\n * recognized off-chain (via event analysis).\\n */\\nabstract contract ERC20Burnable is Context, ERC20 {\\n /**\\n * @dev Destroys `amount` tokens from the caller.\\n *\\n * See {ERC20-_burn}.\\n */\\n function burn(uint256 amount) public virtual {\\n _burn(_msgSender(), amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, deducting from the caller's\\n * allowance.\\n *\\n * See {ERC20-_burn} and {ERC20-allowance}.\\n *\\n * Requirements:\\n *\\n * - the caller must have allowance for ``accounts``'s tokens of at least\\n * `amount`.\\n */\\n function burnFrom(address account, uint256 amount) public virtual {\\n _spendAllowance(account, _msgSender(), amount);\\n _burn(account, amount);\\n }\\n}\\n\",\"keccak256\":\"0x0d19410453cda55960a818e02bd7c18952a5c8fe7a3036e81f0d599f34487a7b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0xa92e4fa126feb6907daa0513ddd816b2eb91f30a808de54f63c17d0e162c3439\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"},\"src/token/PinakionV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"../libraries/SafeERC20.sol\\\";\\n\\n/// @custom:security-contact contact@kleros.io\\ncontract PinakionV2 is ERC20, ERC20Burnable, Ownable {\\n using SafeERC20 for IERC20;\\n\\n constructor() ERC20(\\\"PinakionV2\\\", \\\"PNK\\\") {\\n _mint(msg.sender, 1000000000 * 10 ** decimals());\\n }\\n\\n function mint(address to, uint256 amount) public onlyOwner {\\n _mint(to, amount);\\n }\\n\\n /// @notice Recover tokens sent mistakenly to this contract.\\n /// @param _token The address of the token contract that you want to recover, or set to 0 in case you want to extract ether.\\n function recoverTokens(address _token) public onlyOwner {\\n if (_token == address(0)) {\\n require(payable(owner()).send(address(this).balance), \\\"Transfer failed\\\");\\n return;\\n }\\n\\n IERC20 token = IERC20(_token);\\n uint balance = token.balanceOf(address(this));\\n require(token.safeTransfer(payable(owner()), balance), \\\"Token transfer failed\\\");\\n }\\n}\\n\",\"keccak256\":\"0x842a8e750d437381116c5619e89930c41053570a5361286a63f109ec92bc44f0\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b506040518060400160405280600a8152602001692834b730b5b4b7b72b1960b11b81525060405180604001604052806003815260200162504e4b60e81b815250816003908162000062919062000282565b50600462000071828262000282565b5050506200008e62000088620000bd60201b60201c565b620000c1565b620000b733620000a16012600a62000463565b620000b190633b9aca006200047b565b62000113565b620004ab565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166200016e5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b806002600082825462000182919062000495565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200020957607f821691505b6020821081036200022a57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001d957600081815260208120601f850160051c81016020861015620002595750805b601f850160051c820191505b818110156200027a5782815560010162000265565b505050505050565b81516001600160401b038111156200029e576200029e620001de565b620002b681620002af8454620001f4565b8462000230565b602080601f831160018114620002ee5760008415620002d55750858301515b600019600386901b1c1916600185901b1785556200027a565b600085815260208120601f198616915b828110156200031f57888601518255948401946001909101908401620002fe565b50858210156200033e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b600181815b80851115620003a55781600019048211156200038957620003896200034e565b808516156200039757918102915b93841c939080029062000369565b509250929050565b600082620003be575060016200045d565b81620003cd575060006200045d565b8160018114620003e65760028114620003f15762000411565b60019150506200045d565b60ff8411156200040557620004056200034e565b50506001821b6200045d565b5060208310610133831016604e8410600b841016171562000436575081810a6200045d565b62000442838362000364565b80600019048211156200045957620004596200034e565b0290505b92915050565b60006200047460ff841683620003ad565b9392505050565b80820281158282048414176200045d576200045d6200034e565b808201808211156200045d576200045d6200034e565b610f1280620004bb6000396000f3fe608060405234801561001057600080fd5b50600436106100f65760003560e01c806370a082311161009257806370a08231146101be578063715018a6146101e757806379cc6790146101ef5780638da5cb5b1461020257806395d89b411461021d578063a457c2d714610225578063a9059cbb14610238578063dd62ed3e1461024b578063f2fde38b1461025e57600080fd5b806306fdde03146100fb578063095ea7b31461011957806316114acd1461013c57806318160ddd1461015157806323b872dd14610163578063313ce56714610176578063395093511461018557806340c10f191461019857806342966c68146101ab575b600080fd5b610103610271565b6040516101109190610ce7565b60405180910390f35b61012c610127366004610d36565b610303565b6040519015158152602001610110565b61014f61014a366004610d60565b61031d565b005b6002545b604051908152602001610110565b61012c610171366004610d82565b61047f565b60405160128152602001610110565b61012c610193366004610d36565b6104a3565b61014f6101a6366004610d36565b6104c5565b61014f6101b9366004610dbe565b6104db565b6101556101cc366004610d60565b6001600160a01b031660009081526020819052604090205490565b61014f6104e5565b61014f6101fd366004610d36565b6104f9565b6005546040516001600160a01b039091168152602001610110565b61010361050e565b61012c610233366004610d36565b61051d565b61012c610246366004610d36565b610598565b610155610259366004610dd7565b6105a6565b61014f61026c366004610d60565b6105d1565b60606003805461028090610e0a565b80601f01602080910402602001604051908101604052809291908181526020018280546102ac90610e0a565b80156102f95780601f106102ce576101008083540402835291602001916102f9565b820191906000526020600020905b8154815290600101906020018083116102dc57829003601f168201915b5050505050905090565b600033610311818585610647565b60019150505b92915050565b61032561076b565b6001600160a01b0381166103a1576005546040516001600160a01b03909116904780156108fc02916000818181858888f1935050505061039e5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064015b60405180910390fd5b50565b6040516370a0823160e01b815230600482015281906000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156103ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040e9190610e44565b90506104366104256005546001600160a01b031690565b6001600160a01b03841690836107c5565b61047a5760405162461bcd60e51b8152602060048201526015602482015274151bdad95b881d1c985b9cd9995c8819985a5b1959605a1b6044820152606401610395565b505050565b60003361048d858285610898565b610498858585610912565b506001949350505050565b6000336103118185856104b683836105a6565b6104c09190610e5d565b610647565b6104cd61076b565b6104d78282610aa4565b5050565b61039e3382610b51565b6104ed61076b565b6104f76000610c71565b565b610504823383610898565b6104d78282610b51565b60606004805461028090610e0a565b6000338161052b82866105a6565b90508381101561058b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610395565b6104988286868403610647565b600033610311818585610912565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6105d961076b565b6001600160a01b03811661063e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610395565b61039e81610c71565b6001600160a01b0383166106a95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610395565b6001600160a01b03821661070a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610395565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6005546001600160a01b031633146104f75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610395565b6040516001600160a01b03838116602483015260448201839052600091829182919087169060640160408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b179052516108229190610e7e565b6000604051808303816000865af19150503d806000811461085f576040519150601f19603f3d011682016040523d82523d6000602084013e610864565b606091505b509150915081801561088e57508051158061088e57508080602001905181019061088e9190610e9a565b9695505050505050565b60006108a484846105a6565b9050600019811461090c57818110156108ff5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610395565b61090c8484848403610647565b50505050565b6001600160a01b0383166109765760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610395565b6001600160a01b0382166109d85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610395565b6001600160a01b03831660009081526020819052604090205481811015610a505760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610395565b6001600160a01b0384811660008181526020818152604080832087870390559387168083529184902080548701905592518581529092600080516020610ebd833981519152910160405180910390a361090c565b6001600160a01b038216610afa5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610395565b8060026000828254610b0c9190610e5d565b90915550506001600160a01b03821660008181526020818152604080832080548601905551848152600080516020610ebd833981519152910160405180910390a35050565b6001600160a01b038216610bb15760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610395565b6001600160a01b03821660009081526020819052604090205481811015610c255760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610395565b6001600160a01b038316600081815260208181526040808320868603905560028054879003905551858152919291600080516020610ebd833981519152910160405180910390a3505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005b83811015610cde578181015183820152602001610cc6565b50506000910152565b6020815260008251806020840152610d06816040850160208701610cc3565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114610d3157600080fd5b919050565b60008060408385031215610d4957600080fd5b610d5283610d1a565b946020939093013593505050565b600060208284031215610d7257600080fd5b610d7b82610d1a565b9392505050565b600080600060608486031215610d9757600080fd5b610da084610d1a565b9250610dae60208501610d1a565b9150604084013590509250925092565b600060208284031215610dd057600080fd5b5035919050565b60008060408385031215610dea57600080fd5b610df383610d1a565b9150610e0160208401610d1a565b90509250929050565b600181811c90821680610e1e57607f821691505b602082108103610e3e57634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215610e5657600080fd5b5051919050565b8082018082111561031757634e487b7160e01b600052601160045260246000fd5b60008251610e90818460208701610cc3565b9190910192915050565b600060208284031215610eac57600080fd5b81518015158114610d7b57600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220b9413b3e295ea54466427cb3885d953a088c004783f196ffc402f8c96242d9e764736f6c63430008120033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f65760003560e01c806370a082311161009257806370a08231146101be578063715018a6146101e757806379cc6790146101ef5780638da5cb5b1461020257806395d89b411461021d578063a457c2d714610225578063a9059cbb14610238578063dd62ed3e1461024b578063f2fde38b1461025e57600080fd5b806306fdde03146100fb578063095ea7b31461011957806316114acd1461013c57806318160ddd1461015157806323b872dd14610163578063313ce56714610176578063395093511461018557806340c10f191461019857806342966c68146101ab575b600080fd5b610103610271565b6040516101109190610ce7565b60405180910390f35b61012c610127366004610d36565b610303565b6040519015158152602001610110565b61014f61014a366004610d60565b61031d565b005b6002545b604051908152602001610110565b61012c610171366004610d82565b61047f565b60405160128152602001610110565b61012c610193366004610d36565b6104a3565b61014f6101a6366004610d36565b6104c5565b61014f6101b9366004610dbe565b6104db565b6101556101cc366004610d60565b6001600160a01b031660009081526020819052604090205490565b61014f6104e5565b61014f6101fd366004610d36565b6104f9565b6005546040516001600160a01b039091168152602001610110565b61010361050e565b61012c610233366004610d36565b61051d565b61012c610246366004610d36565b610598565b610155610259366004610dd7565b6105a6565b61014f61026c366004610d60565b6105d1565b60606003805461028090610e0a565b80601f01602080910402602001604051908101604052809291908181526020018280546102ac90610e0a565b80156102f95780601f106102ce576101008083540402835291602001916102f9565b820191906000526020600020905b8154815290600101906020018083116102dc57829003601f168201915b5050505050905090565b600033610311818585610647565b60019150505b92915050565b61032561076b565b6001600160a01b0381166103a1576005546040516001600160a01b03909116904780156108fc02916000818181858888f1935050505061039e5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064015b60405180910390fd5b50565b6040516370a0823160e01b815230600482015281906000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156103ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040e9190610e44565b90506104366104256005546001600160a01b031690565b6001600160a01b03841690836107c5565b61047a5760405162461bcd60e51b8152602060048201526015602482015274151bdad95b881d1c985b9cd9995c8819985a5b1959605a1b6044820152606401610395565b505050565b60003361048d858285610898565b610498858585610912565b506001949350505050565b6000336103118185856104b683836105a6565b6104c09190610e5d565b610647565b6104cd61076b565b6104d78282610aa4565b5050565b61039e3382610b51565b6104ed61076b565b6104f76000610c71565b565b610504823383610898565b6104d78282610b51565b60606004805461028090610e0a565b6000338161052b82866105a6565b90508381101561058b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610395565b6104988286868403610647565b600033610311818585610912565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6105d961076b565b6001600160a01b03811661063e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610395565b61039e81610c71565b6001600160a01b0383166106a95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610395565b6001600160a01b03821661070a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610395565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6005546001600160a01b031633146104f75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610395565b6040516001600160a01b03838116602483015260448201839052600091829182919087169060640160408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b179052516108229190610e7e565b6000604051808303816000865af19150503d806000811461085f576040519150601f19603f3d011682016040523d82523d6000602084013e610864565b606091505b509150915081801561088e57508051158061088e57508080602001905181019061088e9190610e9a565b9695505050505050565b60006108a484846105a6565b9050600019811461090c57818110156108ff5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610395565b61090c8484848403610647565b50505050565b6001600160a01b0383166109765760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610395565b6001600160a01b0382166109d85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610395565b6001600160a01b03831660009081526020819052604090205481811015610a505760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610395565b6001600160a01b0384811660008181526020818152604080832087870390559387168083529184902080548701905592518581529092600080516020610ebd833981519152910160405180910390a361090c565b6001600160a01b038216610afa5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610395565b8060026000828254610b0c9190610e5d565b90915550506001600160a01b03821660008181526020818152604080832080548601905551848152600080516020610ebd833981519152910160405180910390a35050565b6001600160a01b038216610bb15760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610395565b6001600160a01b03821660009081526020819052604090205481811015610c255760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610395565b6001600160a01b038316600081815260208181526040808320868603905560028054879003905551858152919291600080516020610ebd833981519152910160405180910390a3505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005b83811015610cde578181015183820152602001610cc6565b50506000910152565b6020815260008251806020840152610d06816040850160208701610cc3565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114610d3157600080fd5b919050565b60008060408385031215610d4957600080fd5b610d5283610d1a565b946020939093013593505050565b600060208284031215610d7257600080fd5b610d7b82610d1a565b9392505050565b600080600060608486031215610d9757600080fd5b610da084610d1a565b9250610dae60208501610d1a565b9150604084013590509250925092565b600060208284031215610dd057600080fd5b5035919050565b60008060408385031215610dea57600080fd5b610df383610d1a565b9150610e0160208401610d1a565b90509250929050565b600181811c90821680610e1e57607f821691505b602082108103610e3e57634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215610e5657600080fd5b5051919050565b8082018082111561031757634e487b7160e01b600052601160045260246000fd5b60008251610e90818460208701610cc3565b9190910192915050565b600060208284031215610eac57600080fd5b81518015158114610d7b57600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220b9413b3e295ea54466427cb3885d953a088c004783f196ffc402f8c96242d9e764736f6c63430008120033", + "devdoc": { + "custom:security-contact": "contact@kleros.io", + "events": { + "Approval(address,address,uint256)": { + "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." + }, + "Transfer(address,address,uint256)": { + "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." + } + }, + "kind": "dev", + "methods": { + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "burn(uint256)": { + "details": "Destroys `amount` tokens from the caller. See {ERC20-_burn}." + }, + "burnFrom(address,uint256)": { + "details": "Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {ERC20-_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for ``accounts``'s tokens of at least `amount`." + }, + "decimals()": { + "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." + }, + "decreaseAllowance(address,uint256)": { + "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." + }, + "increaseAllowance(address,uint256)": { + "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." + }, + "name()": { + "details": "Returns the name of the token." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "recoverTokens(address)": { + "params": { + "_token": "The address of the token contract that you want to recover, or set to 0 in case you want to extract ether." + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "recoverTokens(address)": { + "notice": "Recover tokens sent mistakenly to this contract." + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 393, + "contract": "src/token/PinakionV2.sol:PinakionV2", + "label": "_balances", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 399, + "contract": "src/token/PinakionV2.sol:PinakionV2", + "label": "_allowances", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 401, + "contract": "src/token/PinakionV2.sol:PinakionV2", + "label": "_totalSupply", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 403, + "contract": "src/token/PinakionV2.sol:PinakionV2", + "label": "_name", + "offset": 0, + "slot": "3", + "type": "t_string_storage" + }, + { + "astId": 405, + "contract": "src/token/PinakionV2.sol:PinakionV2", + "label": "_symbol", + "offset": 0, + "slot": "4", + "type": "t_string_storage" + }, + { + "astId": 103, + "contract": "src/token/PinakionV2.sol:PinakionV2", + "label": "_owner", + "offset": 0, + "slot": "5", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/foundry.toml b/contracts/foundry.toml index 9274b49d6..b0153a252 100644 --- a/contracts/foundry.toml +++ b/contracts/foundry.toml @@ -5,8 +5,10 @@ out = 'out' libs = ['../node_modules', 'lib'] [rpc_endpoints] +arbitrumSepolia = "https://sepolia-rollup.arbitrum.io/rpc" arbitrumGoerli = "https://goerli-rollup.arbitrum.io/rpc" arbitrum = "https://arb1.arbitrum.io/rpc" +sepolia = "https://sepolia.infura.io/v3/${INFURA_API_KEY}" goerli = "https://goerli.infura.io/v3/${INFURA_API_KEY}" mainnet = "https://mainnet.infura.io/v3/${INFURA_API_KEY}" chiado = "https://rpc.chiadochain.net" diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index d43a73c7d..9a47be685 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -112,6 +112,7 @@ const config: HardhatUserConfig = { }, verify: { etherscan: { + apiUrl: "https://api-sepolia.arbiscan.io", apiKey: process.env.ARBISCAN_API_KEY, }, }, @@ -137,6 +138,7 @@ const config: HardhatUserConfig = { }, verify: { etherscan: { + apiUrl: "https://api-sepolia.arbiscan.io", apiKey: process.env.ARBISCAN_API_KEY, }, }, diff --git a/contracts/scripts/generateDeploymentsMarkdown.sh b/contracts/scripts/generateDeploymentsMarkdown.sh index 7946375d9..1b6220e37 100755 --- a/contracts/scripts/generateDeploymentsMarkdown.sh +++ b/contracts/scripts/generateDeploymentsMarkdown.sh @@ -2,10 +2,19 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +IGNORED_ARTIFACTS=( + "CREATE3Factory.json" + "MetaEvidence_*" + "PNK.json" + "RandomizerOracle.json" + "_Implementation.json" + "_Proxy.json" +) + function generate() { #deploymentDir #explorerUrl deploymentDir=$1 explorerUrl=$2 - for f in $(ls -1 $deploymentDir/*.json 2>/dev/null | grep -v "PNK.json\|MetaEvidence_*\|CREATE3Factory.json\|_Proxy.json\|_Implementation.json" | sort); do + for f in $(ls -1 $deploymentDir/*.json 2>/dev/null | grep -v ${IGNORED_ARTIFACTS[@]/#/-e } | sort); do contractName=$(basename $f .json) address=$(cat $f | jq -r .address) implementation=$(cat $f | jq -r .implementation) @@ -19,29 +28,28 @@ function generate() { #deploymentDir #explorerUrl } echo "### Official Testnet" -echo "#### Chiado" +echo "#### Arbitrum Sepolia" echo -generate "$SCRIPT_DIR/../deployments/chiado" "https://gnosis-chiado.blockscout.com/address/" +generate "$SCRIPT_DIR/../deployments/arbitrumSepolia" "https://sepolia.arbiscan.io/address/" echo echo "#### Sepolia" echo -generate "$SCRIPT_DIR/../deployments/goerli" "https://goerli.etherscan.io/address/" +generate "$SCRIPT_DIR/../deployments/sepolia" "https://sepolia.etherscan.io/address/" echo -echo "#### Arbitrum Sepolia" +echo "#### Chiado" echo -echo "- [PNK](https://goerli.arbiscan.io/token/0x3483FA1b87792cd5BE4100822C4eCEC8D3E531ee)" -generate "$SCRIPT_DIR/../deployments/arbitrumSepolia" "https://goerli.arbiscan.io/address/" +generate "$SCRIPT_DIR/../deployments/chiado" "https://gnosis-chiado.blockscout.com/address/" echo + echo "### Devnet" -echo "#### Chiado" +echo "#### Arbitrum Sepolia" echo -generate "$SCRIPT_DIR/../deployments/chiadoDevnet" "https://gnosis-chiado.blockscout.com/address/" +generate "$SCRIPT_DIR/../deployments/arbitrumSepoliaDevnet" "https://sepolia.arbiscan.io/address/" echo echo "#### Sepolia" echo -generate "$SCRIPT_DIR/../deployments/goerliDevnet" "https://goerli.etherscan.io/address/" +generate "$SCRIPT_DIR/../deployments/sepoliaDevnet" "https://sepolia.etherscan.io/address/" echo -echo "#### Arbitrum Sepolia" +echo "#### Chiado" echo -echo "- [PNK](https://goerli.arbiscan.io/token/0x3483FA1b87792cd5BE4100822C4eCEC8D3E531ee)" -generate "$SCRIPT_DIR/../deployments/arbitrumSepoliaDevnet" "https://goerli.arbiscan.io/address/" \ No newline at end of file +generate "$SCRIPT_DIR/../deployments/chiadoDevnet" "https://gnosis-chiado.blockscout.com/address/" diff --git a/contracts/test/arbitration/staking.ts b/contracts/test/arbitration/staking.ts index b4c5eb756..71e8b0346 100644 --- a/contracts/test/arbitration/staking.ts +++ b/contracts/test/arbitration/staking.ts @@ -10,7 +10,6 @@ import { RandomizerMock, } from "../../typechain-types"; import { expect } from "chai"; -import exp from "constants"; import { it } from "mocha"; /* eslint-disable no-unused-vars */ diff --git a/cspell.json b/cspell.json index 759c8834e..e0347b486 100644 --- a/cspell.json +++ b/cspell.json @@ -21,6 +21,7 @@ "Devnet", "DISPUTOR", "dockerhost", + "ethersproject", "Ethfinex", "gluegun", "graphprotocol", From b728ee7578486d9dc83796d01b8da278eb56d0b6 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Wed, 20 Dec 2023 13:54:17 +0000 Subject: [PATCH 47/77] chore: deployment of the devnet arbitrable and PNKFaucet, subgraph and web fixes --- contracts/README.md | 5 + .../ArbitrableExample.json | 618 ++++++++++ .../DisputeResolver.json | 522 ++++++++ .../DisputeTemplateRegistry.json | 311 +++++ ...isputeTemplateRegistry_Implementation.json | 392 ++++++ .../DisputeTemplateRegistry_Proxy.json | 93 ++ .../arbitrumSepoliaDevnet/Escrow.json | 1081 +++++++++++++++++ .../arbitrumSepoliaDevnet/PNKFaucet.json | 226 ++++ contracts/package.json | 2 +- contracts/test/arbitration/staking.ts | 2 +- .../DisputeTemplateRegistry/subgraph.yaml | 10 +- subgraph/package.json | 35 +- subgraph/src/KlerosCore.ts | 30 +- subgraph/src/entities/JurorTokensPerCourt.ts | 32 +- subgraph/subgraph.yaml | 25 +- web/.env.devnet.public | 4 +- web/package.json | 8 +- .../Popup/Description/StakeWithdraw.tsx | 4 +- .../CourtDetails/StakePanel/InputDisplay.tsx | 4 +- .../StakePanel/JurorStakeDisplay.tsx | 6 +- .../StakePanel/StakeWithdrawButton.tsx | 6 +- yarn.lock | 186 ++- 22 files changed, 3473 insertions(+), 129 deletions(-) create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/ArbitrableExample.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/DisputeResolver.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Implementation.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Proxy.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/Escrow.json create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/PNKFaucet.json diff --git a/contracts/README.md b/contracts/README.md index fceded066..c4da58cc7 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -34,11 +34,16 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments #### Arbitrum Sepolia +- [ArbitrableExample](https://sepolia.arbiscan.io/address/0x96a29c421007Ab6d523B1743FA3f177a15063D07) - [DAI](https://sepolia.arbiscan.io/address/0x593e89704D285B0c3fbF157c7CF2537456CE64b5) - [DAIFaucet](https://sepolia.arbiscan.io/address/0xB5b39A1bcD2D7097A8824B3cC18Ebd2dFb0D9B5E) - [DisputeKitClassic: proxy](https://sepolia.arbiscan.io/address/0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3), [implementation](https://sepolia.arbiscan.io/address/0xC3dB344755b15c8Edfd834db79af4f8860029FB4) +- [DisputeResolver](https://sepolia.arbiscan.io/address/0x3E22eBE8c86a58b0BfEd5383aa9DEFB87De85034) +- [DisputeTemplateRegistry: proxy](https://sepolia.arbiscan.io/address/0xc60e862273c1eAa1F9afBC69b39cee30270A2419), [implementation](https://sepolia.arbiscan.io/address/0xeA44D4710bc804573E7d8653b88A60CaC51E3738) +- [Escrow](https://sepolia.arbiscan.io/address/0x224E52523354BEdCaFF3e98de463E829f3388f84) - [EvidenceModule: proxy](https://sepolia.arbiscan.io/address/0x827411b3e98bAe8c441efBf26842A1670f8f378F), [implementation](https://sepolia.arbiscan.io/address/0x26c1980120F1C82cF611D666CE81D2b54d018547) - [KlerosCore: proxy](https://sepolia.arbiscan.io/address/0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284), [implementation](https://sepolia.arbiscan.io/address/0x614498118850184c62f82d08261109334bFB050f) +- [PNKFaucet](https://sepolia.arbiscan.io/address/0x7EFE468003Ad6A858b5350CDE0A67bBED58739dD) - [PinakionV2](https://sepolia.arbiscan.io/address/0x34B944D42cAcfC8266955D07A80181D2054aa225) - [PolicyRegistry: proxy](https://sepolia.arbiscan.io/address/0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da), [implementation](https://sepolia.arbiscan.io/address/0xAA637C9E2831614158d7eB193D03af4a7223C56E) - [RandomizerRNG: proxy](https://sepolia.arbiscan.io/address/0xA995C172d286f8F4eE137CC662e2844E59Cf4836), [implementation](https://sepolia.arbiscan.io/address/0xe62B776498F48061ef9425fCEf30F3d1370DB005) diff --git a/contracts/deployments/arbitrumSepoliaDevnet/ArbitrableExample.json b/contracts/deployments/arbitrumSepoliaDevnet/ArbitrableExample.json new file mode 100644 index 000000000..e1f77e5fc --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/ArbitrableExample.json @@ -0,0 +1,618 @@ +{ + "address": "0x96a29c421007Ab6d523B1743FA3f177a15063D07", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + }, + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "_templateRegistry", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_weth", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "string", + "name": "_action", + "type": "string" + } + ], + "name": "Action", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_arbitrableDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_templateId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateUri", + "type": "string" + } + ], + "name": "DisputeRequest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "arbitratorExtraData", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + } + ], + "name": "changeArbitrator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + } + ], + "name": "changeArbitratorExtraData", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + } + ], + "name": "changeDisputeTemplate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "_templateRegistry", + "type": "address" + } + ], + "name": "changeTemplateRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_action", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_feeInWeth", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_action", + "type": "string" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "bool", + "name": "isRuled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numberOfRulingOptions", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "externalIDtoLocalID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "rule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "templateId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "templateRegistry", + "outputs": [ + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "weth", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x2884335c81bd0f19fcfce0e88a5ac247e10967ea5b9e3f476321ea18df53efa3", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x96a29c421007Ab6d523B1743FA3f177a15063D07", + "transactionIndex": 1, + "gasUsed": "1332621", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800080000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000020000000002020000400000000000100000000000000000000000000000000000000", + "blockHash": "0xc563bdfaa4019bb91fb68e90e5bb3b7b740cf8ec6c1c02c21e128de667af36b3", + "transactionHash": "0x2884335c81bd0f19fcfce0e88a5ac247e10967ea5b9e3f476321ea18df53efa3", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3087468, + "transactionHash": "0x2884335c81bd0f19fcfce0e88a5ac247e10967ea5b9e3f476321ea18df53efa3", + "address": "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + "topics": [ + "0x00f7cd7255d1073b4e136dd477c38ea0020c051ab17110cc5bfab0c840ff9924", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c6469737075746554656d706c6174654d617070696e673a20544f444f00000000", + "logIndex": 0, + "blockHash": "0xc563bdfaa4019bb91fb68e90e5bb3b7b740cf8ec6c1c02c21e128de667af36b3" + } + ], + "blockNumber": 3087468, + "cumulativeGasUsed": "1332621", + "status": 1, + "byzantium": true + }, + "args": [ + "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + { + "$schema": "../NewDisputeTemplate.schema.json", + "title": "Let's do this", + "description": "We want to do this: %s", + "question": "Does it comply with the policy?", + "answers": [ + { + "title": "Yes", + "description": "Select this if you agree that it must be done." + }, + { + "title": "No", + "description": "Select this if you do not agree that it must be done." + } + ], + "policyURI": "/ipfs/Qmdvk...rSD6cE/policy.pdf", + "frontendUrl": "https://kleros-v2.netlify.app/#/cases/%s/overview", + "arbitratorChainID": "421614", + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", + "category": "Others", + "specification": "KIP001", + "lang": "en_US" + }, + "disputeTemplateMapping: TODO", + "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003", + "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + "0x3829A2486d53ee984a0ca2D76552715726b77138" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"_weth\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"string\",\"name\":\"_action\",\"type\":\"string\"}],\"name\":\"Action\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_arbitrableDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateUri\",\"type\":\"string\"}],\"name\":\"DisputeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"arbitratorExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"name\":\"changeArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"}],\"name\":\"changeArbitratorExtraData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"}],\"name\":\"changeDisputeTemplate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"}],\"name\":\"changeTemplateRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_action\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_feeInWeth\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_action\",\"type\":\"string\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isRuled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRulingOptions\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"externalIDtoLocalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templateId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templateRegistry\",\"outputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"weth\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"DisputeRequest(address,uint256,uint256,uint256,string)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrableDisputeID\":\"The identifier of the dispute in the Arbitrable contract.\",\"_arbitrator\":\"The arbitrator of the contract.\",\"_externalDisputeID\":\"An identifier created outside Kleros by the protocol requesting arbitration.\",\"_templateId\":\"The identifier of the dispute template. Should not be used with _templateUri.\",\"_templateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrator\":\"The arbitrator giving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_arbitrator\":\"The arbitrator to rule on created disputes.\",\"_arbitratorExtraData\":\"The extra data for the arbitrator.\",\"_templateData\":\"The dispute template data.\",\"_templateDataMappings\":\"The dispute template data mappings.\",\"_templateRegistry\":\"The dispute template registry.\",\"_weth\":\"The WETH token.\"}},\"createDispute(string)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_action\":\"The action that requires arbitration.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the dispute created.\"}},\"createDispute(string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_action\":\"The action that requires arbitration.\",\"_feeInWeth\":\"Amount of fees in WETH for the arbitrator.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the dispute created.\"}},\"rule(uint256,uint256)\":{\"details\":\"To be called by the arbitrator of the dispute, to declare the winning ruling.\",\"params\":{\"_externalDisputeID\":\"ID of the dispute in arbitrator contract.\",\"_ruling\":\"The ruling choice of the arbitration.\"}}},\"title\":\"ArbitrableExample An example of an arbitrable contract which connects to the arbitator that implements the updated interface.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/arbitrables/ArbitrableExample.sol\":\"ArbitrableExample\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/arbitrables/ArbitrableExample.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"../interfaces/IArbitrableV2.sol\\\";\\nimport \\\"../interfaces/IDisputeTemplateRegistry.sol\\\";\\nimport \\\"../../libraries/SafeERC20.sol\\\";\\n\\n/// @title ArbitrableExample\\n/// An example of an arbitrable contract which connects to the arbitator that implements the updated interface.\\ncontract ArbitrableExample is IArbitrableV2 {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n struct DisputeStruct {\\n bool isRuled; // Whether the dispute has been ruled or not.\\n uint256 ruling; // Ruling given by the arbitrator.\\n uint256 numberOfRulingOptions; // The number of choices the arbitrator can give.\\n }\\n\\n event Action(string indexed _action);\\n\\n address public immutable governor;\\n IArbitratorV2 public arbitrator; // Arbitrator is set in constructor.\\n IDisputeTemplateRegistry public templateRegistry; // The dispute template registry.\\n uint256 public templateId; // The current dispute template identifier.\\n bytes public arbitratorExtraData; // Extra data to set up the arbitration.\\n IERC20 public immutable weth; // The WETH token.\\n mapping(uint256 => uint256) public externalIDtoLocalID; // Maps external (arbitrator side) dispute IDs to local dispute IDs.\\n DisputeStruct[] public disputes; // Stores the disputes' info. disputes[disputeID].\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(address(this) == msg.sender, \\\"Only the governor allowed.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor\\n /// @param _arbitrator The arbitrator to rule on created disputes.\\n /// @param _templateData The dispute template data.\\n /// @param _templateDataMappings The dispute template data mappings.\\n /// @param _arbitratorExtraData The extra data for the arbitrator.\\n /// @param _templateRegistry The dispute template registry.\\n /// @param _weth The WETH token.\\n constructor(\\n IArbitratorV2 _arbitrator,\\n string memory _templateData,\\n string memory _templateDataMappings,\\n bytes memory _arbitratorExtraData,\\n IDisputeTemplateRegistry _templateRegistry,\\n IERC20 _weth\\n ) {\\n governor = msg.sender;\\n arbitrator = _arbitrator;\\n arbitratorExtraData = _arbitratorExtraData;\\n templateRegistry = _templateRegistry;\\n weth = _weth;\\n\\n templateId = templateRegistry.setDisputeTemplate(\\\"\\\", _templateData, _templateDataMappings);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n function changeArbitrator(IArbitratorV2 _arbitrator) external onlyByGovernor {\\n arbitrator = _arbitrator;\\n }\\n\\n function changeArbitratorExtraData(bytes calldata _arbitratorExtraData) external onlyByGovernor {\\n arbitratorExtraData = _arbitratorExtraData;\\n }\\n\\n function changeTemplateRegistry(IDisputeTemplateRegistry _templateRegistry) external onlyByGovernor {\\n templateRegistry = _templateRegistry;\\n }\\n\\n function changeDisputeTemplate(\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external onlyByGovernor {\\n templateId = templateRegistry.setDisputeTemplate(\\\"\\\", _templateData, _templateDataMappings);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _action The action that requires arbitration.\\n /// @return disputeID Dispute id (on arbitrator side) of the dispute created.\\n function createDispute(string calldata _action) external payable returns (uint256 disputeID) {\\n emit Action(_action);\\n\\n uint256 numberOfRulingOptions = 2;\\n uint256 localDisputeID = disputes.length;\\n disputes.push(DisputeStruct({isRuled: false, ruling: 0, numberOfRulingOptions: numberOfRulingOptions}));\\n\\n disputeID = arbitrator.createDispute{value: msg.value}(numberOfRulingOptions, arbitratorExtraData);\\n externalIDtoLocalID[disputeID] = localDisputeID;\\n\\n uint256 externalDisputeID = uint256(keccak256(abi.encodePacked(_action)));\\n emit DisputeRequest(arbitrator, disputeID, externalDisputeID, templateId, \\\"\\\");\\n }\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _action The action that requires arbitration.\\n /// @param _feeInWeth Amount of fees in WETH for the arbitrator.\\n /// @return disputeID Dispute id (on arbitrator side) of the dispute created.\\n function createDispute(string calldata _action, uint256 _feeInWeth) external returns (uint256 disputeID) {\\n emit Action(_action);\\n\\n uint256 numberOfRulingOptions = 2;\\n uint256 localDisputeID = disputes.length;\\n disputes.push(DisputeStruct({isRuled: false, ruling: 0, numberOfRulingOptions: numberOfRulingOptions}));\\n\\n require(weth.safeTransferFrom(msg.sender, address(this), _feeInWeth), \\\"Transfer failed\\\");\\n require(weth.increaseAllowance(address(arbitrator), _feeInWeth), \\\"Allowance increase failed\\\");\\n\\n disputeID = arbitrator.createDispute(numberOfRulingOptions, arbitratorExtraData, weth, _feeInWeth);\\n externalIDtoLocalID[disputeID] = localDisputeID;\\n\\n uint256 externalDisputeID = uint256(keccak256(abi.encodePacked(_action)));\\n emit DisputeRequest(arbitrator, disputeID, externalDisputeID, templateId, \\\"\\\");\\n }\\n\\n /// @dev To be called by the arbitrator of the dispute, to declare the winning ruling.\\n /// @param _externalDisputeID ID of the dispute in arbitrator contract.\\n /// @param _ruling The ruling choice of the arbitration.\\n function rule(uint256 _externalDisputeID, uint256 _ruling) external override {\\n uint256 localDisputeID = externalIDtoLocalID[_externalDisputeID];\\n DisputeStruct storage dispute = disputes[localDisputeID];\\n require(msg.sender == address(arbitrator), \\\"Only the arbitrator can execute this.\\\");\\n require(_ruling <= dispute.numberOfRulingOptions, \\\"Invalid ruling.\\\");\\n require(dispute.isRuled == false, \\\"This dispute has been ruled already.\\\");\\n\\n dispute.isRuled = true;\\n dispute.ruling = _ruling;\\n\\n emit Ruling(IArbitratorV2(msg.sender), _externalDisputeID, dispute.ruling);\\n }\\n}\\n\",\"keccak256\":\"0x19d38e04eed4156c108539f5ac7c98af87d1d457ef40b5d52bd1aa592c8b0df3\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeTemplateRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n/// @title IDisputeTemplate\\n/// @notice Dispute Template interface.\\ninterface IDisputeTemplateRegistry {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n /// @param _templateDataMappings The data mappings.\\n event DisputeTemplate(\\n uint256 indexed _templateId,\\n string indexed _templateTag,\\n string _templateData,\\n string _templateDataMappings\\n );\\n\\n function setDisputeTemplate(\\n string memory _templateTag,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external returns (uint256 templateId);\\n}\\n\",\"keccak256\":\"0x88b0038d226532e6cf862a485d162f7bca61ac3d361d6801146b55a240f091ac\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60c06040523480156200001157600080fd5b506040516200191a3803806200191a83398101604081905262000034916200020f565b33608052600080546001600160a01b0319166001600160a01b03881617905560036200006184826200037e565b50600180546001600160a01b0319166001600160a01b0384811691821790925590821660a0526040516312a6505d60e21b8152634a99417490620000ac908890889060040162000478565b6020604051808303816000875af1158015620000cc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000f29190620004b8565b60025550620004d2945050505050565b6001600160a01b03811681146200011857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200014e57818101518382015260200162000134565b50506000910152565b60006001600160401b03808411156200017457620001746200011b565b604051601f8501601f19908116603f011681019082821181831017156200019f576200019f6200011b565b81604052809350858152868686011115620001b957600080fd5b620001c986602083018762000131565b5050509392505050565b600082601f830112620001e557600080fd5b620001f68383516020850162000157565b9392505050565b80516200020a8162000102565b919050565b60008060008060008060c087890312156200022957600080fd5b8651620002368162000102565b60208801519096506001600160401b03808211156200025457600080fd5b620002628a838b01620001d3565b965060408901519150808211156200027957600080fd5b620002878a838b01620001d3565b955060608901519150808211156200029e57600080fd5b508701601f81018913620002b157600080fd5b620002c28982516020840162000157565b935050620002d360808801620001fd565b9150620002e360a08801620001fd565b90509295509295509295565b600181811c908216806200030457607f821691505b6020821081036200032557634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200037957600081815260208120601f850160051c81016020861015620003545750805b601f850160051c820191505b81811015620003755782815560010162000360565b5050505b505050565b81516001600160401b038111156200039a576200039a6200011b565b620003b281620003ab8454620002ef565b846200032b565b602080601f831160018114620003ea5760008415620003d15750858301515b600019600386901b1c1916600185901b17855562000375565b600085815260208120601f198616915b828110156200041b57888601518255948401946001909101908401620003fa565b50858210156200043a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600081518084526200046481602086016020860162000131565b601f01601f19169290920160200192915050565b60608152600060608201526080602082015260006200049b60808301856200044a565b8281036040840152620004af81856200044a565b95945050505050565b600060208284031215620004cb57600080fd5b5051919050565b60805160a05161140e6200050c60003960008181610194015281816106e40152818161076301526108010152600060df015261140e6000f3fe6080604052600436106100c85760003560e01c8063654692871161007a578063654692871461021357806368175996146102415780636cc6cde1146102545780637aa77f2914610274578063a0af81f01461028a578063c21ae061146102aa578063c5d55288146102d7578063fc548f08146102f757600080fd5b80630c340a24146100cd5780630c7ac7b61461011e578063311a6c561461014057806334e2672d146101625780633fc8cef3146101825780634660ebbe146101b6578063564a565d146101d6575b600080fd5b3480156100d957600080fd5b506101017f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561012a57600080fd5b50610133610317565b6040516101159190610e3d565b34801561014c57600080fd5b5061016061015b366004610e57565b6103a5565b005b34801561016e57600080fd5b5061016061017d366004610ec2565b61053e565b34801561018e57600080fd5b506101017f000000000000000000000000000000000000000000000000000000000000000081565b3480156101c257600080fd5b506101606101d1366004610f1c565b61056f565b3480156101e257600080fd5b506101f66101f1366004610f39565b6105b0565b604080519315158452602084019290925290820152606001610115565b34801561021f57600080fd5b5061023361022e366004610f52565b6105e7565b604051908152602001610115565b61023361024f366004610ec2565b61091b565b34801561026057600080fd5b50600054610101906001600160a01b031681565b34801561028057600080fd5b5061023360025481565b34801561029657600080fd5b50600154610101906001600160a01b031681565b3480156102b657600080fd5b506102336102c5366004610f39565b60046020526000908152604090205481565b3480156102e357600080fd5b506101606102f2366004611041565b610b31565b34801561030357600080fd5b50610160610312366004610f1c565b610bcc565b60038054610324906110a5565b80601f0160208091040260200160405190810160405280929190818152602001828054610350906110a5565b801561039d5780601f106103725761010080835404028352916020019161039d565b820191906000526020600020905b81548152906001019060200180831161038057829003601f168201915b505050505081565b60008281526004602052604081205460058054919291839081106103cb576103cb6110df565b600091825260208220915460039190910290910191506001600160a01b0316331461044b5760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600201548311156104915760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b6044820152606401610442565b805460ff16156104ef5760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b6064820152608401610442565b805460ff1916600190811782558101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b30331461055d5760405162461bcd60e51b8152600401610442906110f5565b600361056a82848361117a565b505050565b30331461058e5760405162461bcd60e51b8152600401610442906110f5565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600581815481106105c057600080fd5b600091825260209091206003909102018054600182015460029092015460ff909116925083565b600083836040516105f992919061123b565b604051908190038120907f8b2c14fe955d044ef95ba32b88d2ceb87c6f73fcefdcebe906063a6d75690f2790600090a2600580546040805160608101825260008082526020820181815260029383018481526001860187559590915290517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db060038502908101805460ff19169215159290921790915590517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db182015592517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db2909301929092556107147f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316333087610c0d565b6107525760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606401610442565b60005461078c906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911686610ce9565b6107d45760405162461bcd60e51b8152602060048201526019602482015278105b1b1bddd85b98d9481a5b98dc99585cd94819985a5b1959603a1b6044820152606401610442565b600054604051633d941b6d60e21b81526001600160a01b039091169063f6506db49061082b9085906003907f0000000000000000000000000000000000000000000000000000000000000000908a906004016112c8565b6020604051808303816000875af115801561084a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086e91906112fd565b600081815260046020908152604080832085905551929550909161089691899189910161123b565b60408051601f1981840301815290829052805160209091012060005460025491935086926001600160a01b03909116917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e271869161090991868252602082015260606040820181905260009082015260800190565b60405180910390a35050509392505050565b6000828260405161092d92919061123b565b604051908190038120907f8b2c14fe955d044ef95ba32b88d2ceb87c6f73fcefdcebe906063a6d75690f2790600090a26005805460408051606081018252600080825260208201818152600283850181815260018701885596835292517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db06003808802918201805460ff19169315159390931790925591517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db183015595517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db29091015554915163c13517e160e01b815290936001600160a01b039092169163c13517e1913491610a4291879190600401611316565b60206040518083038185885af1158015610a60573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a8591906112fd565b6000818152600460209081526040808320859055519295509091610aad91889188910161123b565b60408051601f1981840301815290829052805160209091012060005460025491935086926001600160a01b03909116917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e2718691610b2091868252602082015260606040820181905260009082015260800190565b60405180910390a350505092915050565b303314610b505760405162461bcd60e51b8152600401610442906110f5565b6001546040516312a6505d60e21b81526001600160a01b0390911690634a99417490610b829085908590600401611337565b6020604051808303816000875af1158015610ba1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc591906112fd565b6002555050565b303314610beb5760405162461bcd60e51b8152600401610442906110f5565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b17905251610c729190611373565b6000604051808303816000865af19150503d8060008114610caf576040519150601f19603f3d011682016040523d82523d6000602084013e610cb4565b606091505b5091509150818015610cde575080511580610cde575080806020019051810190610cde919061138f565b979650505050505050565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063095ea7b39085908590849063dd62ed3e90604401602060405180830381865afa158015610d45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6991906112fd565b610d7391906113b1565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de2919061138f565b506001949350505050565b60005b83811015610e08578181015183820152602001610df0565b50506000910152565b60008151808452610e29816020860160208601610ded565b601f01601f19169290920160200192915050565b602081526000610e506020830184610e11565b9392505050565b60008060408385031215610e6a57600080fd5b50508035926020909101359150565b60008083601f840112610e8b57600080fd5b50813567ffffffffffffffff811115610ea357600080fd5b602083019150836020828501011115610ebb57600080fd5b9250929050565b60008060208385031215610ed557600080fd5b823567ffffffffffffffff811115610eec57600080fd5b610ef885828601610e79565b90969095509350505050565b6001600160a01b0381168114610f1957600080fd5b50565b600060208284031215610f2e57600080fd5b8135610e5081610f04565b600060208284031215610f4b57600080fd5b5035919050565b600080600060408486031215610f6757600080fd5b833567ffffffffffffffff811115610f7e57600080fd5b610f8a86828701610e79565b909790965060209590950135949350505050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112610fc557600080fd5b813567ffffffffffffffff80821115610fe057610fe0610f9e565b604051601f8301601f19908116603f0116810190828211818310171561100857611008610f9e565b8160405283815286602085880101111561102157600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561105457600080fd5b823567ffffffffffffffff8082111561106c57600080fd5b61107886838701610fb4565b9350602085013591508082111561108e57600080fd5b5061109b85828601610fb4565b9150509250929050565b600181811c908216806110b957607f821691505b6020821081036110d957634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b6020808252601a908201527f4f6e6c792074686520676f7665726e6f7220616c6c6f7765642e000000000000604082015260600190565b601f82111561056a57600081815260208120601f850160051c810160208610156111535750805b601f850160051c820191505b818110156111725782815560010161115f565b505050505050565b67ffffffffffffffff83111561119257611192610f9e565b6111a6836111a083546110a5565b8361112c565b6000601f8411600181146111da57600085156111c25750838201355b600019600387901b1c1916600186901b178355611234565b600083815260209020601f19861690835b8281101561120b57868501358255602094850194600190920191016111eb565b50868210156112285760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b8183823760009101908152919050565b60008154611258816110a5565b808552602060018381168015611275576001811461128f576112bd565b60ff1985168884015283151560051b8801830195506112bd565b866000528260002060005b858110156112b55781548a820186015290830190840161129a565b890184019650505b505050505092915050565b8481526080602082015260006112e1608083018661124b565b6001600160a01b03949094166040830152506060015292915050565b60006020828403121561130f57600080fd5b5051919050565b82815260406020820152600061132f604083018461124b565b949350505050565b60608152600060608201526080602082015260006113586080830185610e11565b828103604084015261136a8185610e11565b95945050505050565b60008251611385818460208701610ded565b9190910192915050565b6000602082840312156113a157600080fd5b81518015158114610e5057600080fd5b808201808211156113d257634e487b7160e01b600052601160045260246000fd5b9291505056fea264697066735822122084881e01383e37e86fd1919d8c218c3fb5e00372697336cc5557215eecd6e56964736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106100c85760003560e01c8063654692871161007a578063654692871461021357806368175996146102415780636cc6cde1146102545780637aa77f2914610274578063a0af81f01461028a578063c21ae061146102aa578063c5d55288146102d7578063fc548f08146102f757600080fd5b80630c340a24146100cd5780630c7ac7b61461011e578063311a6c561461014057806334e2672d146101625780633fc8cef3146101825780634660ebbe146101b6578063564a565d146101d6575b600080fd5b3480156100d957600080fd5b506101017f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561012a57600080fd5b50610133610317565b6040516101159190610e3d565b34801561014c57600080fd5b5061016061015b366004610e57565b6103a5565b005b34801561016e57600080fd5b5061016061017d366004610ec2565b61053e565b34801561018e57600080fd5b506101017f000000000000000000000000000000000000000000000000000000000000000081565b3480156101c257600080fd5b506101606101d1366004610f1c565b61056f565b3480156101e257600080fd5b506101f66101f1366004610f39565b6105b0565b604080519315158452602084019290925290820152606001610115565b34801561021f57600080fd5b5061023361022e366004610f52565b6105e7565b604051908152602001610115565b61023361024f366004610ec2565b61091b565b34801561026057600080fd5b50600054610101906001600160a01b031681565b34801561028057600080fd5b5061023360025481565b34801561029657600080fd5b50600154610101906001600160a01b031681565b3480156102b657600080fd5b506102336102c5366004610f39565b60046020526000908152604090205481565b3480156102e357600080fd5b506101606102f2366004611041565b610b31565b34801561030357600080fd5b50610160610312366004610f1c565b610bcc565b60038054610324906110a5565b80601f0160208091040260200160405190810160405280929190818152602001828054610350906110a5565b801561039d5780601f106103725761010080835404028352916020019161039d565b820191906000526020600020905b81548152906001019060200180831161038057829003601f168201915b505050505081565b60008281526004602052604081205460058054919291839081106103cb576103cb6110df565b600091825260208220915460039190910290910191506001600160a01b0316331461044b5760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600201548311156104915760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b6044820152606401610442565b805460ff16156104ef5760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b6064820152608401610442565b805460ff1916600190811782558101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b30331461055d5760405162461bcd60e51b8152600401610442906110f5565b600361056a82848361117a565b505050565b30331461058e5760405162461bcd60e51b8152600401610442906110f5565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600581815481106105c057600080fd5b600091825260209091206003909102018054600182015460029092015460ff909116925083565b600083836040516105f992919061123b565b604051908190038120907f8b2c14fe955d044ef95ba32b88d2ceb87c6f73fcefdcebe906063a6d75690f2790600090a2600580546040805160608101825260008082526020820181815260029383018481526001860187559590915290517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db060038502908101805460ff19169215159290921790915590517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db182015592517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db2909301929092556107147f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316333087610c0d565b6107525760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606401610442565b60005461078c906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911686610ce9565b6107d45760405162461bcd60e51b8152602060048201526019602482015278105b1b1bddd85b98d9481a5b98dc99585cd94819985a5b1959603a1b6044820152606401610442565b600054604051633d941b6d60e21b81526001600160a01b039091169063f6506db49061082b9085906003907f0000000000000000000000000000000000000000000000000000000000000000908a906004016112c8565b6020604051808303816000875af115801561084a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086e91906112fd565b600081815260046020908152604080832085905551929550909161089691899189910161123b565b60408051601f1981840301815290829052805160209091012060005460025491935086926001600160a01b03909116917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e271869161090991868252602082015260606040820181905260009082015260800190565b60405180910390a35050509392505050565b6000828260405161092d92919061123b565b604051908190038120907f8b2c14fe955d044ef95ba32b88d2ceb87c6f73fcefdcebe906063a6d75690f2790600090a26005805460408051606081018252600080825260208201818152600283850181815260018701885596835292517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db06003808802918201805460ff19169315159390931790925591517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db183015595517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db29091015554915163c13517e160e01b815290936001600160a01b039092169163c13517e1913491610a4291879190600401611316565b60206040518083038185885af1158015610a60573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a8591906112fd565b6000818152600460209081526040808320859055519295509091610aad91889188910161123b565b60408051601f1981840301815290829052805160209091012060005460025491935086926001600160a01b03909116917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e2718691610b2091868252602082015260606040820181905260009082015260800190565b60405180910390a350505092915050565b303314610b505760405162461bcd60e51b8152600401610442906110f5565b6001546040516312a6505d60e21b81526001600160a01b0390911690634a99417490610b829085908590600401611337565b6020604051808303816000875af1158015610ba1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc591906112fd565b6002555050565b303314610beb5760405162461bcd60e51b8152600401610442906110f5565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b17905251610c729190611373565b6000604051808303816000865af19150503d8060008114610caf576040519150601f19603f3d011682016040523d82523d6000602084013e610cb4565b606091505b5091509150818015610cde575080511580610cde575080806020019051810190610cde919061138f565b979650505050505050565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063095ea7b39085908590849063dd62ed3e90604401602060405180830381865afa158015610d45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6991906112fd565b610d7391906113b1565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de2919061138f565b506001949350505050565b60005b83811015610e08578181015183820152602001610df0565b50506000910152565b60008151808452610e29816020860160208601610ded565b601f01601f19169290920160200192915050565b602081526000610e506020830184610e11565b9392505050565b60008060408385031215610e6a57600080fd5b50508035926020909101359150565b60008083601f840112610e8b57600080fd5b50813567ffffffffffffffff811115610ea357600080fd5b602083019150836020828501011115610ebb57600080fd5b9250929050565b60008060208385031215610ed557600080fd5b823567ffffffffffffffff811115610eec57600080fd5b610ef885828601610e79565b90969095509350505050565b6001600160a01b0381168114610f1957600080fd5b50565b600060208284031215610f2e57600080fd5b8135610e5081610f04565b600060208284031215610f4b57600080fd5b5035919050565b600080600060408486031215610f6757600080fd5b833567ffffffffffffffff811115610f7e57600080fd5b610f8a86828701610e79565b909790965060209590950135949350505050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112610fc557600080fd5b813567ffffffffffffffff80821115610fe057610fe0610f9e565b604051601f8301601f19908116603f0116810190828211818310171561100857611008610f9e565b8160405283815286602085880101111561102157600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561105457600080fd5b823567ffffffffffffffff8082111561106c57600080fd5b61107886838701610fb4565b9350602085013591508082111561108e57600080fd5b5061109b85828601610fb4565b9150509250929050565b600181811c908216806110b957607f821691505b6020821081036110d957634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b6020808252601a908201527f4f6e6c792074686520676f7665726e6f7220616c6c6f7765642e000000000000604082015260600190565b601f82111561056a57600081815260208120601f850160051c810160208610156111535750805b601f850160051c820191505b818110156111725782815560010161115f565b505050505050565b67ffffffffffffffff83111561119257611192610f9e565b6111a6836111a083546110a5565b8361112c565b6000601f8411600181146111da57600085156111c25750838201355b600019600387901b1c1916600186901b178355611234565b600083815260209020601f19861690835b8281101561120b57868501358255602094850194600190920191016111eb565b50868210156112285760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b8183823760009101908152919050565b60008154611258816110a5565b808552602060018381168015611275576001811461128f576112bd565b60ff1985168884015283151560051b8801830195506112bd565b866000528260002060005b858110156112b55781548a820186015290830190840161129a565b890184019650505b505050505092915050565b8481526080602082015260006112e1608083018661124b565b6001600160a01b03949094166040830152506060015292915050565b60006020828403121561130f57600080fd5b5051919050565b82815260406020820152600061132f604083018461124b565b949350505050565b60608152600060608201526080602082015260006113586080830185610e11565b828103604084015261136a8185610e11565b95945050505050565b60008251611385818460208701610ded565b9190910192915050565b6000602082840312156113a157600080fd5b81518015158114610e5057600080fd5b808201808211156113d257634e487b7160e01b600052601160045260246000fd5b9291505056fea264697066735822122084881e01383e37e86fd1919d8c218c3fb5e00372697336cc5557215eecd6e56964736f6c63430008120033", + "devdoc": { + "events": { + "DisputeRequest(address,uint256,uint256,uint256,string)": { + "details": "To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.", + "params": { + "_arbitrableDisputeID": "The identifier of the dispute in the Arbitrable contract.", + "_arbitrator": "The arbitrator of the contract.", + "_externalDisputeID": "An identifier created outside Kleros by the protocol requesting arbitration.", + "_templateId": "The identifier of the dispute template. Should not be used with _templateUri.", + "_templateUri": "The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId." + } + }, + "Ruling(address,uint256,uint256)": { + "details": "To be raised when a ruling is given.", + "params": { + "_arbitrator": "The arbitrator giving the ruling.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract.", + "_ruling": "The ruling which was given." + } + } + }, + "kind": "dev", + "methods": { + "constructor": { + "details": "Constructor", + "params": { + "_arbitrator": "The arbitrator to rule on created disputes.", + "_arbitratorExtraData": "The extra data for the arbitrator.", + "_templateData": "The dispute template data.", + "_templateDataMappings": "The dispute template data mappings.", + "_templateRegistry": "The dispute template registry.", + "_weth": "The WETH token." + } + }, + "createDispute(string)": { + "details": "Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "params": { + "_action": "The action that requires arbitration." + }, + "returns": { + "disputeID": "Dispute id (on arbitrator side) of the dispute created." + } + }, + "createDispute(string,uint256)": { + "details": "Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "params": { + "_action": "The action that requires arbitration.", + "_feeInWeth": "Amount of fees in WETH for the arbitrator." + }, + "returns": { + "disputeID": "Dispute id (on arbitrator side) of the dispute created." + } + }, + "rule(uint256,uint256)": { + "details": "To be called by the arbitrator of the dispute, to declare the winning ruling.", + "params": { + "_externalDisputeID": "ID of the dispute in arbitrator contract.", + "_ruling": "The ruling choice of the arbitration." + } + } + }, + "title": "ArbitrableExample An example of an arbitrable contract which connects to the arbitator that implements the updated interface.", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 9862, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "arbitrator", + "offset": 0, + "slot": "0", + "type": "t_contract(IArbitratorV2)17049" + }, + { + "astId": 9865, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "templateRegistry", + "offset": 0, + "slot": "1", + "type": "t_contract(IDisputeTemplateRegistry)17216" + }, + { + "astId": 9867, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "templateId", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 9869, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "arbitratorExtraData", + "offset": 0, + "slot": "3", + "type": "t_bytes_storage" + }, + { + "astId": 9876, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "externalIDtoLocalID", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 9880, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "disputes", + "offset": 0, + "slot": "5", + "type": "t_array(t_struct(DisputeStruct)9853_storage)dyn_storage" + } + ], + "types": { + "t_array(t_struct(DisputeStruct)9853_storage)dyn_storage": { + "base": "t_struct(DisputeStruct)9853_storage", + "encoding": "dynamic_array", + "label": "struct ArbitrableExample.DisputeStruct[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(IArbitratorV2)17049": { + "encoding": "inplace", + "label": "contract IArbitratorV2", + "numberOfBytes": "20" + }, + "t_contract(IDisputeTemplateRegistry)17216": { + "encoding": "inplace", + "label": "contract IDisputeTemplateRegistry", + "numberOfBytes": "20" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(DisputeStruct)9853_storage": { + "encoding": "inplace", + "label": "struct ArbitrableExample.DisputeStruct", + "members": [ + { + "astId": 9848, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "isRuled", + "offset": 0, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 9850, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "ruling", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 9852, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "numberOfRulingOptions", + "offset": 0, + "slot": "2", + "type": "t_uint256" + } + ], + "numberOfBytes": "96" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DisputeResolver.json b/contracts/deployments/arbitrumSepoliaDevnet/DisputeResolver.json new file mode 100644 index 000000000..7bf31192b --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/DisputeResolver.json @@ -0,0 +1,522 @@ +{ + "address": "0x3E22eBE8c86a58b0BfEd5383aa9DEFB87De85034", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "_templateRegistry", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_arbitrableDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_templateId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateUri", + "type": "string" + } + ], + "name": "DisputeRequest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "arbitratorDisputeIDToLocalID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + } + ], + "name": "changeArbitrator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "_templateRegistry", + "type": "address" + } + ], + "name": "changeTemplateRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "string", + "name": "_disputeTemplate", + "type": "string" + }, + { + "internalType": "string", + "name": "_disputeTemplateDataMappings", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_numberOfRulingOptions", + "type": "uint256" + } + ], + "name": "createDisputeForTemplate", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "string", + "name": "_disputeTemplateUri", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_numberOfRulingOptions", + "type": "uint256" + } + ], + "name": "createDisputeForTemplateUri", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "bytes", + "name": "arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "isRuled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numberOfRulingOptions", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "rule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "templateRegistry", + "outputs": [ + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x663feb674e9a6299d3cde548797e79e9f908e2136441adeb1a7ccf0e1b8465f1", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x3E22eBE8c86a58b0BfEd5383aa9DEFB87De85034", + "transactionIndex": 1, + "gasUsed": "899040", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x33bd575519da65d8903ee2bdca4679bc04acb9db41b9bca8f6f310d3fd24acb0", + "transactionHash": "0x663feb674e9a6299d3cde548797e79e9f908e2136441adeb1a7ccf0e1b8465f1", + "logs": [], + "blockNumber": 3087471, + "cumulativeGasUsed": "899040", + "status": 1, + "byzantium": true + }, + "args": [ + "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "0xc60e862273c1eAa1F9afBC69b39cee30270A2419" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_arbitrableDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateUri\",\"type\":\"string\"}],\"name\":\"DisputeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"arbitratorDisputeIDToLocalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"name\":\"changeArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"}],\"name\":\"changeTemplateRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplate\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplateDataMappings\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"}],\"name\":\"createDisputeForTemplate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplateUri\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"}],\"name\":\"createDisputeForTemplateUri\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"isRuled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRulingOptions\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templateRegistry\",\"outputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"DisputeRequest(address,uint256,uint256,uint256,string)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrableDisputeID\":\"The identifier of the dispute in the Arbitrable contract.\",\"_arbitrator\":\"The arbitrator of the contract.\",\"_externalDisputeID\":\"An identifier created outside Kleros by the protocol requesting arbitration.\",\"_templateId\":\"The identifier of the dispute template. Should not be used with _templateUri.\",\"_templateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrator\":\"The arbitrator giving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}}},\"kind\":\"dev\",\"methods\":{\"changeGovernor(address)\":{\"details\":\"Changes the governor.\",\"params\":{\"_governor\":\"The address of the new governor.\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_arbitrator\":\"Target global arbitrator for any disputes.\"}},\"createDisputeForTemplate(bytes,string,string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator of the dispute.\",\"_disputeTemplate\":\"Dispute template.\",\"_disputeTemplateDataMappings\":\"The data mappings.\",\"_numberOfRulingOptions\":\"Number of ruling options.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the created dispute.\"}},\"createDisputeForTemplateUri(bytes,string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator of the dispute.\",\"_disputeTemplateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.\",\"_numberOfRulingOptions\":\"Number of ruling options.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the created dispute.\"}},\"rule(uint256,uint256)\":{\"details\":\"To be called by the arbitrator of the dispute, to declare the winning ruling.\",\"params\":{\"_externalDisputeID\":\"ID of the dispute in arbitrator contract.\",\"_ruling\":\"The ruling choice of the arbitration.\"}}},\"title\":\"DisputeResolver DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/arbitrables/DisputeResolver.sol\":\"DisputeResolver\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/arbitrables/DisputeResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@ferittuncer, @unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"../interfaces/IArbitrableV2.sol\\\";\\nimport \\\"../interfaces/IDisputeTemplateRegistry.sol\\\";\\n\\npragma solidity 0.8.18;\\n\\n/// @title DisputeResolver\\n/// DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\\ncontract DisputeResolver is IArbitrableV2 {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n struct DisputeStruct {\\n bytes arbitratorExtraData; // Extra data for the dispute.\\n bool isRuled; // True if the dispute has been ruled.\\n uint256 ruling; // Ruling given to the dispute.\\n uint256 numberOfRulingOptions; // The number of choices the arbitrator can give.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The governor.\\n IArbitratorV2 public arbitrator; // The arbitrator.\\n IDisputeTemplateRegistry public templateRegistry; // The dispute template registry.\\n DisputeStruct[] public disputes; // Local disputes.\\n mapping(uint256 => uint256) public arbitratorDisputeIDToLocalID; // Maps arbitrator-side dispute IDs to local dispute IDs.\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor\\n /// @param _arbitrator Target global arbitrator for any disputes.\\n constructor(IArbitratorV2 _arbitrator, IDisputeTemplateRegistry _templateRegistry) {\\n governor = msg.sender;\\n arbitrator = _arbitrator;\\n templateRegistry = _templateRegistry;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Changes the governor.\\n /// @param _governor The address of the new governor.\\n function changeGovernor(address _governor) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n governor = _governor;\\n }\\n\\n function changeArbitrator(IArbitratorV2 _arbitrator) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n arbitrator = _arbitrator;\\n }\\n\\n function changeTemplateRegistry(IDisputeTemplateRegistry _templateRegistry) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n templateRegistry = _templateRegistry;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.\\n /// @param _disputeTemplate Dispute template.\\n /// @param _disputeTemplateDataMappings The data mappings.\\n /// @param _numberOfRulingOptions Number of ruling options.\\n /// @return disputeID Dispute id (on arbitrator side) of the created dispute.\\n function createDisputeForTemplate(\\n bytes calldata _arbitratorExtraData,\\n string calldata _disputeTemplate,\\n string memory _disputeTemplateDataMappings,\\n uint256 _numberOfRulingOptions\\n ) external payable returns (uint256 disputeID) {\\n return\\n _createDispute(\\n _arbitratorExtraData,\\n _disputeTemplate,\\n _disputeTemplateDataMappings,\\n \\\"\\\",\\n _numberOfRulingOptions\\n );\\n }\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.\\n /// @param _disputeTemplateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.\\n /// @param _numberOfRulingOptions Number of ruling options.\\n /// @return disputeID Dispute id (on arbitrator side) of the created dispute.\\n function createDisputeForTemplateUri(\\n bytes calldata _arbitratorExtraData,\\n string calldata _disputeTemplateUri,\\n uint256 _numberOfRulingOptions\\n ) external payable returns (uint256 disputeID) {\\n return _createDispute(_arbitratorExtraData, \\\"\\\", \\\"\\\", _disputeTemplateUri, _numberOfRulingOptions);\\n }\\n\\n /// @dev To be called by the arbitrator of the dispute, to declare the winning ruling.\\n /// @param _externalDisputeID ID of the dispute in arbitrator contract.\\n /// @param _ruling The ruling choice of the arbitration.\\n function rule(uint256 _externalDisputeID, uint256 _ruling) external override {\\n uint256 localDisputeID = arbitratorDisputeIDToLocalID[_externalDisputeID];\\n DisputeStruct storage dispute = disputes[localDisputeID];\\n require(msg.sender == address(arbitrator), \\\"Only the arbitrator can execute this.\\\");\\n require(_ruling <= dispute.numberOfRulingOptions, \\\"Invalid ruling.\\\");\\n require(!dispute.isRuled, \\\"This dispute has been ruled already.\\\");\\n\\n dispute.isRuled = true;\\n dispute.ruling = _ruling;\\n\\n emit Ruling(IArbitratorV2(msg.sender), _externalDisputeID, dispute.ruling);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n function _createDispute(\\n bytes calldata _arbitratorExtraData,\\n string memory _disputeTemplate,\\n string memory _disputeTemplateDataMappings,\\n string memory _disputeTemplateUri,\\n uint256 _numberOfRulingOptions\\n ) internal returns (uint256 disputeID) {\\n require(_numberOfRulingOptions > 1, \\\"Should be at least 2 ruling options.\\\");\\n\\n disputeID = arbitrator.createDispute{value: msg.value}(_numberOfRulingOptions, _arbitratorExtraData);\\n uint256 localDisputeID = disputes.length;\\n disputes.push(\\n DisputeStruct({\\n arbitratorExtraData: _arbitratorExtraData,\\n isRuled: false,\\n ruling: 0,\\n numberOfRulingOptions: _numberOfRulingOptions\\n })\\n );\\n arbitratorDisputeIDToLocalID[disputeID] = localDisputeID;\\n uint256 templateId = templateRegistry.setDisputeTemplate(\\\"\\\", _disputeTemplate, _disputeTemplateDataMappings);\\n emit DisputeRequest(arbitrator, disputeID, localDisputeID, templateId, _disputeTemplateUri);\\n }\\n}\\n\",\"keccak256\":\"0x6a73611696ae6b6f128c1c3d6f355f691f93b374243f41e6a9b0795bbfb8fb13\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeTemplateRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n/// @title IDisputeTemplate\\n/// @notice Dispute Template interface.\\ninterface IDisputeTemplateRegistry {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n /// @param _templateDataMappings The data mappings.\\n event DisputeTemplate(\\n uint256 indexed _templateId,\\n string indexed _templateTag,\\n string _templateData,\\n string _templateDataMappings\\n );\\n\\n function setDisputeTemplate(\\n string memory _templateTag,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external returns (uint256 templateId);\\n}\\n\",\"keccak256\":\"0x88b0038d226532e6cf862a485d162f7bca61ac3d361d6801146b55a240f091ac\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50604051610ed5380380610ed583398101604081905261002f91610083565b600080546001600160a01b03199081163317909155600180546001600160a01b03948516908316179055600280549290931691161790556100bd565b6001600160a01b038116811461008057600080fd5b50565b6000806040838503121561009657600080fd5b82516100a18161006b565b60208401519092506100b28161006b565b809150509250929050565b610e09806100cc6000396000f3fe60806040526004361061009c5760003560e01c8063908bb29511610064578063908bb29514610170578063a0af81f014610191578063dc653511146101b1578063e09997d9146101c4578063e4c0aaf4146101f1578063fc548f081461021157600080fd5b80630c340a24146100a1578063311a6c56146100de5780634660ebbe14610100578063564a565d146101205780636cc6cde114610150575b600080fd5b3480156100ad57600080fd5b506000546100c1906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ea57600080fd5b506100fe6100f93660046108bb565b610231565b005b34801561010c57600080fd5b506100fe61011b3660046108f5565b6103d1565b34801561012c57600080fd5b5061014061013b366004610919565b61041d565b6040516100d59493929190610978565b34801561015c57600080fd5b506001546100c1906001600160a01b031681565b61018361017e3660046109f0565b6104eb565b6040519081526020016100d5565b34801561019d57600080fd5b506002546100c1906001600160a01b031681565b6101836101bf366004610a7a565b61055a565b3480156101d057600080fd5b506101836101df366004610919565b60046020526000908152604090205481565b3480156101fd57600080fd5b506100fe61020c3660046108f5565b6105b9565b34801561021d57600080fd5b506100fe61022c3660046108f5565b610605565b600082815260046020526040812054600380549192918390811061025757610257610b88565b6000918252602090912060015460049092020191506001600160a01b031633146102d65760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b806003015483111561031c5760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102cd565b600181015460ff161561037d5760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102cd565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b6000546001600160a01b031633146103fb5760405162461bcd60e51b81526004016102cd90610b9e565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6003818154811061042d57600080fd5b906000526020600020906004020160009150905080600001805461045090610be0565b80601f016020809104026020016040519081016040528092919081815260200182805461047c90610be0565b80156104c95780601f1061049e576101008083540402835291602001916104c9565b820191906000526020600020905b8154815290600101906020018083116104ac57829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b60006105508686604051806020016040528060008152506040518060200160405280600081525088888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250610651915050565b9695505050505050565b60006105ae878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525060408051602081019091529081528a93509150889050610651565b979650505050505050565b6000546001600160a01b031633146105e35760405162461bcd60e51b81526004016102cd90610b9e565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461062f5760405162461bcd60e51b81526004016102cd90610b9e565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000600182116106af5760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b60648201526084016102cd565b60015460405163c13517e160e01b81526001600160a01b039091169063c13517e19034906106e59086908c908c90600401610c1a565b60206040518083038185885af1158015610703573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107289190610c50565b600380546040805160a06020601f8d018190040282018101909252608081018b8152949550919382918c908c90819085018382808284376000920182905250938552505050602080830182905260408301829052606090920187905283546001810185559381522081519192600402019081906107a59082610cb8565b5060208281015160018301805460ff19169115159190911790556040808401516002808501919091556060909401516003909301929092556000858152600491829052828120859055925491516312a6505d60e21b81526001600160a01b0390921691634a9941749161081c918b918b9101610d78565b6020604051808303816000875af115801561083b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085f9190610c50565b60015460405191925084916001600160a01b03909116907f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186906108a790869086908b90610db4565b60405180910390a350509695505050505050565b600080604083850312156108ce57600080fd5b50508035926020909101359150565b6001600160a01b03811681146108f257600080fd5b50565b60006020828403121561090757600080fd5b8135610912816108dd565b9392505050565b60006020828403121561092b57600080fd5b5035919050565b6000815180845260005b818110156109585760208185018101518683018201520161093c565b506000602082860101526020601f19601f83011685010191505092915050565b60808152600061098b6080830187610932565b9415156020830152506040810192909252606090910152919050565b60008083601f8401126109b957600080fd5b50813567ffffffffffffffff8111156109d157600080fd5b6020830191508360208285010111156109e957600080fd5b9250929050565b600080600080600060608688031215610a0857600080fd5b853567ffffffffffffffff80821115610a2057600080fd5b610a2c89838a016109a7565b90975095506020880135915080821115610a4557600080fd5b50610a52888289016109a7565b96999598509660400135949350505050565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060808789031215610a9357600080fd5b863567ffffffffffffffff80821115610aab57600080fd5b610ab78a838b016109a7565b90985096506020890135915080821115610ad057600080fd5b610adc8a838b016109a7565b90965094506040890135915080821115610af557600080fd5b818901915089601f830112610b0957600080fd5b813581811115610b1b57610b1b610a64565b604051601f8201601f19908116603f01168101908382118183101715610b4357610b43610a64565b816040528281528c6020848701011115610b5c57600080fd5b826020860160208301376000602084830101528096505050505050606087013590509295509295509295565b634e487b7160e01b600052603260045260246000fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600181811c90821680610bf457607f821691505b602082108103610c1457634e487b7160e01b600052602260045260246000fd5b50919050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610c6257600080fd5b5051919050565b601f821115610cb357600081815260208120601f850160051c81016020861015610c905750805b601f850160051c820191505b81811015610caf57828155600101610c9c565b5050505b505050565b815167ffffffffffffffff811115610cd257610cd2610a64565b610ce681610ce08454610be0565b84610c69565b602080601f831160018114610d1b5760008415610d035750858301515b600019600386901b1c1916600185901b178555610caf565b600085815260208120601f198616915b82811015610d4a57888601518255948401946001909101908401610d2b565b5085821015610d685787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006060820152608060208201526000610d996080830185610932565b8281036040840152610dab8185610932565b95945050505050565b838152826020820152606060408201526000610dab606083018461093256fea2646970667358221220877ae0e909997117f80796c7abc2192eb434ddbaf0b29b8c6a7ca73e306f53b964736f6c63430008120033", + "deployedBytecode": "0x60806040526004361061009c5760003560e01c8063908bb29511610064578063908bb29514610170578063a0af81f014610191578063dc653511146101b1578063e09997d9146101c4578063e4c0aaf4146101f1578063fc548f081461021157600080fd5b80630c340a24146100a1578063311a6c56146100de5780634660ebbe14610100578063564a565d146101205780636cc6cde114610150575b600080fd5b3480156100ad57600080fd5b506000546100c1906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ea57600080fd5b506100fe6100f93660046108bb565b610231565b005b34801561010c57600080fd5b506100fe61011b3660046108f5565b6103d1565b34801561012c57600080fd5b5061014061013b366004610919565b61041d565b6040516100d59493929190610978565b34801561015c57600080fd5b506001546100c1906001600160a01b031681565b61018361017e3660046109f0565b6104eb565b6040519081526020016100d5565b34801561019d57600080fd5b506002546100c1906001600160a01b031681565b6101836101bf366004610a7a565b61055a565b3480156101d057600080fd5b506101836101df366004610919565b60046020526000908152604090205481565b3480156101fd57600080fd5b506100fe61020c3660046108f5565b6105b9565b34801561021d57600080fd5b506100fe61022c3660046108f5565b610605565b600082815260046020526040812054600380549192918390811061025757610257610b88565b6000918252602090912060015460049092020191506001600160a01b031633146102d65760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b806003015483111561031c5760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102cd565b600181015460ff161561037d5760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102cd565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b6000546001600160a01b031633146103fb5760405162461bcd60e51b81526004016102cd90610b9e565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6003818154811061042d57600080fd5b906000526020600020906004020160009150905080600001805461045090610be0565b80601f016020809104026020016040519081016040528092919081815260200182805461047c90610be0565b80156104c95780601f1061049e576101008083540402835291602001916104c9565b820191906000526020600020905b8154815290600101906020018083116104ac57829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b60006105508686604051806020016040528060008152506040518060200160405280600081525088888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250610651915050565b9695505050505050565b60006105ae878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525060408051602081019091529081528a93509150889050610651565b979650505050505050565b6000546001600160a01b031633146105e35760405162461bcd60e51b81526004016102cd90610b9e565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461062f5760405162461bcd60e51b81526004016102cd90610b9e565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000600182116106af5760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b60648201526084016102cd565b60015460405163c13517e160e01b81526001600160a01b039091169063c13517e19034906106e59086908c908c90600401610c1a565b60206040518083038185885af1158015610703573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107289190610c50565b600380546040805160a06020601f8d018190040282018101909252608081018b8152949550919382918c908c90819085018382808284376000920182905250938552505050602080830182905260408301829052606090920187905283546001810185559381522081519192600402019081906107a59082610cb8565b5060208281015160018301805460ff19169115159190911790556040808401516002808501919091556060909401516003909301929092556000858152600491829052828120859055925491516312a6505d60e21b81526001600160a01b0390921691634a9941749161081c918b918b9101610d78565b6020604051808303816000875af115801561083b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085f9190610c50565b60015460405191925084916001600160a01b03909116907f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186906108a790869086908b90610db4565b60405180910390a350509695505050505050565b600080604083850312156108ce57600080fd5b50508035926020909101359150565b6001600160a01b03811681146108f257600080fd5b50565b60006020828403121561090757600080fd5b8135610912816108dd565b9392505050565b60006020828403121561092b57600080fd5b5035919050565b6000815180845260005b818110156109585760208185018101518683018201520161093c565b506000602082860101526020601f19601f83011685010191505092915050565b60808152600061098b6080830187610932565b9415156020830152506040810192909252606090910152919050565b60008083601f8401126109b957600080fd5b50813567ffffffffffffffff8111156109d157600080fd5b6020830191508360208285010111156109e957600080fd5b9250929050565b600080600080600060608688031215610a0857600080fd5b853567ffffffffffffffff80821115610a2057600080fd5b610a2c89838a016109a7565b90975095506020880135915080821115610a4557600080fd5b50610a52888289016109a7565b96999598509660400135949350505050565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060808789031215610a9357600080fd5b863567ffffffffffffffff80821115610aab57600080fd5b610ab78a838b016109a7565b90985096506020890135915080821115610ad057600080fd5b610adc8a838b016109a7565b90965094506040890135915080821115610af557600080fd5b818901915089601f830112610b0957600080fd5b813581811115610b1b57610b1b610a64565b604051601f8201601f19908116603f01168101908382118183101715610b4357610b43610a64565b816040528281528c6020848701011115610b5c57600080fd5b826020860160208301376000602084830101528096505050505050606087013590509295509295509295565b634e487b7160e01b600052603260045260246000fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600181811c90821680610bf457607f821691505b602082108103610c1457634e487b7160e01b600052602260045260246000fd5b50919050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610c6257600080fd5b5051919050565b601f821115610cb357600081815260208120601f850160051c81016020861015610c905750805b601f850160051c820191505b81811015610caf57828155600101610c9c565b5050505b505050565b815167ffffffffffffffff811115610cd257610cd2610a64565b610ce681610ce08454610be0565b84610c69565b602080601f831160018114610d1b5760008415610d035750858301515b600019600386901b1c1916600185901b178555610caf565b600085815260208120601f198616915b82811015610d4a57888601518255948401946001909101908401610d2b565b5085821015610d685787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006060820152608060208201526000610d996080830185610932565b8281036040840152610dab8185610932565b95945050505050565b838152826020820152606060408201526000610dab606083018461093256fea2646970667358221220877ae0e909997117f80796c7abc2192eb434ddbaf0b29b8c6a7ca73e306f53b964736f6c63430008120033", + "devdoc": { + "events": { + "DisputeRequest(address,uint256,uint256,uint256,string)": { + "details": "To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.", + "params": { + "_arbitrableDisputeID": "The identifier of the dispute in the Arbitrable contract.", + "_arbitrator": "The arbitrator of the contract.", + "_externalDisputeID": "An identifier created outside Kleros by the protocol requesting arbitration.", + "_templateId": "The identifier of the dispute template. Should not be used with _templateUri.", + "_templateUri": "The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId." + } + }, + "Ruling(address,uint256,uint256)": { + "details": "To be raised when a ruling is given.", + "params": { + "_arbitrator": "The arbitrator giving the ruling.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract.", + "_ruling": "The ruling which was given." + } + } + }, + "kind": "dev", + "methods": { + "changeGovernor(address)": { + "details": "Changes the governor.", + "params": { + "_governor": "The address of the new governor." + } + }, + "constructor": { + "details": "Constructor", + "params": { + "_arbitrator": "Target global arbitrator for any disputes." + } + }, + "createDisputeForTemplate(bytes,string,string,uint256)": { + "details": "Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "params": { + "_arbitratorExtraData": "Extra data for the arbitrator of the dispute.", + "_disputeTemplate": "Dispute template.", + "_disputeTemplateDataMappings": "The data mappings.", + "_numberOfRulingOptions": "Number of ruling options." + }, + "returns": { + "disputeID": "Dispute id (on arbitrator side) of the created dispute." + } + }, + "createDisputeForTemplateUri(bytes,string,uint256)": { + "details": "Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "params": { + "_arbitratorExtraData": "Extra data for the arbitrator of the dispute.", + "_disputeTemplateUri": "The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.", + "_numberOfRulingOptions": "Number of ruling options." + }, + "returns": { + "disputeID": "Dispute id (on arbitrator side) of the created dispute." + } + }, + "rule(uint256,uint256)": { + "details": "To be called by the arbitrator of the dispute, to declare the winning ruling.", + "params": { + "_externalDisputeID": "ID of the dispute in arbitrator contract.", + "_ruling": "The ruling choice of the arbitration." + } + } + }, + "title": "DisputeResolver DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 10260, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 10263, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "arbitrator", + "offset": 0, + "slot": "1", + "type": "t_contract(IArbitratorV2)17049" + }, + { + "astId": 10266, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "templateRegistry", + "offset": 0, + "slot": "2", + "type": "t_contract(IDisputeTemplateRegistry)17216" + }, + { + "astId": 10270, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "disputes", + "offset": 0, + "slot": "3", + "type": "t_array(t_struct(DisputeStruct)10258_storage)dyn_storage" + }, + { + "astId": 10274, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "arbitratorDisputeIDToLocalID", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_uint256)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(DisputeStruct)10258_storage)dyn_storage": { + "base": "t_struct(DisputeStruct)10258_storage", + "encoding": "dynamic_array", + "label": "struct DisputeResolver.DisputeStruct[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(IArbitratorV2)17049": { + "encoding": "inplace", + "label": "contract IArbitratorV2", + "numberOfBytes": "20" + }, + "t_contract(IDisputeTemplateRegistry)17216": { + "encoding": "inplace", + "label": "contract IDisputeTemplateRegistry", + "numberOfBytes": "20" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(DisputeStruct)10258_storage": { + "encoding": "inplace", + "label": "struct DisputeResolver.DisputeStruct", + "members": [ + { + "astId": 10251, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "arbitratorExtraData", + "offset": 0, + "slot": "0", + "type": "t_bytes_storage" + }, + { + "astId": 10253, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "isRuled", + "offset": 0, + "slot": "1", + "type": "t_bool" + }, + { + "astId": 10255, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "ruling", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 10257, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "numberOfRulingOptions", + "offset": 0, + "slot": "3", + "type": "t_uint256" + } + ], + "numberOfBytes": "128" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry.json b/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry.json new file mode 100644 index 000000000..b59cb3ce1 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry.json @@ -0,0 +1,311 @@ +{ + "address": "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_templateId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "string", + "name": "_templateTag", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + } + ], + "name": "DisputeTemplate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_templateTag", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + } + ], + "name": "setDisputeTemplate", + "outputs": [ + { + "internalType": "uint256", + "name": "templateId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "templates", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0x60b03812afc0e4fc36f66e3bc1f8aa7953a7a7bbf4fa8ea6e16e3c166d39538e", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + "transactionIndex": 1, + "gasUsed": "175211", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000004000000000000000000000000000020000000000000000000000000000000000000000000000000000000", + "blockHash": "0x9d4803d3e8255ee697b39e40e77e005bf3b315ec798d15139412624a91b41226", + "transactionHash": "0x60b03812afc0e4fc36f66e3bc1f8aa7953a7a7bbf4fa8ea6e16e3c166d39538e", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3087464, + "transactionHash": "0x60b03812afc0e4fc36f66e3bc1f8aa7953a7a7bbf4fa8ea6e16e3c166d39538e", + "address": "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x9d4803d3e8255ee697b39e40e77e005bf3b315ec798d15139412624a91b41226" + } + ], + "blockNumber": 3087464, + "cumulativeGasUsed": "175211", + "status": 1, + "byzantium": true + }, + "args": [ + "0xeA44D4710bc804573E7d8653b88A60CaC51E3738", + "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59" + ] + }, + "implementation": "0xeA44D4710bc804573E7d8653b88A60CaC51E3738", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Implementation.json b/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Implementation.json new file mode 100644 index 000000000..1c9765248 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Implementation.json @@ -0,0 +1,392 @@ +{ + "address": "0xeA44D4710bc804573E7d8653b88A60CaC51E3738", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_templateId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "string", + "name": "_templateTag", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + } + ], + "name": "DisputeTemplate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_templateTag", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + } + ], + "name": "setDisputeTemplate", + "outputs": [ + { + "internalType": "uint256", + "name": "templateId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "templates", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x6397611709713a7bdbf16c8b4d07b5bed5b8b227a6b7f4b4c01efef1c72cd868", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xeA44D4710bc804573E7d8653b88A60CaC51E3738", + "transactionIndex": 1, + "gasUsed": "567386", + "logsBloom": "0x00000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000100000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x6588b75561007ce9bcc9180b9d33d34cc8fedc5b178c3414c0055d0b2e0f5499", + "transactionHash": "0x6397611709713a7bdbf16c8b4d07b5bed5b8b227a6b7f4b4c01efef1c72cd868", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3087460, + "transactionHash": "0x6397611709713a7bdbf16c8b4d07b5bed5b8b227a6b7f4b4c01efef1c72cd868", + "address": "0xeA44D4710bc804573E7d8653b88A60CaC51E3738", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 0, + "blockHash": "0x6588b75561007ce9bcc9180b9d33d34cc8fedc5b178c3414c0055d0b2e0f5499" + } + ], + "blockNumber": 3087460, + "cumulativeGasUsed": "567386", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"_templateTag\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"}],\"name\":\"DisputeTemplate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_templateTag\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"}],\"name\":\"setDisputeTemplate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"templateId\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templates\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"A contract to maintain a registry of dispute templates.\",\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"DisputeTemplate(uint256,string,string,string)\":{\"details\":\"To be emitted when a new dispute template is created.\",\"params\":{\"_templateData\":\"The template data.\",\"_templateDataMappings\":\"The data mappings.\",\"_templateId\":\"The identifier of the dispute template.\",\"_templateTag\":\"An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"changeGovernor(address)\":{\"details\":\"Changes the governor of the contract.\",\"params\":{\"_governor\":\"The new governor.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"initialize(address)\":{\"details\":\"Initializer\",\"params\":{\"_governor\":\"Governor of the contract.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"setDisputeTemplate(string,string,string)\":{\"details\":\"Registers a new dispute template.\",\"params\":{\"_templateData\":\"The data of the template.\",\"_templateDataMappings\":\"The data mappings of the template.\",\"_templateTag\":\"The tag of the template (optional).\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"Dispute Template Registry\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/DisputeTemplateRegistry.sol\":\"DisputeTemplateRegistry\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/arbitration/DisputeTemplateRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\nimport \\\"../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../proxy/Initializable.sol\\\";\\nimport \\\"./interfaces/IDisputeTemplateRegistry.sol\\\";\\n\\n/// @title Dispute Template Registry\\n/// @dev A contract to maintain a registry of dispute templates.\\ncontract DisputeTemplateRegistry is IDisputeTemplateRegistry, UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The address that can withdraw funds.\\n uint256 public templates; // The number of templates.\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Governor only\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer\\n /// @param _governor Governor of the contract.\\n function initialize(address _governor) external reinitializer(1) {\\n governor = _governor;\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /**\\n * @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Changes the governor of the contract.\\n /// @param _governor The new governor.\\n function changeGovernor(address _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Registers a new dispute template.\\n /// @param _templateTag The tag of the template (optional).\\n /// @param _templateData The data of the template.\\n /// @param _templateDataMappings The data mappings of the template.\\n function setDisputeTemplate(\\n string memory _templateTag,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external returns (uint256 templateId) {\\n templateId = templates++;\\n emit DisputeTemplate(templateId, _templateTag, _templateData, _templateDataMappings);\\n }\\n}\\n\",\"keccak256\":\"0x230526c8cffcfc580fa1c802cd497a944ae92bd97b37d750ca2f811edb32ff93\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeTemplateRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n/// @title IDisputeTemplate\\n/// @notice Dispute Template interface.\\ninterface IDisputeTemplateRegistry {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n /// @param _templateDataMappings The data mappings.\\n event DisputeTemplate(\\n uint256 indexed _templateId,\\n string indexed _templateTag,\\n string _templateData,\\n string _templateDataMappings\\n );\\n\\n function setDisputeTemplate(\\n string memory _templateTag,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external returns (uint256 templateId);\\n}\\n\",\"keccak256\":\"0x88b0038d226532e6cf862a485d162f7bca61ac3d361d6801146b55a240f091ac\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060805234801561001457600080fd5b5061001d610022565b6100d3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff16156100715760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b03908116146100d05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6080516108d66100fc600039600081816101d1015281816101fa01526103f701526108d66000f3fe6080604052600436106100605760003560e01c80630c340a24146100655780633a283d7d146100a25780634a994174146100c65780634f1ef286146100e657806352d1902d146100fb578063c4d66de814610110578063e4c0aaf414610130575b600080fd5b34801561007157600080fd5b50600054610085906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ae57600080fd5b506100b860015481565b604051908152602001610099565b3480156100d257600080fd5b506100b86100e136600461065e565b610150565b6100f96100f4366004610702565b6101bd565b005b34801561010757600080fd5b506100b86103ea565b34801561011c57600080fd5b506100f961012b366004610764565b610448565b34801561013c57600080fd5b506100f961014b366004610764565b610532565b60018054600091826101618361077f565b9190505590508360405161017591906107ca565b6040518091039020817ef7cd7255d1073b4e136dd477c38ea0020c051ab17110cc5bfab0c840ff992485856040516101ae929190610812565b60405180910390a39392505050565b6101c68261057e565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061024457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166102386000805160206108818339815191525490565b6001600160a01b031614155b156102625760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156102bc575060408051601f3d908101601f191682019092526102b991810190610840565b60015b6102e957604051630c76093760e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610881833981519152811461031a57604051632a87526960e21b8152600481018290526024016102e0565b6000805160206108818339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28151156103e5576000836001600160a01b03168360405161038191906107ca565b600060405180830381855af49150503d80600081146103bc576040519150601f19603f3d011682016040523d82523d6000602084013e6103c1565b606091505b50509050806103e3576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104355760405163703e46dd60e11b815260040160405180910390fd5b5060008051602061088183398151915290565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806104925750805467ffffffffffffffff808416911610155b156104af5760405162dc149f60e41b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6000546001600160a01b0316331461055c5760405162461bcd60e51b81526004016102e090610859565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146105a85760405162461bcd60e51b81526004016102e090610859565b50565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156105dc576105dc6105ab565b604051601f8501601f19908116603f01168101908282118183101715610604576106046105ab565b8160405280935085815286868601111561061d57600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261064857600080fd5b610657838335602085016105c1565b9392505050565b60008060006060848603121561067357600080fd5b833567ffffffffffffffff8082111561068b57600080fd5b61069787838801610637565b945060208601359150808211156106ad57600080fd5b6106b987838801610637565b935060408601359150808211156106cf57600080fd5b506106dc86828701610637565b9150509250925092565b80356001600160a01b03811681146106fd57600080fd5b919050565b6000806040838503121561071557600080fd5b61071e836106e6565b9150602083013567ffffffffffffffff81111561073a57600080fd5b8301601f8101851361074b57600080fd5b61075a858235602084016105c1565b9150509250929050565b60006020828403121561077657600080fd5b610657826106e6565b60006001820161079f57634e487b7160e01b600052601160045260246000fd5b5060010190565b60005b838110156107c15781810151838201526020016107a9565b50506000910152565b600082516107dc8184602087016107a6565b9190910192915050565b600081518084526107fe8160208601602086016107a6565b601f01601f19169290920160200192915050565b60408152600061082560408301856107e6565b828103602084015261083781856107e6565b95945050505050565b60006020828403121561085257600080fd5b5051919050565b6020808252600d908201526c476f7665726e6f72206f6e6c7960981b60408201526060019056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212200004ee6006386c26ab6ccd4a63aa3601a23b64b04172511e9dbcdf70e85f6e7c64736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106100605760003560e01c80630c340a24146100655780633a283d7d146100a25780634a994174146100c65780634f1ef286146100e657806352d1902d146100fb578063c4d66de814610110578063e4c0aaf414610130575b600080fd5b34801561007157600080fd5b50600054610085906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ae57600080fd5b506100b860015481565b604051908152602001610099565b3480156100d257600080fd5b506100b86100e136600461065e565b610150565b6100f96100f4366004610702565b6101bd565b005b34801561010757600080fd5b506100b86103ea565b34801561011c57600080fd5b506100f961012b366004610764565b610448565b34801561013c57600080fd5b506100f961014b366004610764565b610532565b60018054600091826101618361077f565b9190505590508360405161017591906107ca565b6040518091039020817ef7cd7255d1073b4e136dd477c38ea0020c051ab17110cc5bfab0c840ff992485856040516101ae929190610812565b60405180910390a39392505050565b6101c68261057e565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061024457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166102386000805160206108818339815191525490565b6001600160a01b031614155b156102625760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156102bc575060408051601f3d908101601f191682019092526102b991810190610840565b60015b6102e957604051630c76093760e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610881833981519152811461031a57604051632a87526960e21b8152600481018290526024016102e0565b6000805160206108818339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28151156103e5576000836001600160a01b03168360405161038191906107ca565b600060405180830381855af49150503d80600081146103bc576040519150601f19603f3d011682016040523d82523d6000602084013e6103c1565b606091505b50509050806103e3576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104355760405163703e46dd60e11b815260040160405180910390fd5b5060008051602061088183398151915290565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806104925750805467ffffffffffffffff808416911610155b156104af5760405162dc149f60e41b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6000546001600160a01b0316331461055c5760405162461bcd60e51b81526004016102e090610859565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146105a85760405162461bcd60e51b81526004016102e090610859565b50565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156105dc576105dc6105ab565b604051601f8501601f19908116603f01168101908282118183101715610604576106046105ab565b8160405280935085815286868601111561061d57600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261064857600080fd5b610657838335602085016105c1565b9392505050565b60008060006060848603121561067357600080fd5b833567ffffffffffffffff8082111561068b57600080fd5b61069787838801610637565b945060208601359150808211156106ad57600080fd5b6106b987838801610637565b935060408601359150808211156106cf57600080fd5b506106dc86828701610637565b9150509250925092565b80356001600160a01b03811681146106fd57600080fd5b919050565b6000806040838503121561071557600080fd5b61071e836106e6565b9150602083013567ffffffffffffffff81111561073a57600080fd5b8301601f8101851361074b57600080fd5b61075a858235602084016105c1565b9150509250929050565b60006020828403121561077657600080fd5b610657826106e6565b60006001820161079f57634e487b7160e01b600052601160045260246000fd5b5060010190565b60005b838110156107c15781810151838201526020016107a9565b50506000910152565b600082516107dc8184602087016107a6565b9190910192915050565b600081518084526107fe8160208601602086016107a6565b601f01601f19169290920160200192915050565b60408152600061082560408301856107e6565b828103602084015261083781856107e6565b95945050505050565b60006020828403121561085257600080fd5b5051919050565b6020808252600d908201526c476f7665726e6f72206f6e6c7960981b60408201526060019056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212200004ee6006386c26ab6ccd4a63aa3601a23b64b04172511e9dbcdf70e85f6e7c64736f6c63430008120033", + "devdoc": { + "details": "A contract to maintain a registry of dispute templates.", + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "DisputeTemplate(uint256,string,string,string)": { + "details": "To be emitted when a new dispute template is created.", + "params": { + "_templateData": "The template data.", + "_templateDataMappings": "The data mappings.", + "_templateId": "The identifier of the dispute template.", + "_templateTag": "An optional tag for the dispute template, such as \"registration\" or \"removal\"." + } + }, + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "changeGovernor(address)": { + "details": "Changes the governor of the contract.", + "params": { + "_governor": "The new governor." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "initialize(address)": { + "details": "Initializer", + "params": { + "_governor": "Governor of the contract." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "setDisputeTemplate(string,string,string)": { + "details": "Registers a new dispute template.", + "params": { + "_templateData": "The data of the template.", + "_templateDataMappings": "The data mappings of the template.", + "_templateTag": "The tag of the template (optional)." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "title": "Dispute Template Registry", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 2856, + "contract": "src/arbitration/DisputeTemplateRegistry.sol:DisputeTemplateRegistry", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 2858, + "contract": "src/arbitration/DisputeTemplateRegistry.sol:DisputeTemplateRegistry", + "label": "templates", + "offset": 0, + "slot": "1", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Proxy.json b/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Proxy.json new file mode 100644 index 000000000..1d783e5d5 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x60b03812afc0e4fc36f66e3bc1f8aa7953a7a7bbf4fa8ea6e16e3c166d39538e", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + "transactionIndex": 1, + "gasUsed": "175211", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000004000000000000000000000000000020000000000000000000000000000000000000000000000000000000", + "blockHash": "0x9d4803d3e8255ee697b39e40e77e005bf3b315ec798d15139412624a91b41226", + "transactionHash": "0x60b03812afc0e4fc36f66e3bc1f8aa7953a7a7bbf4fa8ea6e16e3c166d39538e", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3087464, + "transactionHash": "0x60b03812afc0e4fc36f66e3bc1f8aa7953a7a7bbf4fa8ea6e16e3c166d39538e", + "address": "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x9d4803d3e8255ee697b39e40e77e005bf3b315ec798d15139412624a91b41226" + } + ], + "blockNumber": 3087464, + "cumulativeGasUsed": "175211", + "status": 1, + "byzantium": true + }, + "args": [ + "0xeA44D4710bc804573E7d8653b88A60CaC51E3738", + "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/Escrow.json b/contracts/deployments/arbitrumSepoliaDevnet/Escrow.json new file mode 100644 index 000000000..177ae268d --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/Escrow.json @@ -0,0 +1,1081 @@ +{ + "address": "0x224E52523354BEdCaFF3e98de463E829f3388f84", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + }, + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "_templateRegistry", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_feeTimeout", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ArbitratorOnly", + "type": "error" + }, + { + "inputs": [], + "name": "BuyerFeeNotCoverArbitrationCosts", + "type": "error" + }, + { + "inputs": [], + "name": "BuyerOnly", + "type": "error" + }, + { + "inputs": [], + "name": "DeadlineNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeAlreadyCreatedOrTransactionAlreadyExecuted", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeAlreadyResolved", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorOnly", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidRuling", + "type": "error" + }, + { + "inputs": [], + "name": "MaximumPaymentAmountExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "NotWaitingForBuyerFees", + "type": "error" + }, + { + "inputs": [], + "name": "NotWaitingForSellerFees", + "type": "error" + }, + { + "inputs": [], + "name": "SellerFeeNotCoverArbitrationCosts", + "type": "error" + }, + { + "inputs": [], + "name": "SellerOnly", + "type": "error" + }, + { + "inputs": [], + "name": "TimeoutNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "TransactionDisputed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_arbitrableDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_templateId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateUri", + "type": "string" + } + ], + "name": "DisputeRequest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum Escrow.Party", + "name": "_party", + "type": "uint8" + } + ], + "name": "HasToPayFee", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "_party", + "type": "address" + } + ], + "name": "Payment", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_buyer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_seller", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "TransactionCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "enum Escrow.Resolution", + "name": "_resolution", + "type": "uint8" + } + ], + "name": "TransactionResolved", + "type": "event" + }, + { + "inputs": [], + "name": "AMOUNT_OF_CHOICES", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "arbitratorExtraData", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + } + ], + "name": "changeArbitrator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + } + ], + "name": "changeArbitratorExtraData", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + } + ], + "name": "changeDisputeTemplate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "_templateRegistry", + "type": "address" + } + ], + "name": "changeTemplateRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_timeoutPayment", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_seller", + "type": "address" + }, + { + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + } + ], + "name": "createTransaction", + "outputs": [ + { + "internalType": "uint256", + "name": "transactionID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputeIDtoTransactionID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + } + ], + "name": "executeTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "feeTimeout", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCountTransactions", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "pay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + } + ], + "name": "payArbitrationFeeByBuyer", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + } + ], + "name": "payArbitrationFeeBySeller", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_amountReimbursed", + "type": "uint256" + } + ], + "name": "reimburse", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "rule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "templateId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "templateRegistry", + "outputs": [ + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + } + ], + "name": "timeOutByBuyer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + } + ], + "name": "timeOutBySeller", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "transactions", + "outputs": [ + { + "internalType": "address payable", + "name": "buyer", + "type": "address" + }, + { + "internalType": "address payable", + "name": "seller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyerFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastFeePaymentTime", + "type": "uint256" + }, + { + "internalType": "string", + "name": "templateData", + "type": "string" + }, + { + "internalType": "string", + "name": "templateDataMappings", + "type": "string" + }, + { + "internalType": "enum Escrow.Status", + "name": "status", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x0b22de728111f58bd9659c02baabb82a6c883fe6a33f5dcb3d71e2398bfac628", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x224E52523354BEdCaFF3e98de463E829f3388f84", + "transactionIndex": 1, + "gasUsed": "1864661", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000080000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000040000000002020000400000000000100000000000000000000000000000000000000", + "blockHash": "0xf88d81ede1bf3cf635ac854704ff3b2edc75306b2dcc6afc45639b3836320e16", + "transactionHash": "0x0b22de728111f58bd9659c02baabb82a6c883fe6a33f5dcb3d71e2398bfac628", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3087475, + "transactionHash": "0x0b22de728111f58bd9659c02baabb82a6c883fe6a33f5dcb3d71e2398bfac628", + "address": "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + "topics": [ + "0x00f7cd7255d1073b4e136dd477c38ea0020c051ab17110cc5bfab0c840ff9924", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c6469737075746554656d706c6174654d617070696e673a20544f444f00000000", + "logIndex": 0, + "blockHash": "0xf88d81ede1bf3cf635ac854704ff3b2edc75306b2dcc6afc45639b3836320e16" + } + ], + "blockNumber": 3087475, + "cumulativeGasUsed": "1864661", + "status": 1, + "byzantium": true + }, + "args": [ + "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003", + { + "$schema": "../NewDisputeTemplate.schema.json", + "title": "Let's do this", + "description": "We want to do this: %s", + "question": "Does it comply with the policy?", + "answers": [ + { + "title": "Yes", + "description": "Select this if you agree that it must be done." + }, + { + "title": "No", + "description": "Select this if you do not agree that it must be done." + } + ], + "policyURI": "/ipfs/Qmdvk...rSD6cE/policy.pdf", + "frontendUrl": "https://kleros-v2.netlify.app/#/cases/%s/overview", + "arbitratorChainID": "421614", + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", + "category": "Others", + "specification": "KIP001", + "lang": "en_US" + }, + "disputeTemplateMapping: TODO", + "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + 600 + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"},{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_feeTimeout\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ArbitratorOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BuyerFeeNotCoverArbitrationCosts\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BuyerOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeadlineNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeAlreadyCreatedOrTransactionAlreadyExecuted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeAlreadyResolved\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRuling\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaximumPaymentAmountExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotWaitingForBuyerFees\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotWaitingForSellerFees\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SellerFeeNotCoverArbitrationCosts\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SellerOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TimeoutNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransactionDisputed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_arbitrableDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateUri\",\"type\":\"string\"}],\"name\":\"DisputeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum Escrow.Party\",\"name\":\"_party\",\"type\":\"uint8\"}],\"name\":\"HasToPayFee\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_party\",\"type\":\"address\"}],\"name\":\"Payment\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_buyer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_seller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"TransactionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"enum Escrow.Resolution\",\"name\":\"_resolution\",\"type\":\"uint8\"}],\"name\":\"TransactionResolved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AMOUNT_OF_CHOICES\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"arbitratorExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"name\":\"changeArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"}],\"name\":\"changeArbitratorExtraData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"}],\"name\":\"changeDisputeTemplate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"}],\"name\":\"changeTemplateRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_timeoutPayment\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"_seller\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"}],\"name\":\"createTransaction\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"transactionID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputeIDtoTransactionID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"executeTransaction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeTimeout\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCountTransactions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"pay\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"payArbitrationFeeByBuyer\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"payArbitrationFeeBySeller\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_amountReimbursed\",\"type\":\"uint256\"}],\"name\":\"reimburse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templateId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templateRegistry\",\"outputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"timeOutByBuyer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"timeOutBySeller\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"transactions\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"buyer\",\"type\":\"address\"},{\"internalType\":\"address payable\",\"name\":\"seller\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"buyerFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sellerFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastFeePaymentTime\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"templateDataMappings\",\"type\":\"string\"},{\"internalType\":\"enum Escrow.Status\",\"name\":\"status\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"MultipleArbitrableTransaction contract that is compatible with V2. Adapted from https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTransaction.sol\",\"events\":{\"DisputeRequest(address,uint256,uint256,uint256,string)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrableDisputeID\":\"The identifier of the dispute in the Arbitrable contract.\",\"_arbitrator\":\"The arbitrator of the contract.\",\"_externalDisputeID\":\"An identifier created outside Kleros by the protocol requesting arbitration.\",\"_templateId\":\"The identifier of the dispute template. Should not be used with _templateUri.\",\"_templateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\"}},\"HasToPayFee(uint256,uint8)\":{\"details\":\"Indicate that a party has to pay a fee or would otherwise be considered as losing.\",\"params\":{\"_party\":\"The party who has to pay.\",\"_transactionID\":\"The index of the transaction.\"}},\"Payment(uint256,uint256,address)\":{\"details\":\"To be emitted when a party pays or reimburses the other.\",\"params\":{\"_amount\":\"The amount paid.\",\"_party\":\"The party that paid.\",\"_transactionID\":\"The index of the transaction.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrator\":\"The arbitrator giving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}},\"TransactionCreated(uint256,address,address,uint256)\":{\"details\":\"Emitted when a transaction is created.\",\"params\":{\"_amount\":\"The initial amount in the transaction.\",\"_buyer\":\"The address of the buyer.\",\"_seller\":\"The address of the seller.\",\"_transactionID\":\"The index of the transaction.\"}},\"TransactionResolved(uint256,uint8)\":{\"details\":\"To be emitted when a transaction is resolved, either by its execution, a timeout or because a ruling was enforced.\",\"params\":{\"_resolution\":\"Short description of what caused the transaction to be solved.\",\"_transactionID\":\"The ID of the respective transaction.\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"_arbitrator\":\"The arbitrator of the contract.\",\"_arbitratorExtraData\":\"Extra data for the arbitrator.\",\"_feeTimeout\":\"Arbitration fee timeout for the parties.\",\"_templateData\":\"The dispute template data.\",\"_templateDataMappings\":\"The dispute template data mappings.\",\"_templateRegistry\":\"The dispute template registry.\"}},\"createTransaction(uint256,address,string,string)\":{\"details\":\"Create a transaction.\",\"params\":{\"_seller\":\"The recipient of the transaction.\",\"_templateData\":\"The dispute template data.\",\"_templateDataMappings\":\"The dispute template data mappings.\",\"_timeoutPayment\":\"Time after which a party can automatically execute the arbitrable transaction.\"},\"returns\":{\"transactionID\":\"The index of the transaction.\"}},\"executeTransaction(uint256)\":{\"details\":\"Transfer the transaction's amount to the seller if the timeout has passed.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}},\"getCountTransactions()\":{\"details\":\"Getter to know the count of transactions.\",\"returns\":{\"_0\":\"The count of transactions.\"}},\"pay(uint256,uint256)\":{\"details\":\"Pay seller. To be called if the good or service is provided.\",\"params\":{\"_amount\":\"Amount to pay in wei.\",\"_transactionID\":\"The index of the transaction.\"}},\"payArbitrationFeeByBuyer(uint256)\":{\"details\":\"Pay the arbitration fee to raise a dispute. To be called by the buyer. Note that the arbitrator can have createDispute throw, which will make this function throw and therefore lead to a party being timed-out. This is not a vulnerability as the arbitrator can rule in favor of one party anyway.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}},\"payArbitrationFeeBySeller(uint256)\":{\"details\":\"Pay the arbitration fee to raise a dispute. To be called by the seller. Note that this function mirrors payArbitrationFeeByBuyer.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}},\"reimburse(uint256,uint256)\":{\"details\":\"Reimburse buyer. To be called if the good or service can't be fully provided.\",\"params\":{\"_amountReimbursed\":\"Amount to reimburse in wei.\",\"_transactionID\":\"The index of the transaction.\"}},\"rule(uint256,uint256)\":{\"details\":\"Give a ruling for a dispute. Must be called by the arbitrator to enforce the final ruling. The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\",\"params\":{\"_disputeID\":\"ID of the dispute in the Arbitrator contract.\",\"_ruling\":\"Ruling given by the arbitrator. Note that 0 is reserved for \\\"Refuse to arbitrate\\\".\"}},\"timeOutByBuyer(uint256)\":{\"details\":\"Reimburse buyer if seller fails to pay the fee.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}},\"timeOutBySeller(uint256)\":{\"details\":\"Pay seller if buyer fails to pay the fee.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}}},\"title\":\"Escrow for a sale paid in ETH and no fees.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/arbitrables/Escrow.sol\":\"Escrow\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/arbitrables/Escrow.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @authors: [@unknownunknown1, @fnanni-0, @shalzz, @jaybuidl]\\n/// @reviewers: []\\n/// @auditors: []\\n/// @bounties: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"../interfaces/IArbitrableV2.sol\\\";\\nimport \\\"../interfaces/IDisputeTemplateRegistry.sol\\\";\\n\\n/// @title Escrow for a sale paid in ETH and no fees.\\n/// @dev MultipleArbitrableTransaction contract that is compatible with V2.\\n/// Adapted from https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTransaction.sol\\ncontract Escrow is IArbitrableV2 {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Party {\\n None,\\n Buyer, // Makes a purchase in ETH.\\n Seller // Provides a good or service in exchange for ETH.\\n }\\n\\n enum Status {\\n NoDispute,\\n WaitingBuyer,\\n WaitingSeller,\\n DisputeCreated,\\n TransactionResolved\\n }\\n\\n enum Resolution {\\n TransactionExecuted,\\n TimeoutByBuyer,\\n TimeoutBySeller,\\n RulingEnforced\\n }\\n\\n struct Transaction {\\n address payable buyer;\\n address payable seller;\\n uint256 amount;\\n uint256 deadline; // Timestamp at which the transaction can be automatically executed if not disputed.\\n uint256 disputeID; // If dispute exists, the ID of the dispute.\\n uint256 buyerFee; // Total fees paid by the buyer.\\n uint256 sellerFee; // Total fees paid by the seller.\\n uint256 lastFeePaymentTime; // Last time the dispute fees were paid by either party.\\n string templateData;\\n string templateDataMappings;\\n Status status;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant AMOUNT_OF_CHOICES = 2;\\n address public immutable governor;\\n IArbitratorV2 public arbitrator; // Address of the arbitrator contract.\\n bytes public arbitratorExtraData; // Extra data to set up the arbitration.\\n IDisputeTemplateRegistry public templateRegistry; // The dispute template registry.\\n uint256 public templateId; // The current dispute template identifier.\\n uint256 public immutable feeTimeout; // Time in seconds a party can take to pay arbitration fees before being considered unresponsive and lose the dispute.\\n Transaction[] public transactions; // List of all created transactions.\\n mapping(uint256 => uint256) public disputeIDtoTransactionID; // Naps dispute ID to tx ID.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n /// @dev To be emitted when a party pays or reimburses the other.\\n /// @param _transactionID The index of the transaction.\\n /// @param _amount The amount paid.\\n /// @param _party The party that paid.\\n event Payment(uint256 indexed _transactionID, uint256 _amount, address _party);\\n\\n /// @dev Indicate that a party has to pay a fee or would otherwise be considered as losing.\\n /// @param _transactionID The index of the transaction.\\n /// @param _party The party who has to pay.\\n event HasToPayFee(uint256 indexed _transactionID, Party _party);\\n\\n /// @dev Emitted when a transaction is created.\\n /// @param _transactionID The index of the transaction.\\n /// @param _buyer The address of the buyer.\\n /// @param _seller The address of the seller.\\n /// @param _amount The initial amount in the transaction.\\n event TransactionCreated(\\n uint256 indexed _transactionID,\\n address indexed _buyer,\\n address indexed _seller,\\n uint256 _amount\\n );\\n\\n /// @dev To be emitted when a transaction is resolved, either by its\\n /// execution, a timeout or because a ruling was enforced.\\n /// @param _transactionID The ID of the respective transaction.\\n /// @param _resolution Short description of what caused the transaction to be solved.\\n event TransactionResolved(uint256 indexed _transactionID, Resolution indexed _resolution);\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator.\\n /// @param _templateData The dispute template data.\\n /// @param _templateDataMappings The dispute template data mappings.\\n /// @param _templateRegistry The dispute template registry.\\n /// @param _feeTimeout Arbitration fee timeout for the parties.\\n constructor(\\n IArbitratorV2 _arbitrator,\\n bytes memory _arbitratorExtraData,\\n string memory _templateData,\\n string memory _templateDataMappings,\\n IDisputeTemplateRegistry _templateRegistry,\\n uint256 _feeTimeout\\n ) {\\n governor = msg.sender;\\n arbitrator = _arbitrator;\\n arbitratorExtraData = _arbitratorExtraData;\\n templateRegistry = _templateRegistry;\\n feeTimeout = _feeTimeout;\\n\\n templateId = templateRegistry.setDisputeTemplate(\\\"\\\", _templateData, _templateDataMappings);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n function changeArbitrator(IArbitratorV2 _arbitrator) external onlyByGovernor {\\n arbitrator = _arbitrator;\\n }\\n\\n function changeArbitratorExtraData(bytes calldata _arbitratorExtraData) external onlyByGovernor {\\n arbitratorExtraData = _arbitratorExtraData;\\n }\\n\\n function changeTemplateRegistry(IDisputeTemplateRegistry _templateRegistry) external onlyByGovernor {\\n templateRegistry = _templateRegistry;\\n }\\n\\n function changeDisputeTemplate(\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external onlyByGovernor {\\n templateId = templateRegistry.setDisputeTemplate(\\\"\\\", _templateData, _templateDataMappings);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Create a transaction.\\n /// @param _timeoutPayment Time after which a party can automatically execute the arbitrable transaction.\\n /// @param _seller The recipient of the transaction.\\n /// @param _templateData The dispute template data.\\n /// @param _templateDataMappings The dispute template data mappings.\\n /// @return transactionID The index of the transaction.\\n function createTransaction(\\n uint256 _timeoutPayment,\\n address payable _seller,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external payable returns (uint256 transactionID) {\\n Transaction storage transaction = transactions.push();\\n transaction.buyer = payable(msg.sender);\\n transaction.seller = _seller;\\n transaction.amount = msg.value;\\n transaction.deadline = block.timestamp + _timeoutPayment;\\n transaction.templateData = _templateData;\\n transaction.templateDataMappings = _templateDataMappings;\\n\\n transactionID = transactions.length - 1;\\n\\n emit TransactionCreated(transactionID, msg.sender, _seller, msg.value);\\n }\\n\\n /// @dev Pay seller. To be called if the good or service is provided.\\n /// @param _transactionID The index of the transaction.\\n /// @param _amount Amount to pay in wei.\\n function pay(uint256 _transactionID, uint256 _amount) external {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.buyer != msg.sender) revert BuyerOnly();\\n if (transaction.status != Status.NoDispute) revert TransactionDisputed();\\n if (_amount > transaction.amount) revert MaximumPaymentAmountExceeded();\\n\\n transaction.seller.send(_amount); // It is the user responsibility to accept ETH.\\n transaction.amount -= _amount;\\n\\n emit Payment(_transactionID, _amount, msg.sender);\\n }\\n\\n /// @dev Reimburse buyer. To be called if the good or service can't be fully provided.\\n /// @param _transactionID The index of the transaction.\\n /// @param _amountReimbursed Amount to reimburse in wei.\\n function reimburse(uint256 _transactionID, uint256 _amountReimbursed) external {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.seller != msg.sender) revert SellerOnly();\\n if (transaction.status != Status.NoDispute) revert TransactionDisputed();\\n if (_amountReimbursed > transaction.amount) revert MaximumPaymentAmountExceeded();\\n\\n transaction.buyer.send(_amountReimbursed); // It is the user responsibility to accept ETH.\\n transaction.amount -= _amountReimbursed;\\n\\n emit Payment(_transactionID, _amountReimbursed, msg.sender);\\n }\\n\\n /// @dev Transfer the transaction's amount to the seller if the timeout has passed.\\n /// @param _transactionID The index of the transaction.\\n function executeTransaction(uint256 _transactionID) external {\\n Transaction storage transaction = transactions[_transactionID];\\n if (block.timestamp < transaction.deadline) revert DeadlineNotPassed();\\n if (transaction.status != Status.NoDispute) revert TransactionDisputed();\\n\\n transaction.seller.send(transaction.amount); // It is the user responsibility to accept ETH.\\n transaction.amount = 0;\\n transaction.status = Status.TransactionResolved;\\n\\n emit TransactionResolved(_transactionID, Resolution.TransactionExecuted);\\n }\\n\\n /// @dev Pay the arbitration fee to raise a dispute. To be called by the buyer.\\n /// Note that the arbitrator can have createDispute throw, which will make\\n /// this function throw and therefore lead to a party being timed-out.\\n /// This is not a vulnerability as the arbitrator can rule in favor of one party anyway.\\n /// @param _transactionID The index of the transaction.\\n function payArbitrationFeeByBuyer(uint256 _transactionID) external payable {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.status >= Status.DisputeCreated) revert DisputeAlreadyCreatedOrTransactionAlreadyExecuted();\\n if (msg.sender != transaction.buyer) revert BuyerOnly();\\n\\n transaction.buyerFee += msg.value;\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);\\n if (transaction.buyerFee < arbitrationCost) revert BuyerFeeNotCoverArbitrationCosts();\\n\\n transaction.lastFeePaymentTime = block.timestamp;\\n\\n if (transaction.sellerFee < arbitrationCost) {\\n // The seller still has to pay. This can also happen if he has paid, but arbitrationCost has increased.\\n transaction.status = Status.WaitingSeller;\\n emit HasToPayFee(_transactionID, Party.Seller);\\n } else {\\n // The seller has also paid the fee. We create the dispute.\\n raiseDispute(_transactionID, arbitrationCost);\\n }\\n }\\n\\n /// @dev Pay the arbitration fee to raise a dispute. To be called by the seller.\\n /// Note that this function mirrors payArbitrationFeeByBuyer.\\n /// @param _transactionID The index of the transaction.\\n function payArbitrationFeeBySeller(uint256 _transactionID) external payable {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.status >= Status.DisputeCreated) revert DisputeAlreadyCreatedOrTransactionAlreadyExecuted();\\n if (msg.sender != transaction.seller) revert SellerOnly();\\n\\n transaction.sellerFee += msg.value;\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);\\n if (transaction.sellerFee < arbitrationCost) revert SellerFeeNotCoverArbitrationCosts();\\n\\n transaction.lastFeePaymentTime = block.timestamp;\\n\\n if (transaction.buyerFee < arbitrationCost) {\\n // The buyer still has to pay. This can also happen if he has paid, but arbitrationCost has increased.\\n transaction.status = Status.WaitingBuyer;\\n emit HasToPayFee(_transactionID, Party.Buyer);\\n } else {\\n // The buyer has also paid the fee. We create the dispute.\\n raiseDispute(_transactionID, arbitrationCost);\\n }\\n }\\n\\n /// @dev Reimburse buyer if seller fails to pay the fee.\\n /// @param _transactionID The index of the transaction.\\n function timeOutByBuyer(uint256 _transactionID) external {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.status != Status.WaitingSeller) revert NotWaitingForSellerFees();\\n if (block.timestamp - transaction.lastFeePaymentTime < feeTimeout) revert TimeoutNotPassed();\\n\\n if (transaction.sellerFee != 0) {\\n transaction.seller.send(transaction.sellerFee); // It is the user responsibility to accept ETH.\\n transaction.sellerFee = 0;\\n }\\n executeRuling(_transactionID, uint256(Party.Buyer));\\n emit TransactionResolved(_transactionID, Resolution.TimeoutByBuyer);\\n }\\n\\n /// @dev Pay seller if buyer fails to pay the fee.\\n /// @param _transactionID The index of the transaction.\\n function timeOutBySeller(uint256 _transactionID) external {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.status != Status.WaitingBuyer) revert NotWaitingForBuyerFees();\\n if (block.timestamp - transaction.lastFeePaymentTime < feeTimeout) revert TimeoutNotPassed();\\n\\n if (transaction.buyerFee != 0) {\\n transaction.buyer.send(transaction.buyerFee); // It is the user responsibility to accept ETH.\\n transaction.buyerFee = 0;\\n }\\n\\n executeRuling(_transactionID, uint256(Party.Seller));\\n emit TransactionResolved(_transactionID, Resolution.TimeoutBySeller);\\n }\\n\\n /// @dev Give a ruling for a dispute. Must be called by the arbitrator to enforce the final ruling.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID ID of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator. Note that 0 is reserved\\n /// for \\\"Refuse to arbitrate\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external override {\\n if (msg.sender != address(arbitrator)) revert ArbitratorOnly();\\n if (_ruling > AMOUNT_OF_CHOICES) revert InvalidRuling();\\n\\n uint256 transactionID = disputeIDtoTransactionID[_disputeID];\\n Transaction storage transaction = transactions[transactionID];\\n if (transaction.status != Status.DisputeCreated) revert DisputeAlreadyResolved();\\n\\n emit Ruling(arbitrator, _disputeID, _ruling);\\n executeRuling(transactionID, _ruling);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Create a dispute.\\n /// @param _transactionID The index of the transaction.\\n /// @param _arbitrationCost Amount to pay the arbitrator.\\n function raiseDispute(uint256 _transactionID, uint256 _arbitrationCost) internal {\\n Transaction storage transaction = transactions[_transactionID];\\n transaction.status = Status.DisputeCreated;\\n transaction.disputeID = arbitrator.createDispute{value: _arbitrationCost}(\\n AMOUNT_OF_CHOICES,\\n arbitratorExtraData\\n );\\n disputeIDtoTransactionID[transaction.disputeID] = _transactionID;\\n emit DisputeRequest(arbitrator, transaction.disputeID, _transactionID, templateId, \\\"\\\");\\n\\n // Refund buyer if he overpaid.\\n if (transaction.buyerFee > _arbitrationCost) {\\n uint256 extraFeeBuyer = transaction.buyerFee - _arbitrationCost;\\n transaction.buyerFee = _arbitrationCost;\\n transaction.buyer.send(extraFeeBuyer); // It is the user responsibility to accept ETH.\\n }\\n\\n // Refund seller if he overpaid.\\n if (transaction.sellerFee > _arbitrationCost) {\\n uint256 extraFeeSeller = transaction.sellerFee - _arbitrationCost;\\n transaction.sellerFee = _arbitrationCost;\\n transaction.seller.send(extraFeeSeller); // It is the user responsibility to accept ETH.\\n }\\n }\\n\\n /// @dev Execute a ruling of a dispute. It reimburses the fee to the winning party.\\n /// @param _transactionID The index of the transaction.\\n /// @param _ruling Ruling given by the arbitrator. 1 : Reimburse the seller. 2 : Pay the buyer.\\n function executeRuling(uint256 _transactionID, uint256 _ruling) internal {\\n Transaction storage transaction = transactions[_transactionID];\\n // Give the arbitration fee back.\\n // Note that we use send to prevent a party from blocking the execution.\\n if (_ruling == uint256(Party.Buyer)) {\\n transaction.buyer.send(transaction.buyerFee + transaction.amount);\\n } else if (_ruling == uint256(Party.Seller)) {\\n transaction.seller.send(transaction.sellerFee + transaction.amount);\\n } else {\\n uint256 splitAmount = (transaction.buyerFee + transaction.amount) / 2;\\n transaction.buyer.send(splitAmount);\\n transaction.seller.send(splitAmount);\\n }\\n\\n transaction.amount = 0;\\n transaction.buyerFee = 0;\\n transaction.sellerFee = 0;\\n transaction.status = Status.TransactionResolved;\\n\\n emit TransactionResolved(_transactionID, Resolution.RulingEnforced);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Getter to know the count of transactions.\\n /// @return The count of transactions.\\n function getCountTransactions() external view returns (uint256) {\\n return transactions.length;\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error BuyerOnly();\\n error SellerOnly();\\n error ArbitratorOnly();\\n error TransactionDisputed();\\n error MaximumPaymentAmountExceeded();\\n error DisputeAlreadyCreatedOrTransactionAlreadyExecuted();\\n error DeadlineNotPassed();\\n error BuyerFeeNotCoverArbitrationCosts();\\n error SellerFeeNotCoverArbitrationCosts();\\n error NotWaitingForSellerFees();\\n error NotWaitingForBuyerFees();\\n error TimeoutNotPassed();\\n error InvalidRuling();\\n error DisputeAlreadyResolved();\\n}\\n\",\"keccak256\":\"0x9fa34c5dca0b60c55a0ab61601f78a38c599b95bb04652cc11aab399431367fe\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeTemplateRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n/// @title IDisputeTemplate\\n/// @notice Dispute Template interface.\\ninterface IDisputeTemplateRegistry {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n /// @param _templateDataMappings The data mappings.\\n event DisputeTemplate(\\n uint256 indexed _templateId,\\n string indexed _templateTag,\\n string _templateData,\\n string _templateDataMappings\\n );\\n\\n function setDisputeTemplate(\\n string memory _templateTag,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external returns (uint256 templateId);\\n}\\n\",\"keccak256\":\"0x88b0038d226532e6cf862a485d162f7bca61ac3d361d6801146b55a240f091ac\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60c06040523480156200001157600080fd5b50604051620022c0380380620022c083398101604081905262000034916200020d565b33608052600080546001600160a01b0319166001600160a01b038816179055600162000061868262000376565b50600280546001600160a01b0319166001600160a01b03841690811790915560a08290526040516312a6505d60e21b8152634a99417490620000aa908790879060040162000470565b6020604051808303816000875af1158015620000ca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000f09190620004b0565b60035550620004ca945050505050565b6001600160a01b03811681146200011657600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200014c57818101518382015260200162000132565b50506000910152565b60006001600160401b038084111562000172576200017262000119565b604051601f8501601f19908116603f011681019082821181831017156200019d576200019d62000119565b81604052809350858152868686011115620001b757600080fd5b620001c78660208301876200012f565b5050509392505050565b600082601f830112620001e357600080fd5b620001f48383516020850162000155565b9392505050565b8051620002088162000100565b919050565b60008060008060008060c087890312156200022757600080fd5b8651620002348162000100565b60208801519096506001600160401b03808211156200025257600080fd5b818901915089601f8301126200026757600080fd5b620002788a83516020850162000155565b965060408901519150808211156200028f57600080fd5b6200029d8a838b01620001d1565b95506060890151915080821115620002b457600080fd5b50620002c389828a01620001d1565b935050620002d460808801620001fb565b915060a087015190509295509295509295565b600181811c90821680620002fc57607f821691505b6020821081036200031d57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200037157600081815260208120601f850160051c810160208610156200034c5750805b601f850160051c820191505b818110156200036d5782815560010162000358565b5050505b505050565b81516001600160401b0381111562000392576200039262000119565b620003aa81620003a38454620002e7565b8462000323565b602080601f831160018114620003e25760008415620003c95750858301515b600019600386901b1c1916600185901b1785556200036d565b600085815260208120601f198616915b828110156200041357888601518255948401946001909101908401620003f2565b5085821015620004325787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600081518084526200045c8160208601602086016200012f565b601f01601f19169290920160200192915050565b606081526000606082015260806020820152600062000493608083018562000442565b8281036040840152620004a7818562000442565b95945050505050565b600060208284031215620004c357600080fd5b5051919050565b60805160a051611da66200051a60003960008181610364015281816105490152610f16015260008181610157015281816108d201528181610abd01528181610cb501526111be0152611da66000f3fe6080604052600436106101405760003560e01c80637aa77f29116100b6578063d1e41b5d1161006f578063d1e41b5d146103a6578063e77d0bd3146103b9578063ee22610b146103d9578063ef48eee6146103f9578063fc548f0814610419578063fe43a9921461043957600080fd5b80637aa77f29146102d05780639ace38c2146102e6578063a0af81f01461031d578063a527aa6a1461033d578063b329036b14610352578063c5d552881461038657600080fd5b80632fbe3b03116101085780632fbe3b0314610210578063311a6c561461023d57806334e2672d1461025d5780633bf547241461027d5780634660ebbe146102905780636cc6cde1146102b057600080fd5b80630c340a24146101455780630c7ac7b6146101965780631bd1823a146101b85780632be6d005146101da5780632e0b6422146101ed575b600080fd5b34801561015157600080fd5b506101797f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101a257600080fd5b506101ab610459565b60405161018d919061169b565b3480156101c457600080fd5b506101d86101d33660046116b5565b6104e7565b005b6101d86101e83660046116b5565b610612565b3480156101f957600080fd5b50610202600281565b60405190815260200161018d565b34801561021c57600080fd5b5061020261022b3660046116b5565b60056020526000908152604090205481565b34801561024957600080fd5b506101d86102583660046116ce565b6107c0565b34801561026957600080fd5b506101d86102783660046116f0565b6108d0565b6101d861028b3660046116b5565b610926565b34801561029c57600080fd5b506101d86102ab36600461177a565b610abb565b3480156102bc57600080fd5b50600054610179906001600160a01b031681565b3480156102dc57600080fd5b5061020260035481565b3480156102f257600080fd5b506103066103013660046116b5565b610b26565b60405161018d9b9a999897969594939291906117ad565b34801561032957600080fd5b50600254610179906001600160a01b031681565b34801561034957600080fd5b50600454610202565b34801561035e57600080fd5b506102027f000000000000000000000000000000000000000000000000000000000000000081565b34801561039257600080fd5b506101d86103a13660046118e0565b610cb3565b6102026103b4366004611944565b610d78565b3480156103c557600080fd5b506101d86103d43660046116b5565b610eb4565b3480156103e557600080fd5b506101d86103f43660046116b5565b610fb7565b34801561040557600080fd5b506101d86104143660046116ce565b611088565b34801561042557600080fd5b506101d861043436600461177a565b6111bc565b34801561044557600080fd5b506101d86104543660046116ce565b611227565b60018054610466906119c4565b80601f0160208091040260200160405190810160405280929190818152602001828054610492906119c4565b80156104df5780601f106104b4576101008083540402835291602001916104df565b820191906000526020600020905b8154815290600101906020018083116104c257829003601f168201915b505050505081565b6000600482815481106104fc576104fc6119fe565b60009182526020909120600b9091020190506001600a82015460ff16600481111561052957610529611797565b1461054757604051635ed7670b60e11b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000008160070154426105789190611a2a565b101561059757604051634799187b60e01b815260040160405180910390fd5b6005810154156105d557805460058201546040516001600160a01b039092169181156108fc0291906000818181858888f15050600060058501555050505b6105e0826002611318565b60025b60405183907f89e6168584e1de3ec704ff46376271b5481b0d9b2b0ef0ae102f0d001093e00090600090a35050565b600060048281548110610627576106276119fe565b60009182526020909120600b9091020190506003600a82015460ff16600481111561065457610654611797565b106106725760405163df44e9d960e01b815260040160405180910390fd5b80546001600160a01b0316331461069c5760405163e2bc376b60e01b815260040160405180910390fd5b348160050160008282546106b09190611a43565b90915550506000805460405163f7434ea960e01b81526001600160a01b039091169063f7434ea9906106e790600190600401611ad3565b602060405180830381865afa158015610704573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107289190611ae6565b9050808260050154101561074f57604051631a48f3db60e11b815260040160405180910390fd5b42600783015560068201548111156107b157600a8201805460ff1916600290811790915560405184917fc74b9f7dedf2887cd3c113b6d8da9cea19e55c1116e25f1f0e1b72d7543179b5916107a49190611aff565b60405180910390a2505050565b6107bb8382611488565b505050565b6000546001600160a01b031633146107eb57604051630955f84760e31b815260040160405180910390fd5b600281111561080d576040516309efd47960e41b815260040160405180910390fd5b6000828152600560205260408120546004805491929183908110610833576108336119fe565b60009182526020909120600b9091020190506003600a82015460ff16600481111561086057610860611797565b1461087e5760405163f10068b560e01b815260040160405180910390fd5b60005460405184815285916001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a36108ca8284611318565b50505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633146109195760405163c383977560e01b815260040160405180910390fd5b60016107bb828483611b7c565b60006004828154811061093b5761093b6119fe565b60009182526020909120600b9091020190506003600a82015460ff16600481111561096857610968611797565b106109865760405163df44e9d960e01b815260040160405180910390fd5b60018101546001600160a01b031633146109b357604051635800797f60e11b815260040160405180910390fd5b348160060160008282546109c79190611a43565b90915550506000805460405163f7434ea960e01b81526001600160a01b039091169063f7434ea9906109fe90600190600401611ad3565b602060405180830381865afa158015610a1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3f9190611ae6565b90508082600601541015610a665760405163818d938f60e01b815260040160405180910390fd5b42600783015560058201548111156107b157600a8201805460ff1916600190811790915560405184917fc74b9f7dedf2887cd3c113b6d8da9cea19e55c1116e25f1f0e1b72d7543179b5916107a49190611aff565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163314610b045760405163c383977560e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60048181548110610b3657600080fd5b60009182526020909120600b90910201805460018201546002830154600384015460048501546005860154600687015460078801546008890180546001600160a01b03998a169b50989097169895979496939592949193909291610b99906119c4565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc5906119c4565b8015610c125780601f10610be757610100808354040283529160200191610c12565b820191906000526020600020905b815481529060010190602001808311610bf557829003601f168201915b505050505090806009018054610c27906119c4565b80601f0160208091040260200160405190810160405280929190818152602001828054610c53906119c4565b8015610ca05780601f10610c7557610100808354040283529160200191610ca0565b820191906000526020600020905b815481529060010190602001808311610c8357829003601f168201915b505050600a909301549192505060ff168b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163314610cfc5760405163c383977560e01b815260040160405180910390fd5b6002546040516312a6505d60e21b81526001600160a01b0390911690634a99417490610d2e9085908590600401611c37565b6020604051808303816000875af1158015610d4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d719190611ae6565b6003555050565b600480546001810182556000918252600b027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b810180546001600160a01b0319908116331782557f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c830180546001600160a01b0389169216919091179055347f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d90920191909155610e298642611a43565b600382015560088101610e3c8582611c73565b5060098101610e4b8482611c73565b50600454610e5b90600190611a2a565b9150846001600160a01b0316336001600160a01b0316837fe9097a4f4eddc0e5906640fcd9e1193c9db52771536ca4c8b06ab4c40aa045d234604051610ea391815260200190565b60405180910390a450949350505050565b600060048281548110610ec957610ec96119fe565b60009182526020909120600b9091020190506002600a82015460ff166004811115610ef657610ef6611797565b14610f1457604051638225aba560e01b815260040160405180910390fd5b7f0000000000000000000000000000000000000000000000000000000000000000816007015442610f459190611a2a565b1015610f6457604051634799187b60e01b815260040160405180910390fd5b600681015415610fa557600181015460068201546040516001600160a01b039092169181156108fc0291906000818181858888f15050600060068501555050505b610fb0826001611318565b60016105e3565b600060048281548110610fcc57610fcc6119fe565b90600052602060002090600b020190508060030154421015611001576040516302eb354360e41b815260040160405180910390fd5b6000600a82015460ff16600481111561101c5761101c611797565b1461103a57604051634e22597f60e11b815260040160405180910390fd5b600181015460028201546040516001600160a01b039092169181156108fc0291906000818181858888f15050600060028501819055600a8501805460ff1916600417905592506105e3915050565b60006004838154811061109d5761109d6119fe565b60009182526020909120600b9091020180549091506001600160a01b031633146110da5760405163e2bc376b60e01b815260040160405180910390fd5b6000600a82015460ff1660048111156110f5576110f5611797565b1461111357604051634e22597f60e11b815260040160405180910390fd5b8060020154821115611138576040516305aafecf60e01b815260040160405180910390fd5b60018101546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050818160020160008282546111789190611a2a565b90915550506040805183815233602082015284917fd1432ca9a38d944f01b256a411861b109bc4bfe200c40d7144e919a16b86a8a8910160405180910390a2505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633146112055760405163c383977560e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006004838154811061123c5761123c6119fe565b600091825260209091206001600b90920201908101549091506001600160a01b0316331461127d57604051635800797f60e11b815260040160405180910390fd5b6000600a82015460ff16600481111561129857611298611797565b146112b657604051634e22597f60e11b815260040160405180910390fd5b80600201548211156112db576040516305aafecf60e01b815260040160405180910390fd5b80546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050818160020160008282546111789190611a2a565b60006004838154811061132d5761132d6119fe565b60009182526020909120600b90910201905060018203611389578054600282015460058301546001600160a01b03909216916108fc9161136c91611a43565b6040518115909202916000818181858888f1935050505050611431565b600282036113b9576001810154600282015460068301546001600160a01b03909216916108fc9161136c91611a43565b60006002826002015483600501546113d19190611a43565b6113db9190611d2d565b82546040519192506001600160a01b03169082156108fc029083906000818181858888f150505060018401546040516001600160a01b03909116925083156108fc02915083906000818181858888f15050505050505b6000600282018190556005820181905560068201819055600a8201805460ff1916600417905560405160039185917f89e6168584e1de3ec704ff46376271b5481b0d9b2b0ef0ae102f0d001093e0009190a3505050565b60006004838154811061149d5761149d6119fe565b600091825260208220600a600b90920201908101805460ff19166003179055905460405163c13517e160e01b81529192506001600160a01b03169063c13517e19084906114f290600290600190600401611d4f565b60206040518083038185885af1158015611510573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115359190611ae6565b600482018181556000918252600560205260408083208690559054915460035491516001600160a01b03909116917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186916115a691888252602082015260606040820181905260009082015260800190565b60405180910390a381816005015411156115fe5760008282600501546115cc9190611a2a565b6005830184905582546040519192506001600160a01b03169082156108fc029083906000818181858888f15050505050505b81816006015411156107bb57600082826006015461161c9190611a2a565b6006830184905560018301546040519192506001600160a01b03169082156108fc029083906000818181858888f1505050505050505050565b6000815180845260005b8181101561167b5760208185018101518683018201520161165f565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006116ae6020830184611655565b9392505050565b6000602082840312156116c757600080fd5b5035919050565b600080604083850312156116e157600080fd5b50508035926020909101359150565b6000806020838503121561170357600080fd5b823567ffffffffffffffff8082111561171b57600080fd5b818501915085601f83011261172f57600080fd5b81358181111561173e57600080fd5b86602082850101111561175057600080fd5b60209290920196919550909350505050565b6001600160a01b038116811461177757600080fd5b50565b60006020828403121561178c57600080fd5b81356116ae81611762565b634e487b7160e01b600052602160045260246000fd5b600061016060018060a01b03808f168452808e166020850152508b60408401528a60608401528960808401528860a08401528760c08401528660e0840152806101008401526117fe81840187611655565b90508281036101208401526118138186611655565b9150506005831061182657611826611797565b826101408301529c9b505050505050505050505050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261186457600080fd5b813567ffffffffffffffff8082111561187f5761187f61183d565b604051601f8301601f19908116603f011681019082821181831017156118a7576118a761183d565b816040528381528660208588010111156118c057600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080604083850312156118f357600080fd5b823567ffffffffffffffff8082111561190b57600080fd5b61191786838701611853565b9350602085013591508082111561192d57600080fd5b5061193a85828601611853565b9150509250929050565b6000806000806080858703121561195a57600080fd5b84359350602085013561196c81611762565b9250604085013567ffffffffffffffff8082111561198957600080fd5b61199588838901611853565b935060608701359150808211156119ab57600080fd5b506119b887828801611853565b91505092959194509250565b600181811c908216806119d857607f821691505b6020821081036119f857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115611a3d57611a3d611a14565b92915050565b80820180821115611a3d57611a3d611a14565b60008154611a63816119c4565b808552602060018381168015611a805760018114611a9a57611ac8565b60ff1985168884015283151560051b880183019550611ac8565b866000528260002060005b85811015611ac05781548a8201860152908301908401611aa5565b890184019650505b505050505092915050565b6020815260006116ae6020830184611a56565b600060208284031215611af857600080fd5b5051919050565b6020810160038310611b1357611b13611797565b91905290565b601f8211156107bb57600081815260208120601f850160051c81016020861015611b405750805b601f850160051c820191505b81811015611b5f57828155600101611b4c565b505050505050565b600019600383901b1c191660019190911b1790565b67ffffffffffffffff831115611b9457611b9461183d565b611ba883611ba283546119c4565b83611b19565b6000601f841160018114611bd65760008515611bc45750838201355b611bce8682611b67565b845550611c30565b600083815260209020601f19861690835b82811015611c075786850135825560209485019460019092019101611be7565b5086821015611c245760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b6060815260006060820152608060208201526000611c586080830185611655565b8281036040840152611c6a8185611655565b95945050505050565b815167ffffffffffffffff811115611c8d57611c8d61183d565b611ca181611c9b84546119c4565b84611b19565b602080601f831160018114611cd05760008415611cbe5750858301515b611cc88582611b67565b865550611b5f565b600085815260208120601f198616915b82811015611cff57888601518255948401946001909101908401611ce0565b5085821015611d1d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082611d4a57634e487b7160e01b600052601260045260246000fd5b500490565b828152604060208201526000611d686040830184611a56565b94935050505056fea264697066735822122005b0699f8f6e4a5a2b7331292d34d72ef79a72fae2d7ed4c1c12fe8da221be2b64736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106101405760003560e01c80637aa77f29116100b6578063d1e41b5d1161006f578063d1e41b5d146103a6578063e77d0bd3146103b9578063ee22610b146103d9578063ef48eee6146103f9578063fc548f0814610419578063fe43a9921461043957600080fd5b80637aa77f29146102d05780639ace38c2146102e6578063a0af81f01461031d578063a527aa6a1461033d578063b329036b14610352578063c5d552881461038657600080fd5b80632fbe3b03116101085780632fbe3b0314610210578063311a6c561461023d57806334e2672d1461025d5780633bf547241461027d5780634660ebbe146102905780636cc6cde1146102b057600080fd5b80630c340a24146101455780630c7ac7b6146101965780631bd1823a146101b85780632be6d005146101da5780632e0b6422146101ed575b600080fd5b34801561015157600080fd5b506101797f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101a257600080fd5b506101ab610459565b60405161018d919061169b565b3480156101c457600080fd5b506101d86101d33660046116b5565b6104e7565b005b6101d86101e83660046116b5565b610612565b3480156101f957600080fd5b50610202600281565b60405190815260200161018d565b34801561021c57600080fd5b5061020261022b3660046116b5565b60056020526000908152604090205481565b34801561024957600080fd5b506101d86102583660046116ce565b6107c0565b34801561026957600080fd5b506101d86102783660046116f0565b6108d0565b6101d861028b3660046116b5565b610926565b34801561029c57600080fd5b506101d86102ab36600461177a565b610abb565b3480156102bc57600080fd5b50600054610179906001600160a01b031681565b3480156102dc57600080fd5b5061020260035481565b3480156102f257600080fd5b506103066103013660046116b5565b610b26565b60405161018d9b9a999897969594939291906117ad565b34801561032957600080fd5b50600254610179906001600160a01b031681565b34801561034957600080fd5b50600454610202565b34801561035e57600080fd5b506102027f000000000000000000000000000000000000000000000000000000000000000081565b34801561039257600080fd5b506101d86103a13660046118e0565b610cb3565b6102026103b4366004611944565b610d78565b3480156103c557600080fd5b506101d86103d43660046116b5565b610eb4565b3480156103e557600080fd5b506101d86103f43660046116b5565b610fb7565b34801561040557600080fd5b506101d86104143660046116ce565b611088565b34801561042557600080fd5b506101d861043436600461177a565b6111bc565b34801561044557600080fd5b506101d86104543660046116ce565b611227565b60018054610466906119c4565b80601f0160208091040260200160405190810160405280929190818152602001828054610492906119c4565b80156104df5780601f106104b4576101008083540402835291602001916104df565b820191906000526020600020905b8154815290600101906020018083116104c257829003601f168201915b505050505081565b6000600482815481106104fc576104fc6119fe565b60009182526020909120600b9091020190506001600a82015460ff16600481111561052957610529611797565b1461054757604051635ed7670b60e11b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000008160070154426105789190611a2a565b101561059757604051634799187b60e01b815260040160405180910390fd5b6005810154156105d557805460058201546040516001600160a01b039092169181156108fc0291906000818181858888f15050600060058501555050505b6105e0826002611318565b60025b60405183907f89e6168584e1de3ec704ff46376271b5481b0d9b2b0ef0ae102f0d001093e00090600090a35050565b600060048281548110610627576106276119fe565b60009182526020909120600b9091020190506003600a82015460ff16600481111561065457610654611797565b106106725760405163df44e9d960e01b815260040160405180910390fd5b80546001600160a01b0316331461069c5760405163e2bc376b60e01b815260040160405180910390fd5b348160050160008282546106b09190611a43565b90915550506000805460405163f7434ea960e01b81526001600160a01b039091169063f7434ea9906106e790600190600401611ad3565b602060405180830381865afa158015610704573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107289190611ae6565b9050808260050154101561074f57604051631a48f3db60e11b815260040160405180910390fd5b42600783015560068201548111156107b157600a8201805460ff1916600290811790915560405184917fc74b9f7dedf2887cd3c113b6d8da9cea19e55c1116e25f1f0e1b72d7543179b5916107a49190611aff565b60405180910390a2505050565b6107bb8382611488565b505050565b6000546001600160a01b031633146107eb57604051630955f84760e31b815260040160405180910390fd5b600281111561080d576040516309efd47960e41b815260040160405180910390fd5b6000828152600560205260408120546004805491929183908110610833576108336119fe565b60009182526020909120600b9091020190506003600a82015460ff16600481111561086057610860611797565b1461087e5760405163f10068b560e01b815260040160405180910390fd5b60005460405184815285916001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a36108ca8284611318565b50505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633146109195760405163c383977560e01b815260040160405180910390fd5b60016107bb828483611b7c565b60006004828154811061093b5761093b6119fe565b60009182526020909120600b9091020190506003600a82015460ff16600481111561096857610968611797565b106109865760405163df44e9d960e01b815260040160405180910390fd5b60018101546001600160a01b031633146109b357604051635800797f60e11b815260040160405180910390fd5b348160060160008282546109c79190611a43565b90915550506000805460405163f7434ea960e01b81526001600160a01b039091169063f7434ea9906109fe90600190600401611ad3565b602060405180830381865afa158015610a1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3f9190611ae6565b90508082600601541015610a665760405163818d938f60e01b815260040160405180910390fd5b42600783015560058201548111156107b157600a8201805460ff1916600190811790915560405184917fc74b9f7dedf2887cd3c113b6d8da9cea19e55c1116e25f1f0e1b72d7543179b5916107a49190611aff565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163314610b045760405163c383977560e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60048181548110610b3657600080fd5b60009182526020909120600b90910201805460018201546002830154600384015460048501546005860154600687015460078801546008890180546001600160a01b03998a169b50989097169895979496939592949193909291610b99906119c4565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc5906119c4565b8015610c125780601f10610be757610100808354040283529160200191610c12565b820191906000526020600020905b815481529060010190602001808311610bf557829003601f168201915b505050505090806009018054610c27906119c4565b80601f0160208091040260200160405190810160405280929190818152602001828054610c53906119c4565b8015610ca05780601f10610c7557610100808354040283529160200191610ca0565b820191906000526020600020905b815481529060010190602001808311610c8357829003601f168201915b505050600a909301549192505060ff168b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163314610cfc5760405163c383977560e01b815260040160405180910390fd5b6002546040516312a6505d60e21b81526001600160a01b0390911690634a99417490610d2e9085908590600401611c37565b6020604051808303816000875af1158015610d4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d719190611ae6565b6003555050565b600480546001810182556000918252600b027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b810180546001600160a01b0319908116331782557f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c830180546001600160a01b0389169216919091179055347f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d90920191909155610e298642611a43565b600382015560088101610e3c8582611c73565b5060098101610e4b8482611c73565b50600454610e5b90600190611a2a565b9150846001600160a01b0316336001600160a01b0316837fe9097a4f4eddc0e5906640fcd9e1193c9db52771536ca4c8b06ab4c40aa045d234604051610ea391815260200190565b60405180910390a450949350505050565b600060048281548110610ec957610ec96119fe565b60009182526020909120600b9091020190506002600a82015460ff166004811115610ef657610ef6611797565b14610f1457604051638225aba560e01b815260040160405180910390fd5b7f0000000000000000000000000000000000000000000000000000000000000000816007015442610f459190611a2a565b1015610f6457604051634799187b60e01b815260040160405180910390fd5b600681015415610fa557600181015460068201546040516001600160a01b039092169181156108fc0291906000818181858888f15050600060068501555050505b610fb0826001611318565b60016105e3565b600060048281548110610fcc57610fcc6119fe565b90600052602060002090600b020190508060030154421015611001576040516302eb354360e41b815260040160405180910390fd5b6000600a82015460ff16600481111561101c5761101c611797565b1461103a57604051634e22597f60e11b815260040160405180910390fd5b600181015460028201546040516001600160a01b039092169181156108fc0291906000818181858888f15050600060028501819055600a8501805460ff1916600417905592506105e3915050565b60006004838154811061109d5761109d6119fe565b60009182526020909120600b9091020180549091506001600160a01b031633146110da5760405163e2bc376b60e01b815260040160405180910390fd5b6000600a82015460ff1660048111156110f5576110f5611797565b1461111357604051634e22597f60e11b815260040160405180910390fd5b8060020154821115611138576040516305aafecf60e01b815260040160405180910390fd5b60018101546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050818160020160008282546111789190611a2a565b90915550506040805183815233602082015284917fd1432ca9a38d944f01b256a411861b109bc4bfe200c40d7144e919a16b86a8a8910160405180910390a2505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633146112055760405163c383977560e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006004838154811061123c5761123c6119fe565b600091825260209091206001600b90920201908101549091506001600160a01b0316331461127d57604051635800797f60e11b815260040160405180910390fd5b6000600a82015460ff16600481111561129857611298611797565b146112b657604051634e22597f60e11b815260040160405180910390fd5b80600201548211156112db576040516305aafecf60e01b815260040160405180910390fd5b80546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050818160020160008282546111789190611a2a565b60006004838154811061132d5761132d6119fe565b60009182526020909120600b90910201905060018203611389578054600282015460058301546001600160a01b03909216916108fc9161136c91611a43565b6040518115909202916000818181858888f1935050505050611431565b600282036113b9576001810154600282015460068301546001600160a01b03909216916108fc9161136c91611a43565b60006002826002015483600501546113d19190611a43565b6113db9190611d2d565b82546040519192506001600160a01b03169082156108fc029083906000818181858888f150505060018401546040516001600160a01b03909116925083156108fc02915083906000818181858888f15050505050505b6000600282018190556005820181905560068201819055600a8201805460ff1916600417905560405160039185917f89e6168584e1de3ec704ff46376271b5481b0d9b2b0ef0ae102f0d001093e0009190a3505050565b60006004838154811061149d5761149d6119fe565b600091825260208220600a600b90920201908101805460ff19166003179055905460405163c13517e160e01b81529192506001600160a01b03169063c13517e19084906114f290600290600190600401611d4f565b60206040518083038185885af1158015611510573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115359190611ae6565b600482018181556000918252600560205260408083208690559054915460035491516001600160a01b03909116917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186916115a691888252602082015260606040820181905260009082015260800190565b60405180910390a381816005015411156115fe5760008282600501546115cc9190611a2a565b6005830184905582546040519192506001600160a01b03169082156108fc029083906000818181858888f15050505050505b81816006015411156107bb57600082826006015461161c9190611a2a565b6006830184905560018301546040519192506001600160a01b03169082156108fc029083906000818181858888f1505050505050505050565b6000815180845260005b8181101561167b5760208185018101518683018201520161165f565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006116ae6020830184611655565b9392505050565b6000602082840312156116c757600080fd5b5035919050565b600080604083850312156116e157600080fd5b50508035926020909101359150565b6000806020838503121561170357600080fd5b823567ffffffffffffffff8082111561171b57600080fd5b818501915085601f83011261172f57600080fd5b81358181111561173e57600080fd5b86602082850101111561175057600080fd5b60209290920196919550909350505050565b6001600160a01b038116811461177757600080fd5b50565b60006020828403121561178c57600080fd5b81356116ae81611762565b634e487b7160e01b600052602160045260246000fd5b600061016060018060a01b03808f168452808e166020850152508b60408401528a60608401528960808401528860a08401528760c08401528660e0840152806101008401526117fe81840187611655565b90508281036101208401526118138186611655565b9150506005831061182657611826611797565b826101408301529c9b505050505050505050505050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261186457600080fd5b813567ffffffffffffffff8082111561187f5761187f61183d565b604051601f8301601f19908116603f011681019082821181831017156118a7576118a761183d565b816040528381528660208588010111156118c057600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080604083850312156118f357600080fd5b823567ffffffffffffffff8082111561190b57600080fd5b61191786838701611853565b9350602085013591508082111561192d57600080fd5b5061193a85828601611853565b9150509250929050565b6000806000806080858703121561195a57600080fd5b84359350602085013561196c81611762565b9250604085013567ffffffffffffffff8082111561198957600080fd5b61199588838901611853565b935060608701359150808211156119ab57600080fd5b506119b887828801611853565b91505092959194509250565b600181811c908216806119d857607f821691505b6020821081036119f857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115611a3d57611a3d611a14565b92915050565b80820180821115611a3d57611a3d611a14565b60008154611a63816119c4565b808552602060018381168015611a805760018114611a9a57611ac8565b60ff1985168884015283151560051b880183019550611ac8565b866000528260002060005b85811015611ac05781548a8201860152908301908401611aa5565b890184019650505b505050505092915050565b6020815260006116ae6020830184611a56565b600060208284031215611af857600080fd5b5051919050565b6020810160038310611b1357611b13611797565b91905290565b601f8211156107bb57600081815260208120601f850160051c81016020861015611b405750805b601f850160051c820191505b81811015611b5f57828155600101611b4c565b505050505050565b600019600383901b1c191660019190911b1790565b67ffffffffffffffff831115611b9457611b9461183d565b611ba883611ba283546119c4565b83611b19565b6000601f841160018114611bd65760008515611bc45750838201355b611bce8682611b67565b845550611c30565b600083815260209020601f19861690835b82811015611c075786850135825560209485019460019092019101611be7565b5086821015611c245760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b6060815260006060820152608060208201526000611c586080830185611655565b8281036040840152611c6a8185611655565b95945050505050565b815167ffffffffffffffff811115611c8d57611c8d61183d565b611ca181611c9b84546119c4565b84611b19565b602080601f831160018114611cd05760008415611cbe5750858301515b611cc88582611b67565b865550611b5f565b600085815260208120601f198616915b82811015611cff57888601518255948401946001909101908401611ce0565b5085821015611d1d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082611d4a57634e487b7160e01b600052601260045260246000fd5b500490565b828152604060208201526000611d686040830184611a56565b94935050505056fea264697066735822122005b0699f8f6e4a5a2b7331292d34d72ef79a72fae2d7ed4c1c12fe8da221be2b64736f6c63430008120033", + "devdoc": { + "details": "MultipleArbitrableTransaction contract that is compatible with V2. Adapted from https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTransaction.sol", + "events": { + "DisputeRequest(address,uint256,uint256,uint256,string)": { + "details": "To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.", + "params": { + "_arbitrableDisputeID": "The identifier of the dispute in the Arbitrable contract.", + "_arbitrator": "The arbitrator of the contract.", + "_externalDisputeID": "An identifier created outside Kleros by the protocol requesting arbitration.", + "_templateId": "The identifier of the dispute template. Should not be used with _templateUri.", + "_templateUri": "The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId." + } + }, + "HasToPayFee(uint256,uint8)": { + "details": "Indicate that a party has to pay a fee or would otherwise be considered as losing.", + "params": { + "_party": "The party who has to pay.", + "_transactionID": "The index of the transaction." + } + }, + "Payment(uint256,uint256,address)": { + "details": "To be emitted when a party pays or reimburses the other.", + "params": { + "_amount": "The amount paid.", + "_party": "The party that paid.", + "_transactionID": "The index of the transaction." + } + }, + "Ruling(address,uint256,uint256)": { + "details": "To be raised when a ruling is given.", + "params": { + "_arbitrator": "The arbitrator giving the ruling.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract.", + "_ruling": "The ruling which was given." + } + }, + "TransactionCreated(uint256,address,address,uint256)": { + "details": "Emitted when a transaction is created.", + "params": { + "_amount": "The initial amount in the transaction.", + "_buyer": "The address of the buyer.", + "_seller": "The address of the seller.", + "_transactionID": "The index of the transaction." + } + }, + "TransactionResolved(uint256,uint8)": { + "details": "To be emitted when a transaction is resolved, either by its execution, a timeout or because a ruling was enforced.", + "params": { + "_resolution": "Short description of what caused the transaction to be solved.", + "_transactionID": "The ID of the respective transaction." + } + } + }, + "kind": "dev", + "methods": { + "constructor": { + "details": "Constructor.", + "params": { + "_arbitrator": "The arbitrator of the contract.", + "_arbitratorExtraData": "Extra data for the arbitrator.", + "_feeTimeout": "Arbitration fee timeout for the parties.", + "_templateData": "The dispute template data.", + "_templateDataMappings": "The dispute template data mappings.", + "_templateRegistry": "The dispute template registry." + } + }, + "createTransaction(uint256,address,string,string)": { + "details": "Create a transaction.", + "params": { + "_seller": "The recipient of the transaction.", + "_templateData": "The dispute template data.", + "_templateDataMappings": "The dispute template data mappings.", + "_timeoutPayment": "Time after which a party can automatically execute the arbitrable transaction." + }, + "returns": { + "transactionID": "The index of the transaction." + } + }, + "executeTransaction(uint256)": { + "details": "Transfer the transaction's amount to the seller if the timeout has passed.", + "params": { + "_transactionID": "The index of the transaction." + } + }, + "getCountTransactions()": { + "details": "Getter to know the count of transactions.", + "returns": { + "_0": "The count of transactions." + } + }, + "pay(uint256,uint256)": { + "details": "Pay seller. To be called if the good or service is provided.", + "params": { + "_amount": "Amount to pay in wei.", + "_transactionID": "The index of the transaction." + } + }, + "payArbitrationFeeByBuyer(uint256)": { + "details": "Pay the arbitration fee to raise a dispute. To be called by the buyer. Note that the arbitrator can have createDispute throw, which will make this function throw and therefore lead to a party being timed-out. This is not a vulnerability as the arbitrator can rule in favor of one party anyway.", + "params": { + "_transactionID": "The index of the transaction." + } + }, + "payArbitrationFeeBySeller(uint256)": { + "details": "Pay the arbitration fee to raise a dispute. To be called by the seller. Note that this function mirrors payArbitrationFeeByBuyer.", + "params": { + "_transactionID": "The index of the transaction." + } + }, + "reimburse(uint256,uint256)": { + "details": "Reimburse buyer. To be called if the good or service can't be fully provided.", + "params": { + "_amountReimbursed": "Amount to reimburse in wei.", + "_transactionID": "The index of the transaction." + } + }, + "rule(uint256,uint256)": { + "details": "Give a ruling for a dispute. Must be called by the arbitrator to enforce the final ruling. The purpose of this function is to ensure that the address calling it has the right to rule on the contract.", + "params": { + "_disputeID": "ID of the dispute in the Arbitrator contract.", + "_ruling": "Ruling given by the arbitrator. Note that 0 is reserved for \"Refuse to arbitrate\"." + } + }, + "timeOutByBuyer(uint256)": { + "details": "Reimburse buyer if seller fails to pay the fee.", + "params": { + "_transactionID": "The index of the transaction." + } + }, + "timeOutBySeller(uint256)": { + "details": "Pay seller if buyer fails to pay the fee.", + "params": { + "_transactionID": "The index of the transaction." + } + } + }, + "title": "Escrow for a sale paid in ETH and no fees.", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 10600, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "arbitrator", + "offset": 0, + "slot": "0", + "type": "t_contract(IArbitratorV2)17049" + }, + { + "astId": 10602, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "arbitratorExtraData", + "offset": 0, + "slot": "1", + "type": "t_bytes_storage" + }, + { + "astId": 10605, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "templateRegistry", + "offset": 0, + "slot": "2", + "type": "t_contract(IDisputeTemplateRegistry)17216" + }, + { + "astId": 10607, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "templateId", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 10613, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "transactions", + "offset": 0, + "slot": "4", + "type": "t_array(t_struct(Transaction)10592_storage)dyn_storage" + }, + { + "astId": 10617, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "disputeIDtoTransactionID", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_uint256,t_uint256)" + } + ], + "types": { + "t_address_payable": { + "encoding": "inplace", + "label": "address payable", + "numberOfBytes": "20" + }, + "t_array(t_struct(Transaction)10592_storage)dyn_storage": { + "base": "t_struct(Transaction)10592_storage", + "encoding": "dynamic_array", + "label": "struct Escrow.Transaction[]", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(IArbitratorV2)17049": { + "encoding": "inplace", + "label": "contract IArbitratorV2", + "numberOfBytes": "20" + }, + "t_contract(IDisputeTemplateRegistry)17216": { + "encoding": "inplace", + "label": "contract IDisputeTemplateRegistry", + "numberOfBytes": "20" + }, + "t_enum(Status)10563": { + "encoding": "inplace", + "label": "enum Escrow.Status", + "numberOfBytes": "1" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Transaction)10592_storage": { + "encoding": "inplace", + "label": "struct Escrow.Transaction", + "members": [ + { + "astId": 10570, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "buyer", + "offset": 0, + "slot": "0", + "type": "t_address_payable" + }, + { + "astId": 10572, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "seller", + "offset": 0, + "slot": "1", + "type": "t_address_payable" + }, + { + "astId": 10574, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "amount", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 10576, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "deadline", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 10578, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "disputeID", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 10580, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "buyerFee", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 10582, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "sellerFee", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 10584, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "lastFeePaymentTime", + "offset": 0, + "slot": "7", + "type": "t_uint256" + }, + { + "astId": 10586, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "templateData", + "offset": 0, + "slot": "8", + "type": "t_string_storage" + }, + { + "astId": 10588, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "templateDataMappings", + "offset": 0, + "slot": "9", + "type": "t_string_storage" + }, + { + "astId": 10591, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "status", + "offset": 0, + "slot": "10", + "type": "t_enum(Status)10563" + } + ], + "numberOfBytes": "352" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/PNKFaucet.json b/contracts/deployments/arbitrumSepoliaDevnet/PNKFaucet.json new file mode 100644 index 000000000..e3492bd6d --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/PNKFaucet.json @@ -0,0 +1,226 @@ +{ + "address": "0x7EFE468003Ad6A858b5350CDE0A67bBED58739dD", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "amount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "balance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "changeAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "request", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "withdrewAlready", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x928dc17d6759de6301100a914cb3f8d03df88611941b6e29eb9d123ccbf868f3", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x7EFE468003Ad6A858b5350CDE0A67bBED58739dD", + "transactionIndex": 1, + "gasUsed": "14689170", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x3fc1286a38313be24381d53c5b137138cd89d35b8ed3b77d8ea46920b12a5f87", + "transactionHash": "0x928dc17d6759de6301100a914cb3f8d03df88611941b6e29eb9d123ccbf868f3", + "logs": [], + "blockNumber": 3121428, + "cumulativeGasUsed": "14689170", + "status": 1, + "byzantium": true + }, + "args": [ + "0x34B944D42cAcfC8266955D07A80181D2054aa225" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"amount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"balance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"changeAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"request\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"withdrewAlready\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/token/Faucet.sol\":\"Faucet\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/token/Faucet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ncontract Faucet {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n IERC20 public token;\\n address public governor;\\n mapping(address => bool) public withdrewAlready;\\n uint256 public amount = 10_000 ether;\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(address(governor) == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n constructor(IERC20 _token) {\\n token = _token;\\n governor = msg.sender;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n function changeGovernor(address _governor) public onlyByGovernor {\\n governor = _governor;\\n }\\n\\n function changeAmount(uint256 _amount) public onlyByGovernor {\\n amount = _amount;\\n }\\n\\n function withdraw() public onlyByGovernor {\\n token.transfer(governor, token.balanceOf(address(this)));\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function request() public {\\n require(\\n !withdrewAlready[msg.sender],\\n \\\"You have used this faucet already. If you need more tokens, please use another address.\\\"\\n );\\n token.transfer(msg.sender, amount);\\n withdrewAlready[msg.sender] = true;\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n function balance() public view returns (uint) {\\n return token.balanceOf(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x3a54681cc304ccbfdb42215104b63809919a432ac5d3986d3021a11fcc7a1cc3\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405269021e19e0c9bab240000060035534801561001e57600080fd5b5060405161065538038061065583398101604081905261003d9161006b565b600080546001600160a01b039092166001600160a01b0319928316179055600180549091163317905561009b565b60006020828403121561007d57600080fd5b81516001600160a01b038116811461009457600080fd5b9392505050565b6105ab806100aa6000396000f3fe608060405234801561001057600080fd5b50600436106100835760003560e01c80630c340a2414610088578063338cdca1146100b15780633ccfd60b146100bb5780635c320516146100c3578063aa8c217c146100d6578063b69ef8a8146100ed578063d61c40dc146100f5578063e4c0aaf414610128578063fc0c546a1461013b575b600080fd5b60015461009b906001600160a01b031681565b6040516100a8919061049b565b60405180910390f35b6100b961014e565b005b6100b961028f565b6100b96100d13660046104af565b6103a9565b6100df60035481565b6040519081526020016100a8565b6100df6103d8565b6101186101033660046104c8565b60026020526000908152604090205460ff1681565b60405190151581526020016100a8565b6100b96101363660046104c8565b61044f565b60005461009b906001600160a01b031681565b3360009081526002602052604090205460ff16156101f95760405162461bcd60e51b815260206004820152605760248201527f596f752068617665207573656420746869732066617563657420616c7265616460448201527f792e20496620796f75206e656564206d6f726520746f6b656e732c20706c656160648201527639b2903ab9b29030b737ba3432b91030b2323932b9b99760491b608482015260a4015b60405180910390fd5b60005460035460405163a9059cbb60e01b815233600482015260248101919091526001600160a01b039091169063a9059cbb906044016020604051808303816000875af115801561024e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027291906104f8565b50336000908152600260205260409020805460ff19166001179055565b6001546001600160a01b031633146102b95760405162461bcd60e51b81526004016101f09061051a565b6000546001546040516370a0823160e01b81526001600160a01b039283169263a9059cbb92169083906370a08231906102f690309060040161049b565b602060405180830381865afa158015610313573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610337919061055c565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a691906104f8565b50565b6001546001600160a01b031633146103d35760405162461bcd60e51b81526004016101f09061051a565b600355565b600080546040516370a0823160e01b81526001600160a01b03909116906370a082319061040990309060040161049b565b602060405180830381865afa158015610426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a919061055c565b905090565b6001546001600160a01b031633146104795760405162461bcd60e51b81526004016101f09061051a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0391909116815260200190565b6000602082840312156104c157600080fd5b5035919050565b6000602082840312156104da57600080fd5b81356001600160a01b03811681146104f157600080fd5b9392505050565b60006020828403121561050a57600080fd5b815180151581146104f157600080fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60006020828403121561056e57600080fd5b505191905056fea26469706673582212204f7fd812260eacd88f23b436eb40b4943480e914005f0a0f2738f0d3c9696a5964736f6c63430008120033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100835760003560e01c80630c340a2414610088578063338cdca1146100b15780633ccfd60b146100bb5780635c320516146100c3578063aa8c217c146100d6578063b69ef8a8146100ed578063d61c40dc146100f5578063e4c0aaf414610128578063fc0c546a1461013b575b600080fd5b60015461009b906001600160a01b031681565b6040516100a8919061049b565b60405180910390f35b6100b961014e565b005b6100b961028f565b6100b96100d13660046104af565b6103a9565b6100df60035481565b6040519081526020016100a8565b6100df6103d8565b6101186101033660046104c8565b60026020526000908152604090205460ff1681565b60405190151581526020016100a8565b6100b96101363660046104c8565b61044f565b60005461009b906001600160a01b031681565b3360009081526002602052604090205460ff16156101f95760405162461bcd60e51b815260206004820152605760248201527f596f752068617665207573656420746869732066617563657420616c7265616460448201527f792e20496620796f75206e656564206d6f726520746f6b656e732c20706c656160648201527639b2903ab9b29030b737ba3432b91030b2323932b9b99760491b608482015260a4015b60405180910390fd5b60005460035460405163a9059cbb60e01b815233600482015260248101919091526001600160a01b039091169063a9059cbb906044016020604051808303816000875af115801561024e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027291906104f8565b50336000908152600260205260409020805460ff19166001179055565b6001546001600160a01b031633146102b95760405162461bcd60e51b81526004016101f09061051a565b6000546001546040516370a0823160e01b81526001600160a01b039283169263a9059cbb92169083906370a08231906102f690309060040161049b565b602060405180830381865afa158015610313573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610337919061055c565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a691906104f8565b50565b6001546001600160a01b031633146103d35760405162461bcd60e51b81526004016101f09061051a565b600355565b600080546040516370a0823160e01b81526001600160a01b03909116906370a082319061040990309060040161049b565b602060405180830381865afa158015610426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a919061055c565b905090565b6001546001600160a01b031633146104795760405162461bcd60e51b81526004016101f09061051a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0391909116815260200190565b6000602082840312156104c157600080fd5b5035919050565b6000602082840312156104da57600080fd5b81356001600160a01b03811681146104f157600080fd5b9392505050565b60006020828403121561050a57600080fd5b815180151581146104f157600080fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60006020828403121561056e57600080fd5b505191905056fea26469706673582212204f7fd812260eacd88f23b436eb40b4943480e914005f0a0f2738f0d3c9696a5964736f6c63430008120033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 24559, + "contract": "src/token/Faucet.sol:Faucet", + "label": "token", + "offset": 0, + "slot": "0", + "type": "t_contract(IERC20)1042" + }, + { + "astId": 24561, + "contract": "src/token/Faucet.sol:Faucet", + "label": "governor", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 24565, + "contract": "src/token/Faucet.sol:Faucet", + "label": "withdrewAlready", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 24568, + "contract": "src/token/Faucet.sol:Faucet", + "label": "amount", + "offset": 0, + "slot": "3", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)1042": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/package.json b/contracts/package.json index 1e582bafc..a5c8d62b5 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -59,7 +59,7 @@ "dotenv": "^16.3.1", "ethereumjs-util": "^7.1.5", "ethers": "^5.7.2", - "graphql": "^16.7.1", + "graphql": "^16.8.1", "graphql-request": "^6.1.0", "hardhat": "2.15.0", "hardhat-contract-sizer": "^2.10.0", diff --git a/contracts/test/arbitration/staking.ts b/contracts/test/arbitration/staking.ts index 71e8b0346..bb47e4136 100644 --- a/contracts/test/arbitration/staking.ts +++ b/contracts/test/arbitration/staking.ts @@ -185,7 +185,7 @@ describe("Staking", async () => { await expect(core.setStake(2, PNK(3000))) .to.emit(sortition, "StakeDelayedAlreadyTransferred") .withArgs(deployer, 2, PNK(3000)); - expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(5000), 0, PNK(2000), 2]); // stake has changed immediately, WARNING: this is misleading because it's not actually added to the SortitionSumTree + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(5000), 0, PNK(2000), 2]); // stake does not change }); it("Should transfer some PNK out of the juror's account", async () => { diff --git a/subgraph/DisputeTemplateRegistry/subgraph.yaml b/subgraph/DisputeTemplateRegistry/subgraph.yaml index c5ea24264..de3fa1446 100644 --- a/subgraph/DisputeTemplateRegistry/subgraph.yaml +++ b/subgraph/DisputeTemplateRegistry/subgraph.yaml @@ -1,14 +1,14 @@ specVersion: 0.0.4 schema: - file: ./schema.graphql + file: schema.graphql dataSources: - kind: ethereum name: DisputeTemplateRegistry network: arbitrum-sepolia source: - address: "0x8d17Ed667512412D9c194d178699f68159f250A2" + address: "0xc60e862273c1eAa1F9afBC69b39cee30270A2419" abi: DisputeTemplateRegistry - startBlock: 48887136 + startBlock: 3087464 mapping: kind: ethereum/events apiVersion: 0.0.6 @@ -17,8 +17,8 @@ dataSources: - DisputeTemplate abis: - name: DisputeTemplateRegistry - file: ../../contracts/deployments/arbitrumSepolia/DisputeTemplateRegistry.json + file: ../../contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry.json eventHandlers: - event: DisputeTemplate(indexed uint256,indexed string,string,string) handler: handleDisputeTemplate - file: ./src/DisputeTemplateRegistry.ts + file: src/DisputeTemplateRegistry.ts diff --git a/subgraph/package.json b/subgraph/package.json index ca0bddf38..1472461e1 100644 --- a/subgraph/package.json +++ b/subgraph/package.json @@ -2,17 +2,26 @@ "name": "@kleros/kleros-v2-subgraph", "license": "MIT", "scripts": { - "update:arbitrum-sepolia": "./scripts/update.sh arbitrumSepolia arbitrum-sepolia", - "update:arbitrum-sepolia-devnet": "./scripts/update.sh arbitrumSepoliaDevnet arbitrum-sepolia", - "update:arbitrum": "./scripts/update.sh arbitrum arbitrum", - "update:local": "./scripts/update.sh localhost mainnet", - "codegen": "graph codegen", - "build": "graph build", - "test": "graph test", - "clean": "graph clean && rm subgraph.yaml.bak.*", - "deploy:arbitrum-sepolia": "graph deploy --product hosted-service kleros/kleros-v2-core-testnet-2", - "deploy:arbitrum-sepolia-devnet": "graph deploy --product hosted-service kleros/kleros-v2-core-devnet", - "deploy:arbitrum": "graph deploy --product hosted-service kleros/kleros-v2-core-arbitrum", + "update:core:arbitrum-sepolia": "./scripts/update.sh arbitrumSepolia arbitrum-sepolia", + "update:core:arbitrum-sepolia-devnet": "./scripts/update.sh arbitrumSepoliaDevnet arbitrum-sepolia", + "update:core:arbitrum": "./scripts/update.sh arbitrum arbitrum", + "update:core:local": "./scripts/update.sh localhost mainnet", + "codegen:core": "graph codegen", + "build:core": "graph build", + "test:core": "graph test", + "clean:core": "graph clean && rm subgraph.yaml.bak.*", + "deploy:core:arbitrum-sepolia": "graph deploy --product subgraph-studio kleros-v2-core-testnet-3 -l v0.0.1", + "deploy:core:arbitrum-sepolia-devnet": "graph deploy --product subgraph-studio kleros-v2-core-devnet -l v0.0.1", + "deploy:core:arbitrum": "graph deploy --product subgraph-studio kleros-v2-core -l v0.0.1", + "update:dr:arbitrum-sepolia": "TODO", + "update:dr:arbitrum-sepolia-devnet": "TODO", + "update:dr:arbitrum": "TODO", + "update:dr:local": "TODO", + "codegen:dr": "cd DisputeTemplateRegistry && graph codegen ./subgraph.yaml", + "build:dr": "cd DisputeTemplateRegistry && graph build ./subgraph.yaml", + "test:dr": "TODO", + "clean:dr": "cd DisputeTemplateRegistry && graph clean ./subgraph.yaml", + "deploy:dr:arbitrum-sepolia-devnet": "cd DisputeTemplateRegistry && graph deploy --product subgraph-studio kleros-v2-dr-devnet -l v0.0.1 ./subgraph.yaml", "create-local": "graph create --node http://localhost:8020/ kleros/kleros-v2-core-local", "remove-local": "graph remove --node http://localhost:8020/ kleros/kleros-v2-core-local", "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 kleros/kleros-v2-core-local --version-label v$(date +%s)", @@ -25,10 +34,10 @@ "yarn": "3.3.1" }, "dependencies": { - "@graphprotocol/graph-ts": "^0.31.0" + "@graphprotocol/graph-ts": "^0.32.0" }, "devDependencies": { - "@graphprotocol/graph-cli": "0.52.0", + "@graphprotocol/graph-cli": "0.64.0", "@kleros/kleros-v2-eslint-config": "workspace:^", "@kleros/kleros-v2-prettier-config": "workspace:^", "gluegun": "^5.1.2", diff --git a/subgraph/src/KlerosCore.ts b/subgraph/src/KlerosCore.ts index 2c7983733..cfb2b57b4 100644 --- a/subgraph/src/KlerosCore.ts +++ b/subgraph/src/KlerosCore.ts @@ -8,11 +8,9 @@ import { CourtModified, Draw as DrawEvent, NewPeriod, - StakeSet, TokenAndETHShift as TokenAndETHShiftEvent, CourtJump, Ruling, - StakeDelayedNotTransferred, AcceptedFeeToken, } from "../generated/KlerosCore/KlerosCore"; import { ZERO, ONE } from "./utils"; @@ -185,22 +183,24 @@ export function handleDraw(event: DrawEvent): void { addUserActiveDispute(jurorAddress, disputeID); } -export function handleStakeSet(event: StakeSet): void { - const jurorAddress = event.params._address.toHexString(); - ensureUser(jurorAddress); - const courtID = event.params._courtID.toString(); +// TODO: index the sortition module and handle these events there +// export function handleStakeSet(event: StakeSet): void { +// const jurorAddress = event.params._address.toHexString(); +// ensureUser(jurorAddress); +// const courtID = event.params._courtID.toString(); - updateJurorStake(jurorAddress, courtID.toString(), KlerosCore.bind(event.address), event.block.timestamp); +// updateJurorStake(jurorAddress, courtID.toString(), KlerosCore.bind(event.address), event.block.timestamp); - // Check if the transaction the event comes from is executeDelayedStakes - if (event.transaction.input.toHexString().substring(0, 10) === "0x35975f4a") { - updateJurorDelayedStake(jurorAddress, courtID, ZERO.minus(event.params._amount)); - } -} +// // Check if the transaction the event comes from is executeDelayedStakes +// if (event.transaction.input.toHexString().substring(0, 10) === "0x35975f4a") { +// updateJurorDelayedStake(jurorAddress, courtID, ZERO.minus(event.params._amount)); +// } +// } -export function handleStakeDelayedNotTransferred(event: StakeDelayedNotTransferred): void { - updateJurorDelayedStake(event.params._address.toHexString(), event.params._courtID.toString(), event.params._amount); -} +// TODO: index the sortition module and handle these events there +// export function handleStakeDelayedNotTransferred(event: StakeDelayedNotTransferred): void { +// updateJurorDelayedStake(event.params._address.toHexString(), event.params._courtID.toString(), event.params._amount); +// } export function handleTokenAndETHShift(event: TokenAndETHShiftEvent): void { updatePenalty(event); diff --git a/subgraph/src/entities/JurorTokensPerCourt.ts b/subgraph/src/entities/JurorTokensPerCourt.ts index c42cfd4b3..6365c972c 100644 --- a/subgraph/src/entities/JurorTokensPerCourt.ts +++ b/subgraph/src/entities/JurorTokensPerCourt.ts @@ -35,21 +35,23 @@ export function updateJurorStake(jurorAddress: string, courtID: string, contract const court = Court.load(courtID); if (!court) return; const jurorTokens = ensureJurorTokensPerCourt(jurorAddress, courtID); - const jurorBalance = contract.getJurorBalance(Address.fromString(jurorAddress), BigInt.fromString(courtID)); - const previousStake = jurorTokens.staked; - const previousTotalStake = juror.totalStake; - jurorTokens.staked = jurorBalance.value2; - jurorTokens.locked = jurorBalance.value1; - jurorTokens.save(); - const stakeDelta = getDelta(previousStake, jurorTokens.staked); - const newTotalStake = juror.totalStake.plus(stakeDelta); - juror.totalStake = newTotalStake; - court.stake = court.stake.plus(stakeDelta); - updateStakedPNK(stakeDelta, timestamp); - const activeJurorsDelta = getActivityDelta(previousTotalStake, newTotalStake); - const stakedJurorsDelta = getActivityDelta(previousStake, jurorBalance.value2); - court.numberStakedJurors = court.numberStakedJurors.plus(stakedJurorsDelta); - updateActiveJurors(activeJurorsDelta, timestamp); + + // TODO: index the sortition module and handle these events there + // const jurorBalance = contract.getJurorBalance(Address.fromString(jurorAddress), BigInt.fromString(courtID)); + // const previousStake = jurorTokens.staked; + // const previousTotalStake = juror.totalStake; + // jurorTokens.staked = jurorBalance.value2; + // jurorTokens.locked = jurorBalance.value1; + // jurorTokens.save(); + // const stakeDelta = getDelta(previousStake, jurorTokens.staked); + // const newTotalStake = juror.totalStake.plus(stakeDelta); + // juror.totalStake = newTotalStake; + // court.stake = court.stake.plus(stakeDelta); + // updateStakedPNK(stakeDelta, timestamp); + // const activeJurorsDelta = getActivityDelta(previousTotalStake, newTotalStake); + // const stakedJurorsDelta = getActivityDelta(previousStake, jurorBalance.value2); + // court.numberStakedJurors = court.numberStakedJurors.plus(stakedJurorsDelta); + // updateActiveJurors(activeJurorsDelta, timestamp); juror.save(); court.save(); } diff --git a/subgraph/subgraph.yaml b/subgraph/subgraph.yaml index 7139f7628..b8133448e 100644 --- a/subgraph/subgraph.yaml +++ b/subgraph/subgraph.yaml @@ -6,9 +6,9 @@ dataSources: name: KlerosCore network: arbitrum-sepolia source: - address: "0xB88643fd1e4351dAF9eA7292db126207FDE42e45" + address: "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284" abi: KlerosCore - startBlock: 49141544 + startBlock: 3084598 mapping: kind: ethereum/events apiVersion: 0.0.6 @@ -46,10 +46,11 @@ dataSources: handler: handleDisputeKitCreated - event: DisputeKitEnabled(indexed uint96,indexed uint256,indexed bool) handler: handleDisputeKitEnabled - - event: StakeSet(indexed address,uint256,uint256) - handler: handleStakeSet - - event: StakeDelayedNotTransferred(indexed address,uint256,uint256) - handler: handleStakeDelayedNotTransferred + # TODO: index the sortition module and handle these events there + # - event: StakeSet(indexed address,uint256,uint256) + # handler: handleStakeSet + # - event: StakeDelayedNotTransferred(indexed address,uint256,uint256) + # handler: handleStakeDelayedNotTransferred - event: TokenAndETHShift(indexed address,indexed uint256,indexed uint256,uint256,int256,int256,address) handler: handleTokenAndETHShift - event: Ruling(indexed address,indexed uint256,uint256) @@ -63,9 +64,9 @@ dataSources: name: PolicyRegistry network: arbitrum-sepolia source: - address: "0x37FFaF5506BB16327B4a32191Bb39d739fCE55a3" + address: "0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da" abi: PolicyRegistry - startBlock: 48886711 + startBlock: 3084568 mapping: kind: ethereum/events apiVersion: 0.0.6 @@ -83,9 +84,9 @@ dataSources: name: DisputeKitClassic network: arbitrum-sepolia source: - address: "0x67f3b472F345119692d575E59190400E371946f6" + address: "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3" abi: DisputeKitClassic - startBlock: 49141470 + startBlock: 3084586 mapping: kind: ethereum/events apiVersion: 0.0.6 @@ -118,9 +119,9 @@ dataSources: name: EvidenceModule network: arbitrum-sepolia source: - address: "0xF679E4a92AE843fd5cD0717A7417C3A773Dfd55F" + address: "0x827411b3e98bAe8c441efBf26842A1670f8f378F" abi: EvidenceModule - startBlock: 49137992 + startBlock: 3084571 mapping: kind: ethereum/events apiVersion: 0.0.6 diff --git a/web/.env.devnet.public b/web/.env.devnet.public index 22f53b41f..4336a13c5 100644 --- a/web/.env.devnet.public +++ b/web/.env.devnet.public @@ -1,5 +1,5 @@ # Do not enter sensitive information here. export REACT_APP_DEPLOYMENT=devnet -export REACT_APP_KLEROS_CORE_SUBGRAPH_DEVNET=REDEPLOY SUBGRAPH IN ARBSEPOLIA AND PUT API THEGRAPH LINK HERE -export REACT_APP_DISPUTE_TEMPLATE_ARBSEPOLIA_SUBGRAPH_DEVNET=REDEPLOY SUBGRAPH IN ARBSEPOLIA AND PUT API THEGRAPH LINK HERE +export REACT_APP_KLEROS_CORE_SUBGRAPH_DEVNET=https://api.studio.thegraph.com/query/61688/kleros-v2-core-devnet/v0.0.1 +export REACT_APP_DISPUTE_TEMPLATE_ARBSEPOLIA_SUBGRAPH_DEVNET=https://api.studio.thegraph.com/query/61688/kleros-v2-dr-devnet/v0.0.1 export REACT_APP_STATUS_URL=https://kleros-v2-devnet.betteruptime.com/badge \ No newline at end of file diff --git a/web/package.json b/web/package.json index 92ebf89ef..258e7cc63 100644 --- a/web/package.json +++ b/web/package.json @@ -43,7 +43,7 @@ "prettier": "@kleros/kleros-v2-prettier-config", "devDependencies": { "@graphql-codegen/cli": "^4.0.1", - "@graphql-codegen/client-preset": "^4.0.1", + "@graphql-codegen/client-preset": "^4.1.0", "@kleros/kleros-v2-eslint-config": "workspace:^", "@kleros/kleros-v2-prettier-config": "workspace:^", "@kleros/kleros-v2-tsconfig": "workspace:^", @@ -85,7 +85,7 @@ "chartjs-adapter-moment": "^1.0.1", "core-js": "^3.34.0", "ethers": "^5.7.2", - "graphql": "^16.7.1", + "graphql": "^16.8.1", "graphql-request": "~6.1.0", "moment": "^2.29.4", "overlayscrollbars": "^2.3.0", @@ -104,8 +104,8 @@ "react-toastify": "^9.1.3", "react-use": "^17.4.0", "styled-components": "^5.3.9", - "viem": "^1.19.13", - "wagmi": "^1.4.11" + "viem": "^1.20.3", + "wagmi": "^1.4.12" }, "volta": { "node": "16.20.1", diff --git a/web/src/components/Popup/Description/StakeWithdraw.tsx b/web/src/components/Popup/Description/StakeWithdraw.tsx index d6b042a86..d70e2bc3f 100644 --- a/web/src/components/Popup/Description/StakeWithdraw.tsx +++ b/web/src/components/Popup/Description/StakeWithdraw.tsx @@ -3,7 +3,7 @@ import styled from "styled-components"; import { formatUnits } from "viem"; import { useAccount } from "wagmi"; import { isUndefined } from "utils/index"; -import { useKlerosCoreGetJurorBalance } from "hooks/contracts/generated"; +import { useSortitionModuleGetJurorBalance } from "hooks/contracts/generated"; import KlerosLogo from "tsx:svgs/icons/kleros.svg"; import { responsiveSize } from "styles/responsiveSize"; @@ -72,7 +72,7 @@ const AmountStakedOrWithdrawn: React.FC = ({ pnkStaked const StakeWithdraw: React.FC = ({ pnkStaked, courtName, isStake, courtId }) => { const { address } = useAccount(); - const { data: jurorBalance } = useKlerosCoreGetJurorBalance({ + const { data: jurorBalance } = useSortitionModuleGetJurorBalance({ enabled: !isUndefined(address) && !isUndefined(courtId), args: [address, BigInt(courtId)], watch: true, diff --git a/web/src/pages/Courts/CourtDetails/StakePanel/InputDisplay.tsx b/web/src/pages/Courts/CourtDetails/StakePanel/InputDisplay.tsx index b78c9579d..69a02048c 100644 --- a/web/src/pages/Courts/CourtDetails/StakePanel/InputDisplay.tsx +++ b/web/src/pages/Courts/CourtDetails/StakePanel/InputDisplay.tsx @@ -6,7 +6,7 @@ import { useAccount } from "wagmi"; import { NumberInputField } from "components/NumberInputField"; import { useParsedAmount } from "hooks/useParsedAmount"; import { useCourtDetails } from "hooks/queries/useCourtDetails"; -import { useKlerosCoreGetJurorBalance, usePnkBalanceOf } from "hooks/contracts/generated"; +import { useSortitionModuleGetJurorBalance, usePnkBalanceOf } from "hooks/contracts/generated"; import StakeWithdrawButton, { ActionType } from "./StakeWithdrawButton"; import { formatPNK, roundNumberDown } from "utils/format"; import { isUndefined } from "utils/index"; @@ -78,7 +78,7 @@ const InputDisplay: React.FC = ({ watch: true, }); const parsedBalance = formatPNK(balance ?? 0n, 0, true); - const { data: jurorBalance } = useKlerosCoreGetJurorBalance({ + const { data: jurorBalance } = useSortitionModuleGetJurorBalance({ enabled: !isUndefined(address), args: [address, id], watch: true, diff --git a/web/src/pages/Courts/CourtDetails/StakePanel/JurorStakeDisplay.tsx b/web/src/pages/Courts/CourtDetails/StakePanel/JurorStakeDisplay.tsx index 5b42bbba8..4b2af92a1 100644 --- a/web/src/pages/Courts/CourtDetails/StakePanel/JurorStakeDisplay.tsx +++ b/web/src/pages/Courts/CourtDetails/StakePanel/JurorStakeDisplay.tsx @@ -9,7 +9,7 @@ import Field from "components/Field"; import DiceIcon from "svgs/icons/dice.svg"; import PNKIcon from "svgs/icons/pnk.svg"; import { useCourtDetails } from "queries/useCourtDetails"; -import { useKlerosCoreGetJurorBalance } from "hooks/contracts/generated"; +import { useSortitionModuleGetJurorBalance } from "hooks/contracts/generated"; const Container = styled.div` display: flex; @@ -44,7 +44,7 @@ const bigIntRatioToPercentage = (numerator: bigint, denominator: bigint): string }; const useCalculateJurorOdds = ( - jurorBalance: readonly [bigint, bigint, bigint] | undefined, + jurorBalance: readonly [bigint, bigint, bigint, bigint] | undefined, stakedByAllJurors: string | undefined, loading: boolean ): string => { @@ -64,7 +64,7 @@ const useCalculateJurorOdds = ( const JurorBalanceDisplay = () => { const { id } = useParams(); const { address } = useAccount(); - const { data: jurorBalance } = useKlerosCoreGetJurorBalance({ + const { data: jurorBalance } = useSortitionModuleGetJurorBalance({ enabled: !isUndefined(address), args: [address ?? "0x", BigInt(id ?? 0)], watch: true, diff --git a/web/src/pages/Courts/CourtDetails/StakePanel/StakeWithdrawButton.tsx b/web/src/pages/Courts/CourtDetails/StakePanel/StakeWithdrawButton.tsx index ab3137959..51b3f1ac3 100644 --- a/web/src/pages/Courts/CourtDetails/StakePanel/StakeWithdrawButton.tsx +++ b/web/src/pages/Courts/CourtDetails/StakePanel/StakeWithdrawButton.tsx @@ -9,7 +9,7 @@ import { usePnkBalanceOf, usePnkIncreaseAllowance, usePreparePnkIncreaseAllowance, - useKlerosCoreGetJurorBalance, + useSortitionModuleGetJurorBalance, usePnkAllowance, } from "hooks/contracts/generated"; import { useCourtDetails } from "hooks/queries/useCourtDetails"; @@ -48,7 +48,7 @@ const StakeWithdrawButton: React.FC = ({ args: [address!], watch: true, }); - const { data: jurorBalance } = useKlerosCoreGetJurorBalance({ + const { data: jurorBalance } = useSortitionModuleGetJurorBalance({ enabled: !isUndefined(address), args: [address ?? "0x", BigInt(id ?? 0)], watch: true, @@ -138,7 +138,7 @@ const StakeWithdrawButton: React.FC = ({ isUndefined(targetStake) || isUndefined(courtDetails) || checkDisabled() || - (targetStake !== 0n && targetStake < BigInt(courtDetails.court.minStake)) || + (targetStake !== 0n && targetStake < BigInt(courtDetails.court?.minStake)) || (isStaking && !isAllowance && isUndefined(setStakeConfig.request)) } onClick={onClick} diff --git a/yarn.lock b/yarn.lock index 051f4844a..045120754 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4172,12 +4172,14 @@ __metadata: languageName: node linkType: hard -"@graphprotocol/graph-cli@npm:0.52.0": - version: 0.52.0 - resolution: "@graphprotocol/graph-cli@npm:0.52.0" +"@graphprotocol/graph-cli@npm:0.64.0": + version: 0.64.0 + resolution: "@graphprotocol/graph-cli@npm:0.64.0" dependencies: "@float-capital/float-subgraph-uncrashable": ^0.0.0-alpha.4 "@oclif/core": 2.8.6 + "@oclif/plugin-autocomplete": ^2.3.6 + "@oclif/plugin-not-found": ^2.4.0 "@whatwg-node/fetch": ^0.8.4 assemblyscript: 0.19.23 binary-install-raw: 0.0.13 @@ -4204,16 +4206,16 @@ __metadata: yaml: 1.10.2 bin: graph: bin/run - checksum: 7c6e2dbf022f4229b412e1107bb16b8e5914da2c21802af9a072a79a4f463132a192380e9c395a463c285004abedf16461037cebea7387c580c2de46200ddd40 + checksum: f4abd1fac20e235e4d8e459ce3495fe4910064fc6d53e725dacb67d8814c95ce0eb38c8f8ec6b92db33b371ae5f59ebda86164bd437b48a82bee3729c030bcc0 languageName: node linkType: hard -"@graphprotocol/graph-ts@npm:^0.31.0": - version: 0.31.0 - resolution: "@graphprotocol/graph-ts@npm:0.31.0" +"@graphprotocol/graph-ts@npm:^0.32.0": + version: 0.32.0 + resolution: "@graphprotocol/graph-ts@npm:0.32.0" dependencies: assemblyscript: 0.19.10 - checksum: 20394b17d3241a662f0b2efebdc02f44e4e0814fdbb09b4cac0c84b84a173798325840bc1daf1d11ebaf27b1b3e13ff6e2766567c755cb77c1321ba1462fbecc + checksum: 9376ad625d3e439c9026c6aac15c82b43bb704c99469649e758bd27e68c3de3dcf36381a01ca76fea073f9e4ec507bccfa9ee4bb2b82bf67404419855efc735f languageName: node linkType: hard @@ -4279,15 +4281,15 @@ __metadata: languageName: node linkType: hard -"@graphql-codegen/client-preset@npm:^4.0.1": - version: 4.0.1 - resolution: "@graphql-codegen/client-preset@npm:4.0.1" +"@graphql-codegen/client-preset@npm:^4.1.0": + version: 4.1.0 + resolution: "@graphql-codegen/client-preset@npm:4.1.0" dependencies: "@babel/helper-plugin-utils": ^7.20.2 "@babel/template": ^7.20.7 "@graphql-codegen/add": ^5.0.0 "@graphql-codegen/gql-tag-operations": 4.0.1 - "@graphql-codegen/plugin-helpers": ^5.0.0 + "@graphql-codegen/plugin-helpers": ^5.0.1 "@graphql-codegen/typed-document-node": ^5.0.1 "@graphql-codegen/typescript": ^4.0.1 "@graphql-codegen/typescript-operations": ^4.0.1 @@ -4298,7 +4300,7 @@ __metadata: tslib: ~2.5.0 peerDependencies: graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 - checksum: ddcaaf55575e2f36b4ae7e7caf6c170d72fbd5bd42ccb00c22ed01723ef466e1dab8f37915036047f306098468344ebc004524764be9aca95a8fd68d48e321a9 + checksum: e4b87a443b1437fc61e2d033af24079a41f6879cfa38af4364d6351decb61a7951d787d4f430324ded7c01ae096a6dbd2d20d00205291c37382c1ea8a820ee19 languageName: node linkType: hard @@ -4347,6 +4349,22 @@ __metadata: languageName: node linkType: hard +"@graphql-codegen/plugin-helpers@npm:^5.0.1": + version: 5.0.1 + resolution: "@graphql-codegen/plugin-helpers@npm:5.0.1" + dependencies: + "@graphql-tools/utils": ^10.0.0 + change-case-all: 1.0.15 + common-tags: 1.8.2 + import-from: 4.0.0 + lodash: ~4.17.0 + tslib: ~2.5.0 + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + checksum: 97faa8f87f41292bb5263097b1613733faf07fd0ff375ac89438aa0f2cd91e163d088b63dcafcdb6d66beaba8f7d13005bb980793e71979e9ad61fdfd206a730 + languageName: node + linkType: hard + "@graphql-codegen/schema-ast@npm:^4.0.0": version: 4.0.0 resolution: "@graphql-codegen/schema-ast@npm:4.0.0" @@ -5349,7 +5367,7 @@ __metadata: dotenv: ^16.3.1 ethereumjs-util: ^7.1.5 ethers: ^5.7.2 - graphql: ^16.7.1 + graphql: ^16.8.1 graphql-request: ^6.1.0 hardhat: 2.15.0 hardhat-contract-sizer: ^2.10.0 @@ -5407,8 +5425,8 @@ __metadata: version: 0.0.0-use.local resolution: "@kleros/kleros-v2-subgraph@workspace:subgraph" dependencies: - "@graphprotocol/graph-cli": 0.52.0 - "@graphprotocol/graph-ts": ^0.31.0 + "@graphprotocol/graph-cli": 0.64.0 + "@graphprotocol/graph-ts": ^0.32.0 "@kleros/kleros-v2-eslint-config": "workspace:^" "@kleros/kleros-v2-prettier-config": "workspace:^" gluegun: ^5.1.2 @@ -5430,7 +5448,7 @@ __metadata: dependencies: "@filebase/client": ^0.0.5 "@graphql-codegen/cli": ^4.0.1 - "@graphql-codegen/client-preset": ^4.0.1 + "@graphql-codegen/client-preset": ^4.1.0 "@kleros/kleros-v2-contracts": "workspace:^" "@kleros/kleros-v2-eslint-config": "workspace:^" "@kleros/kleros-v2-prettier-config": "workspace:^" @@ -5465,7 +5483,7 @@ __metadata: eslint-plugin-react: ^7.33.0 eslint-plugin-react-hooks: ^4.6.0 ethers: ^5.7.2 - graphql: ^16.7.1 + graphql: ^16.8.1 graphql-request: ~6.1.0 lru-cache: ^7.18.3 moment: ^2.29.4 @@ -5488,8 +5506,8 @@ __metadata: styled-components: ^5.3.9 supabase: ^1.102.2 typescript: ^4.9.5 - viem: ^1.19.13 - wagmi: ^1.4.11 + viem: ^1.20.3 + wagmi: ^1.4.12 languageName: unknown linkType: soft @@ -5525,13 +5543,6 @@ __metadata: languageName: node linkType: hard -"@ledgerhq/connect-kit-loader@npm:^1.1.0": - version: 1.1.2 - resolution: "@ledgerhq/connect-kit-loader@npm:1.1.2" - checksum: 614fdd9ac2363da60af667adcfe4721f863d8ea06ee45a08192a162c28e806dc07491bee4833d14def74de673eac1f1450eaf67e783c8c28da4e0cd095b4474a - languageName: node - linkType: hard - "@leichtgewicht/ip-codec@npm:^2.0.1": version: 2.0.4 resolution: "@leichtgewicht/ip-codec@npm:2.0.4" @@ -6497,6 +6508,64 @@ __metadata: languageName: node linkType: hard +"@oclif/core@npm:^2.15.0": + version: 2.15.0 + resolution: "@oclif/core@npm:2.15.0" + dependencies: + "@types/cli-progress": ^3.11.0 + ansi-escapes: ^4.3.2 + ansi-styles: ^4.3.0 + cardinal: ^2.1.1 + chalk: ^4.1.2 + clean-stack: ^3.0.1 + cli-progress: ^3.12.0 + debug: ^4.3.4 + ejs: ^3.1.8 + get-package-type: ^0.1.0 + globby: ^11.1.0 + hyperlinker: ^1.0.0 + indent-string: ^4.0.0 + is-wsl: ^2.2.0 + js-yaml: ^3.14.1 + natural-orderby: ^2.0.3 + object-treeify: ^1.1.33 + password-prompt: ^1.1.2 + slice-ansi: ^4.0.0 + string-width: ^4.2.3 + strip-ansi: ^6.0.1 + supports-color: ^8.1.1 + supports-hyperlinks: ^2.2.0 + ts-node: ^10.9.1 + tslib: ^2.5.0 + widest-line: ^3.1.0 + wordwrap: ^1.0.0 + wrap-ansi: ^7.0.0 + checksum: a4ef8ad00d9bc7cb48e5847bad7def6947f913875f4b0ecec65ab423a3c2a82c87df173c709c3c25396d545f60d20d17d562c474f66230d76de43061ce22ba90 + languageName: node + linkType: hard + +"@oclif/plugin-autocomplete@npm:^2.3.6": + version: 2.3.10 + resolution: "@oclif/plugin-autocomplete@npm:2.3.10" + dependencies: + "@oclif/core": ^2.15.0 + chalk: ^4.1.0 + debug: ^4.3.4 + checksum: 294f21679a1dfec7f7cd593e704f160a8137733215b58158cb4bf0b6855684f4e27e0df118bf803e894fc52e7f1184ecae3026ce96057a19c6dbdd9318c7e2f9 + languageName: node + linkType: hard + +"@oclif/plugin-not-found@npm:^2.4.0": + version: 2.4.3 + resolution: "@oclif/plugin-not-found@npm:2.4.3" + dependencies: + "@oclif/core": ^2.15.0 + chalk: ^4 + fast-levenshtein: ^3.0.0 + checksum: a7452e4d4b868411856dd3a195609af0757a8a171fbcc17f4311d8b04764e37f4c6d32dd1d9078b166452836e5fa7c42996ffb444016e466f92092c46a2606fb + languageName: node + linkType: hard + "@octokit/auth-token@npm:^2.4.4": version: 2.5.0 resolution: "@octokit/auth-token@npm:2.5.0" @@ -10066,12 +10135,11 @@ __metadata: languageName: node linkType: hard -"@wagmi/connectors@npm:3.1.9": - version: 3.1.9 - resolution: "@wagmi/connectors@npm:3.1.9" +"@wagmi/connectors@npm:3.1.10": + version: 3.1.10 + resolution: "@wagmi/connectors@npm:3.1.10" dependencies: "@coinbase/wallet-sdk": ^3.6.6 - "@ledgerhq/connect-kit-loader": ^1.1.0 "@safe-global/safe-apps-provider": ^0.18.1 "@safe-global/safe-apps-sdk": ^8.1.0 "@walletconnect/ethereum-provider": 2.10.6 @@ -10086,15 +10154,15 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 95773a9617b17cae1adf818669a53126182087363cbbcd711b8452bb71b51b3173432993fbdfe9b0163489a32d8dcfee0735e2f02d646f8f5aeb9cdf9dcae5fc + checksum: 65eeb30881fbbf018ec842eb156f4119090c804450f55de60d95c92b124d86b5a769cdc02f4db0bc04ae481b678375d6061d67a86b14b30b62527c202a688574 languageName: node linkType: hard -"@wagmi/core@npm:1.4.11": - version: 1.4.11 - resolution: "@wagmi/core@npm:1.4.11" +"@wagmi/core@npm:1.4.12": + version: 1.4.12 + resolution: "@wagmi/core@npm:1.4.12" dependencies: - "@wagmi/connectors": 3.1.9 + "@wagmi/connectors": 3.1.10 abitype: 0.8.7 eventemitter3: ^4.0.7 zustand: ^4.3.1 @@ -10104,7 +10172,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: a687ae63863772aaf2e3375c479c0fbefa77bfdfecc79faece2c595e706b9b1b2d917cfbd7b271210d02948d7e63879dd8b18923c11f77b8267ca8b67023f9b3 + checksum: 4f1e7c532e7f8a984c6918328a6690543cf77d224f0e1119a7eba4e3495da466d7a2c64718922bc5e3741cabf17c20ff0de2600531ea3f9bd07ba4b27067d68b languageName: node linkType: hard @@ -13114,7 +13182,7 @@ __metadata: languageName: node linkType: hard -"chalk@npm:^4.0.0, chalk@npm:^4.0.2, chalk@npm:^4.1.0, chalk@npm:^4.1.1, chalk@npm:^4.1.2": +"chalk@npm:^4, chalk@npm:^4.0.0, chalk@npm:^4.0.2, chalk@npm:^4.1.0, chalk@npm:^4.1.1, chalk@npm:^4.1.2": version: 4.1.2 resolution: "chalk@npm:4.1.2" dependencies: @@ -17301,6 +17369,15 @@ __metadata: languageName: node linkType: hard +"fast-levenshtein@npm:^3.0.0": + version: 3.0.0 + resolution: "fast-levenshtein@npm:3.0.0" + dependencies: + fastest-levenshtein: ^1.0.7 + checksum: 02732ba6c656797ca7e987c25f3e53718c8fcc39a4bfab46def78eef7a8729eb629632d4a7eca4c27a33e10deabffa9984839557e18a96e91ecf7ccaeedb9890 + languageName: node + linkType: hard + "fast-loops@npm:^1.1.3": version: 1.1.3 resolution: "fast-loops@npm:1.1.3" @@ -17365,6 +17442,13 @@ __metadata: languageName: node linkType: hard +"fastest-levenshtein@npm:^1.0.7": + version: 1.0.16 + resolution: "fastest-levenshtein@npm:1.0.16" + checksum: a78d44285c9e2ae2c25f3ef0f8a73f332c1247b7ea7fb4a191e6bb51aa6ee1ef0dfb3ed113616dcdc7023e18e35a8db41f61c8d88988e877cf510df8edafbc71 + languageName: node + linkType: hard + "fastest-stable-stringify@npm:^2.0.2": version: 2.0.2 resolution: "fastest-stable-stringify@npm:2.0.2" @@ -18636,10 +18720,10 @@ __metadata: languageName: node linkType: hard -"graphql@npm:^16.7.1": - version: 16.7.1 - resolution: "graphql@npm:16.7.1" - checksum: c924d8428daf0e96a5ea43e9bc3cd1b6802899907d284478ac8f705c8fd233a0a51eef915f7569fb5de8acb2e85b802ccc6c85c2b157ad805c1e9adba5a299bd +"graphql@npm:^16.8.1": + version: 16.8.1 + resolution: "graphql@npm:16.8.1" + checksum: 8d304b7b6f708c8c5cc164b06e92467dfe36aff6d4f2cf31dd19c4c2905a0e7b89edac4b7e225871131fd24e21460836b369de0c06532644d15b461d55b1ccc0 languageName: node linkType: hard @@ -32349,9 +32433,9 @@ __metadata: languageName: node linkType: hard -"viem@npm:^1.19.13": - version: 1.19.13 - resolution: "viem@npm:1.19.13" +"viem@npm:^1.20.3": + version: 1.20.3 + resolution: "viem@npm:1.20.3" dependencies: "@adraffy/ens-normalize": 1.10.0 "@noble/curves": 1.2.0 @@ -32366,7 +32450,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 1794550a0879d35c902b0dc8468b09c664182b3df463f1039a3d86d0e9677938fe3aa89aee14c3fa184fef72843fdb44a25da61f3a2cba7b6ffe74a57c5f0e0a + checksum: 92fffbc1715482969b6af7ac6df51cbd4cfe4e6d55226562eb0658a16b9a9b3df743c1ec1aebb63221b5117d4956fb2f71788bc06f6316d054ac402406614b31 languageName: node linkType: hard @@ -32477,14 +32561,14 @@ __metadata: languageName: node linkType: hard -"wagmi@npm:^1.4.11": - version: 1.4.11 - resolution: "wagmi@npm:1.4.11" +"wagmi@npm:^1.4.12": + version: 1.4.12 + resolution: "wagmi@npm:1.4.12" dependencies: "@tanstack/query-sync-storage-persister": ^4.27.1 "@tanstack/react-query": ^4.28.0 "@tanstack/react-query-persist-client": ^4.28.0 - "@wagmi/core": 1.4.11 + "@wagmi/core": 1.4.12 abitype: 0.8.7 use-sync-external-store: ^1.2.0 peerDependencies: @@ -32494,7 +32578,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 44fe06ebf874fb8e3575161b8a4ae991929ddd9a9547df7696b42a251e52fb847f681bf37b8abc5401aadc39e48064a4d99b76d56876d99c92bdb8ee189d665f + checksum: 7c1cb64c53e29899d508142e43a450b07f7f4f0ac2a19f5651f0f3dbfe2bb5b159d2b6251f6f613bd9bae007dc8390383ff79f5ab7bdf8d06788fe0bbdb3f8ab languageName: node linkType: hard From 2ac62626111c03ef78fe3e5e959d7cc561ff0466 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Wed, 20 Dec 2023 19:19:48 +0000 Subject: [PATCH 48/77] refactor: both the core and drt subgraphs --- .github/workflows/deploy-subgraph.yml | 22 +++++--- subgraph/README.md | 21 +++++--- subgraph/{ => core}/schema.graphql | 0 subgraph/{ => core}/src/DisputeKitClassic.ts | 0 subgraph/{ => core}/src/EvidenceModule.ts | 0 subgraph/{ => core}/src/HomeGateway.ts | 9 +--- subgraph/{ => core}/src/KlerosCore.ts | 0 subgraph/{ => core}/src/PolicyRegistry.ts | 0 subgraph/{ => core}/src/datapoint.ts | 0 .../{ => core}/src/entities/Arbitrable.ts | 0 .../src/entities/ClassicContribution.ts | 9 +--- .../{ => core}/src/entities/ClassicDispute.ts | 0 .../src/entities/ClassicEvidenceGroup.ts | 0 .../{ => core}/src/entities/ClassicRound.ts | 0 .../{ => core}/src/entities/ClassicVote.ts | 0 subgraph/{ => core}/src/entities/Court.ts | 0 subgraph/{ => core}/src/entities/Dispute.ts | 0 .../{ => core}/src/entities/DisputeKit.ts | 0 subgraph/{ => core}/src/entities/Draw.ts | 0 subgraph/{ => core}/src/entities/FeeToken.ts | 0 .../src/entities/JurorTokensPerCourt.ts | 0 subgraph/{ => core}/src/entities/Penalty.ts | 0 .../src/entities/PeriodIndexCounter.ts | 0 subgraph/{ => core}/src/entities/Round.ts | 0 .../src/entities/TokenAndEthShift.ts | 0 subgraph/{ => core}/src/entities/User.ts | 0 subgraph/{ => core}/src/utils.ts | 0 subgraph/{ => core}/subgraph.yaml | 12 ++--- subgraph/{ => core}/tests/user.test.ts | 0 .../schema.graphql | 0 .../src/DisputeTemplateRegistry.ts | 0 .../subgraph.yaml | 0 subgraph/package.json | 51 +++++++++++-------- subgraph/scripts/all.sh | 17 +++++++ subgraph/scripts/update.sh | 28 +++++----- web/.env.devnet.public | 4 +- web/.env.local.public | 4 +- web/.env.testnet.public | 4 +- web/src/utils/graphqlQueryFnHelper.ts | 21 +------- 39 files changed, 111 insertions(+), 91 deletions(-) rename subgraph/{ => core}/schema.graphql (100%) rename subgraph/{ => core}/src/DisputeKitClassic.ts (100%) rename subgraph/{ => core}/src/EvidenceModule.ts (100%) rename subgraph/{ => core}/src/HomeGateway.ts (79%) rename subgraph/{ => core}/src/KlerosCore.ts (100%) rename subgraph/{ => core}/src/PolicyRegistry.ts (100%) rename subgraph/{ => core}/src/datapoint.ts (100%) rename subgraph/{ => core}/src/entities/Arbitrable.ts (100%) rename subgraph/{ => core}/src/entities/ClassicContribution.ts (85%) rename subgraph/{ => core}/src/entities/ClassicDispute.ts (100%) rename subgraph/{ => core}/src/entities/ClassicEvidenceGroup.ts (100%) rename subgraph/{ => core}/src/entities/ClassicRound.ts (100%) rename subgraph/{ => core}/src/entities/ClassicVote.ts (100%) rename subgraph/{ => core}/src/entities/Court.ts (100%) rename subgraph/{ => core}/src/entities/Dispute.ts (100%) rename subgraph/{ => core}/src/entities/DisputeKit.ts (100%) rename subgraph/{ => core}/src/entities/Draw.ts (100%) rename subgraph/{ => core}/src/entities/FeeToken.ts (100%) rename subgraph/{ => core}/src/entities/JurorTokensPerCourt.ts (100%) rename subgraph/{ => core}/src/entities/Penalty.ts (100%) rename subgraph/{ => core}/src/entities/PeriodIndexCounter.ts (100%) rename subgraph/{ => core}/src/entities/Round.ts (100%) rename subgraph/{ => core}/src/entities/TokenAndEthShift.ts (100%) rename subgraph/{ => core}/src/entities/User.ts (100%) rename subgraph/{ => core}/src/utils.ts (100%) rename subgraph/{ => core}/subgraph.yaml (90%) rename subgraph/{ => core}/tests/user.test.ts (100%) rename subgraph/{DisputeTemplateRegistry => dispute-template-registry}/schema.graphql (100%) rename subgraph/{DisputeTemplateRegistry => dispute-template-registry}/src/DisputeTemplateRegistry.ts (100%) rename subgraph/{DisputeTemplateRegistry => dispute-template-registry}/subgraph.yaml (100%) create mode 100755 subgraph/scripts/all.sh diff --git a/.github/workflows/deploy-subgraph.yml b/.github/workflows/deploy-subgraph.yml index 112031ecc..b31ab20c1 100644 --- a/.github/workflows/deploy-subgraph.yml +++ b/.github/workflows/deploy-subgraph.yml @@ -6,12 +6,20 @@ on: network: description: The network to deploy the subgraph to required: true - default: 'arbitrum-goerli' + default: 'arbitrum-sepolia' type: choice options: - - arbitrum-goerli-devnet - - arbitrum-goerli + - arbitrum-sepolia-devnet + - arbitrum-sepolia - arbitrum + subgraph: + description: The name of the subgraph to deploy + required: true + default: 'core' + type: choice + options: + - core + - drt update: description: Whether to update the subgraph with the current artifacts for the selected network. required: true @@ -58,13 +66,13 @@ jobs: if: ${{ inputs.update }} run: | export PATH=$PWD/../bin:$PATH - yarn update:${{ inputs.network }} + yarn update:${{ inputs.subgraph }}:${{ inputs.network }} working-directory: subgraph - name: Build the subgraph run: | - yarn codegen - yarn build + yarn codegen:${{ inputs.subgraph }} + yarn build:${{ inputs.subgraph }} working-directory: subgraph - name: Authenticate with TheGraph @@ -72,5 +80,5 @@ jobs: working-directory: subgraph - name: Deploy the subgraph - run: yarn deploy:${{ inputs.network }} + run: yarn deploy:${{ inputs.subgraph }}:${{ inputs.network }} working-directory: subgraph diff --git a/subgraph/README.md b/subgraph/README.md index ff5b4a4f2..25a69b51b 100644 --- a/subgraph/README.md +++ b/subgraph/README.md @@ -2,23 +2,30 @@ ## Deployments -### Arbitrum Sepolia (hosted service) +### Testnet -- [Subgraph explorer](https://thegraph.com/explorer/subgraph/kleros/kleros-v2-core-arbitrum-sepolia) -- [Subgraph endpoints](https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-core-arbitrum-sepolia) +- [Core](https://thegraph.com/studio/subgraph/kleros-v2-core-testnet/) +- [Dispute Registry Template - Arbitrum Sepolia](https://thegraph.com/studio/subgraph/kleros-v2-drt-arbisep-testnet/) + +### Devnet + +- [Core](https://thegraph.com/studio/subgraph/kleros-v2-core-devnet/) +- [Dispute Registry Template - Arbitrum Sepolia](https://thegraph.com/studio/subgraph/kleros-v2-drt-arbisep-devnet/) +- [Dispute Registry Template - Gnosis]() +- [Dispute Registry Template - Sepolia]() ## Build ```bash # update subgraph.yml using the contract deployment artifacts -$ yarn update:arbitrum-sepolia +$ yarn update:arbitrum-sepolia-devnet $ yarn codegen $ yarn build ``` -## Deployment to The Graph (hosted service) +## Deployment to The Graph Studio ### Using a personal account for development @@ -27,13 +34,13 @@ $ yarn build Get an API key from the thegraph.com, then authenticate. ```bash -$ yarn run graph auth --product hosted-service +$ yarn run graph auth --studio ``` #### Deployment ```bash -yarn deploy:arbitrum-sepolia +yarn deploy:arbitrum-sepolia-devnet ``` ### Using the Kleros organization account diff --git a/subgraph/schema.graphql b/subgraph/core/schema.graphql similarity index 100% rename from subgraph/schema.graphql rename to subgraph/core/schema.graphql diff --git a/subgraph/src/DisputeKitClassic.ts b/subgraph/core/src/DisputeKitClassic.ts similarity index 100% rename from subgraph/src/DisputeKitClassic.ts rename to subgraph/core/src/DisputeKitClassic.ts diff --git a/subgraph/src/EvidenceModule.ts b/subgraph/core/src/EvidenceModule.ts similarity index 100% rename from subgraph/src/EvidenceModule.ts rename to subgraph/core/src/EvidenceModule.ts diff --git a/subgraph/src/HomeGateway.ts b/subgraph/core/src/HomeGateway.ts similarity index 79% rename from subgraph/src/HomeGateway.ts rename to subgraph/core/src/HomeGateway.ts index 24f683529..3623dd8d4 100644 --- a/subgraph/src/HomeGateway.ts +++ b/subgraph/core/src/HomeGateway.ts @@ -1,10 +1,5 @@ -import { - HomeGateway, - Dispute as DisputeEvent, -} from "../generated/HomeGateway/HomeGateway"; -import { - GatewayDispute -} from "../generated/schema"; +import { HomeGateway, Dispute as DisputeEvent } from "../generated/HomeGateway/HomeGateway"; +import { GatewayDispute } from "../generated/schema"; export function handleDisputeEvent(event: DisputeEvent): void { const contract = HomeGateway.bind(event.address); diff --git a/subgraph/src/KlerosCore.ts b/subgraph/core/src/KlerosCore.ts similarity index 100% rename from subgraph/src/KlerosCore.ts rename to subgraph/core/src/KlerosCore.ts diff --git a/subgraph/src/PolicyRegistry.ts b/subgraph/core/src/PolicyRegistry.ts similarity index 100% rename from subgraph/src/PolicyRegistry.ts rename to subgraph/core/src/PolicyRegistry.ts diff --git a/subgraph/src/datapoint.ts b/subgraph/core/src/datapoint.ts similarity index 100% rename from subgraph/src/datapoint.ts rename to subgraph/core/src/datapoint.ts diff --git a/subgraph/src/entities/Arbitrable.ts b/subgraph/core/src/entities/Arbitrable.ts similarity index 100% rename from subgraph/src/entities/Arbitrable.ts rename to subgraph/core/src/entities/Arbitrable.ts diff --git a/subgraph/src/entities/ClassicContribution.ts b/subgraph/core/src/entities/ClassicContribution.ts similarity index 85% rename from subgraph/src/entities/ClassicContribution.ts rename to subgraph/core/src/entities/ClassicContribution.ts index d82dee48d..c21599a51 100644 --- a/subgraph/src/entities/ClassicContribution.ts +++ b/subgraph/core/src/entities/ClassicContribution.ts @@ -1,13 +1,8 @@ import { ClassicContribution } from "../../generated/schema"; -import { - Contribution as ContributionEvent, - Withdrawal, -} from "../../generated/DisputeKitClassic/DisputeKitClassic"; +import { Contribution as ContributionEvent, Withdrawal } from "../../generated/DisputeKitClassic/DisputeKitClassic"; import { DISPUTEKIT_ID } from "../DisputeKitClassic"; -export function ensureClassicContributionFromEvent( - event: T -): ClassicContribution | null { +export function ensureClassicContributionFromEvent(event: T): ClassicContribution | null { if (!(event instanceof ContributionEvent) && !(event instanceof Withdrawal)) { return null; } diff --git a/subgraph/src/entities/ClassicDispute.ts b/subgraph/core/src/entities/ClassicDispute.ts similarity index 100% rename from subgraph/src/entities/ClassicDispute.ts rename to subgraph/core/src/entities/ClassicDispute.ts diff --git a/subgraph/src/entities/ClassicEvidenceGroup.ts b/subgraph/core/src/entities/ClassicEvidenceGroup.ts similarity index 100% rename from subgraph/src/entities/ClassicEvidenceGroup.ts rename to subgraph/core/src/entities/ClassicEvidenceGroup.ts diff --git a/subgraph/src/entities/ClassicRound.ts b/subgraph/core/src/entities/ClassicRound.ts similarity index 100% rename from subgraph/src/entities/ClassicRound.ts rename to subgraph/core/src/entities/ClassicRound.ts diff --git a/subgraph/src/entities/ClassicVote.ts b/subgraph/core/src/entities/ClassicVote.ts similarity index 100% rename from subgraph/src/entities/ClassicVote.ts rename to subgraph/core/src/entities/ClassicVote.ts diff --git a/subgraph/src/entities/Court.ts b/subgraph/core/src/entities/Court.ts similarity index 100% rename from subgraph/src/entities/Court.ts rename to subgraph/core/src/entities/Court.ts diff --git a/subgraph/src/entities/Dispute.ts b/subgraph/core/src/entities/Dispute.ts similarity index 100% rename from subgraph/src/entities/Dispute.ts rename to subgraph/core/src/entities/Dispute.ts diff --git a/subgraph/src/entities/DisputeKit.ts b/subgraph/core/src/entities/DisputeKit.ts similarity index 100% rename from subgraph/src/entities/DisputeKit.ts rename to subgraph/core/src/entities/DisputeKit.ts diff --git a/subgraph/src/entities/Draw.ts b/subgraph/core/src/entities/Draw.ts similarity index 100% rename from subgraph/src/entities/Draw.ts rename to subgraph/core/src/entities/Draw.ts diff --git a/subgraph/src/entities/FeeToken.ts b/subgraph/core/src/entities/FeeToken.ts similarity index 100% rename from subgraph/src/entities/FeeToken.ts rename to subgraph/core/src/entities/FeeToken.ts diff --git a/subgraph/src/entities/JurorTokensPerCourt.ts b/subgraph/core/src/entities/JurorTokensPerCourt.ts similarity index 100% rename from subgraph/src/entities/JurorTokensPerCourt.ts rename to subgraph/core/src/entities/JurorTokensPerCourt.ts diff --git a/subgraph/src/entities/Penalty.ts b/subgraph/core/src/entities/Penalty.ts similarity index 100% rename from subgraph/src/entities/Penalty.ts rename to subgraph/core/src/entities/Penalty.ts diff --git a/subgraph/src/entities/PeriodIndexCounter.ts b/subgraph/core/src/entities/PeriodIndexCounter.ts similarity index 100% rename from subgraph/src/entities/PeriodIndexCounter.ts rename to subgraph/core/src/entities/PeriodIndexCounter.ts diff --git a/subgraph/src/entities/Round.ts b/subgraph/core/src/entities/Round.ts similarity index 100% rename from subgraph/src/entities/Round.ts rename to subgraph/core/src/entities/Round.ts diff --git a/subgraph/src/entities/TokenAndEthShift.ts b/subgraph/core/src/entities/TokenAndEthShift.ts similarity index 100% rename from subgraph/src/entities/TokenAndEthShift.ts rename to subgraph/core/src/entities/TokenAndEthShift.ts diff --git a/subgraph/src/entities/User.ts b/subgraph/core/src/entities/User.ts similarity index 100% rename from subgraph/src/entities/User.ts rename to subgraph/core/src/entities/User.ts diff --git a/subgraph/src/utils.ts b/subgraph/core/src/utils.ts similarity index 100% rename from subgraph/src/utils.ts rename to subgraph/core/src/utils.ts diff --git a/subgraph/subgraph.yaml b/subgraph/core/subgraph.yaml similarity index 90% rename from subgraph/subgraph.yaml rename to subgraph/core/subgraph.yaml index b8133448e..5464349fe 100644 --- a/subgraph/subgraph.yaml +++ b/subgraph/core/subgraph.yaml @@ -26,9 +26,9 @@ dataSources: - Counter abis: - name: DisputeKitClassic - file: ../contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json + file: ../../contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json - name: KlerosCore - file: ../contracts/deployments/arbitrumSepoliaDevnet/KlerosCore.json + file: ../../contracts/deployments/arbitrumSepoliaDevnet/KlerosCore.json eventHandlers: - event: AppealDecision(indexed uint256,indexed address) handler: handleAppealDecision @@ -75,7 +75,7 @@ dataSources: - Court abis: - name: PolicyRegistry - file: ../contracts/deployments/arbitrumSepoliaDevnet/PolicyRegistry.json + file: ../../contracts/deployments/arbitrumSepoliaDevnet/PolicyRegistry.json eventHandlers: - event: PolicyUpdate(indexed uint256,string,string) handler: handlePolicyUpdate @@ -98,9 +98,9 @@ dataSources: - ClassicContribution abis: - name: DisputeKitClassic - file: ../contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json + file: ../../contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json - name: KlerosCore - file: ../contracts/deployments/arbitrumSepoliaDevnet/KlerosCore.json + file: ../../contracts/deployments/arbitrumSepoliaDevnet/KlerosCore.json eventHandlers: - event: DisputeCreation(indexed uint256,uint256,bytes) handler: handleDisputeCreation @@ -131,7 +131,7 @@ dataSources: - ClassicEvidence abis: - name: EvidenceModule - file: ../contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule.json + file: ../../contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule.json eventHandlers: - event: Evidence(indexed uint256,indexed address,string) handler: handleEvidenceEvent diff --git a/subgraph/tests/user.test.ts b/subgraph/core/tests/user.test.ts similarity index 100% rename from subgraph/tests/user.test.ts rename to subgraph/core/tests/user.test.ts diff --git a/subgraph/DisputeTemplateRegistry/schema.graphql b/subgraph/dispute-template-registry/schema.graphql similarity index 100% rename from subgraph/DisputeTemplateRegistry/schema.graphql rename to subgraph/dispute-template-registry/schema.graphql diff --git a/subgraph/DisputeTemplateRegistry/src/DisputeTemplateRegistry.ts b/subgraph/dispute-template-registry/src/DisputeTemplateRegistry.ts similarity index 100% rename from subgraph/DisputeTemplateRegistry/src/DisputeTemplateRegistry.ts rename to subgraph/dispute-template-registry/src/DisputeTemplateRegistry.ts diff --git a/subgraph/DisputeTemplateRegistry/subgraph.yaml b/subgraph/dispute-template-registry/subgraph.yaml similarity index 100% rename from subgraph/DisputeTemplateRegistry/subgraph.yaml rename to subgraph/dispute-template-registry/subgraph.yaml diff --git a/subgraph/package.json b/subgraph/package.json index 1472461e1..93d089be5 100644 --- a/subgraph/package.json +++ b/subgraph/package.json @@ -2,26 +2,37 @@ "name": "@kleros/kleros-v2-subgraph", "license": "MIT", "scripts": { - "update:core:arbitrum-sepolia": "./scripts/update.sh arbitrumSepolia arbitrum-sepolia", - "update:core:arbitrum-sepolia-devnet": "./scripts/update.sh arbitrumSepoliaDevnet arbitrum-sepolia", - "update:core:arbitrum": "./scripts/update.sh arbitrum arbitrum", - "update:core:local": "./scripts/update.sh localhost mainnet", - "codegen:core": "graph codegen", - "build:core": "graph build", - "test:core": "graph test", - "clean:core": "graph clean && rm subgraph.yaml.bak.*", - "deploy:core:arbitrum-sepolia": "graph deploy --product subgraph-studio kleros-v2-core-testnet-3 -l v0.0.1", - "deploy:core:arbitrum-sepolia-devnet": "graph deploy --product subgraph-studio kleros-v2-core-devnet -l v0.0.1", - "deploy:core:arbitrum": "graph deploy --product subgraph-studio kleros-v2-core -l v0.0.1", - "update:dr:arbitrum-sepolia": "TODO", - "update:dr:arbitrum-sepolia-devnet": "TODO", - "update:dr:arbitrum": "TODO", - "update:dr:local": "TODO", - "codegen:dr": "cd DisputeTemplateRegistry && graph codegen ./subgraph.yaml", - "build:dr": "cd DisputeTemplateRegistry && graph build ./subgraph.yaml", - "test:dr": "TODO", - "clean:dr": "cd DisputeTemplateRegistry && graph clean ./subgraph.yaml", - "deploy:dr:arbitrum-sepolia-devnet": "cd DisputeTemplateRegistry && graph deploy --product subgraph-studio kleros-v2-dr-devnet -l v0.0.1 ./subgraph.yaml", + "update:core:arbitrum-sepolia-devnet": "./scripts/update.sh arbitrumSepoliaDevnet arbitrum-sepolia core/subgraph.yaml", + "update:core:arbitrum-sepolia": "./scripts/update.sh arbitrumSepolia arbitrum-sepolia core/subgraph.yaml", + "update:core:arbitrum": "./scripts/update.sh arbitrum arbitrum core/subgraph.yaml", + "update:core:local": "./scripts/update.sh localhost mainnet core/subgraph.yaml", + "codegen:core": "graph codegen --output-dir core/generated/ core/subgraph.yaml", + "build:core": "graph build --output-dir core/build/ core/subgraph.yaml", + "test:core": "cd core && graph test", + "clean:core": "graph clean --codegen-dir core/generated/ --build-dir core/build/ && rm core/subgraph.yaml.bak.*", + "deploy:core:arbitrum-sepolia-devnet": "graph deploy --product subgraph-studio kleros-v2-core-devnet -l v0.0.1 core/subgraph.yaml", + "deploy:core:arbitrum-sepolia": "graph deploy --product subgraph-studio kleros-v2-core-testnet -l v0.0.1 core/subgraph.yaml", + "deploy:core:arbitrum": "graph deploy --product subgraph-studio kleros-v2-core -l v0.0.1 core/subgraph.yaml", + "": "------------------------------------------------------------------------------------------", + "update:drt:arbitrum-sepolia-devnet": "./scripts/update.sh arbitrumSepoliaDevnet arbitrum-sepolia dispute-template-registry/subgraph.yaml", + "update:drt:arbitrum-sepolia": "./scripts/update.sh arbitrumSepolia arbitrum-sepolia dispute-template-registry/subgraph.yaml", + "update:drt:arbitrum": "./scripts/update.sh arbitrum arbitrum dispute-template-registry/subgraph.yaml", + "update:drt:local": "./scripts/update.sh localhost mainnet dispute-template-registry/subgraph.yaml", + "codegen:drt": "graph codegen --output-dir dispute-template-registry/generated/ dispute-template-registry/subgraph.yaml", + "build:drt": "graph build --output-dir dispute-template-registry/generated/ dispute-template-registry/subgraph.yaml", + "test:drt": "cd dispute-template-registry && graph test ", + "clean:drt": "graph clean --codegen-dir dispute-template-registry/generated/ --build-dir dispute-template-registry/build/ && rm dispute-template-registry/subgraph.yaml.bak.*", + "deploy:drt:arbitrum-sepolia-devnet": "graph deploy --product subgraph-studio kleros-v2-drt-arbisep-devnet -l v0.0.1 dispute-template-registry/subgraph.yaml", + "deploy:drt:arbitrum-sepolia": "graph deploy --product subgraph-studio kleros-v2-drt-arbisep-testnet -l v0.0.1 dispute-template-registry/subgraph.yaml", + " ": "-----------------------------------------------------------------------------------------", + "update:arbitrum-sepolia-devnet": "./scripts/all.sh update arbitrum-sepolia-devnet", + "update:arbitrum-sepolia": "./scripts/all.sh update arbitrum-sepolia", + "update:arbitrum": "./scripts/all.sh update arbitrum", + "update:local": "./scripts/all.sh update local", + "clean": "./scripts/all.sh clean", + "codegen": "./scripts/all.sh codegen", + "build": "./scripts/all.sh build", + " ": "----------------------------------------------------------------------------------------", "create-local": "graph create --node http://localhost:8020/ kleros/kleros-v2-core-local", "remove-local": "graph remove --node http://localhost:8020/ kleros/kleros-v2-core-local", "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 kleros/kleros-v2-core-local --version-label v$(date +%s)", diff --git a/subgraph/scripts/all.sh b/subgraph/scripts/all.sh new file mode 100755 index 000000000..e73954695 --- /dev/null +++ b/subgraph/scripts/all.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +cmdPrefix="$1" +cmdPostfix="$2" +if [ -z "$cmdPrefix" ] +then + echo "Usage: $(basename $0) []" + exit 1 +fi + +for subgraph in core drt +do + echo "Running for $subgraph" + yarn "${cmdPrefix}:${subgraph}${cmdPostfix:+:}${cmdPostfix}" +done diff --git a/subgraph/scripts/update.sh b/subgraph/scripts/update.sh index 87c7ce85d..19ba7e293 100755 --- a/subgraph/scripts/update.sh +++ b/subgraph/scripts/update.sh @@ -2,31 +2,32 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -function update() #hardhatNetwork #graphNetwork #dataSourceIndex #contract +function update() #hardhatNetwork #graphNetwork #subgraphConfig #dataSourceIndex #contract { local hardhatNetwork="$1" local graphNetwork="$2" - local dataSourceIndex="$3" - local contract="$4" + local subgraphConfig="$3" + local dataSourceIndex="$4" + local contract="$5" local artifact="$SCRIPT_DIR/../../contracts/deployments/$hardhatNetwork/$contract.json" # Set the address address=$(cat "$artifact" | jq '.address') - yq -i ".dataSources[$dataSourceIndex].source.address=$address" "$SCRIPT_DIR"/../subgraph.yaml + yq -i ".dataSources[$dataSourceIndex].source.address=$address" "$subgraphConfig" # Set the start block blockNumber="$(cat "$artifact" | jq '.receipt.blockNumber')" - yq -i ".dataSources[$dataSourceIndex].source.startBlock=$blockNumber" "$SCRIPT_DIR"/../subgraph.yaml + yq -i ".dataSources[$dataSourceIndex].source.startBlock=$blockNumber" "$subgraphConfig" # Set the Graph network - graphNetwork=$graphNetwork yq -i ".dataSources[$dataSourceIndex].network=env(graphNetwork)" "$SCRIPT_DIR"/../subgraph.yaml + graphNetwork=$graphNetwork yq -i ".dataSources[$dataSourceIndex].network=env(graphNetwork)" "$subgraphConfig" # Set the ABIs path for this Hardhat network abiIndex=0 - for f in $(yq e .dataSources[$dataSourceIndex].mapping.abis[].file subgraph.yaml -o json -I 0 | jq -sr '.[]') + for f in $(yq e .dataSources[$dataSourceIndex].mapping.abis[].file "$subgraphConfig" -o json -I 0 | jq -sr '.[]') do f2=$(echo $f | sed "s|\(.*\/deployments\/\).*\/|\1$hardhatNetwork\/|") - yq -i ".dataSources[$dataSourceIndex].mapping.abis[$abiIndex].file=\"$f2\"" "$SCRIPT_DIR"/../subgraph.yaml + yq -i ".dataSources[$dataSourceIndex].mapping.abis[$abiIndex].file=\"$f2\"" "$subgraphConfig" (( ++abiIndex )) done } @@ -36,13 +37,16 @@ hardhatNetwork=${1:-arbitrumSepolia} # as per https://thegraph.com/docs/en/developing/supported-networks/ graphNetwork=${2:-arbitrum\-sepolia} -i=0 + +subgraphConfig="$SCRIPT_DIR/../${3:-core\/subgraph.yaml}" +echo "Updating $subgraphConfig" # backup -cp "$SCRIPT_DIR"/../subgraph.yaml "$SCRIPT_DIR"/../subgraph.yaml.bak.$(date +%s) +cp "$subgraphConfig" "$subgraphConfig.bak.$(date +%s)" -for contract in $(yq .dataSources[].name "$SCRIPT_DIR"/../subgraph.yaml) +i=0 +for contract in $(yq .dataSources[].name "$subgraphConfig") do - update $hardhatNetwork $graphNetwork $i $contract + update $hardhatNetwork $graphNetwork "$subgraphConfig" $i $contract (( ++i )) done diff --git a/web/.env.devnet.public b/web/.env.devnet.public index 4336a13c5..d62dc6b7a 100644 --- a/web/.env.devnet.public +++ b/web/.env.devnet.public @@ -1,5 +1,5 @@ # Do not enter sensitive information here. export REACT_APP_DEPLOYMENT=devnet -export REACT_APP_KLEROS_CORE_SUBGRAPH_DEVNET=https://api.studio.thegraph.com/query/61688/kleros-v2-core-devnet/v0.0.1 -export REACT_APP_DISPUTE_TEMPLATE_ARBSEPOLIA_SUBGRAPH_DEVNET=https://api.studio.thegraph.com/query/61688/kleros-v2-dr-devnet/v0.0.1 +export REACT_APP_CORE_SUBGRAPH=https://api.studio.thegraph.com/query/61738/kleros-v2-core-devnet/v0.0.1 +export REACT_APP_DRT_ARBSEPOLIA_SUBGRAPH=https://api.studio.thegraph.com/query/61738/kleros-v2-drt-arbisep-devnet/v0.0.1 export REACT_APP_STATUS_URL=https://kleros-v2-devnet.betteruptime.com/badge \ No newline at end of file diff --git a/web/.env.local.public b/web/.env.local.public index bb3c3e014..31bd361cb 100644 --- a/web/.env.local.public +++ b/web/.env.local.public @@ -1,4 +1,4 @@ # Do not enter sensitive information here. export REACT_APP_DEPLOYMENT=devnet -export REACT_APP_KLEROS_CORE_SUBGRAPH_DEVNET=http://localhost:8000/subgraphs/name/kleros/kleros-v2-core-local -export REACT_APP_DISPUTE_TEMPLATE_ARBSEPOLIA_SUBGRAPH_DEVNET=https://api.thegraph.com/subgraphs/name/alcercu/templateregistrydevnet +export REACT_APP_CORE_SUBGRAPH=http://localhost:8000/subgraphs/name/kleros/kleros-v2-core-local +export REACT_APP_DRT_ARBSEPOLIA_SUBGRAPH=https://api.thegraph.com/subgraphs/name/alcercu/templateregistrydevnet diff --git a/web/.env.testnet.public b/web/.env.testnet.public index 07c5c8780..daca8c206 100644 --- a/web/.env.testnet.public +++ b/web/.env.testnet.public @@ -1,5 +1,5 @@ # Do not enter sensitive information here. export REACT_APP_DEPLOYMENT=testnet -export REACT_APP_KLEROS_CORE_SUBGRAPH_TESTNET=REDEPLOY SUBGRAPH IN ARBSEPOLIA AND PUT API THEGRAPH LINK HERE -export REACT_APP_DISPUTE_TEMPLATE_ARBSEPOLIA_SUBGRAPH_TESTNET=REDEPLOY SUBGRAPH IN ARBSEPOLIA AND PUT API THEGRAPH LINK HERE +export REACT_APP_CORE_SUBGRAPH=REDEPLOY SUBGRAPH IN ARBSEPOLIA AND PUT API THEGRAPH LINK HERE +export REACT_APP_DRT_ARBSEPOLIA_SUBGRAPH=REDEPLOY SUBGRAPH IN ARBSEPOLIA AND PUT API THEGRAPH LINK HERE export REACT_APP_STATUS_URL=https://kleros-v2.betteruptime.com/badge diff --git a/web/src/utils/graphqlQueryFnHelper.ts b/web/src/utils/graphqlQueryFnHelper.ts index ea7d3685c..4d3ecbae4 100644 --- a/web/src/utils/graphqlQueryFnHelper.ts +++ b/web/src/utils/graphqlQueryFnHelper.ts @@ -1,30 +1,13 @@ import request from "graphql-request"; import { TypedDocumentNode } from "@graphql-typed-document-node/core"; -const DEPLOYMENT = process.env.REACT_APP_DEPLOYMENT?.toUpperCase() ?? "TESTNET"; - -const DEPLOYMENTS_TO_KLEROS_CORE_SUBGRAPHS = { - MAINNET: process.env.REACT_APP_KLEROS_CORE_SUBGRAPH_MAINNET, - TESTNET: process.env.REACT_APP_KLEROS_CORE_SUBGRAPH_TESTNET, - DEVNET: process.env.REACT_APP_KLEROS_CORE_SUBGRAPH_DEVNET, -}; - -const DEPLOYMENTS_TO_DISPUTE_TEMPLATE_ARBSEPOLIA_SUBGRAPHS = { - MAINNET: process.env.REACT_APP_DISPUTE_TEMPLATE_ARBSEPOLIA_SUBGRAPH_MAINNET, - TESTNET: process.env.REACT_APP_DISPUTE_TEMPLATE_ARBSEPOLIA_SUBGRAPH_TESTNET, - DEVNET: process.env.REACT_APP_DISPUTE_TEMPLATE_ARBSEPOLIA_SUBGRAPH_DEVNET, -}; - const CHAINID_TO_DISPUTE_TEMPLATE_SUBGRAPH = { 421614: - DEPLOYMENTS_TO_DISPUTE_TEMPLATE_ARBSEPOLIA_SUBGRAPHS[DEPLOYMENT] ?? - "https://api.thegraph.com/subgraphs/name/alcercu/disputetemplateregistryarbgrli", + process.env.REACT_APP_DRT_ARBSEPOLIA_SUBGRAPH ?? "Wrong Subgraph URL. Please check the environment variables.", }; export const graphqlUrl = (isDisputeTemplate = false, chainId = 421614) => { - const coreUrl = - DEPLOYMENTS_TO_KLEROS_CORE_SUBGRAPHS[DEPLOYMENT] ?? - "https://api.thegraph.com/subgraphs/name/alcercu/kleroscoretest"; + const coreUrl = process.env.REACT_APP_CORE_SUBGRAPH ?? "Wrong Subgraph URL. Please check the environment variables."; return isDisputeTemplate ? CHAINID_TO_DISPUTE_TEMPLATE_SUBGRAPH[chainId] : coreUrl; }; From d96b7819b0604a572ca9a484464b1a7038410cb8 Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Tue, 19 Dec 2023 17:46:40 +0530 Subject: [PATCH 49/77] chore: add-sortition-module-as-dataSource --- subgraph/core/src/KlerosCore.ts | 32 ++---- subgraph/core/src/SortitionModule.ts | 48 +++++++++ .../core/src/entities/JurorTokensPerCourt.ts | 18 +++- subgraph/core/subgraph.yaml | 33 +++++- subgraph/core/tests/sortition-module-utils.ts | 101 ++++++++++++++++++ subgraph/core/tests/sortition-module.test.ts | 39 +++++++ 6 files changed, 238 insertions(+), 33 deletions(-) create mode 100644 subgraph/core/src/SortitionModule.ts create mode 100644 subgraph/core/tests/sortition-module-utils.ts create mode 100644 subgraph/core/tests/sortition-module.test.ts diff --git a/subgraph/core/src/KlerosCore.ts b/subgraph/core/src/KlerosCore.ts index cfb2b57b4..a8dee3fdc 100644 --- a/subgraph/core/src/KlerosCore.ts +++ b/subgraph/core/src/KlerosCore.ts @@ -20,7 +20,7 @@ import { createDisputeFromEvent } from "./entities/Dispute"; import { createRoundFromRoundInfo } from "./entities/Round"; import { updateCases, updateCasesAppealing, updateCasesRuled, updateCasesVoting } from "./datapoint"; import { addUserActiveDispute, ensureUser } from "./entities/User"; -import { updateJurorDelayedStake, updateJurorStake } from "./entities/JurorTokensPerCourt"; +import { updateJurorStake } from "./entities/JurorTokensPerCourt"; import { createDrawFromEvent } from "./entities/Draw"; import { updateTokenAndEthShiftFromEvent } from "./entities/TokenAndEthShift"; import { updateArbitrableCases } from "./entities/Arbitrable"; @@ -29,6 +29,7 @@ import { BigInt } from "@graphprotocol/graph-ts"; import { updatePenalty } from "./entities/Penalty"; import { ensureFeeToken } from "./entities/FeeToken"; import { getAndIncrementPeriodCounter } from "./entities/PeriodIndexCounter"; +import { SortitionModule } from "../generated/SortitionModule/SortitionModule"; function getPeriodName(index: i32): string { const periodArray = ["evidence", "commit", "vote", "appeal", "execution"]; @@ -177,31 +178,14 @@ export function handleDraw(event: DrawEvent): void { const disputeID = event.params._disputeID.toString(); const dispute = Dispute.load(disputeID); if (!dispute) return; - const contract = KlerosCore.bind(event.address); + const klerosCore = KlerosCore.bind(event.address); + const sortitionModule = SortitionModule.bind(klerosCore.sortitionModule()); + const jurorAddress = event.params._address.toHexString(); - updateJurorStake(jurorAddress, dispute.court, contract, event.block.timestamp); + updateJurorStake(jurorAddress, dispute.court, sortitionModule, event.block.timestamp); addUserActiveDispute(jurorAddress, disputeID); } -// TODO: index the sortition module and handle these events there -// export function handleStakeSet(event: StakeSet): void { -// const jurorAddress = event.params._address.toHexString(); -// ensureUser(jurorAddress); -// const courtID = event.params._courtID.toString(); - -// updateJurorStake(jurorAddress, courtID.toString(), KlerosCore.bind(event.address), event.block.timestamp); - -// // Check if the transaction the event comes from is executeDelayedStakes -// if (event.transaction.input.toHexString().substring(0, 10) === "0x35975f4a") { -// updateJurorDelayedStake(jurorAddress, courtID, ZERO.minus(event.params._amount)); -// } -// } - -// TODO: index the sortition module and handle these events there -// export function handleStakeDelayedNotTransferred(event: StakeDelayedNotTransferred): void { -// updateJurorDelayedStake(event.params._address.toHexString(), event.params._courtID.toString(), event.params._amount); -// } - export function handleTokenAndETHShift(event: TokenAndETHShiftEvent): void { updatePenalty(event); updateTokenAndEthShiftFromEvent(event); @@ -211,7 +195,9 @@ export function handleTokenAndETHShift(event: TokenAndETHShiftEvent): void { if (!dispute) return; const court = Court.load(dispute.court); if (!court) return; - updateJurorStake(jurorAddress, court.id, KlerosCore.bind(event.address), event.block.timestamp); + const klerosCore = KlerosCore.bind(event.address); + const sortitionModule = SortitionModule.bind(klerosCore.sortitionModule()); + updateJurorStake(jurorAddress, court.id, sortitionModule, event.block.timestamp); } export function handleAcceptedFeeToken(event: AcceptedFeeToken): void { diff --git a/subgraph/core/src/SortitionModule.ts b/subgraph/core/src/SortitionModule.ts new file mode 100644 index 000000000..12756967e --- /dev/null +++ b/subgraph/core/src/SortitionModule.ts @@ -0,0 +1,48 @@ +import { + SortitionModule, + StakeDelayedAlreadyTransferred, + StakeDelayedAlreadyTransferredWithdrawn, + StakeDelayedNotTransferred, + StakeLocked, + StakeSet, +} from "../generated/SortitionModule/SortitionModule"; + +import { updateJurorDelayedStake, updateJurorStake } from "./entities/JurorTokensPerCourt"; +import { ensureUser } from "./entities/User"; +import { ZERO } from "./utils"; + +export function handleStakeDelayedAlreadyTransferred(event: StakeDelayedAlreadyTransferred): void { + const jurorAddress = event.params._address.toHexString(); + ensureUser(jurorAddress); + const courtID = event.params._courtID.toString(); + + updateJurorStake(jurorAddress, courtID.toString(), SortitionModule.bind(event.address), event.block.timestamp); + + //stake is updated instantly so no delayed amount, set delay amount to zero + updateJurorDelayedStake(jurorAddress, courtID, ZERO); +} + +export function handleStakeDelayedAlreadyTransferredWithdrawn(event: StakeDelayedAlreadyTransferredWithdrawn): void { + const jurorAddress = event.params._address.toHexString(); + ensureUser(jurorAddress); + const courtID = event.params._courtID.toString(); + + updateJurorStake(jurorAddress, courtID.toString(), SortitionModule.bind(event.address), event.block.timestamp); + + updateJurorDelayedStake(jurorAddress, courtID, ZERO); +} + +export function handleStakeDelayedNotTransferred(event: StakeDelayedNotTransferred): void { + updateJurorDelayedStake(event.params._address.toHexString(), event.params._courtID.toString(), event.params._amount); +} + +export function handleStakeSet(event: StakeSet): void { + const jurorAddress = event.params._address.toHexString(); + ensureUser(jurorAddress); + const courtID = event.params._courtID.toString(); + + updateJurorStake(jurorAddress, courtID.toString(), SortitionModule.bind(event.address), event.block.timestamp); + //stake is updated instantly so no delayed amount, set delay amount to zero + updateJurorDelayedStake(jurorAddress, courtID, ZERO); +} +export function handleStakeLocked(event: StakeLocked): void {} diff --git a/subgraph/core/src/entities/JurorTokensPerCourt.ts b/subgraph/core/src/entities/JurorTokensPerCourt.ts index 6365c972c..db8568729 100644 --- a/subgraph/core/src/entities/JurorTokensPerCourt.ts +++ b/subgraph/core/src/entities/JurorTokensPerCourt.ts @@ -1,9 +1,9 @@ import { BigInt, Address } from "@graphprotocol/graph-ts"; -import { KlerosCore } from "../../generated/KlerosCore/KlerosCore"; import { Court, JurorTokensPerCourt } from "../../generated/schema"; import { updateActiveJurors, getDelta, updateStakedPNK } from "../datapoint"; import { ensureUser } from "./User"; import { ONE, ZERO } from "../utils"; +import { SortitionModule } from "../../generated/SortitionModule/SortitionModule"; export function ensureJurorTokensPerCourt(jurorAddress: string, courtID: string): JurorTokensPerCourt { const id = `${jurorAddress}-${courtID}`; @@ -30,7 +30,12 @@ export function createJurorTokensPerCourt(jurorAddress: string, courtID: string) return jurorTokens; } -export function updateJurorStake(jurorAddress: string, courtID: string, contract: KlerosCore, timestamp: BigInt): void { +export function updateJurorStake( + jurorAddress: string, + courtID: string, + contract: SortitionModule, + timestamp: BigInt +): void { const juror = ensureUser(jurorAddress); const court = Court.load(courtID); if (!court) return; @@ -61,9 +66,12 @@ export function updateJurorDelayedStake(jurorAddress: string, courtID: string, a const court = Court.load(courtID); if (!court) return; const jurorTokens = ensureJurorTokensPerCourt(jurorAddress, courtID); - jurorTokens.delayed = jurorTokens.delayed.plus(amount); - juror.totalDelayed = juror.totalDelayed.plus(amount); - court.delayedStake = court.stake.plus(amount); + let lastDelayedAmount = jurorTokens.delayed; + + jurorTokens.delayed = amount; + //since we need to track only the latest delay amount now, subtract the previous amount and add the new amount + juror.totalDelayed = juror.totalDelayed.plus(amount).minus(lastDelayedAmount); + court.delayedStake = court.stake.plus(amount).minus(lastDelayedAmount); jurorTokens.save(); juror.save(); court.save(); diff --git a/subgraph/core/subgraph.yaml b/subgraph/core/subgraph.yaml index 5464349fe..40612313b 100644 --- a/subgraph/core/subgraph.yaml +++ b/subgraph/core/subgraph.yaml @@ -46,11 +46,6 @@ dataSources: handler: handleDisputeKitCreated - event: DisputeKitEnabled(indexed uint96,indexed uint256,indexed bool) handler: handleDisputeKitEnabled - # TODO: index the sortition module and handle these events there - # - event: StakeSet(indexed address,uint256,uint256) - # handler: handleStakeSet - # - event: StakeDelayedNotTransferred(indexed address,uint256,uint256) - # handler: handleStakeDelayedNotTransferred - event: TokenAndETHShift(indexed address,indexed uint256,indexed uint256,uint256,int256,int256,address) handler: handleTokenAndETHShift - event: Ruling(indexed address,indexed uint256,uint256) @@ -136,3 +131,31 @@ dataSources: - event: Evidence(indexed uint256,indexed address,string) handler: handleEvidenceEvent file: ./src/EvidenceModule.ts + - kind: ethereum + name: SortitionModule + network: mainnet + source: + address: "0x3Aa5ebB10DC797CAC828524e59A333d0A371443c" + abi: SortitionModule + startBlock: 20 + mapping: + kind: ethereum/events + apiVersion: 0.0.6 + language: wasm/assemblyscript + entities: + - JurorTokensPerCourt + abis: + - name: SortitionModule + file: ../contracts/deployments/localhost/SortitionModule.json + eventHandlers: + - event: StakeDelayedAlreadyTransferred(indexed address,uint256,uint256) + handler: handleStakeDelayedAlreadyTransferred + - event: StakeDelayedAlreadyTransferredWithdrawn(indexed address,indexed uint96,uint256) + handler: handleStakeDelayedAlreadyTransferredWithdrawn + - event: StakeDelayedNotTransferred(indexed address,uint256,uint256) + handler: handleStakeDelayedNotTransferred + - event: StakeLocked(indexed address,uint256,bool) + handler: handleStakeLocked + - event: StakeSet(indexed address,uint256,uint256) + handler: handleStakeSet + file: ./src/SortitionModule.ts diff --git a/subgraph/core/tests/sortition-module-utils.ts b/subgraph/core/tests/sortition-module-utils.ts new file mode 100644 index 000000000..2f999a75d --- /dev/null +++ b/subgraph/core/tests/sortition-module-utils.ts @@ -0,0 +1,101 @@ +import { newMockEvent } from "matchstick-as"; +import { ethereum, BigInt, Address } from "@graphprotocol/graph-ts"; +import { + StakeDelayedAlreadyTransferred, + StakeDelayedAlreadyTransferredWithdrawn, + StakeDelayedNotTransferred, + StakeLocked, + StakeSet, +} from "../generated/SortitionModule/SortitionModule"; + +export function createStakeDelayedAlreadyTransferredEvent( + _address: Address, + _courtID: BigInt, + _amount: BigInt +): StakeDelayedAlreadyTransferred { + let stakeDelayedAlreadyTransferredEvent: StakeDelayedAlreadyTransferred = newMockEvent(); + + stakeDelayedAlreadyTransferredEvent.parameters = new Array(); + + stakeDelayedAlreadyTransferredEvent.parameters.push( + new ethereum.EventParam("_address", ethereum.Value.fromAddress(_address)) + ); + stakeDelayedAlreadyTransferredEvent.parameters.push( + new ethereum.EventParam("_courtID", ethereum.Value.fromUnsignedBigInt(_courtID)) + ); + stakeDelayedAlreadyTransferredEvent.parameters.push( + new ethereum.EventParam("_amount", ethereum.Value.fromUnsignedBigInt(_amount)) + ); + + return stakeDelayedAlreadyTransferredEvent; +} + +export function createStakeDelayedAlreadyTransferredWithdrawnEvent( + _address: Address, + _courtID: BigInt, + _amount: BigInt +): StakeDelayedAlreadyTransferredWithdrawn { + let stakeDelayedAlreadyTransferredWithdrawnEvent = newMockEvent(); + + stakeDelayedAlreadyTransferredWithdrawnEvent.parameters = new Array(); + + stakeDelayedAlreadyTransferredWithdrawnEvent.parameters.push( + new ethereum.EventParam("_address", ethereum.Value.fromAddress(_address)) + ); + stakeDelayedAlreadyTransferredWithdrawnEvent.parameters.push( + new ethereum.EventParam("_courtID", ethereum.Value.fromUnsignedBigInt(_courtID)) + ); + stakeDelayedAlreadyTransferredWithdrawnEvent.parameters.push( + new ethereum.EventParam("_amount", ethereum.Value.fromUnsignedBigInt(_amount)) + ); + + return stakeDelayedAlreadyTransferredWithdrawnEvent; +} + +export function createStakeDelayedNotTransferredEvent( + _address: Address, + _courtID: BigInt, + _amount: BigInt +): StakeDelayedNotTransferred { + let stakeDelayedNotTransferredEvent = newMockEvent(); + + stakeDelayedNotTransferredEvent.parameters = new Array(); + + stakeDelayedNotTransferredEvent.parameters.push( + new ethereum.EventParam("_address", ethereum.Value.fromAddress(_address)) + ); + stakeDelayedNotTransferredEvent.parameters.push( + new ethereum.EventParam("_courtID", ethereum.Value.fromUnsignedBigInt(_courtID)) + ); + stakeDelayedNotTransferredEvent.parameters.push( + new ethereum.EventParam("_amount", ethereum.Value.fromUnsignedBigInt(_amount)) + ); + + return stakeDelayedNotTransferredEvent; +} + +export function createStakeLockedEvent(_address: Address, _relativeAmount: BigInt, _unlock: boolean): StakeLocked { + let stakeLockedEvent = newMockEvent(); + + stakeLockedEvent.parameters = new Array(); + + stakeLockedEvent.parameters.push(new ethereum.EventParam("_address", ethereum.Value.fromAddress(_address))); + stakeLockedEvent.parameters.push( + new ethereum.EventParam("_relativeAmount", ethereum.Value.fromUnsignedBigInt(_relativeAmount)) + ); + stakeLockedEvent.parameters.push(new ethereum.EventParam("_unlock", ethereum.Value.fromBoolean(_unlock))); + + return stakeLockedEvent; +} + +export function createStakeSetEvent(_address: Address, _courtID: BigInt, _amount: BigInt): StakeSet { + let stakeSetEvent = newMockEvent(); + + stakeSetEvent.parameters = new Array(); + + stakeSetEvent.parameters.push(new ethereum.EventParam("_address", ethereum.Value.fromAddress(_address))); + stakeSetEvent.parameters.push(new ethereum.EventParam("_courtID", ethereum.Value.fromUnsignedBigInt(_courtID))); + stakeSetEvent.parameters.push(new ethereum.EventParam("_amount", ethereum.Value.fromUnsignedBigInt(_amount))); + + return stakeSetEvent; +} diff --git a/subgraph/core/tests/sortition-module.test.ts b/subgraph/core/tests/sortition-module.test.ts new file mode 100644 index 000000000..8533bd894 --- /dev/null +++ b/subgraph/core/tests/sortition-module.test.ts @@ -0,0 +1,39 @@ +import { assert, describe, test, clearStore, beforeAll, afterAll } from "matchstick-as/assembly/index"; +import { BigInt, Address } from "@graphprotocol/graph-ts"; +import { handleStakeSet } from "../src/SortitionModule"; +import { createStakeSetEvent } from "./sortition-module-utils"; + +// Tests structure (matchstick-as >=0.5.0) +// https://thegraph.com/docs/en/developer/matchstick/#tests-structure-0-5-0 + +describe("Describe event", () => { + beforeAll(() => { + let courtId = BigInt.fromI32(1); + let amount = BigInt.fromI32(1000); + let jurorAddress = Address.fromString("0x922911F4f80a569a4425fa083456239838F7F003"); + let newStakeSetEvent = createStakeSetEvent(jurorAddress, courtId, amount); + handleStakeSet(newStakeSetEvent); + }); + + afterAll(() => { + clearStore(); + }); + + // For more test scenarios, see: + // https://thegraph.com/docs/en/developer/matchstick/#write-a-unit-test + + test("Initialized created and stored", () => { + assert.entityCount("Initialized", 1); + + // 0xa16081f360e3847006db660bae1c6d1b2e17ec2a is the default address used in newMockEvent() function + // assert.fieldEquals( + // "Initialized", + // "0xa16081f360e3847006db660bae1c6d1b2e17ec2a-1", + // "version", + // "234" + // ) + + // More assert options: + // https://thegraph.com/docs/en/developer/matchstick/#asserts + }); +}); From 8f1a11f14c67735de0e8b2c90d24ac122afeab5a Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Wed, 20 Dec 2023 19:33:15 +0000 Subject: [PATCH 50/77] chore: subgraph values for devnet --- subgraph/core/subgraph.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subgraph/core/subgraph.yaml b/subgraph/core/subgraph.yaml index 40612313b..f05d7f20e 100644 --- a/subgraph/core/subgraph.yaml +++ b/subgraph/core/subgraph.yaml @@ -133,11 +133,11 @@ dataSources: file: ./src/EvidenceModule.ts - kind: ethereum name: SortitionModule - network: mainnet + network: arbitrum-sepolia source: - address: "0x3Aa5ebB10DC797CAC828524e59A333d0A371443c" + address: "0xf327200420F21BAafce8F1C03B1EEdF926074B95" abi: SortitionModule - startBlock: 20 + startBlock: 3084593 mapping: kind: ethereum/events apiVersion: 0.0.6 @@ -146,7 +146,7 @@ dataSources: - JurorTokensPerCourt abis: - name: SortitionModule - file: ../contracts/deployments/localhost/SortitionModule.json + file: ../../contracts/deployments/arbitrumSepoliaDevnet/SortitionModule.json eventHandlers: - event: StakeDelayedAlreadyTransferred(indexed address,uint256,uint256) handler: handleStakeDelayedAlreadyTransferred From 5ee00e257421b358a94e21be12f97a1c3feebc98 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Wed, 20 Dec 2023 20:34:45 +0000 Subject: [PATCH 51/77] fix: hardcoded block number for filter queries --- contracts/.gitignore | 5 +++++ contracts/.npmignore | 5 +++++ web/.env.devnet.public | 3 ++- web/src/consts/index.ts | 2 ++ web/src/hooks/queries/useDisputeTemplate.ts | 6 +++--- web/src/hooks/queries/useEvidenceGroup.ts | 3 ++- web/src/hooks/useIsCrossChainDispute.ts | 3 ++- web/src/utils/graphqlQueryFnHelper.ts | 7 ++++--- 8 files changed, 25 insertions(+), 9 deletions(-) diff --git a/contracts/.gitignore b/contracts/.gitignore index 0b8d6e394..15a17c490 100644 --- a/contracts/.gitignore +++ b/contracts/.gitignore @@ -179,3 +179,8 @@ tags # .pnp.* # End of https://www.toptal.com/developers/gitignore/api/vim,node,visualstudiocode,yarn + +.env* +.flaskenv* +!.env.project +!.env.vault \ No newline at end of file diff --git a/contracts/.npmignore b/contracts/.npmignore index d3bdf96ef..32042814c 100644 --- a/contracts/.npmignore +++ b/contracts/.npmignore @@ -9,3 +9,8 @@ # Except this /deployments/localhost/ **/.DS_Store + +.env* +.flaskenv* +!.env.project +!.env.vault \ No newline at end of file diff --git a/web/.env.devnet.public b/web/.env.devnet.public index d62dc6b7a..9f89e2e16 100644 --- a/web/.env.devnet.public +++ b/web/.env.devnet.public @@ -2,4 +2,5 @@ export REACT_APP_DEPLOYMENT=devnet export REACT_APP_CORE_SUBGRAPH=https://api.studio.thegraph.com/query/61738/kleros-v2-core-devnet/v0.0.1 export REACT_APP_DRT_ARBSEPOLIA_SUBGRAPH=https://api.studio.thegraph.com/query/61738/kleros-v2-drt-arbisep-devnet/v0.0.1 -export REACT_APP_STATUS_URL=https://kleros-v2-devnet.betteruptime.com/badge \ No newline at end of file +export REACT_APP_STATUS_URL=https://kleros-v2-devnet.betteruptime.com/badge +export REACT_APP_GENESIS_BLOCK_ARBSEPOLIA=3084598 \ No newline at end of file diff --git a/web/src/consts/index.ts b/web/src/consts/index.ts index 305fca577..a906253f1 100644 --- a/web/src/consts/index.ts +++ b/web/src/consts/index.ts @@ -18,4 +18,6 @@ export const TELEGRAM_REGEX = /^@\w{5,32}$/; export const ETH_ADDRESS_REGEX = /^0x[a-fA-F0-9]{40}$/; export const ETH_SIGNATURE_REGEX = /^0x[a-fA-F0-9]{130}$/; +export const GENESIS_BLOCK_ARBSEPOLIA = BigInt(process.env.REACT_APP_GENESIS_BLOCK_ARBSEPOLIA ?? 0); + export const isProductionDeployment = () => process.env.REACT_APP_DEPLOYMENT !== "mainnet"; diff --git a/web/src/hooks/queries/useDisputeTemplate.ts b/web/src/hooks/queries/useDisputeTemplate.ts index 4372c2c20..f7447ca43 100644 --- a/web/src/hooks/queries/useDisputeTemplate.ts +++ b/web/src/hooks/queries/useDisputeTemplate.ts @@ -3,10 +3,10 @@ import { graphql } from "src/graphql"; import { PublicClient } from "viem"; import { usePublicClient } from "wagmi"; import { getIArbitrableV2 } from "hooks/contracts/generated"; -import { DisputeTemplateQuery } from "src/graphql/graphql"; import { isUndefined } from "utils/index"; -import { graphqlQueryFnHelper } from "utils/graphqlQueryFnHelper"; +import { graphqlQueryFnHelper, graphqlUrl } from "utils/graphqlQueryFnHelper"; import { useIsCrossChainDispute } from "../useIsCrossChainDispute"; +import { GENESIS_BLOCK_ARBSEPOLIA } from "consts/index"; const disputeTemplateQuery = graphql(` query DisputeTemplate($id: ID!) { @@ -62,7 +62,7 @@ const getTemplateId = async ( _arbitrableDisputeID: BigInt(disputeID), }, { - fromBlock: 27808516n, + fromBlock: GENESIS_BLOCK_ARBSEPOLIA, toBlock: "latest", } ); diff --git a/web/src/hooks/queries/useEvidenceGroup.ts b/web/src/hooks/queries/useEvidenceGroup.ts index ef5fa02ab..b7abee401 100644 --- a/web/src/hooks/queries/useEvidenceGroup.ts +++ b/web/src/hooks/queries/useEvidenceGroup.ts @@ -2,6 +2,7 @@ import { useQuery } from "@tanstack/react-query"; import { getIArbitrableV2 } from "hooks/contracts/generated"; import { usePublicClient } from "wagmi"; import { isUndefined } from "utils/index"; +import { GENESIS_BLOCK_ARBSEPOLIA } from "consts/index"; export const useEvidenceGroup = (disputeID?: string, arbitrableAddress?: `0x${string}`) => { const isEnabled = !isUndefined(arbitrableAddress); @@ -20,7 +21,7 @@ export const useEvidenceGroup = (disputeID?: string, arbitrableAddress?: `0x${st _arbitrableDisputeID: BigInt(disputeID), }, { - fromBlock: 27808516n, + fromBlock: GENESIS_BLOCK_ARBSEPOLIA, toBlock: "latest", } ); diff --git a/web/src/hooks/useIsCrossChainDispute.ts b/web/src/hooks/useIsCrossChainDispute.ts index 764b7fb38..9d1b60909 100644 --- a/web/src/hooks/useIsCrossChainDispute.ts +++ b/web/src/hooks/useIsCrossChainDispute.ts @@ -2,6 +2,7 @@ import { useQuery } from "@tanstack/react-query"; import { usePublicClient } from "wagmi"; import { getIHomeGateway } from "hooks/contracts/generated"; import { isUndefined } from "utils/index"; +import { GENESIS_BLOCK_ARBSEPOLIA } from "consts"; interface IIsCrossChainDispute { isCrossChainDispute: boolean; @@ -27,7 +28,7 @@ export const useIsCrossChainDispute = (disputeID?: string, arbitrableAddress?: ` _arbitratorDisputeID: BigInt(disputeID), }, { - fromBlock: 27808516n, + fromBlock: GENESIS_BLOCK_ARBSEPOLIA, toBlock: "latest", } ); diff --git a/web/src/utils/graphqlQueryFnHelper.ts b/web/src/utils/graphqlQueryFnHelper.ts index 4d3ecbae4..47235f63c 100644 --- a/web/src/utils/graphqlQueryFnHelper.ts +++ b/web/src/utils/graphqlQueryFnHelper.ts @@ -1,12 +1,13 @@ import request from "graphql-request"; +import { arbitrumSepolia } from "wagmi/chains"; import { TypedDocumentNode } from "@graphql-typed-document-node/core"; const CHAINID_TO_DISPUTE_TEMPLATE_SUBGRAPH = { - 421614: + [arbitrumSepolia.id]: process.env.REACT_APP_DRT_ARBSEPOLIA_SUBGRAPH ?? "Wrong Subgraph URL. Please check the environment variables.", }; -export const graphqlUrl = (isDisputeTemplate = false, chainId = 421614) => { +export const graphqlUrl = (isDisputeTemplate = false, chainId = arbitrumSepolia.id) => { const coreUrl = process.env.REACT_APP_CORE_SUBGRAPH ?? "Wrong Subgraph URL. Please check the environment variables."; return isDisputeTemplate ? CHAINID_TO_DISPUTE_TEMPLATE_SUBGRAPH[chainId] : coreUrl; }; @@ -15,7 +16,7 @@ export const graphqlQueryFnHelper = async ( query: TypedDocumentNode, parametersObject: Record, isDisputeTemplate = false, - chainId = 421614 + chainId = arbitrumSepolia.id ) => { const url = graphqlUrl(isDisputeTemplate, chainId); return request(url, query, parametersObject); From 82994c5a56d0d2081f8f6eed87eb8da97320f4d6 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Wed, 20 Dec 2023 20:47:40 +0000 Subject: [PATCH 52/77] test: fix due to RandomizerMock name change and borked coverage dep --- contracts/package.json | 2 +- contracts/scripts/simulations/utils.ts | 4 +- contracts/test/arbitration/staking.ts | 2 +- contracts/test/integration/index.ts | 2 +- yarn.lock | 53 +++++++++++++++++++++----- 5 files changed, 49 insertions(+), 14 deletions(-) diff --git a/contracts/package.json b/contracts/package.json index a5c8d62b5..0c3699c1b 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -75,7 +75,7 @@ "pino-pretty": "^10.2.3", "shelljs": "^0.8.5", "solhint-plugin-prettier": "^0.1.0", - "solidity-coverage": "0.8.5", + "solidity-coverage": "0.8.2", "ts-node": "^10.9.2", "typechain": "^8.3.2", "typescript": "^4.9.5" diff --git a/contracts/scripts/simulations/utils.ts b/contracts/scripts/simulations/utils.ts index 895b4105b..3a9780f6e 100644 --- a/contracts/scripts/simulations/utils.ts +++ b/contracts/scripts/simulations/utils.ts @@ -6,7 +6,7 @@ import { PNK, RandomizerRNG, ArbitrableExampleEthFee, - RandomizerMock, + RandomizerOracle, } from "../../typechain-types"; export enum Period { @@ -25,7 +25,7 @@ export const getContracts = async (hre) => { const pnk = (await hre.ethers.getContract("PNK")) as PNK; const randomizerRng = (await hre.ethers.getContract("RandomizerRNG")) as RandomizerRNG; const arbitrable = (await hre.ethers.getContract("ArbitrableExampleEthFee")) as ArbitrableExampleEthFee; - const randomizerMock = (await hre.ethers.getContract("RandomizerMock")) as RandomizerMock; + const randomizerMock = (await hre.ethers.getContract("RandomizerOracle")) as RandomizerMock; return { core, diff --git a/contracts/test/arbitration/staking.ts b/contracts/test/arbitration/staking.ts index bb47e4136..068e3c603 100644 --- a/contracts/test/arbitration/staking.ts +++ b/contracts/test/arbitration/staking.ts @@ -42,7 +42,7 @@ describe("Staking", async () => { core = (await ethers.getContract("KlerosCore")) as KlerosCore; sortition = (await ethers.getContract("SortitionModule")) as SortitionModule; rng = (await ethers.getContract("RandomizerRNG")) as RandomizerRNG; - randomizer = (await ethers.getContract("RandomizerMock")) as RandomizerMock; + randomizer = (await ethers.getContract("RandomizerOracle")) as RandomizerMock; }; describe("When outside the Staking phase", async () => { diff --git a/contracts/test/integration/index.ts b/contracts/test/integration/index.ts index d226e279d..d149d72a6 100644 --- a/contracts/test/integration/index.ts +++ b/contracts/test/integration/index.ts @@ -48,7 +48,7 @@ describe("Integration tests", async () => { keepExistingDeployments: false, }); rng = (await ethers.getContract("RandomizerRNG")) as RandomizerRNG; - randomizer = (await ethers.getContract("RandomizerMock")) as RandomizerMock; + randomizer = (await ethers.getContract("RandomizerOracle")) as RandomizerMock; disputeKit = (await ethers.getContract("DisputeKitClassic")) as DisputeKitClassic; pnk = (await ethers.getContract("PNK")) as PNK; core = (await ethers.getContract("KlerosCore")) as KlerosCore; diff --git a/yarn.lock b/yarn.lock index 045120754..99598bc3f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5383,7 +5383,7 @@ __metadata: pino-pretty: ^10.2.3 shelljs: ^0.8.5 solhint-plugin-prettier: ^0.1.0 - solidity-coverage: 0.8.5 + solidity-coverage: 0.8.2 ts-node: ^10.9.2 typechain: ^8.3.2 typescript: ^4.9.5 @@ -8282,7 +8282,7 @@ __metadata: languageName: node linkType: hard -"@solidity-parser/parser@npm:^0.14.0": +"@solidity-parser/parser@npm:^0.14.0, @solidity-parser/parser@npm:^0.14.1": version: 0.14.5 resolution: "@solidity-parser/parser@npm:0.14.5" dependencies: @@ -24171,7 +24171,42 @@ __metadata: languageName: node linkType: hard -"mocha@npm:10.2.0, mocha@npm:^10.0.0": +"mocha@npm:7.1.2": + version: 7.1.2 + resolution: "mocha@npm:7.1.2" + dependencies: + ansi-colors: 3.2.3 + browser-stdout: 1.3.1 + chokidar: 3.3.0 + debug: 3.2.6 + diff: 3.5.0 + escape-string-regexp: 1.0.5 + find-up: 3.0.0 + glob: 7.1.3 + growl: 1.10.5 + he: 1.2.0 + js-yaml: 3.13.1 + log-symbols: 3.0.0 + minimatch: 3.0.4 + mkdirp: 0.5.5 + ms: 2.1.1 + node-environment-flags: 1.0.6 + object.assign: 4.1.0 + strip-json-comments: 2.0.1 + supports-color: 6.0.0 + which: 1.3.1 + wide-align: 1.1.3 + yargs: 13.3.2 + yargs-parser: 13.1.2 + yargs-unparser: 1.6.0 + bin: + _mocha: bin/_mocha + mocha: bin/mocha + checksum: 0fc9ad0dd79e43a34de03441634f58e8a3d211af4cdbcd56de150ec99f7aff3b8678bd5aeb41f82115f7df4199a24f7bb372f65e5bcba133b41a5310dee908bd + languageName: node + linkType: hard + +"mocha@npm:^10.0.0": version: 10.2.0 resolution: "mocha@npm:10.2.0" dependencies: @@ -29589,12 +29624,12 @@ __metadata: languageName: node linkType: hard -"solidity-coverage@npm:0.8.5": - version: 0.8.5 - resolution: "solidity-coverage@npm:0.8.5" +"solidity-coverage@npm:0.8.2": + version: 0.8.2 + resolution: "solidity-coverage@npm:0.8.2" dependencies: "@ethersproject/abi": ^5.0.9 - "@solidity-parser/parser": ^0.16.0 + "@solidity-parser/parser": ^0.14.1 chalk: ^2.4.2 death: ^1.1.0 detect-port: ^1.3.0 @@ -29605,7 +29640,7 @@ __metadata: globby: ^10.0.1 jsonschema: ^1.2.4 lodash: ^4.17.15 - mocha: 10.2.0 + mocha: 7.1.2 node-emoji: ^1.10.0 pify: ^4.0.1 recursive-readdir: ^2.2.2 @@ -29617,7 +29652,7 @@ __metadata: hardhat: ^2.11.0 bin: solidity-coverage: plugins/bin.js - checksum: c9ca4deda9383c1db425117e72677f8908dcb2263ad41cfc1821c96afcfd5e8070146b87cd2c4b0812612fb707896928c07b776347143db838e486b4c938b394 + checksum: 489f73d56a1279f2394b7a14db315532884895baa00a4016e68a4e5be0eddca90a95cb3322e6a0b15e67f2d9003b9413ee24c1c61d78f558f5a2e1e233840825 languageName: node linkType: hard From f68fb49ce461db5548ed208bd5761fb44b2df37f Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Fri, 22 Dec 2023 13:22:06 +0530 Subject: [PATCH 53/77] fix(subgraph): fix-stake-handlers --- subgraph/core/src/SortitionModule.ts | 17 ++--------- .../core/src/entities/JurorTokensPerCourt.ts | 30 +++++++++---------- subgraph/core/subgraph.yaml | 2 ++ 3 files changed, 19 insertions(+), 30 deletions(-) diff --git a/subgraph/core/src/SortitionModule.ts b/subgraph/core/src/SortitionModule.ts index 12756967e..1625b6686 100644 --- a/subgraph/core/src/SortitionModule.ts +++ b/subgraph/core/src/SortitionModule.ts @@ -12,24 +12,11 @@ import { ensureUser } from "./entities/User"; import { ZERO } from "./utils"; export function handleStakeDelayedAlreadyTransferred(event: StakeDelayedAlreadyTransferred): void { - const jurorAddress = event.params._address.toHexString(); - ensureUser(jurorAddress); - const courtID = event.params._courtID.toString(); - - updateJurorStake(jurorAddress, courtID.toString(), SortitionModule.bind(event.address), event.block.timestamp); - - //stake is updated instantly so no delayed amount, set delay amount to zero - updateJurorDelayedStake(jurorAddress, courtID, ZERO); + updateJurorDelayedStake(event.params._address.toHexString(), event.params._courtID.toString(), event.params._amount); } export function handleStakeDelayedAlreadyTransferredWithdrawn(event: StakeDelayedAlreadyTransferredWithdrawn): void { - const jurorAddress = event.params._address.toHexString(); - ensureUser(jurorAddress); - const courtID = event.params._courtID.toString(); - - updateJurorStake(jurorAddress, courtID.toString(), SortitionModule.bind(event.address), event.block.timestamp); - - updateJurorDelayedStake(jurorAddress, courtID, ZERO); + updateJurorDelayedStake(event.params._address.toHexString(), event.params._courtID.toString(), event.params._amount); } export function handleStakeDelayedNotTransferred(event: StakeDelayedNotTransferred): void { diff --git a/subgraph/core/src/entities/JurorTokensPerCourt.ts b/subgraph/core/src/entities/JurorTokensPerCourt.ts index db8568729..d2abd910a 100644 --- a/subgraph/core/src/entities/JurorTokensPerCourt.ts +++ b/subgraph/core/src/entities/JurorTokensPerCourt.ts @@ -42,21 +42,21 @@ export function updateJurorStake( const jurorTokens = ensureJurorTokensPerCourt(jurorAddress, courtID); // TODO: index the sortition module and handle these events there - // const jurorBalance = contract.getJurorBalance(Address.fromString(jurorAddress), BigInt.fromString(courtID)); - // const previousStake = jurorTokens.staked; - // const previousTotalStake = juror.totalStake; - // jurorTokens.staked = jurorBalance.value2; - // jurorTokens.locked = jurorBalance.value1; - // jurorTokens.save(); - // const stakeDelta = getDelta(previousStake, jurorTokens.staked); - // const newTotalStake = juror.totalStake.plus(stakeDelta); - // juror.totalStake = newTotalStake; - // court.stake = court.stake.plus(stakeDelta); - // updateStakedPNK(stakeDelta, timestamp); - // const activeJurorsDelta = getActivityDelta(previousTotalStake, newTotalStake); - // const stakedJurorsDelta = getActivityDelta(previousStake, jurorBalance.value2); - // court.numberStakedJurors = court.numberStakedJurors.plus(stakedJurorsDelta); - // updateActiveJurors(activeJurorsDelta, timestamp); + const jurorBalance = contract.getJurorBalance(Address.fromString(jurorAddress), BigInt.fromString(courtID)); + const previousStake = jurorTokens.staked; + const previousTotalStake = juror.totalStake; + jurorTokens.staked = jurorBalance.value2; + jurorTokens.locked = jurorBalance.value1; + jurorTokens.save(); + const stakeDelta = getDelta(previousStake, jurorTokens.staked); + const newTotalStake = juror.totalStake.plus(stakeDelta); + juror.totalStake = newTotalStake; + court.stake = court.stake.plus(stakeDelta); + updateStakedPNK(stakeDelta, timestamp); + const activeJurorsDelta = getActivityDelta(previousTotalStake, newTotalStake); + const stakedJurorsDelta = getActivityDelta(previousStake, jurorBalance.value2); + court.numberStakedJurors = court.numberStakedJurors.plus(stakedJurorsDelta); + updateActiveJurors(activeJurorsDelta, timestamp); juror.save(); court.save(); } diff --git a/subgraph/core/subgraph.yaml b/subgraph/core/subgraph.yaml index f05d7f20e..6ef2a43a7 100644 --- a/subgraph/core/subgraph.yaml +++ b/subgraph/core/subgraph.yaml @@ -25,6 +25,8 @@ dataSources: - DisputeKit - Counter abis: + - name: SortitionModule + file: ../../contracts/deployments/arbitrumSepoliaDevnet/SortitionModule.json - name: DisputeKitClassic file: ../../contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json - name: KlerosCore From 19339aa250402488f4dcc52aeb3ef9a59e83dacd Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Wed, 27 Dec 2023 16:17:38 +0100 Subject: [PATCH 54/77] test: fixed non-running tests --- contracts/test/arbitration/staking.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/contracts/test/arbitration/staking.ts b/contracts/test/arbitration/staking.ts index 068e3c603..90108014f 100644 --- a/contracts/test/arbitration/staking.ts +++ b/contracts/test/arbitration/staking.ts @@ -10,7 +10,6 @@ import { RandomizerMock, } from "../../typechain-types"; import { expect } from "chai"; -import { it } from "mocha"; /* eslint-disable no-unused-vars */ /* eslint-disable no-unused-expressions */ From b36d08a0f543674236be9a3df6a6be8710e6c818 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Wed, 27 Dec 2023 17:43:20 +0100 Subject: [PATCH 55/77] fix: staking miscalculation + test coverage --- contracts/src/arbitration/SortitionModule.sol | 8 +- contracts/test/arbitration/staking.ts | 199 ++++++++++++++---- 2 files changed, 167 insertions(+), 40 deletions(-) diff --git a/contracts/src/arbitration/SortitionModule.sol b/contracts/src/arbitration/SortitionModule.sol index 72b5b8e4f..7e0f8121d 100644 --- a/contracts/src/arbitration/SortitionModule.sol +++ b/contracts/src/arbitration/SortitionModule.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT /** - * @custom:authors: [@epiqueras, @unknownunknown1, @shotaronowhere] + * @custom:authors: [@epiqueras, @unknownunknown1, @jaybuidl, @shotaronowhere] * @custom:reviewers: [] * @custom:auditors: [] * @custom:bounties: [] @@ -281,9 +281,9 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { return (0, 0, false); // Prevent staking beyond MAX_STAKE_PATHS but unstaking is always allowed. } - pnkWithdrawal = _deleteDelayedStake(_courtID, _account); - if (phase != Phase.staking) { + pnkWithdrawal = _deleteDelayedStake(_courtID, _account); + // Store the stake change as delayed, to be applied when the phase switches back to Staking. DelayedStake storage delayedStake = delayedStakes[++delayedStakeWriteIndex]; delayedStake.account = _account; @@ -302,7 +302,7 @@ contract SortitionModule is ISortitionModule, UUPSProxiable, Initializable { return (pnkDeposit, pnkWithdrawal, true); } - // Staking phase: set normal stakes or delayed stakes (which may have been already transferred). + // Current phase is Staking: set normal stakes or delayed stakes (which may have been already transferred). if (_newStake >= currentStake) { if (!_alreadyTransferred) { pnkDeposit = _increaseStake(juror, _courtID, _newStake, currentStake); diff --git a/contracts/test/arbitration/staking.ts b/contracts/test/arbitration/staking.ts index 90108014f..22df64f2c 100644 --- a/contracts/test/arbitration/staking.ts +++ b/contracts/test/arbitration/staking.ts @@ -1,14 +1,7 @@ import { ethers, getNamedAccounts, network, deployments } from "hardhat"; const { anyValue } = require("@nomicfoundation/hardhat-chai-matchers/withArgs"); import { BigNumber } from "ethers"; -import { - PNK, - KlerosCore, - DisputeKitClassic, - SortitionModule, - RandomizerRNG, - RandomizerMock, -} from "../../typechain-types"; +import { PNK, KlerosCore, SortitionModule, RandomizerRNG, RandomizerMock } from "../../typechain-types"; import { expect } from "chai"; /* eslint-disable no-unused-vars */ @@ -23,7 +16,6 @@ describe("Staking", async () => { "0x000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000001"; let deployer; - let disputeKit; let pnk; let core; let sortition; @@ -36,7 +28,6 @@ describe("Staking", async () => { fallbackToGlobal: true, keepExistingDeployments: false, }); - disputeKit = (await ethers.getContract("DisputeKitClassic")) as DisputeKitClassic; pnk = (await ethers.getContract("PNK")) as PNK; core = (await ethers.getContract("KlerosCore")) as KlerosCore; sortition = (await ethers.getContract("SortitionModule")) as SortitionModule; @@ -80,6 +71,136 @@ describe("Staking", async () => { await sortition.passPhase(); // Drawing -> Staking }; + describe("When stake is increased once", async () => { + before("Setup", async () => { + await deploy(); + await reachDrawingPhase(); + }); + + it("Should be outside the Staking phase", async () => { + expect(await sortition.phase()).to.be.equal(1); // Drawing + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); + }); + + describe("When stake is increased", () => { + it("Should transfer PNK but delay the stake increase", async () => { + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(0); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + await pnk.approve(core.address, PNK(1000)); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); + await expect(core.setStake(2, PNK(3000))) + .to.emit(sortition, "StakeDelayedAlreadyTransferred") + .withArgs(deployer, 2, PNK(3000)); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(5000), 0, PNK(2000), 2]); // stake does not change + }); + + it("Should transfer some PNK out of the juror's account", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore.sub(PNK(1000))); // PNK is transferred out of the juror's account + }); + + it("Should store the delayed stake for later", async () => { + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(1); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([deployer, 2, PNK(3000), true]); + }); + }); + + describe("When the Phase passes back to Staking", () => { + before("Setup", async () => { + await reachStakingPhaseAfterDrawing(); + balanceBefore = await pnk.balanceOf(deployer); + }); + + it("Should execute the delayed stakes", async () => { + await expect(sortition.executeDelayedStakes(10)) + .to.emit(sortition, "StakeSet") + .withArgs(deployer, 2, PNK(3000)) + .to.not.emit(sortition, "StakeDelayedNotTransferred") + .to.not.emit(sortition, "StakeDelayedAlreadyTransferred") + .to.not.emit(sortition, "StakeDelayedAlreadyTransferredWithdrawn"); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([ + PNK(5000), + PNK(300), // we're the only juror so we are drawn 3 times + PNK(3000), + 2, + ]); // stake unchanged, delayed + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(1); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(2); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted + expect(await sortition.delayedStakes(2)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 2nd delayed stake got deleted + expect(await sortition.latestDelayedStakeIndex(deployer, 1)).to.be.equal(0); // no delayed stakes left + }); + + it("Should not transfer any PNK", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer + }); + }); + }); + + describe("When stake is decreased once", async () => { + before("Setup", async () => { + await deploy(); + await reachDrawingPhase(); + }); + + it("Should be outside the Staking phase", async () => { + expect(await sortition.phase()).to.be.equal(1); // Drawing + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); + }); + + describe("When stake is decreased", async () => { + it("Should delay the stake decrease", async () => { + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(0); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); + await expect(core.setStake(2, PNK(1000))) + .to.emit(sortition, "StakeDelayedNotTransferred") + .withArgs(deployer, 2, PNK(1000)); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([PNK(4000), 0, PNK(2000), 2]); // stake unchanged, delayed + }); + + it("Should not transfer any PNK", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet + }); + + it("Should store the delayed stake for later", async () => { + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(1); + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(1); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(1); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([deployer, 2, PNK(1000), false]); + }); + }); + + describe("When the Phase passes back to Staking", () => { + before("Setup", async () => { + await reachStakingPhaseAfterDrawing(); + balanceBefore = await pnk.balanceOf(deployer); + }); + + it("Should execute the delayed stakes by withdrawing PNK and reducing the stakes", async () => { + await expect(sortition.executeDelayedStakes(10)) + .to.emit(sortition, "StakeSet") + .withArgs(deployer, 2, PNK(1000)); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([ + PNK(3000), + PNK(300), // we're the only juror so we are drawn 3 times + PNK(1000), + 2, + ]); // stake unchanged, delayed + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(1); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(2); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted + expect(await sortition.delayedStakes(2)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 2nd delayed stake got deleted + expect(await sortition.latestDelayedStakeIndex(deployer, 1)).to.be.equal(0); // no delayed stakes left + }); + + it("Should withdraw some PNK", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore.add(PNK(1000))); // No PNK transfer yet + }); + }); + }); + describe("When stake is decreased then increased back", async () => { before("Setup", async () => { await deploy(); @@ -139,9 +260,12 @@ describe("Staking", async () => { }); describe("When the Phase passes back to Staking", () => { - it("Should execute the delayed stakes but the stakes should remain the same", async () => { + before("Setup", async () => { await reachStakingPhaseAfterDrawing(); balanceBefore = await pnk.balanceOf(deployer); + }); + + it("Should execute the delayed stakes but the stakes should remain the same", async () => { await expect(sortition.executeDelayedStakes(10)) .to.emit(sortition, "StakeSet") .withArgs(deployer, 2, PNK(2000)); @@ -223,33 +347,36 @@ describe("Staking", async () => { expect(await sortition.delayedStakes(2)).to.be.deep.equal([deployer, 2, PNK(2000), false]); }); }); - }); - describe("When the Phase passes back to Staking", () => { - it("Should execute the delayed stakes but the stakes should remain the same", async () => { - await reachStakingPhaseAfterDrawing(); - balanceBefore = await pnk.balanceOf(deployer); - await expect(sortition.executeDelayedStakes(10)) - .to.emit(sortition, "StakeSet") - .withArgs(deployer, 2, PNK(2000)) - .to.not.emit(sortition, "StakeDelayedNotTransferred") - .to.not.emit(sortition, "StakeDelayedAlreadyTransferred") - .to.not.emit(sortition, "StakeDelayedAlreadyTransferredWithdrawn"); - expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([ - PNK(4000), - PNK(300), // we're the only juror so we are drawn 3 times - PNK(2000), - 2, - ]); // stake unchanged, delayed - expect(await sortition.delayedStakeWriteIndex()).to.be.equal(2); - expect(await sortition.delayedStakeReadIndex()).to.be.equal(3); - expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted - expect(await sortition.delayedStakes(2)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 2nd delayed stake got deleted - expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); // no delayed stakes left - }); + describe("When the Phase passes back to Staking", () => { + before("Setup", async () => { + await reachStakingPhaseAfterDrawing(); + balanceBefore = await pnk.balanceOf(deployer); + }); - it("Should not transfer any PNK", async () => { - expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet + it("Should execute the delayed stakes but the stakes should remain the same", async () => { + await expect(sortition.executeDelayedStakes(10)) + .to.emit(sortition, "StakeSet") + .withArgs(deployer, 2, PNK(2000)) + .to.not.emit(sortition, "StakeDelayedNotTransferred") + .to.not.emit(sortition, "StakeDelayedAlreadyTransferred") + .to.not.emit(sortition, "StakeDelayedAlreadyTransferredWithdrawn"); + expect(await sortition.getJurorBalance(deployer, 2)).to.be.deep.equal([ + PNK(4000), + PNK(300), // we're the only juror so we are drawn 3 times + PNK(2000), + 2, + ]); // stake unchanged, delayed + expect(await sortition.delayedStakeWriteIndex()).to.be.equal(2); + expect(await sortition.delayedStakeReadIndex()).to.be.equal(3); + expect(await sortition.delayedStakes(1)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 1st delayed stake got deleted + expect(await sortition.delayedStakes(2)).to.be.deep.equal([ethers.constants.AddressZero, 0, 0, false]); // the 2nd delayed stake got deleted + expect(await sortition.latestDelayedStakeIndex(deployer, 2)).to.be.equal(0); // no delayed stakes left + }); + + it("Should not transfer any PNK", async () => { + expect(await pnk.balanceOf(deployer)).to.be.equal(balanceBefore); // No PNK transfer yet + }); }); }); }); From c08023ded0915d7a0968ac80aee4367fffdbf603 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Wed, 27 Dec 2023 18:46:25 +0100 Subject: [PATCH 56/77] chore: contracts redeployment --- contracts/README.md | 17 +-- .../ArbitrableExample.json | 30 ++-- .../arbitrumSepoliaDevnet/BlockHashRNG.json | 133 ++++++++++++++++++ .../DisputeKitClassic.json | 30 ++-- .../DisputeKitClassic_Implementation.json | 26 ++-- .../DisputeKitClassic_Proxy.json | 28 ++-- .../DisputeResolver.json | 20 +-- .../DisputeTemplateRegistry.json | 30 ++-- ...isputeTemplateRegistry_Implementation.json | 26 ++-- .../DisputeTemplateRegistry_Proxy.json | 28 ++-- .../arbitrumSepoliaDevnet/Escrow.json | 30 ++-- .../arbitrumSepoliaDevnet/EvidenceModule.json | 30 ++-- .../EvidenceModule_Implementation.json | 26 ++-- .../EvidenceModule_Proxy.json | 28 ++-- .../arbitrumSepoliaDevnet/KlerosCore.json | 62 ++++---- .../KlerosCore_Implementation.json | 26 ++-- .../KlerosCore_Proxy.json | 56 ++++---- .../SortitionModule.json | 38 ++--- .../SortitionModule_Implementation.json | 128 ++++++++--------- .../SortitionModule_Proxy.json | 34 ++--- .../scripts/generateDeploymentArtifact.sh | 11 +- contracts/scripts/verifyProxies.sh | 8 +- 22 files changed, 489 insertions(+), 356 deletions(-) create mode 100644 contracts/deployments/arbitrumSepoliaDevnet/BlockHashRNG.json diff --git a/contracts/README.md b/contracts/README.md index c4da58cc7..e0849d831 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -34,20 +34,21 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments #### Arbitrum Sepolia -- [ArbitrableExample](https://sepolia.arbiscan.io/address/0x96a29c421007Ab6d523B1743FA3f177a15063D07) +- [ArbitrableExample](https://sepolia.arbiscan.io/address/0xe48488AE09022a4F32c528d7EbfF92870225AcBf) +- [BlockHashRNG](https://sepolia.arbiscan.io/address/0x56d6d65Fe202232714794B5D5e4ed9894466Ee01) - [DAI](https://sepolia.arbiscan.io/address/0x593e89704D285B0c3fbF157c7CF2537456CE64b5) - [DAIFaucet](https://sepolia.arbiscan.io/address/0xB5b39A1bcD2D7097A8824B3cC18Ebd2dFb0D9B5E) -- [DisputeKitClassic: proxy](https://sepolia.arbiscan.io/address/0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3), [implementation](https://sepolia.arbiscan.io/address/0xC3dB344755b15c8Edfd834db79af4f8860029FB4) -- [DisputeResolver](https://sepolia.arbiscan.io/address/0x3E22eBE8c86a58b0BfEd5383aa9DEFB87De85034) -- [DisputeTemplateRegistry: proxy](https://sepolia.arbiscan.io/address/0xc60e862273c1eAa1F9afBC69b39cee30270A2419), [implementation](https://sepolia.arbiscan.io/address/0xeA44D4710bc804573E7d8653b88A60CaC51E3738) -- [Escrow](https://sepolia.arbiscan.io/address/0x224E52523354BEdCaFF3e98de463E829f3388f84) -- [EvidenceModule: proxy](https://sepolia.arbiscan.io/address/0x827411b3e98bAe8c441efBf26842A1670f8f378F), [implementation](https://sepolia.arbiscan.io/address/0x26c1980120F1C82cF611D666CE81D2b54d018547) -- [KlerosCore: proxy](https://sepolia.arbiscan.io/address/0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284), [implementation](https://sepolia.arbiscan.io/address/0x614498118850184c62f82d08261109334bFB050f) +- [DisputeKitClassic: proxy](https://sepolia.arbiscan.io/address/0x9426F127116C3652A262AE1eA48391AC8F44D35b), [implementation](https://sepolia.arbiscan.io/address/0x692CC78F2570181FFB99297965FeAA8352ab12E8) +- [DisputeResolver](https://sepolia.arbiscan.io/address/0xB8B36CC43f852f9F0484f53Eb38CaBBA28a81bF6) +- [DisputeTemplateRegistry: proxy](https://sepolia.arbiscan.io/address/0x596D3B09E684D62217682216e9b7a0De75933391), [implementation](https://sepolia.arbiscan.io/address/0xc53b813ed94AaEb6F5518D60bf6a8109954bE3f6) +- [Escrow](https://sepolia.arbiscan.io/address/0xdaf749DABE7be6C6894950AE69af35c20a00ABd9) +- [EvidenceModule: proxy](https://sepolia.arbiscan.io/address/0x57fd453FB0d16f8ca174E7386102D7170E17Be09), [implementation](https://sepolia.arbiscan.io/address/0x05AD81f245209b7f91885fd96e57c9da90554824) +- [KlerosCore: proxy](https://sepolia.arbiscan.io/address/0xA54e7A16d7460e38a8F324eF46782FB520d58CE8), [implementation](https://sepolia.arbiscan.io/address/0x91a373BBdE0532F86410682F362e2Cf685e95085) - [PNKFaucet](https://sepolia.arbiscan.io/address/0x7EFE468003Ad6A858b5350CDE0A67bBED58739dD) - [PinakionV2](https://sepolia.arbiscan.io/address/0x34B944D42cAcfC8266955D07A80181D2054aa225) - [PolicyRegistry: proxy](https://sepolia.arbiscan.io/address/0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da), [implementation](https://sepolia.arbiscan.io/address/0xAA637C9E2831614158d7eB193D03af4a7223C56E) - [RandomizerRNG: proxy](https://sepolia.arbiscan.io/address/0xA995C172d286f8F4eE137CC662e2844E59Cf4836), [implementation](https://sepolia.arbiscan.io/address/0xe62B776498F48061ef9425fCEf30F3d1370DB005) -- [SortitionModule: proxy](https://sepolia.arbiscan.io/address/0xf327200420F21BAafce8F1C03B1EEdF926074B95), [implementation](https://sepolia.arbiscan.io/address/0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9) +- [SortitionModule: proxy](https://sepolia.arbiscan.io/address/0x19cb28BAB40C3585955798f5EEabd71Eec14471C), [implementation](https://sepolia.arbiscan.io/address/0xBC82B29e5aE8a749D82b7919118Ab7C0D41fA3D3) - [WETH](https://sepolia.arbiscan.io/address/0x3829A2486d53ee984a0ca2D76552715726b77138) - [WETHFaucet](https://sepolia.arbiscan.io/address/0x6F8C10E0030aDf5B8030a5E282F026ADdB6525fd) diff --git a/contracts/deployments/arbitrumSepoliaDevnet/ArbitrableExample.json b/contracts/deployments/arbitrumSepoliaDevnet/ArbitrableExample.json index e1f77e5fc..7170b8199 100644 --- a/contracts/deployments/arbitrumSepoliaDevnet/ArbitrableExample.json +++ b/contracts/deployments/arbitrumSepoliaDevnet/ArbitrableExample.json @@ -1,5 +1,5 @@ { - "address": "0x96a29c421007Ab6d523B1743FA3f177a15063D07", + "address": "0xe48488AE09022a4F32c528d7EbfF92870225AcBf", "abi": [ { "inputs": [ @@ -357,22 +357,22 @@ "type": "function" } ], - "transactionHash": "0x2884335c81bd0f19fcfce0e88a5ac247e10967ea5b9e3f476321ea18df53efa3", + "transactionHash": "0xb2308a18e0bfd0030cb4889acef1a482410f7a3decac8e4e3240ae4a24981824", "receipt": { "to": null, "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "contractAddress": "0x96a29c421007Ab6d523B1743FA3f177a15063D07", + "contractAddress": "0xe48488AE09022a4F32c528d7EbfF92870225AcBf", "transactionIndex": 1, - "gasUsed": "1332621", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800080000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000020000000002020000400000000000100000000000000000000000000000000000000", - "blockHash": "0xc563bdfaa4019bb91fb68e90e5bb3b7b740cf8ec6c1c02c21e128de667af36b3", - "transactionHash": "0x2884335c81bd0f19fcfce0e88a5ac247e10967ea5b9e3f476321ea18df53efa3", + "gasUsed": "19504456", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000008000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800080000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000020000000002000000400000000000100000000000000000000000000000000000000", + "blockHash": "0x6274b9a4a9be1d49e84450210fd8e92b186af6835a309217ccf400b6ae31eb07", + "transactionHash": "0xb2308a18e0bfd0030cb4889acef1a482410f7a3decac8e4e3240ae4a24981824", "logs": [ { "transactionIndex": 1, - "blockNumber": 3087468, - "transactionHash": "0x2884335c81bd0f19fcfce0e88a5ac247e10967ea5b9e3f476321ea18df53efa3", - "address": "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + "blockNumber": 3639197, + "transactionHash": "0xb2308a18e0bfd0030cb4889acef1a482410f7a3decac8e4e3240ae4a24981824", + "address": "0x596D3B09E684D62217682216e9b7a0De75933391", "topics": [ "0x00f7cd7255d1073b4e136dd477c38ea0020c051ab17110cc5bfab0c840ff9924", "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -380,16 +380,16 @@ ], "data": "0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c6469737075746554656d706c6174654d617070696e673a20544f444f00000000", "logIndex": 0, - "blockHash": "0xc563bdfaa4019bb91fb68e90e5bb3b7b740cf8ec6c1c02c21e128de667af36b3" + "blockHash": "0x6274b9a4a9be1d49e84450210fd8e92b186af6835a309217ccf400b6ae31eb07" } ], - "blockNumber": 3087468, - "cumulativeGasUsed": "1332621", + "blockNumber": 3639197, + "cumulativeGasUsed": "19504456", "status": 1, "byzantium": true }, "args": [ - "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8", { "$schema": "../NewDisputeTemplate.schema.json", "title": "Let's do this", @@ -415,7 +415,7 @@ }, "disputeTemplateMapping: TODO", "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003", - "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + "0x596D3B09E684D62217682216e9b7a0De75933391", "0x3829A2486d53ee984a0ca2D76552715726b77138" ], "numDeployments": 1, diff --git a/contracts/deployments/arbitrumSepoliaDevnet/BlockHashRNG.json b/contracts/deployments/arbitrumSepoliaDevnet/BlockHashRNG.json new file mode 100644 index 000000000..293998a78 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/BlockHashRNG.json @@ -0,0 +1,133 @@ +{ + "address": "0x56d6d65Fe202232714794B5D5e4ed9894466Ee01", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "randomNumbers", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_block", + "type": "uint256" + } + ], + "name": "receiveRandomness", + "outputs": [ + { + "internalType": "uint256", + "name": "randomNumber", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_block", + "type": "uint256" + } + ], + "name": "requestRandomness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x32c51b1394c621cbf7c57329ff44c105baa1e9fcad4c83a64aa4555755a73a1b", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x56d6d65Fe202232714794B5D5e4ed9894466Ee01", + "transactionIndex": 1, + "gasUsed": "131155", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xa93f6b0360c4d5aec6c9375356a101a1dab80c14b1f5bd97d5ff0fc4a949125a", + "transactionHash": "0x32c51b1394c621cbf7c57329ff44c105baa1e9fcad4c83a64aa4555755a73a1b", + "logs": [], + "blockNumber": 3141082, + "cumulativeGasUsed": "131155", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"randomNumbers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_block\",\"type\":\"uint256\"}],\"name\":\"receiveRandomness\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"randomNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_block\",\"type\":\"uint256\"}],\"name\":\"requestRandomness\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Cl\\u00e9ment Lesaege - \",\"details\":\"Random Number Generator returning the blockhash with a fallback behaviour. In case no one called it within the 256 blocks, it returns the previous blockhash. This contract must be used when returning 0 is a worse failure mode than returning another blockhash. Allows saving the random number for use in the future. It allows the contract to still access the blockhash even after 256 blocks.\",\"kind\":\"dev\",\"methods\":{\"receiveRandomness(uint256)\":{\"details\":\"Return the random number. If it has not been saved and is still computable compute it.\",\"params\":{\"_block\":\"Block the random number is linked to.\"},\"returns\":{\"randomNumber\":\"The random number or 0 if it is not ready or has not been requested.\"}},\"requestRandomness(uint256)\":{\"details\":\"Request a random number.\",\"params\":{\"_block\":\"Block the random number is linked to.\"}}},\"title\":\"Random Number Generator using blockhash with fallback.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/rng/BlockhashRNG.sol\":\"BlockHashRNG\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/rng/BlockhashRNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./RNG.sol\\\";\\n\\n/// @title Random Number Generator using blockhash with fallback.\\n/// @author Cl\\u00e9ment Lesaege - \\n/// @dev\\n/// Random Number Generator returning the blockhash with a fallback behaviour.\\n/// In case no one called it within the 256 blocks, it returns the previous blockhash.\\n/// This contract must be used when returning 0 is a worse failure mode than returning another blockhash.\\n/// Allows saving the random number for use in the future. It allows the contract to still access the blockhash even after 256 blocks.\\ncontract BlockHashRNG is RNG {\\n mapping(uint256 => uint256) public randomNumbers; // randomNumbers[block] is the random number for this block, 0 otherwise.\\n\\n /// @dev Request a random number.\\n /// @param _block Block the random number is linked to.\\n function requestRandomness(uint256 _block) external override {\\n // nop\\n }\\n\\n /// @dev Return the random number. If it has not been saved and is still computable compute it.\\n /// @param _block Block the random number is linked to.\\n /// @return randomNumber The random number or 0 if it is not ready or has not been requested.\\n function receiveRandomness(uint256 _block) external override returns (uint256 randomNumber) {\\n randomNumber = randomNumbers[_block];\\n if (randomNumber != 0) {\\n return randomNumber;\\n }\\n\\n if (_block < block.number) {\\n // The random number is not already set and can be.\\n if (blockhash(_block) != 0x0) {\\n // Normal case.\\n randomNumber = uint256(blockhash(_block));\\n } else {\\n // The contract was not called in time. Fallback to returning previous blockhash.\\n randomNumber = uint256(blockhash(block.number - 1));\\n }\\n }\\n randomNumbers[_block] = randomNumber;\\n }\\n}\\n\",\"keccak256\":\"0xbec8950b4a908f498273fb7c678f66ffbe08433009d5161545de9a3369eae1ea\",\"license\":\"MIT\"},\"src/rng/RNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\ninterface RNG {\\n /// @dev Request a random number.\\n /// @param _block Block linked to the request.\\n function requestRandomness(uint256 _block) external;\\n\\n /// @dev Receive the random number.\\n /// @param _block Block the random number is linked to.\\n /// @return randomNumber Random Number. If the number is not ready or has not been required 0 instead.\\n function receiveRandomness(uint256 _block) external returns (uint256 randomNumber);\\n}\\n\",\"keccak256\":\"0x5afe7121f49aebe72218df356bd91b66c2171b9ad15e7945a15a091784291a43\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50610169806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806313cf9054146100465780635257cd901461006b5780637363ae1f1461008b575b600080fd5b6100596100543660046100f3565b61009e565b60405190815260200160405180910390f35b6100596100793660046100f3565b60006020819052908152604090205481565b61009c6100993660046100f3565b50565b005b60008181526020819052604090205480156100b857919050565b438210156100de578140156100cf575080406100de565b6100da60014361010c565b4090505b60009182526020829052604090912081905590565b60006020828403121561010557600080fd5b5035919050565b8181038181111561012d57634e487b7160e01b600052601160045260246000fd5b9291505056fea2646970667358221220d8343029f3281984aa61880b071de45f3d714f660c2a6c1973b488429c50c84e64736f6c63430008120033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c806313cf9054146100465780635257cd901461006b5780637363ae1f1461008b575b600080fd5b6100596100543660046100f3565b61009e565b60405190815260200160405180910390f35b6100596100793660046100f3565b60006020819052908152604090205481565b61009c6100993660046100f3565b50565b005b60008181526020819052604090205480156100b857919050565b438210156100de578140156100cf575080406100de565b6100da60014361010c565b4090505b60009182526020829052604090912081905590565b60006020828403121561010557600080fd5b5035919050565b8181038181111561012d57634e487b7160e01b600052601160045260246000fd5b9291505056fea2646970667358221220d8343029f3281984aa61880b071de45f3d714f660c2a6c1973b488429c50c84e64736f6c63430008120033", + "devdoc": { + "author": "Clément Lesaege - ", + "details": "Random Number Generator returning the blockhash with a fallback behaviour. In case no one called it within the 256 blocks, it returns the previous blockhash. This contract must be used when returning 0 is a worse failure mode than returning another blockhash. Allows saving the random number for use in the future. It allows the contract to still access the blockhash even after 256 blocks.", + "kind": "dev", + "methods": { + "receiveRandomness(uint256)": { + "details": "Return the random number. If it has not been saved and is still computable compute it.", + "params": { + "_block": "Block the random number is linked to." + }, + "returns": { + "randomNumber": "The random number or 0 if it is not ready or has not been requested." + } + }, + "requestRandomness(uint256)": { + "details": "Request a random number.", + "params": { + "_block": "Block the random number is linked to." + } + } + }, + "title": "Random Number Generator using blockhash with fallback.", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 24139, + "contract": "src/rng/BlockhashRNG.sol:BlockHashRNG", + "label": "randomNumbers", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_uint256,t_uint256)" + } + ], + "types": { + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json b/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json index 59171d8eb..90834a879 100644 --- a/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json +++ b/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json @@ -1,5 +1,5 @@ { - "address": "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + "address": "0x9426F127116C3652A262AE1eA48391AC8F44D35b", "abi": [ { "stateMutability": "payable", @@ -936,37 +936,37 @@ "type": "constructor" } ], - "transactionHash": "0x3d8b4b6c62d6ca8ab1c6ccd5fd16bbf9894db1e11575d1e075fd1e335bd9d3c4", + "transactionHash": "0x43b208edcf6fd040290b8ef44cd6da0f54b13515af861fb68acd7ea4255f9464", "receipt": { "to": null, "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "contractAddress": "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + "contractAddress": "0x9426F127116C3652A262AE1eA48391AC8F44D35b", "transactionIndex": 1, - "gasUsed": "177903", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x9f7975c49e1f36319c3912d8040ec70fa39232d7c8416bce33dd3bf578803044", - "transactionHash": "0x3d8b4b6c62d6ca8ab1c6ccd5fd16bbf9894db1e11575d1e075fd1e335bd9d3c4", + "gasUsed": "4175167", + "logsBloom": "0x00000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000002000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x242d1c89de54e1756d61bf0ed70cd5a495cc526ad94987ee7085e719c60d3562", + "transactionHash": "0x43b208edcf6fd040290b8ef44cd6da0f54b13515af861fb68acd7ea4255f9464", "logs": [ { "transactionIndex": 1, - "blockNumber": 3084586, - "transactionHash": "0x3d8b4b6c62d6ca8ab1c6ccd5fd16bbf9894db1e11575d1e075fd1e335bd9d3c4", - "address": "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + "blockNumber": 3638835, + "transactionHash": "0x43b208edcf6fd040290b8ef44cd6da0f54b13515af861fb68acd7ea4255f9464", + "address": "0x9426F127116C3652A262AE1eA48391AC8F44D35b", "topics": [ "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", "logIndex": 0, - "blockHash": "0x9f7975c49e1f36319c3912d8040ec70fa39232d7c8416bce33dd3bf578803044" + "blockHash": "0x242d1c89de54e1756d61bf0ed70cd5a495cc526ad94987ee7085e719c60d3562" } ], - "blockNumber": 3084586, - "cumulativeGasUsed": "177903", + "blockNumber": 3638835, + "cumulativeGasUsed": "4175167", "status": 1, "byzantium": true }, "args": [ - "0xC3dB344755b15c8Edfd834db79af4f8860029FB4", + "0x692CC78F2570181FFB99297965FeAA8352ab12E8", "0x485cc955000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c590000000000000000000000000000000000000000000000000000000000000000" ], "numDeployments": 1, @@ -981,7 +981,7 @@ "0x0000000000000000000000000000000000000000" ] }, - "implementation": "0xC3dB344755b15c8Edfd834db79af4f8860029FB4", + "implementation": "0x692CC78F2570181FFB99297965FeAA8352ab12E8", "devdoc": { "author": "Simon Malatrait ", "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic_Implementation.json b/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic_Implementation.json index 9338cc8e8..072ba4a7c 100644 --- a/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic_Implementation.json +++ b/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic_Implementation.json @@ -1,5 +1,5 @@ { - "address": "0xC3dB344755b15c8Edfd834db79af4f8860029FB4", + "address": "0x692CC78F2570181FFB99297965FeAA8352ab12E8", "abi": [ { "inputs": [], @@ -917,32 +917,32 @@ "type": "function" } ], - "transactionHash": "0x1f0ce8d7ed97f6426105ba4b8b51b6d34ae35959f3d3ff1edb3e4c4beccb008b", + "transactionHash": "0x94bdfd10ea04ecb57b76acbdce19b6d0cd72bde1173b32284dbcf3e2fbb24b68", "receipt": { "to": null, "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "contractAddress": "0xC3dB344755b15c8Edfd834db79af4f8860029FB4", + "contractAddress": "0x692CC78F2570181FFB99297965FeAA8352ab12E8", "transactionIndex": 1, - "gasUsed": "3504819", - "logsBloom": "0x00000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000004000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x491cd79e7eef2473a6fcdc8e5e3c7b49cbd3e2fb144da954a2457ec087fa0696", - "transactionHash": "0x1f0ce8d7ed97f6426105ba4b8b51b6d34ae35959f3d3ff1edb3e4c4beccb008b", + "gasUsed": "41447396", + "logsBloom": "0x00000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000004000000000", + "blockHash": "0xec8815e83c51323930215add9ffb246d3da398d8fd9c9d84c5280d380017da7d", + "transactionHash": "0x94bdfd10ea04ecb57b76acbdce19b6d0cd72bde1173b32284dbcf3e2fbb24b68", "logs": [ { "transactionIndex": 1, - "blockNumber": 3084585, - "transactionHash": "0x1f0ce8d7ed97f6426105ba4b8b51b6d34ae35959f3d3ff1edb3e4c4beccb008b", - "address": "0xC3dB344755b15c8Edfd834db79af4f8860029FB4", + "blockNumber": 3638827, + "transactionHash": "0x94bdfd10ea04ecb57b76acbdce19b6d0cd72bde1173b32284dbcf3e2fbb24b68", + "address": "0x692CC78F2570181FFB99297965FeAA8352ab12E8", "topics": [ "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" ], "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", "logIndex": 0, - "blockHash": "0x491cd79e7eef2473a6fcdc8e5e3c7b49cbd3e2fb144da954a2457ec087fa0696" + "blockHash": "0xec8815e83c51323930215add9ffb246d3da398d8fd9c9d84c5280d380017da7d" } ], - "blockNumber": 3084585, - "cumulativeGasUsed": "3504819", + "blockNumber": 3638827, + "cumulativeGasUsed": "41447396", "status": 1, "byzantium": true }, diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic_Proxy.json b/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic_Proxy.json index 2646f99a0..a05e4e28f 100644 --- a/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic_Proxy.json +++ b/contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic_Proxy.json @@ -1,5 +1,5 @@ { - "address": "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + "address": "0x9426F127116C3652A262AE1eA48391AC8F44D35b", "abi": [ { "inputs": [ @@ -26,37 +26,37 @@ "type": "receive" } ], - "transactionHash": "0x3d8b4b6c62d6ca8ab1c6ccd5fd16bbf9894db1e11575d1e075fd1e335bd9d3c4", + "transactionHash": "0x43b208edcf6fd040290b8ef44cd6da0f54b13515af861fb68acd7ea4255f9464", "receipt": { "to": null, "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "contractAddress": "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + "contractAddress": "0x9426F127116C3652A262AE1eA48391AC8F44D35b", "transactionIndex": 1, - "gasUsed": "177903", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x9f7975c49e1f36319c3912d8040ec70fa39232d7c8416bce33dd3bf578803044", - "transactionHash": "0x3d8b4b6c62d6ca8ab1c6ccd5fd16bbf9894db1e11575d1e075fd1e335bd9d3c4", + "gasUsed": "4175167", + "logsBloom": "0x00000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000002000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x242d1c89de54e1756d61bf0ed70cd5a495cc526ad94987ee7085e719c60d3562", + "transactionHash": "0x43b208edcf6fd040290b8ef44cd6da0f54b13515af861fb68acd7ea4255f9464", "logs": [ { "transactionIndex": 1, - "blockNumber": 3084586, - "transactionHash": "0x3d8b4b6c62d6ca8ab1c6ccd5fd16bbf9894db1e11575d1e075fd1e335bd9d3c4", - "address": "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + "blockNumber": 3638835, + "transactionHash": "0x43b208edcf6fd040290b8ef44cd6da0f54b13515af861fb68acd7ea4255f9464", + "address": "0x9426F127116C3652A262AE1eA48391AC8F44D35b", "topics": [ "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", "logIndex": 0, - "blockHash": "0x9f7975c49e1f36319c3912d8040ec70fa39232d7c8416bce33dd3bf578803044" + "blockHash": "0x242d1c89de54e1756d61bf0ed70cd5a495cc526ad94987ee7085e719c60d3562" } ], - "blockNumber": 3084586, - "cumulativeGasUsed": "177903", + "blockNumber": 3638835, + "cumulativeGasUsed": "4175167", "status": 1, "byzantium": true }, "args": [ - "0xC3dB344755b15c8Edfd834db79af4f8860029FB4", + "0x692CC78F2570181FFB99297965FeAA8352ab12E8", "0x485cc955000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c590000000000000000000000000000000000000000000000000000000000000000" ], "numDeployments": 1, diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DisputeResolver.json b/contracts/deployments/arbitrumSepoliaDevnet/DisputeResolver.json index 7bf31192b..2e37ca79e 100644 --- a/contracts/deployments/arbitrumSepoliaDevnet/DisputeResolver.json +++ b/contracts/deployments/arbitrumSepoliaDevnet/DisputeResolver.json @@ -1,5 +1,5 @@ { - "address": "0x3E22eBE8c86a58b0BfEd5383aa9DEFB87De85034", + "address": "0xB8B36CC43f852f9F0484f53Eb38CaBBA28a81bF6", "abi": [ { "inputs": [ @@ -292,25 +292,25 @@ "type": "function" } ], - "transactionHash": "0x663feb674e9a6299d3cde548797e79e9f908e2136441adeb1a7ccf0e1b8465f1", + "transactionHash": "0x29f6097fe01b421ffa722955322fbfc4d872b89446779af6e7141c0bdc2ff6a7", "receipt": { "to": null, "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "contractAddress": "0x3E22eBE8c86a58b0BfEd5383aa9DEFB87De85034", + "contractAddress": "0xB8B36CC43f852f9F0484f53Eb38CaBBA28a81bF6", "transactionIndex": 1, - "gasUsed": "899040", + "gasUsed": "12967186", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x33bd575519da65d8903ee2bdca4679bc04acb9db41b9bca8f6f310d3fd24acb0", - "transactionHash": "0x663feb674e9a6299d3cde548797e79e9f908e2136441adeb1a7ccf0e1b8465f1", + "blockHash": "0x3ef5f7d0989a6ae711bbb1bcb86a0fd78ebecb0128ec3037c4db13767c58701f", + "transactionHash": "0x29f6097fe01b421ffa722955322fbfc4d872b89446779af6e7141c0bdc2ff6a7", "logs": [], - "blockNumber": 3087471, - "cumulativeGasUsed": "899040", + "blockNumber": 3639204, + "cumulativeGasUsed": "12967186", "status": 1, "byzantium": true }, "args": [ - "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", - "0xc60e862273c1eAa1F9afBC69b39cee30270A2419" + "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8", + "0x596D3B09E684D62217682216e9b7a0De75933391" ], "numDeployments": 1, "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry.json b/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry.json index b59cb3ce1..83e267bd4 100644 --- a/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry.json +++ b/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry.json @@ -1,5 +1,5 @@ { - "address": "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + "address": "0x596D3B09E684D62217682216e9b7a0De75933391", "abi": [ { "stateMutability": "payable", @@ -237,37 +237,37 @@ "type": "constructor" } ], - "transactionHash": "0x60b03812afc0e4fc36f66e3bc1f8aa7953a7a7bbf4fa8ea6e16e3c166d39538e", + "transactionHash": "0x8c2dced9ed139bc917e2ade113d031a438e66a069c9a9014d2aef333dd4eda3e", "receipt": { "to": null, "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "contractAddress": "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + "contractAddress": "0x596D3B09E684D62217682216e9b7a0De75933391", "transactionIndex": 1, - "gasUsed": "175211", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000004000000000000000000000000000020000000000000000000000000000000000000000000000000000000", - "blockHash": "0x9d4803d3e8255ee697b39e40e77e005bf3b315ec798d15139412624a91b41226", - "transactionHash": "0x60b03812afc0e4fc36f66e3bc1f8aa7953a7a7bbf4fa8ea6e16e3c166d39538e", + "gasUsed": "4181458", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000040000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x7c30329f6408ee776e597cbad90a95cf8534390a6b8574e18ac295ca5355e2a8", + "transactionHash": "0x8c2dced9ed139bc917e2ade113d031a438e66a069c9a9014d2aef333dd4eda3e", "logs": [ { "transactionIndex": 1, - "blockNumber": 3087464, - "transactionHash": "0x60b03812afc0e4fc36f66e3bc1f8aa7953a7a7bbf4fa8ea6e16e3c166d39538e", - "address": "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + "blockNumber": 3639191, + "transactionHash": "0x8c2dced9ed139bc917e2ade113d031a438e66a069c9a9014d2aef333dd4eda3e", + "address": "0x596D3B09E684D62217682216e9b7a0De75933391", "topics": [ "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", "logIndex": 0, - "blockHash": "0x9d4803d3e8255ee697b39e40e77e005bf3b315ec798d15139412624a91b41226" + "blockHash": "0x7c30329f6408ee776e597cbad90a95cf8534390a6b8574e18ac295ca5355e2a8" } ], - "blockNumber": 3087464, - "cumulativeGasUsed": "175211", + "blockNumber": 3639191, + "cumulativeGasUsed": "4181458", "status": 1, "byzantium": true }, "args": [ - "0xeA44D4710bc804573E7d8653b88A60CaC51E3738", + "0xc53b813ed94AaEb6F5518D60bf6a8109954bE3f6", "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" ], "numDeployments": 1, @@ -281,7 +281,7 @@ "0xf1C7c037891525E360C59f708739Ac09A7670c59" ] }, - "implementation": "0xeA44D4710bc804573E7d8653b88A60CaC51E3738", + "implementation": "0xc53b813ed94AaEb6F5518D60bf6a8109954bE3f6", "devdoc": { "author": "Simon Malatrait ", "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Implementation.json b/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Implementation.json index 1c9765248..e96715694 100644 --- a/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Implementation.json +++ b/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Implementation.json @@ -1,5 +1,5 @@ { - "address": "0xeA44D4710bc804573E7d8653b88A60CaC51E3738", + "address": "0xc53b813ed94AaEb6F5518D60bf6a8109954bE3f6", "abi": [ { "inputs": [], @@ -218,32 +218,32 @@ "type": "function" } ], - "transactionHash": "0x6397611709713a7bdbf16c8b4d07b5bed5b8b227a6b7f4b4c01efef1c72cd868", + "transactionHash": "0x68a18fb630370db5774e7d41536f3fdce6ce55815860d0b05efa186833d49e23", "receipt": { "to": null, "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "contractAddress": "0xeA44D4710bc804573E7d8653b88A60CaC51E3738", + "contractAddress": "0xc53b813ed94AaEb6F5518D60bf6a8109954bE3f6", "transactionIndex": 1, - "gasUsed": "567386", - "logsBloom": "0x00000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000100000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x6588b75561007ce9bcc9180b9d33d34cc8fedc5b178c3414c0055d0b2e0f5499", - "transactionHash": "0x6397611709713a7bdbf16c8b4d07b5bed5b8b227a6b7f4b4c01efef1c72cd868", + "gasUsed": "8651742", + "logsBloom": "0x00000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000002000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x68e5df417de62cb85461476fb585e415218d0e75b3e9636d861bded120e2ea5d", + "transactionHash": "0x68a18fb630370db5774e7d41536f3fdce6ce55815860d0b05efa186833d49e23", "logs": [ { "transactionIndex": 1, - "blockNumber": 3087460, - "transactionHash": "0x6397611709713a7bdbf16c8b4d07b5bed5b8b227a6b7f4b4c01efef1c72cd868", - "address": "0xeA44D4710bc804573E7d8653b88A60CaC51E3738", + "blockNumber": 3639181, + "transactionHash": "0x68a18fb630370db5774e7d41536f3fdce6ce55815860d0b05efa186833d49e23", + "address": "0xc53b813ed94AaEb6F5518D60bf6a8109954bE3f6", "topics": [ "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" ], "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", "logIndex": 0, - "blockHash": "0x6588b75561007ce9bcc9180b9d33d34cc8fedc5b178c3414c0055d0b2e0f5499" + "blockHash": "0x68e5df417de62cb85461476fb585e415218d0e75b3e9636d861bded120e2ea5d" } ], - "blockNumber": 3087460, - "cumulativeGasUsed": "567386", + "blockNumber": 3639181, + "cumulativeGasUsed": "8651742", "status": 1, "byzantium": true }, diff --git a/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Proxy.json b/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Proxy.json index 1d783e5d5..c3beade40 100644 --- a/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Proxy.json +++ b/contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistry_Proxy.json @@ -1,5 +1,5 @@ { - "address": "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + "address": "0x596D3B09E684D62217682216e9b7a0De75933391", "abi": [ { "inputs": [ @@ -26,37 +26,37 @@ "type": "receive" } ], - "transactionHash": "0x60b03812afc0e4fc36f66e3bc1f8aa7953a7a7bbf4fa8ea6e16e3c166d39538e", + "transactionHash": "0x8c2dced9ed139bc917e2ade113d031a438e66a069c9a9014d2aef333dd4eda3e", "receipt": { "to": null, "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "contractAddress": "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + "contractAddress": "0x596D3B09E684D62217682216e9b7a0De75933391", "transactionIndex": 1, - "gasUsed": "175211", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000004000000000000000000000000000020000000000000000000000000000000000000000000000000000000", - "blockHash": "0x9d4803d3e8255ee697b39e40e77e005bf3b315ec798d15139412624a91b41226", - "transactionHash": "0x60b03812afc0e4fc36f66e3bc1f8aa7953a7a7bbf4fa8ea6e16e3c166d39538e", + "gasUsed": "4181458", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000040000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x7c30329f6408ee776e597cbad90a95cf8534390a6b8574e18ac295ca5355e2a8", + "transactionHash": "0x8c2dced9ed139bc917e2ade113d031a438e66a069c9a9014d2aef333dd4eda3e", "logs": [ { "transactionIndex": 1, - "blockNumber": 3087464, - "transactionHash": "0x60b03812afc0e4fc36f66e3bc1f8aa7953a7a7bbf4fa8ea6e16e3c166d39538e", - "address": "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + "blockNumber": 3639191, + "transactionHash": "0x8c2dced9ed139bc917e2ade113d031a438e66a069c9a9014d2aef333dd4eda3e", + "address": "0x596D3B09E684D62217682216e9b7a0De75933391", "topics": [ "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", "logIndex": 0, - "blockHash": "0x9d4803d3e8255ee697b39e40e77e005bf3b315ec798d15139412624a91b41226" + "blockHash": "0x7c30329f6408ee776e597cbad90a95cf8534390a6b8574e18ac295ca5355e2a8" } ], - "blockNumber": 3087464, - "cumulativeGasUsed": "175211", + "blockNumber": 3639191, + "cumulativeGasUsed": "4181458", "status": 1, "byzantium": true }, "args": [ - "0xeA44D4710bc804573E7d8653b88A60CaC51E3738", + "0xc53b813ed94AaEb6F5518D60bf6a8109954bE3f6", "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" ], "numDeployments": 1, diff --git a/contracts/deployments/arbitrumSepoliaDevnet/Escrow.json b/contracts/deployments/arbitrumSepoliaDevnet/Escrow.json index 177ae268d..993b60f74 100644 --- a/contracts/deployments/arbitrumSepoliaDevnet/Escrow.json +++ b/contracts/deployments/arbitrumSepoliaDevnet/Escrow.json @@ -1,5 +1,5 @@ { - "address": "0x224E52523354BEdCaFF3e98de463E829f3388f84", + "address": "0xdaf749DABE7be6C6894950AE69af35c20a00ABd9", "abi": [ { "inputs": [ @@ -671,22 +671,22 @@ "type": "function" } ], - "transactionHash": "0x0b22de728111f58bd9659c02baabb82a6c883fe6a33f5dcb3d71e2398bfac628", + "transactionHash": "0x3fec232b2cbc99d57bf970770be414dd979379762d5af18424d49924604154b5", "receipt": { "to": null, "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "contractAddress": "0x224E52523354BEdCaFF3e98de463E829f3388f84", + "contractAddress": "0xdaf749DABE7be6C6894950AE69af35c20a00ABd9", "transactionIndex": 1, - "gasUsed": "1864661", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000080000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000040000000002020000400000000000100000000000000000000000000000000000000", - "blockHash": "0xf88d81ede1bf3cf635ac854704ff3b2edc75306b2dcc6afc45639b3836320e16", - "transactionHash": "0x0b22de728111f58bd9659c02baabb82a6c883fe6a33f5dcb3d71e2398bfac628", + "gasUsed": "24294257", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000008000000000000000004000000000000000000000000000000000000000040000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000080000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000002000000400000000000100000000000000000000000000000000000000", + "blockHash": "0x4a245ca111980fc1afe84e9bb51e8ac4b701f6b66982b27a5f5538e13638766d", + "transactionHash": "0x3fec232b2cbc99d57bf970770be414dd979379762d5af18424d49924604154b5", "logs": [ { "transactionIndex": 1, - "blockNumber": 3087475, - "transactionHash": "0x0b22de728111f58bd9659c02baabb82a6c883fe6a33f5dcb3d71e2398bfac628", - "address": "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + "blockNumber": 3639224, + "transactionHash": "0x3fec232b2cbc99d57bf970770be414dd979379762d5af18424d49924604154b5", + "address": "0x596D3B09E684D62217682216e9b7a0De75933391", "topics": [ "0x00f7cd7255d1073b4e136dd477c38ea0020c051ab17110cc5bfab0c840ff9924", "0x0000000000000000000000000000000000000000000000000000000000000001", @@ -694,16 +694,16 @@ ], "data": "0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c6469737075746554656d706c6174654d617070696e673a20544f444f00000000", "logIndex": 0, - "blockHash": "0xf88d81ede1bf3cf635ac854704ff3b2edc75306b2dcc6afc45639b3836320e16" + "blockHash": "0x4a245ca111980fc1afe84e9bb51e8ac4b701f6b66982b27a5f5538e13638766d" } ], - "blockNumber": 3087475, - "cumulativeGasUsed": "1864661", + "blockNumber": 3639224, + "cumulativeGasUsed": "24294257", "status": 1, "byzantium": true }, "args": [ - "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8", "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003", { "$schema": "../NewDisputeTemplate.schema.json", @@ -729,7 +729,7 @@ "lang": "en_US" }, "disputeTemplateMapping: TODO", - "0xc60e862273c1eAa1F9afBC69b39cee30270A2419", + "0x596D3B09E684D62217682216e9b7a0De75933391", 600 ], "numDeployments": 1, diff --git a/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule.json b/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule.json index 90d20a3b4..ad4e847a6 100644 --- a/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule.json +++ b/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule.json @@ -1,5 +1,5 @@ { - "address": "0x827411b3e98bAe8c441efBf26842A1670f8f378F", + "address": "0x57fd453FB0d16f8ca174E7386102D7170E17Be09", "abi": [ { "stateMutability": "payable", @@ -194,37 +194,37 @@ "type": "constructor" } ], - "transactionHash": "0xf3744a46e16a2e55fbb84e35431af26d4c482f2965d69f2886ef43fa1ae4af43", + "transactionHash": "0x8d69083b7054b38ca34473b5aa7e359baf9dfe08e374f926d236a66d3ba89b61", "receipt": { "to": null, "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "contractAddress": "0x827411b3e98bAe8c441efBf26842A1670f8f378F", + "contractAddress": "0x57fd453FB0d16f8ca174E7386102D7170E17Be09", "transactionIndex": 1, - "gasUsed": "175189", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000008000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x96ea242e7e56b0df653f1ac8472119c051e890b8c2e4c79b92655fa01c845f09", - "transactionHash": "0xf3744a46e16a2e55fbb84e35431af26d4c482f2965d69f2886ef43fa1ae4af43", + "gasUsed": "2722260", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000080000000000000000000000000000000000000000000000000000000", + "blockHash": "0xb87d473e0e36ae4b612a0ec69cd350a54608d12378eb4d58830ac4a00fc8136d", + "transactionHash": "0x8d69083b7054b38ca34473b5aa7e359baf9dfe08e374f926d236a66d3ba89b61", "logs": [ { "transactionIndex": 1, - "blockNumber": 3084571, - "transactionHash": "0xf3744a46e16a2e55fbb84e35431af26d4c482f2965d69f2886ef43fa1ae4af43", - "address": "0x827411b3e98bAe8c441efBf26842A1670f8f378F", + "blockNumber": 3638735, + "transactionHash": "0x8d69083b7054b38ca34473b5aa7e359baf9dfe08e374f926d236a66d3ba89b61", + "address": "0x57fd453FB0d16f8ca174E7386102D7170E17Be09", "topics": [ "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", "logIndex": 0, - "blockHash": "0x96ea242e7e56b0df653f1ac8472119c051e890b8c2e4c79b92655fa01c845f09" + "blockHash": "0xb87d473e0e36ae4b612a0ec69cd350a54608d12378eb4d58830ac4a00fc8136d" } ], - "blockNumber": 3084571, - "cumulativeGasUsed": "175189", + "blockNumber": 3638735, + "cumulativeGasUsed": "2722260", "status": 1, "byzantium": true }, "args": [ - "0x26c1980120F1C82cF611D666CE81D2b54d018547", + "0x05AD81f245209b7f91885fd96e57c9da90554824", "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" ], "numDeployments": 1, @@ -238,7 +238,7 @@ "0xf1C7c037891525E360C59f708739Ac09A7670c59" ] }, - "implementation": "0x26c1980120F1C82cF611D666CE81D2b54d018547", + "implementation": "0x05AD81f245209b7f91885fd96e57c9da90554824", "devdoc": { "author": "Simon Malatrait ", "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", diff --git a/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule_Implementation.json b/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule_Implementation.json index 4203b0f6d..d21c57bcf 100644 --- a/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule_Implementation.json +++ b/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule_Implementation.json @@ -1,5 +1,5 @@ { - "address": "0x26c1980120F1C82cF611D666CE81D2b54d018547", + "address": "0x05AD81f245209b7f91885fd96e57c9da90554824", "abi": [ { "inputs": [], @@ -175,32 +175,32 @@ "type": "function" } ], - "transactionHash": "0x118e78306ecb68456d04b5eab509764e9f55712fa053b49eb704f4703d2f99e3", + "transactionHash": "0xb8ebf622d8db54d1b4443f7be1e7be2dc33a2718ed4f7f33639f73940c61caa6", "receipt": { "to": null, "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "contractAddress": "0x26c1980120F1C82cF611D666CE81D2b54d018547", + "contractAddress": "0x05AD81f245209b7f91885fd96e57c9da90554824", "transactionIndex": 1, - "gasUsed": "495528", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080010000000000000000000000000000000000000000000000000000800000000000000000000000000000000010000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x396ddfdc729aad3ff96029dbe9c4feb677db6c5274490685281f354169b00c72", - "transactionHash": "0x118e78306ecb68456d04b5eab509764e9f55712fa053b49eb704f4703d2f99e3", + "gasUsed": "5237753", + "logsBloom": "0x00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xa63e64a94d98e5015c118604aef38341ff47ea0099cf157eb9add4842b189cfd", + "transactionHash": "0xb8ebf622d8db54d1b4443f7be1e7be2dc33a2718ed4f7f33639f73940c61caa6", "logs": [ { "transactionIndex": 1, - "blockNumber": 3084570, - "transactionHash": "0x118e78306ecb68456d04b5eab509764e9f55712fa053b49eb704f4703d2f99e3", - "address": "0x26c1980120F1C82cF611D666CE81D2b54d018547", + "blockNumber": 3638725, + "transactionHash": "0xb8ebf622d8db54d1b4443f7be1e7be2dc33a2718ed4f7f33639f73940c61caa6", + "address": "0x05AD81f245209b7f91885fd96e57c9da90554824", "topics": [ "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" ], "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", "logIndex": 0, - "blockHash": "0x396ddfdc729aad3ff96029dbe9c4feb677db6c5274490685281f354169b00c72" + "blockHash": "0xa63e64a94d98e5015c118604aef38341ff47ea0099cf157eb9add4842b189cfd" } ], - "blockNumber": 3084570, - "cumulativeGasUsed": "495528", + "blockNumber": 3638725, + "cumulativeGasUsed": "5237753", "status": 1, "byzantium": true }, diff --git a/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule_Proxy.json b/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule_Proxy.json index e5aad48d1..a049ed1f5 100644 --- a/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule_Proxy.json +++ b/contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule_Proxy.json @@ -1,5 +1,5 @@ { - "address": "0x827411b3e98bAe8c441efBf26842A1670f8f378F", + "address": "0x57fd453FB0d16f8ca174E7386102D7170E17Be09", "abi": [ { "inputs": [ @@ -26,37 +26,37 @@ "type": "receive" } ], - "transactionHash": "0xf3744a46e16a2e55fbb84e35431af26d4c482f2965d69f2886ef43fa1ae4af43", + "transactionHash": "0x8d69083b7054b38ca34473b5aa7e359baf9dfe08e374f926d236a66d3ba89b61", "receipt": { "to": null, "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "contractAddress": "0x827411b3e98bAe8c441efBf26842A1670f8f378F", + "contractAddress": "0x57fd453FB0d16f8ca174E7386102D7170E17Be09", "transactionIndex": 1, - "gasUsed": "175189", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000008000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x96ea242e7e56b0df653f1ac8472119c051e890b8c2e4c79b92655fa01c845f09", - "transactionHash": "0xf3744a46e16a2e55fbb84e35431af26d4c482f2965d69f2886ef43fa1ae4af43", + "gasUsed": "2722260", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000080000000000000000000000000000000000000000000000000000000", + "blockHash": "0xb87d473e0e36ae4b612a0ec69cd350a54608d12378eb4d58830ac4a00fc8136d", + "transactionHash": "0x8d69083b7054b38ca34473b5aa7e359baf9dfe08e374f926d236a66d3ba89b61", "logs": [ { "transactionIndex": 1, - "blockNumber": 3084571, - "transactionHash": "0xf3744a46e16a2e55fbb84e35431af26d4c482f2965d69f2886ef43fa1ae4af43", - "address": "0x827411b3e98bAe8c441efBf26842A1670f8f378F", + "blockNumber": 3638735, + "transactionHash": "0x8d69083b7054b38ca34473b5aa7e359baf9dfe08e374f926d236a66d3ba89b61", + "address": "0x57fd453FB0d16f8ca174E7386102D7170E17Be09", "topics": [ "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", "logIndex": 0, - "blockHash": "0x96ea242e7e56b0df653f1ac8472119c051e890b8c2e4c79b92655fa01c845f09" + "blockHash": "0xb87d473e0e36ae4b612a0ec69cd350a54608d12378eb4d58830ac4a00fc8136d" } ], - "blockNumber": 3084571, - "cumulativeGasUsed": "175189", + "blockNumber": 3638735, + "cumulativeGasUsed": "2722260", "status": 1, "byzantium": true }, "args": [ - "0x26c1980120F1C82cF611D666CE81D2b54d018547", + "0x05AD81f245209b7f91885fd96e57c9da90554824", "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" ], "numDeployments": 1, diff --git a/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore.json b/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore.json index b24a41cf0..377a98f54 100644 --- a/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore.json +++ b/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore.json @@ -1,5 +1,5 @@ { - "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "address": "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8", "abi": [ { "stateMutability": "payable", @@ -1764,36 +1764,36 @@ "type": "constructor" } ], - "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", + "transactionHash": "0x8375e2c27568a970ffbd7366397810482c8b64248add4a2c38b7c40cd63ee51d", "receipt": { "to": null, "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "contractAddress": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "contractAddress": "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8", "transactionIndex": 1, - "gasUsed": "555971", - "logsBloom": "0x00000000000000000000000020000000000000000000000000000100020000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000040000000000000000000000000000020000000000000010000800402000000000000008000000000000000000000000000000000800000000000000000000000080000000000000800000000000000000000008000000000000000080000000000000000000000000000000000000000000000000000000000000000000000004000000000000000060000004001001000000000000001000000000000000000000000000000020000000", - "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4", - "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", + "gasUsed": "5235914", + "logsBloom": "0x00000000000000000000000020000000000000000000000000000000020000000000000000000000004000000000000000000000000000000000000000040000000000000000000000000000000000000000000000040008000000000000000000000000020000000000000010000800402000000000000008000000080000000000000000000000000800000000000000000000000080000000000000000000000000000000004008000000000000000000000000000000000100000000000000000000000000000000000000000000000000000004000000000000000060000000001001000000000000000000000000000000000000000000000000000000", + "blockHash": "0x103e109081f82664640683b59588786a8fdd7cf0b85e0a64711bb0aa33a8f8fb", + "transactionHash": "0x8375e2c27568a970ffbd7366397810482c8b64248add4a2c38b7c40cd63ee51d", "logs": [ { "transactionIndex": 1, - "blockNumber": 3084598, - "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", - "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "blockNumber": 3638878, + "transactionHash": "0x8375e2c27568a970ffbd7366397810482c8b64248add4a2c38b7c40cd63ee51d", + "address": "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8", "topics": [ "0x44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb2", "0x0000000000000000000000000000000000000000000000000000000000000001", - "0x00000000000000000000000086ac67e5550f837a650b4b0cd4778d4293a2bde3" + "0x0000000000000000000000009426f127116c3652a262ae1ea48391ac8f44d35b" ], "data": "0x", "logIndex": 0, - "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4" + "blockHash": "0x103e109081f82664640683b59588786a8fdd7cf0b85e0a64711bb0aa33a8f8fb" }, { "transactionIndex": 1, - "blockNumber": 3084598, - "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", - "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "blockNumber": 3638878, + "transactionHash": "0x8375e2c27568a970ffbd7366397810482c8b64248add4a2c38b7c40cd63ee51d", + "address": "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8", "topics": [ "0x3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d", "0x0000000000000000000000000000000000000000000000000000000000000001", @@ -1801,13 +1801,13 @@ ], "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000", "logIndex": 1, - "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4" + "blockHash": "0x103e109081f82664640683b59588786a8fdd7cf0b85e0a64711bb0aa33a8f8fb" }, { "transactionIndex": 1, - "blockNumber": 3084598, - "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", - "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "blockNumber": 3638878, + "transactionHash": "0x8375e2c27568a970ffbd7366397810482c8b64248add4a2c38b7c40cd63ee51d", + "address": "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8", "topics": [ "0xb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc79", "0x0000000000000000000000000000000000000000000000000000000000000001", @@ -1816,29 +1816,29 @@ ], "data": "0x", "logIndex": 2, - "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4" + "blockHash": "0x103e109081f82664640683b59588786a8fdd7cf0b85e0a64711bb0aa33a8f8fb" }, { "transactionIndex": 1, - "blockNumber": 3084598, - "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", - "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "blockNumber": 3638878, + "transactionHash": "0x8375e2c27568a970ffbd7366397810482c8b64248add4a2c38b7c40cd63ee51d", + "address": "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8", "topics": [ "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", "logIndex": 3, - "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4" + "blockHash": "0x103e109081f82664640683b59588786a8fdd7cf0b85e0a64711bb0aa33a8f8fb" } ], - "blockNumber": 3084598, - "cumulativeGasUsed": "555971", + "blockNumber": 3638878, + "cumulativeGasUsed": "5235914", "status": 1, "byzantium": true }, "args": [ - "0x614498118850184c62f82d08261109334bFB050f", - "0x994b27af000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c5900000000000000000000000034b944d42cacfc8266955d07a80181d2054aa225000000000000000000000000000000000000000000000000000000000000000000000000000000000000000086ac67e5550f837a650b4b0cd4778d4293a2bde3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000f327200420f21baafce8f1c03b1eedf926074b9500000000000000000000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000" + "0x91a373BBdE0532F86410682F362e2Cf685e95085", + "0x994b27af000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c5900000000000000000000000034b944d42cacfc8266955d07a80181d2054aa22500000000000000000000000000000000000000000000000000000000000000000000000000000000000000009426f127116c3652a262ae1ea48391ac8f44d35b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001e000000000000000000000000019cb28bab40c3585955798f5eeabd71eec14471c00000000000000000000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000" ], "numDeployments": 1, "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", @@ -1851,7 +1851,7 @@ "0xf1C7c037891525E360C59f708739Ac09A7670c59", "0x34B944D42cAcfC8266955D07A80181D2054aa225", "0x0000000000000000000000000000000000000000", - "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3", + "0x9426F127116C3652A262AE1eA48391AC8F44D35b", false, [ { @@ -1872,10 +1872,10 @@ 10 ], "0x05", - "0xf327200420F21BAafce8F1C03B1EEdF926074B95" + "0x19cb28BAB40C3585955798f5EEabd71Eec14471C" ] }, - "implementation": "0x614498118850184c62f82d08261109334bFB050f", + "implementation": "0x91a373BBdE0532F86410682F362e2Cf685e95085", "devdoc": { "author": "Simon Malatrait ", "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", diff --git a/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore_Implementation.json b/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore_Implementation.json index 9c7e0d2d8..57dcd1285 100644 --- a/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore_Implementation.json +++ b/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore_Implementation.json @@ -1,5 +1,5 @@ { - "address": "0x614498118850184c62f82d08261109334bFB050f", + "address": "0x91a373BBdE0532F86410682F362e2Cf685e95085", "abi": [ { "inputs": [], @@ -1745,32 +1745,32 @@ "type": "function" } ], - "transactionHash": "0xc58467c2d89a4e5bab96ead4d8547f3d82d56d9297651316c278d410987a1fd6", + "transactionHash": "0xbcf62d7f5849f5bc03a6fe8ba8de81929f3ef14ac6d00553bd968ddd89bf3a4c", "receipt": { "to": null, "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "contractAddress": "0x614498118850184c62f82d08261109334bFB050f", + "contractAddress": "0x91a373BBdE0532F86410682F362e2Cf685e95085", "transactionIndex": 1, - "gasUsed": "4776582", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000002000000000000000000000000000000000000000000000000", - "blockHash": "0x94238b9c3e2400e396e91cb51431c0762b70494568245c2e450c4d65aba2e180", - "transactionHash": "0xc58467c2d89a4e5bab96ead4d8547f3d82d56d9297651316c278d410987a1fd6", + "gasUsed": "57410230", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000802000000000200000000000080000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x461454ae071be436765d458195dcc2dbba01ca552218a997fcb0078378c32516", + "transactionHash": "0xbcf62d7f5849f5bc03a6fe8ba8de81929f3ef14ac6d00553bd968ddd89bf3a4c", "logs": [ { "transactionIndex": 1, - "blockNumber": 3084595, - "transactionHash": "0xc58467c2d89a4e5bab96ead4d8547f3d82d56d9297651316c278d410987a1fd6", - "address": "0x614498118850184c62f82d08261109334bFB050f", + "blockNumber": 3638866, + "transactionHash": "0xbcf62d7f5849f5bc03a6fe8ba8de81929f3ef14ac6d00553bd968ddd89bf3a4c", + "address": "0x91a373BBdE0532F86410682F362e2Cf685e95085", "topics": [ "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" ], "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", "logIndex": 0, - "blockHash": "0x94238b9c3e2400e396e91cb51431c0762b70494568245c2e450c4d65aba2e180" + "blockHash": "0x461454ae071be436765d458195dcc2dbba01ca552218a997fcb0078378c32516" } ], - "blockNumber": 3084595, - "cumulativeGasUsed": "4776582", + "blockNumber": 3638866, + "cumulativeGasUsed": "57410230", "status": 1, "byzantium": true }, diff --git a/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore_Proxy.json b/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore_Proxy.json index d995b2434..fd3fae16d 100644 --- a/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore_Proxy.json +++ b/contracts/deployments/arbitrumSepoliaDevnet/KlerosCore_Proxy.json @@ -1,5 +1,5 @@ { - "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "address": "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8", "abi": [ { "inputs": [ @@ -26,36 +26,36 @@ "type": "receive" } ], - "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", + "transactionHash": "0x8375e2c27568a970ffbd7366397810482c8b64248add4a2c38b7c40cd63ee51d", "receipt": { "to": null, "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "contractAddress": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "contractAddress": "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8", "transactionIndex": 1, - "gasUsed": "555971", - "logsBloom": "0x00000000000000000000000020000000000000000000000000000100020000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000040000000000000000000000000000020000000000000010000800402000000000000008000000000000000000000000000000000800000000000000000000000080000000000000800000000000000000000008000000000000000080000000000000000000000000000000000000000000000000000000000000000000000004000000000000000060000004001001000000000000001000000000000000000000000000000020000000", - "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4", - "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", + "gasUsed": "5235914", + "logsBloom": "0x00000000000000000000000020000000000000000000000000000000020000000000000000000000004000000000000000000000000000000000000000040000000000000000000000000000000000000000000000040008000000000000000000000000020000000000000010000800402000000000000008000000080000000000000000000000000800000000000000000000000080000000000000000000000000000000004008000000000000000000000000000000000100000000000000000000000000000000000000000000000000000004000000000000000060000000001001000000000000000000000000000000000000000000000000000000", + "blockHash": "0x103e109081f82664640683b59588786a8fdd7cf0b85e0a64711bb0aa33a8f8fb", + "transactionHash": "0x8375e2c27568a970ffbd7366397810482c8b64248add4a2c38b7c40cd63ee51d", "logs": [ { "transactionIndex": 1, - "blockNumber": 3084598, - "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", - "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "blockNumber": 3638878, + "transactionHash": "0x8375e2c27568a970ffbd7366397810482c8b64248add4a2c38b7c40cd63ee51d", + "address": "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8", "topics": [ "0x44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb2", "0x0000000000000000000000000000000000000000000000000000000000000001", - "0x00000000000000000000000086ac67e5550f837a650b4b0cd4778d4293a2bde3" + "0x0000000000000000000000009426f127116c3652a262ae1ea48391ac8f44d35b" ], "data": "0x", "logIndex": 0, - "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4" + "blockHash": "0x103e109081f82664640683b59588786a8fdd7cf0b85e0a64711bb0aa33a8f8fb" }, { "transactionIndex": 1, - "blockNumber": 3084598, - "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", - "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "blockNumber": 3638878, + "transactionHash": "0x8375e2c27568a970ffbd7366397810482c8b64248add4a2c38b7c40cd63ee51d", + "address": "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8", "topics": [ "0x3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d", "0x0000000000000000000000000000000000000000000000000000000000000001", @@ -63,13 +63,13 @@ ], "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000", "logIndex": 1, - "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4" + "blockHash": "0x103e109081f82664640683b59588786a8fdd7cf0b85e0a64711bb0aa33a8f8fb" }, { "transactionIndex": 1, - "blockNumber": 3084598, - "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", - "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "blockNumber": 3638878, + "transactionHash": "0x8375e2c27568a970ffbd7366397810482c8b64248add4a2c38b7c40cd63ee51d", + "address": "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8", "topics": [ "0xb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc79", "0x0000000000000000000000000000000000000000000000000000000000000001", @@ -78,29 +78,29 @@ ], "data": "0x", "logIndex": 2, - "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4" + "blockHash": "0x103e109081f82664640683b59588786a8fdd7cf0b85e0a64711bb0aa33a8f8fb" }, { "transactionIndex": 1, - "blockNumber": 3084598, - "transactionHash": "0x9232b1ecf275f2ed567cd93c3bf29cfba24ddb9bfa8eb6ea1d6dc11a1a0e070b", - "address": "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "blockNumber": 3638878, + "transactionHash": "0x8375e2c27568a970ffbd7366397810482c8b64248add4a2c38b7c40cd63ee51d", + "address": "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8", "topics": [ "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", "logIndex": 3, - "blockHash": "0x8f94a1de66552f35e7ecda260b2b6e2409582f97360529d43a04e4e8318be2e4" + "blockHash": "0x103e109081f82664640683b59588786a8fdd7cf0b85e0a64711bb0aa33a8f8fb" } ], - "blockNumber": 3084598, - "cumulativeGasUsed": "555971", + "blockNumber": 3638878, + "cumulativeGasUsed": "5235914", "status": 1, "byzantium": true }, "args": [ - "0x614498118850184c62f82d08261109334bFB050f", - "0x994b27af000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c5900000000000000000000000034b944d42cacfc8266955d07a80181d2054aa225000000000000000000000000000000000000000000000000000000000000000000000000000000000000000086ac67e5550f837a650b4b0cd4778d4293a2bde3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000f327200420f21baafce8f1c03b1eedf926074b9500000000000000000000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000" + "0x91a373BBdE0532F86410682F362e2Cf685e95085", + "0x994b27af000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c5900000000000000000000000034b944d42cacfc8266955d07a80181d2054aa22500000000000000000000000000000000000000000000000000000000000000000000000000000000000000009426f127116c3652a262ae1ea48391ac8f44d35b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001e000000000000000000000000019cb28bab40c3585955798f5eeabd71eec14471c00000000000000000000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000" ], "numDeployments": 1, "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", diff --git a/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule.json b/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule.json index 23b22c36b..5d8667b3c 100644 --- a/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule.json +++ b/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule.json @@ -1,5 +1,5 @@ { - "address": "0xf327200420F21BAafce8F1C03B1EEdF926074B95", + "address": "0x19cb28BAB40C3585955798f5EEabd71Eec14471C", "abi": [ { "stateMutability": "payable", @@ -974,38 +974,38 @@ "type": "constructor" } ], - "transactionHash": "0x586f56da98113e584a9355075402333309687bf056333595d5407301acfa14c0", + "transactionHash": "0x6b82e5e6e508a7995dc9f85efaf52e02cece2d3a3d21d48f09551e33c1f8fd53", "receipt": { "to": null, "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "contractAddress": "0xf327200420F21BAafce8F1C03B1EEdF926074B95", - "transactionIndex": 1, - "gasUsed": "332147", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000100000000000400000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xd68a4f4bfb4408a7c73c9b14bea1403fa89ec354d86f7e85df074b9104d9b6f7", - "transactionHash": "0x586f56da98113e584a9355075402333309687bf056333595d5407301acfa14c0", + "contractAddress": "0x19cb28BAB40C3585955798f5EEabd71Eec14471C", + "transactionIndex": 2, + "gasUsed": "4675242", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000080000000800000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x857666f5788ef3b02fdc024472ba4f415ecc2b99bfb574382311c73be9c019ae", + "transactionHash": "0x6b82e5e6e508a7995dc9f85efaf52e02cece2d3a3d21d48f09551e33c1f8fd53", "logs": [ { - "transactionIndex": 1, - "blockNumber": 3084593, - "transactionHash": "0x586f56da98113e584a9355075402333309687bf056333595d5407301acfa14c0", - "address": "0xf327200420F21BAafce8F1C03B1EEdF926074B95", + "transactionIndex": 2, + "blockNumber": 3638850, + "transactionHash": "0x6b82e5e6e508a7995dc9f85efaf52e02cece2d3a3d21d48f09551e33c1f8fd53", + "address": "0x19cb28BAB40C3585955798f5EEabd71Eec14471C", "topics": [ "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", "logIndex": 0, - "blockHash": "0xd68a4f4bfb4408a7c73c9b14bea1403fa89ec354d86f7e85df074b9104d9b6f7" + "blockHash": "0x857666f5788ef3b02fdc024472ba4f415ecc2b99bfb574382311c73be9c019ae" } ], - "blockNumber": 3084593, - "cumulativeGasUsed": "332147", + "blockNumber": 3638850, + "cumulativeGasUsed": "5561170", "status": 1, "byzantium": true }, "args": [ - "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9", - "0x54812d17000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c590000000000000000000000004dd8b69958ef1d7d5da9347e9d9f57adfc3dc28400000000000000000000000000000000000000000000000000000000000000b40000000000000000000000000000000000000000000000000000000000000258000000000000000000000000a995c172d286f8f4ee137cc662e2844e59cf48360000000000000000000000000000000000000000000000000000000000000014" + "0xBC82B29e5aE8a749D82b7919118Ab7C0D41fA3D3", + "0x54812d17000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59000000000000000000000000a54e7a16d7460e38a8f324ef46782fb520d58ce800000000000000000000000000000000000000000000000000000000000000b40000000000000000000000000000000000000000000000000000000000000258000000000000000000000000a995c172d286f8f4ee137cc662e2844e59cf48360000000000000000000000000000000000000000000000000000000000000014" ], "numDeployments": 1, "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", @@ -1016,14 +1016,14 @@ "methodName": "initialize", "args": [ "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284", + "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8", 180, 600, "0xA995C172d286f8F4eE137CC662e2844E59Cf4836", 20 ] }, - "implementation": "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9", + "implementation": "0xBC82B29e5aE8a749D82b7919118Ab7C0D41fA3D3", "devdoc": { "author": "Simon Malatrait ", "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", diff --git a/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule_Implementation.json b/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule_Implementation.json index ab953de22..586e2d7f6 100644 --- a/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule_Implementation.json +++ b/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule_Implementation.json @@ -1,5 +1,5 @@ { - "address": "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9", + "address": "0xBC82B29e5aE8a749D82b7919118Ab7C0D41fA3D3", "abi": [ { "inputs": [], @@ -955,41 +955,41 @@ "type": "function" } ], - "transactionHash": "0x1aa215a0d368b34755088e1f44fe0ef55824f2ed0ee75344e9b164a1befedfb6", + "transactionHash": "0xc637eeeec2e54425a4176f8539b86a9198072dc66045184b8af03369d1d5f64f", "receipt": { "to": null, "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "contractAddress": "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9", + "contractAddress": "0xBC82B29e5aE8a749D82b7919118Ab7C0D41fA3D3", "transactionIndex": 1, - "gasUsed": "2648721", - "logsBloom": "0x00000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xe98200ae0d91356076f06e1c16aedfa7cecf01eadb579192dd18aa160dfd3627", - "transactionHash": "0x1aa215a0d368b34755088e1f44fe0ef55824f2ed0ee75344e9b164a1befedfb6", + "gasUsed": "33971097", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000800000000000000000000000080000000000080000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x0e760033b43be44fcfefd9289381a7163d0d7649235cbe8e57c4e4e1b00ce33c", + "transactionHash": "0xc637eeeec2e54425a4176f8539b86a9198072dc66045184b8af03369d1d5f64f", "logs": [ { "transactionIndex": 1, - "blockNumber": 3084588, - "transactionHash": "0x1aa215a0d368b34755088e1f44fe0ef55824f2ed0ee75344e9b164a1befedfb6", - "address": "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9", + "blockNumber": 3638844, + "transactionHash": "0xc637eeeec2e54425a4176f8539b86a9198072dc66045184b8af03369d1d5f64f", + "address": "0xBC82B29e5aE8a749D82b7919118Ab7C0D41fA3D3", "topics": [ "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" ], "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", "logIndex": 0, - "blockHash": "0xe98200ae0d91356076f06e1c16aedfa7cecf01eadb579192dd18aa160dfd3627" + "blockHash": "0x0e760033b43be44fcfefd9289381a7163d0d7649235cbe8e57c4e4e1b00ce33c" } ], - "blockNumber": 3084588, - "cumulativeGasUsed": "2648721", + "blockNumber": 3638844, + "cumulativeGasUsed": "33971097", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", - "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"enum ISortitionModule.Phase\",\"name\":\"_phase\",\"type\":\"uint8\"}],\"name\":\"NewPhase\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeDelayedAlreadyTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeDelayedAlreadyTransferredWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeDelayedNotTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_unlock\",\"type\":\"bool\"}],\"name\":\"StakeLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_K\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_STAKE_PATHS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxDrawingTime\",\"type\":\"uint256\"}],\"name\":\"changeMaxDrawingTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minStakingTime\",\"type\":\"uint256\"}],\"name\":\"changeMinStakingTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_rngLookahead\",\"type\":\"uint256\"}],\"name\":\"changeRandomNumberGenerator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"core\",\"outputs\":[{\"internalType\":\"contract KlerosCore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"createDisputeHook\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createTree\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"delayedStakeReadIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"delayedStakeWriteIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"delayedStakes\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"alreadyTransferred\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disputesWithoutJurors\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"drawnAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"executeDelayedStakes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"getJurorBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalStaked\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalLocked\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"stakedInCourt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbCourts\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"}],\"name\":\"getJurorCourtIDs\",\"outputs\":[{\"internalType\":\"uint96[]\",\"name\":\"\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract KlerosCore\",\"name\":\"_core\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_minStakingTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxDrawingTime\",\"type\":\"uint256\"},{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_rngLookahead\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"}],\"name\":\"isJurorStaked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"jurors\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"stakedPnk\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lockedPnk\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastPhaseChange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"name\":\"latestDelayedStakeIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"}],\"name\":\"lockStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxDrawingTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minStakingTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_randomNumber\",\"type\":\"uint256\"}],\"name\":\"notifyRandomNumber\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passPhase\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"}],\"name\":\"penalizeStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"phase\",\"outputs\":[{\"internalType\":\"enum ISortitionModule.Phase\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"postDrawHook\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomNumberRequestBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rng\",\"outputs\":[{\"internalType\":\"contract RNG\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rngLookahead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"setJurorInactive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_newStake\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"_alreadyTransferred\",\"type\":\"bool\"}],\"name\":\"setStake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"pnkDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pnkWithdrawal\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"succeeded\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_ID\",\"type\":\"bytes32\"}],\"name\":\"stakeOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"stakeOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"}],\"name\":\"unlockStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"A factory of trees that keeps track of staked values for sortition.\",\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"changeMaxDrawingTime(uint256)\":{\"details\":\"Changes the `maxDrawingTime` storage variable.\",\"params\":{\"_maxDrawingTime\":\"The new value for the `maxDrawingTime` storage variable.\"}},\"changeMinStakingTime(uint256)\":{\"details\":\"Changes the `minStakingTime` storage variable.\",\"params\":{\"_minStakingTime\":\"The new value for the `minStakingTime` storage variable.\"}},\"changeRandomNumberGenerator(address,uint256)\":{\"details\":\"Changes the `_rng` and `_rngLookahead` storage variables.\",\"params\":{\"_rng\":\"The new value for the `RNGenerator` storage variable.\",\"_rngLookahead\":\"The new value for the `rngLookahead` storage variable.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"createTree(bytes32,bytes)\":{\"details\":\"Create a sortition sum tree at the specified key.\",\"params\":{\"_extraData\":\"Extra data that contains the number of children each node in the tree should have.\",\"_key\":\"The key of the new tree.\"}},\"draw(bytes32,uint256,uint256)\":{\"details\":\"Draw an ID from a tree using a number. Note that this function reverts if the sum of all values in the tree is 0.\",\"params\":{\"_coreDisputeID\":\"Index of the dispute in Kleros Core.\",\"_key\":\"The key of the tree.\",\"_nonce\":\"Nonce to hash with random number.\"},\"returns\":{\"drawnAddress\":\"The drawn address. `O(k * log_k(n))` where `k` is the maximum number of children per node in the tree, and `n` is the maximum number of nodes ever appended.\"}},\"executeDelayedStakes(uint256)\":{\"details\":\"Executes the next delayed stakes.\",\"params\":{\"_iterations\":\"The number of delayed stakes to execute.\"}},\"getJurorCourtIDs(address)\":{\"details\":\"Gets the court identifiers where a specific `_juror` has staked.\",\"params\":{\"_juror\":\"The address of the juror.\"}},\"initialize(address,address,uint256,uint256,address,uint256)\":{\"details\":\"Initializer (constructor equivalent for upgradable contracts).\",\"params\":{\"_core\":\"The KlerosCore.\",\"_maxDrawingTime\":\"Time after which the drawing phase can be switched\",\"_minStakingTime\":\"Minimal time to stake\",\"_rng\":\"The random number generator.\",\"_rngLookahead\":\"Lookahead value for rng.\"}},\"notifyRandomNumber(uint256)\":{\"details\":\"Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().\",\"params\":{\"_randomNumber\":\"Random number returned by RNG contract.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"setJurorInactive(address)\":{\"details\":\"Unstakes the inactive juror from all courts. `O(n * (p * log_k(j)) )` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\",\"params\":{\"_account\":\"The juror to unstake.\"}},\"setStake(address,uint96,uint256,bool)\":{\"details\":\"Sets the specified juror's stake in a court. `O(n + p * log_k(j))` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\",\"params\":{\"_account\":\"The address of the juror.\",\"_alreadyTransferred\":\"True if the tokens were already transferred from juror. Only relevant for delayed stakes.\",\"_courtID\":\"The ID of the court.\",\"_newStake\":\"The new stake.\"},\"returns\":{\"pnkDeposit\":\"The amount of PNK to be deposited.\",\"pnkWithdrawal\":\"The amount of PNK to be withdrawn.\",\"succeeded\":\"True if the call succeeded, false otherwise.\"}},\"stakeOf(address,uint96)\":{\"details\":\"Get the stake of a juror in a court.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_juror\":\"The address of the juror.\"},\"returns\":{\"_0\":\"value The stake of the juror in the court.\"}},\"stakeOf(bytes32,bytes32)\":{\"details\":\"Get the stake of a juror in a court.\",\"params\":{\"_ID\":\"The stake path ID, corresponding to a juror.\",\"_key\":\"The key of the tree, corresponding to a court.\"},\"returns\":{\"_0\":\"The stake of the juror in the court.\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"SortitionModule\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/SortitionModule.sol\":\"SortitionModule\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/KlerosCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"./interfaces/IArbitratorV2.sol\\\";\\nimport {IDisputeKit} from \\\"./interfaces/IDisputeKit.sol\\\";\\nimport {ISortitionModule} from \\\"./interfaces/ISortitionModule.sol\\\";\\nimport {SafeERC20, IERC20} from \\\"../libraries/SafeERC20.sol\\\";\\nimport {Constants} from \\\"../libraries/Constants.sol\\\";\\nimport {OnError} from \\\"../libraries/Types.sol\\\";\\nimport {UUPSProxiable} from \\\"../proxy/UUPSProxiable.sol\\\";\\nimport {Initializable} from \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title KlerosCore\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\ncontract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum PNKs needed to stake in the court.\\n uint256 alpha; // Basis point of PNKs that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court. Note that each court must support classic dispute kit.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrableV2 arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 pnkAtStakePerJuror; // The amount of PNKs at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 pnkPenalties; // The amount of PNKs collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumFeeRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumPnkRewardPaid; // Total sum of PNK paid to coherent jurors as a reward in this round.\\n IERC20 feeToken; // The token used for paying fees in this round.\\n uint256 drawIterations; // The number of iterations passed drawing the jurors for this round.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 pnkPenaltiesInRound; // The amount of PNKs collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n struct CurrencyRate {\\n bool feePaymentAccepted;\\n uint64 rateInEth;\\n uint8 rateDecimals;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 private constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 private constant NON_PAYABLE_AMOUNT = (2 ** 256 - 2) / 2; // An amount higher than the supply of ETH.\\n\\n address public governor; // The governor of the contract.\\n IERC20 public pinakion; // The Pinakion token contract.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n Court[] public courts; // The courts.\\n IDisputeKit[] public disputeKits; // Array of dispute kits.\\n Dispute[] public disputes; // The disputes.\\n mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(\\n uint96 indexed _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod\\n );\\n event DisputeKitCreated(uint256 indexed _disputeKitID, IDisputeKit indexed _disputeKitAddress);\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _pnkAmount,\\n int256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _pnkAmount,\\n uint256 _feeAmount,\\n IERC20 _feeToken\\n );\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _governor The governor's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n function initialize(\\n address _governor,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) external reinitializer(1) {\\n governor = _governor;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a dispute kit is not supported.\\n disputeKits.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKits.push(_disputeKit);\\n\\n emit DisputeKitCreated(Constants.DISPUTE_KIT_CLASSIC, _disputeKit);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(Constants.FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = Constants.FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(Constants.GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(Constants.GENERAL_COURT, Constants.DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /* @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n if (!success) revert UnsuccessfulCall();\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress) external onlyByGovernor {\\n uint256 disputeKitID = disputeKits.length;\\n disputeKits.push(_disputeKitAddress);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress);\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt();\\n if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit();\\n if (_parent == Constants.FORKING_COURT) revert InvalidForkingCourtAsParent();\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n // Check that Classic DK support was added.\\n if (!court.supportedDisputeKits[Constants.DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic();\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n function changeCourtParameters(\\n uint96 _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod\\n ) external onlyByGovernor {\\n Court storage court = courts[_courtID];\\n if (_courtID != Constants.GENERAL_COURT && courts[court.parent].minStake > _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n for (uint256 i = 0; i < court.children.length; i++) {\\n if (courts[court.children[i]].minStake < _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n }\\n court.minStake = _minStake;\\n court.hiddenVotes = _hiddenVotes;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(\\n _courtID,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod\\n );\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n // Classic dispute kit must be supported by all courts.\\n if (_disputeKitIDs[i] == Constants.DISPUTE_KIT_CLASSIC) {\\n revert CannotDisableClassicDK();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n /// @dev Changes the supported fee tokens.\\n /// @param _feeToken The fee token.\\n /// @param _accepted Whether the token is supported or not as a method of fee payment.\\n function changeAcceptedFeeTokens(IERC20 _feeToken, bool _accepted) external onlyByGovernor {\\n currencyRates[_feeToken].feePaymentAccepted = _accepted;\\n emit AcceptedFeeToken(_feeToken, _accepted);\\n }\\n\\n /// @dev Changes the currency rate of a fee token.\\n /// @param _feeToken The fee token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n function changeCurrencyRates(IERC20 _feeToken, uint64 _rateInEth, uint8 _rateDecimals) external onlyByGovernor {\\n currencyRates[_feeToken].rateInEth = _rateInEth;\\n currencyRates[_feeToken].rateDecimals = _rateDecimals;\\n emit NewCurrencyRate(_feeToken, _rateInEth, _rateDecimals);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// Note that the existing delayed stake will be nullified as non-relevant.\\n function setStake(uint96 _courtID, uint256 _newStake) external {\\n _setStake(msg.sender, _courtID, _newStake, false, OnError.Revert);\\n }\\n\\n /// @dev Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.\\n /// @param _account The account whose stake is being set.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs have already been transferred to the contract.\\n function setStakeBySortitionModule(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external {\\n if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly();\\n _setStake(_account, _courtID, _newStake, _alreadyTransferred, OnError.Return);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough();\\n\\n return _createDispute(_numberOfChoices, _extraData, Constants.NATIVE_CURRENCY, msg.value);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external override returns (uint256 disputeID) {\\n if (!currencyRates[_feeToken].feePaymentAccepted) revert TokenNotAccepted();\\n if (_feeAmount < arbitrationCost(_extraData, _feeToken)) revert ArbitrationFeesNotEnough();\\n\\n if (!_feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount)) revert TransferFailed();\\n return _createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount);\\n }\\n\\n function _createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) internal returns (uint256 disputeID) {\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n if (!courts[courtID].supportedDisputeKits[disputeKitID]) revert DisputeKitNotSupportedByCourt();\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrableV2(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKits[disputeKitID];\\n Court storage court = courts[dispute.courtID];\\n Round storage round = dispute.rounds.push();\\n\\n // Obtain the feeForJuror in the same currency as the _feeAmount\\n uint256 feeForJuror = (_feeToken == Constants.NATIVE_CURRENCY)\\n ? court.feeForJuror\\n : convertEthToTokenAmount(_feeToken, court.feeForJuror);\\n round.nbVotes = _feeAmount / feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = _feeAmount;\\n round.feeToken = IERC20(_feeToken);\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrableV2(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n if (\\n currentRound == 0 &&\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]\\n ) {\\n revert EvidenceNotPassedAndNotAppeal();\\n }\\n if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing();\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areCommitsAllCast(_disputeID)\\n ) {\\n revert CommitPeriodNotPassed();\\n }\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areVotesAllCast(_disputeID)\\n ) {\\n revert VotePeriodNotPassed();\\n }\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) {\\n revert AppealPeriodNotPassed();\\n }\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert DisputePeriodIsFinal();\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period != Period.evidence) revert NotEvidencePeriod();\\n\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 startIndex = round.drawIterations; // for gas: less storage reads\\n uint256 i;\\n while (i < _iterations && round.drawnJurors.length < round.nbVotes) {\\n address drawnAddress = disputeKit.draw(_disputeID, startIndex + i++);\\n if (drawnAddress == address(0)) {\\n continue;\\n }\\n sortitionModule.lockStake(drawnAddress, round.pnkAtStakePerJuror);\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n round.drawIterations += i;\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n if (msg.value < appealCost(_disputeID)) revert AppealFeesNotEnough();\\n\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.appeal) revert DisputeNotAppealable();\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n if (msg.sender != address(disputeKits[round.disputeKitID])) revert DisputeKitOnly();\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n // Switch to classic dispute kit if parent court doesn't support the current one.\\n newDisputeKitID = Constants.DISPUTE_KIT_CLASSIC;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKits[extraRound.disputeKitID].createDispute(\\n _disputeID,\\n _numberOfChoices,\\n _extraData,\\n extraRound.nbVotes\\n );\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n\\n Round storage round = dispute.rounds[_round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 pnkPenaltiesInRoundCache = round.pnkPenalties; // For saving gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect the PNK penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n pnkPenaltiesInRoundCache = _executePenalties(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n }\\n }\\n if (round.pnkPenalties != pnkPenaltiesInRoundCache) {\\n round.pnkPenalties = pnkPenaltiesInRoundCache; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return pnkPenaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.pnkAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.pnkPenaltiesInRound += penalty;\\n\\n // Unlock the PNKs affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n sortitionModule.unlockStake(account, penalty);\\n\\n // Apply the penalty to the staked PNKs.\\n sortitionModule.penalizeStake(account, penalty);\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n -int256(penalty),\\n 0,\\n round.feeToken\\n );\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(round.totalFeesForJurors);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, round.totalFeesForJurors);\\n }\\n pinakion.safeTransfer(governor, _params.pnkPenaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.pnkPenaltiesInRound,\\n round.totalFeesForJurors,\\n round.feeToken\\n );\\n }\\n return _params.pnkPenaltiesInRound;\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the PNKs of the juror for this round.\\n sortitionModule.unlockStake(account, pnkLocked);\\n\\n // Give back the locked PNKs in case the juror fully unstaked earlier.\\n if (!sortitionModule.isJurorStaked(account)) {\\n pinakion.safeTransfer(account, pnkLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumPnkRewardPaid += pnkReward;\\n uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumFeeRewardPaid += feeReward;\\n pinakion.safeTransfer(account, pnkReward);\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(account).send(feeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(account, feeReward);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(pnkReward),\\n int256(feeReward),\\n round.feeToken\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverPnkReward = _params.pnkPenaltiesInRound - round.sumPnkRewardPaid;\\n uint256 leftoverFeeReward = round.totalFeesForJurors - round.sumFeeRewardPaid;\\n if (leftoverPnkReward != 0 || leftoverFeeReward != 0) {\\n if (leftoverPnkReward != 0) {\\n pinakion.safeTransfer(governor, leftoverPnkReward);\\n }\\n if (leftoverFeeReward != 0) {\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(leftoverFeeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, leftoverFeeReward);\\n }\\n }\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n leftoverPnkReward,\\n leftoverFeeReward,\\n round.feeToken\\n );\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n if (dispute.ruled) revert RulingAlreadyExecuted();\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Compute the cost of arbitration denominated in ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) public view override returns (uint256 cost) {\\n cost = convertEthToTokenAmount(_feeToken, arbitrationCost(_extraData));\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == Constants.GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(uint256 _disputeID, uint256 _round) external view returns (Round memory) {\\n return disputes[_disputeID].rounds[_round];\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n timesPerPeriod = courts[_courtID].timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitsLength() external view returns (uint256) {\\n return disputeKits.length;\\n }\\n\\n function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) {\\n return (_amountInEth * 10 ** currencyRates[_toToken].rateDecimals) / currencyRates[_toToken].rateInEth;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support. Note that classic dispute kit should always be enabled.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev If called only once then set _onError to Revert, otherwise set it to Return\\n /// @param _account The account to set the stake for.\\n /// @param _courtID The ID of the court to set the stake for.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs were already transferred to/from the staking contract.\\n /// @param _onError Whether to revert or return false on error.\\n /// @return Whether the stake was successfully set or not.\\n function _setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred,\\n OnError _onError\\n ) internal returns (bool) {\\n if (_courtID == Constants.FORKING_COURT || _courtID > courts.length) {\\n _stakingFailed(_onError); // Staking directly into the forking court is not allowed.\\n return false;\\n }\\n if (_newStake != 0 && _newStake < courts[_courtID].minStake) {\\n _stakingFailed(_onError); // Staking less than the minimum stake is not allowed.\\n return false;\\n }\\n (uint256 pnkDeposit, uint256 pnkWithdrawal, bool sortitionSuccess) = sortitionModule.setStake(\\n _account,\\n _courtID,\\n _newStake,\\n _alreadyTransferred\\n );\\n if (!sortitionSuccess) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n if (pnkDeposit > 0) {\\n if (!pinakion.safeTransferFrom(_account, address(this), pnkDeposit)) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n }\\n if (pnkWithdrawal > 0) {\\n if (!pinakion.safeTransfer(_account, pnkWithdrawal)) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @dev It may revert depending on the _onError parameter.\\n function _stakingFailed(OnError _onError) internal pure {\\n if (_onError == OnError.Return) return;\\n revert StakingFailed();\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == Constants.FORKING_COURT || courtID >= courts.length) {\\n courtID = Constants.GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = Constants.DEFAULT_NB_OF_JURORS;\\n }\\n if (disputeKitID == Constants.NULL_DISPUTE_KIT || disputeKitID >= disputeKits.length) {\\n disputeKitID = Constants.DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = Constants.GENERAL_COURT;\\n minJurors = Constants.DEFAULT_NB_OF_JURORS;\\n disputeKitID = Constants.DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error DisputeKitOnly();\\n error SortitionModuleOnly();\\n error UnsuccessfulCall();\\n error InvalidDisputKitParent();\\n error DepthLevelMax();\\n error MinStakeLowerThanParentCourt();\\n error UnsupportedDisputeKit();\\n error InvalidForkingCourtAsParent();\\n error WrongDisputeKitIndex();\\n error CannotDisableClassicDK();\\n error ArraysLengthMismatch();\\n error StakingFailed();\\n error ArbitrationFeesNotEnough();\\n error DisputeKitNotSupportedByCourt();\\n error MustSupportDisputeKitClassic();\\n error TokenNotAccepted();\\n error EvidenceNotPassedAndNotAppeal();\\n error DisputeStillDrawing();\\n error CommitPeriodNotPassed();\\n error VotePeriodNotPassed();\\n error AppealPeriodNotPassed();\\n error NotEvidencePeriod();\\n error AppealFeesNotEnough();\\n error DisputeNotAppealable();\\n error NotExecutionPeriod();\\n error RulingAlreadyExecuted();\\n error DisputePeriodIsFinal();\\n error TransferFailed();\\n}\\n\",\"keccak256\":\"0x43205bc90f6965b5c1380effd2c29994f6dfea074696e39d5df037343a768d6b\",\"license\":\"MIT\"},\"src/arbitration/SortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @custom:authors: [@epiqueras, @unknownunknown1, @shotaronowhere]\\n * @custom:reviewers: []\\n * @custom:auditors: []\\n * @custom:bounties: []\\n * @custom:deployments: []\\n */\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./KlerosCore.sol\\\";\\nimport \\\"./interfaces/ISortitionModule.sol\\\";\\nimport \\\"./interfaces/IDisputeKit.sol\\\";\\nimport \\\"../rng/RNG.sol\\\";\\nimport \\\"../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../proxy/Initializable.sol\\\";\\nimport \\\"../libraries/Constants.sol\\\";\\n\\n/// @title SortitionModule\\n/// @dev A factory of trees that keeps track of staked values for sortition.\\ncontract SortitionModule is ISortitionModule, UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum PreStakeHookResult {\\n ok, // Correct phase. All checks are passed.\\n stakeDelayedAlreadyTransferred, // Wrong phase but stake is increased, so transfer the tokens without updating the drawing chance.\\n stakeDelayedNotTransferred, // Wrong phase and stake is decreased. Delay the token transfer and drawing chance update.\\n failed // Checks didn't pass. Do no changes.\\n }\\n\\n struct SortitionSumTree {\\n uint256 K; // The maximum number of children per node.\\n // We use this to keep track of vacant positions in the tree after removing a leaf. This is for keeping the tree as balanced as possible without spending gas on moving nodes around.\\n uint256[] stack;\\n uint256[] nodes;\\n // Two-way mapping of IDs to node indexes. Note that node index 0 is reserved for the root node, and means the ID does not have a node.\\n mapping(bytes32 => uint256) IDsToNodeIndexes;\\n mapping(uint256 => bytes32) nodeIndexesToIDs;\\n }\\n\\n struct DelayedStake {\\n address account; // The address of the juror.\\n uint96 courtID; // The ID of the court.\\n uint256 stake; // The new stake.\\n bool alreadyTransferred; // True if tokens were already transferred before delayed stake's execution.\\n }\\n\\n struct Juror {\\n uint96[] courtIDs; // The IDs of courts where the juror's stake path ends. A stake path is a path from the general court to a court the juror directly staked in using `_setStake`.\\n uint256 stakedPnk; // The juror's total amount of tokens staked in subcourts. Reflects actual pnk balance.\\n uint256 lockedPnk; // The juror's total amount of tokens locked in disputes. Can reflect actual pnk balance when stakedPnk are fully withdrawn.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant MAX_STAKE_PATHS = 4; // The maximum number of stake paths a juror can have.\\n uint256 public constant DEFAULT_K = 6; // Default number of children per node.\\n\\n address public governor; // The governor of the contract.\\n KlerosCore public core; // The core arbitrator contract.\\n Phase public phase; // The current phase.\\n uint256 public minStakingTime; // The time after which the phase can be switched to Drawing if there are open disputes.\\n uint256 public maxDrawingTime; // The time after which the phase can be switched back to Staking.\\n uint256 public lastPhaseChange; // The last time the phase was changed.\\n uint256 public randomNumberRequestBlock; // Number of the block when RNG request was made.\\n uint256 public disputesWithoutJurors; // The number of disputes that have not finished drawing jurors.\\n RNG public rng; // The random number generator.\\n uint256 public randomNumber; // Random number returned by RNG.\\n uint256 public rngLookahead; // Minimal block distance between requesting and obtaining a random number.\\n uint256 public delayedStakeWriteIndex; // The index of the last `delayedStake` item that was written to the array. 0 index is skipped.\\n uint256 public delayedStakeReadIndex; // The index of the next `delayedStake` item that should be processed. Starts at 1 because 0 index is skipped.\\n mapping(bytes32 => SortitionSumTree) sortitionSumTrees; // The mapping trees by keys.\\n mapping(address => Juror) public jurors; // The jurors.\\n mapping(uint256 => DelayedStake) public delayedStakes; // Stores the stakes that were changed during Drawing phase, to update them when the phase is switched to Staking.\\n mapping(address => mapping(uint96 => uint256)) public latestDelayedStakeIndex; // Maps the juror to its latest delayed stake. If there is already a delayed stake for this juror then it'll be replaced. latestDelayedStakeIndex[juror][courtID].\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event StakeSet(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayedNotTransferred(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayedAlreadyTransferred(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayedAlreadyTransferredWithdrawn(address indexed _address, uint96 indexed _courtID, uint256 _amount);\\n event StakeLocked(address indexed _address, uint256 _relativeAmount, bool _unlock);\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(address(governor) == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n modifier onlyByCore() {\\n require(address(core) == msg.sender, \\\"Access not allowed: KlerosCore only.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _core The KlerosCore.\\n /// @param _minStakingTime Minimal time to stake\\n /// @param _maxDrawingTime Time after which the drawing phase can be switched\\n /// @param _rng The random number generator.\\n /// @param _rngLookahead Lookahead value for rng.\\n function initialize(\\n address _governor,\\n KlerosCore _core,\\n uint256 _minStakingTime,\\n uint256 _maxDrawingTime,\\n RNG _rng,\\n uint256 _rngLookahead\\n ) external reinitializer(1) {\\n governor = _governor;\\n core = _core;\\n minStakingTime = _minStakingTime;\\n maxDrawingTime = _maxDrawingTime;\\n lastPhaseChange = block.timestamp;\\n rng = _rng;\\n rngLookahead = _rngLookahead;\\n delayedStakeReadIndex = 1;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Changes the `minStakingTime` storage variable.\\n /// @param _minStakingTime The new value for the `minStakingTime` storage variable.\\n function changeMinStakingTime(uint256 _minStakingTime) external onlyByGovernor {\\n minStakingTime = _minStakingTime;\\n }\\n\\n /// @dev Changes the `maxDrawingTime` storage variable.\\n /// @param _maxDrawingTime The new value for the `maxDrawingTime` storage variable.\\n function changeMaxDrawingTime(uint256 _maxDrawingTime) external onlyByGovernor {\\n maxDrawingTime = _maxDrawingTime;\\n }\\n\\n /// @dev Changes the `_rng` and `_rngLookahead` storage variables.\\n /// @param _rng The new value for the `RNGenerator` storage variable.\\n /// @param _rngLookahead The new value for the `rngLookahead` storage variable.\\n function changeRandomNumberGenerator(RNG _rng, uint256 _rngLookahead) external onlyByGovernor {\\n rng = _rng;\\n rngLookahead = _rngLookahead;\\n if (phase == Phase.generating) {\\n rng.requestRandomness(block.number + rngLookahead);\\n randomNumberRequestBlock = block.number;\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function passPhase() external {\\n if (phase == Phase.staking) {\\n require(\\n block.timestamp - lastPhaseChange >= minStakingTime,\\n \\\"The minimum staking time has not passed yet.\\\"\\n );\\n require(disputesWithoutJurors > 0, \\\"There are no disputes that need jurors.\\\");\\n rng.requestRandomness(block.number + rngLookahead);\\n randomNumberRequestBlock = block.number;\\n phase = Phase.generating;\\n } else if (phase == Phase.generating) {\\n randomNumber = rng.receiveRandomness(randomNumberRequestBlock + rngLookahead);\\n require(randomNumber != 0, \\\"Random number is not ready yet\\\");\\n phase = Phase.drawing;\\n } else if (phase == Phase.drawing) {\\n require(\\n disputesWithoutJurors == 0 || block.timestamp - lastPhaseChange >= maxDrawingTime,\\n \\\"There are still disputes without jurors and the maximum drawing time has not passed yet.\\\"\\n );\\n phase = Phase.staking;\\n }\\n\\n lastPhaseChange = block.timestamp;\\n emit NewPhase(phase);\\n }\\n\\n /// @dev Create a sortition sum tree at the specified key.\\n /// @param _key The key of the new tree.\\n /// @param _extraData Extra data that contains the number of children each node in the tree should have.\\n function createTree(bytes32 _key, bytes memory _extraData) external override onlyByCore {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint256 K = _extraDataToTreeK(_extraData);\\n require(tree.K == 0, \\\"Tree already exists.\\\");\\n require(K > 1, \\\"K must be greater than one.\\\");\\n tree.K = K;\\n tree.nodes.push(0);\\n }\\n\\n /// @dev Executes the next delayed stakes.\\n /// @param _iterations The number of delayed stakes to execute.\\n function executeDelayedStakes(uint256 _iterations) external {\\n require(phase == Phase.staking, \\\"Should be in Staking phase.\\\");\\n\\n uint256 actualIterations = (delayedStakeReadIndex + _iterations) - 1 > delayedStakeWriteIndex\\n ? (delayedStakeWriteIndex - delayedStakeReadIndex) + 1\\n : _iterations;\\n uint256 newDelayedStakeReadIndex = delayedStakeReadIndex + actualIterations;\\n\\n for (uint256 i = delayedStakeReadIndex; i < newDelayedStakeReadIndex; i++) {\\n DelayedStake storage delayedStake = delayedStakes[i];\\n // Delayed stake could've been manually removed already. In this case simply move on to the next item.\\n if (delayedStake.account != address(0)) {\\n core.setStakeBySortitionModule(\\n delayedStake.account,\\n delayedStake.courtID,\\n delayedStake.stake,\\n delayedStake.alreadyTransferred\\n );\\n delete latestDelayedStakeIndex[delayedStake.account][delayedStake.courtID];\\n delete delayedStakes[i];\\n }\\n }\\n delayedStakeReadIndex = newDelayedStakeReadIndex;\\n }\\n\\n function createDisputeHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore {\\n disputesWithoutJurors++;\\n }\\n\\n function postDrawHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore {\\n disputesWithoutJurors--;\\n }\\n\\n /// @dev Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().\\n /// @param _randomNumber Random number returned by RNG contract.\\n function notifyRandomNumber(uint256 _randomNumber) public override {}\\n\\n /// @dev Sets the specified juror's stake in a court.\\n /// `O(n + p * log_k(j))` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The address of the juror.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred True if the tokens were already transferred from juror. Only relevant for delayed stakes.\\n /// @return pnkDeposit The amount of PNK to be deposited.\\n /// @return pnkWithdrawal The amount of PNK to be withdrawn.\\n /// @return succeeded True if the call succeeded, false otherwise.\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external override onlyByCore returns (uint256 pnkDeposit, uint256 pnkWithdrawal, bool succeeded) {\\n Juror storage juror = jurors[_account];\\n uint256 currentStake = stakeOf(_account, _courtID);\\n\\n uint256 nbCourts = juror.courtIDs.length;\\n if (_newStake == 0 && (nbCourts >= MAX_STAKE_PATHS || currentStake == 0)) {\\n return (0, 0, false); // Prevent staking beyond MAX_STAKE_PATHS but unstaking is always allowed.\\n }\\n\\n pnkWithdrawal = _deleteDelayedStake(_courtID, _account);\\n\\n if (phase != Phase.staking) {\\n // Store the stake change as delayed, to be applied when the phase switches back to Staking.\\n DelayedStake storage delayedStake = delayedStakes[++delayedStakeWriteIndex];\\n delayedStake.account = _account;\\n delayedStake.courtID = _courtID;\\n delayedStake.stake = _newStake;\\n latestDelayedStakeIndex[_account][_courtID] = delayedStakeWriteIndex;\\n if (_newStake > currentStake) {\\n // PNK deposit: tokens are transferred now.\\n delayedStake.alreadyTransferred = true;\\n pnkDeposit = _increaseStake(juror, _courtID, _newStake, currentStake);\\n emit StakeDelayedAlreadyTransferred(_account, _courtID, _newStake);\\n } else {\\n // PNK withdrawal: tokens are not transferred yet.\\n emit StakeDelayedNotTransferred(_account, _courtID, _newStake);\\n }\\n return (pnkDeposit, pnkWithdrawal, true);\\n }\\n\\n // Staking phase: set normal stakes or delayed stakes (which may have been already transferred).\\n if (_newStake >= currentStake) {\\n if (!_alreadyTransferred) {\\n pnkDeposit = _increaseStake(juror, _courtID, _newStake, currentStake);\\n }\\n } else {\\n pnkWithdrawal += _decreaseStake(juror, _courtID, _newStake, currentStake);\\n }\\n\\n bytes32 stakePathID = _accountAndCourtIDToStakePathID(_account, _courtID);\\n bool finished = false;\\n uint96 currenCourtID = _courtID;\\n while (!finished) {\\n // Tokens are also implicitly staked in parent courts through sortition module to increase the chance of being drawn.\\n _set(bytes32(uint256(currenCourtID)), _newStake, stakePathID);\\n if (currenCourtID == Constants.GENERAL_COURT) {\\n finished = true;\\n } else {\\n (currenCourtID, , , , , , ) = core.courts(currenCourtID);\\n }\\n }\\n emit StakeSet(_account, _courtID, _newStake);\\n return (pnkDeposit, pnkWithdrawal, true);\\n }\\n\\n /// @dev Checks if there is already a delayed stake. In this case consider it irrelevant and remove it.\\n /// @param _courtID ID of the court.\\n /// @param _juror Juror whose stake to check.\\n function _deleteDelayedStake(uint96 _courtID, address _juror) internal returns (uint256 actualAmountToWithdraw) {\\n uint256 latestIndex = latestDelayedStakeIndex[_juror][_courtID];\\n if (latestIndex != 0) {\\n DelayedStake storage delayedStake = delayedStakes[latestIndex];\\n if (delayedStake.alreadyTransferred) {\\n // Sortition stake represents the stake value that was last updated during Staking phase.\\n uint256 sortitionStake = stakeOf(_juror, _courtID);\\n\\n // Withdraw the tokens that were added with the latest delayed stake.\\n uint256 amountToWithdraw = delayedStake.stake - sortitionStake;\\n actualAmountToWithdraw = amountToWithdraw;\\n Juror storage juror = jurors[_juror];\\n if (juror.stakedPnk <= actualAmountToWithdraw) {\\n actualAmountToWithdraw = juror.stakedPnk;\\n }\\n\\n // StakePnk can become lower because of penalty.\\n juror.stakedPnk -= actualAmountToWithdraw;\\n emit StakeDelayedAlreadyTransferredWithdrawn(_juror, _courtID, amountToWithdraw);\\n\\n if (sortitionStake == 0) {\\n // Delete the court otherwise it will be duplicated after staking.\\n for (uint256 i = juror.courtIDs.length; i > 0; i--) {\\n if (juror.courtIDs[i - 1] == _courtID) {\\n juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1];\\n juror.courtIDs.pop();\\n break;\\n }\\n }\\n }\\n }\\n delete delayedStakes[latestIndex];\\n delete latestDelayedStakeIndex[_juror][_courtID];\\n }\\n }\\n\\n function _increaseStake(\\n Juror storage juror,\\n uint96 _courtID,\\n uint256 _newStake,\\n uint256 _currentStake\\n ) internal returns (uint256 transferredAmount) {\\n // Stake increase\\n // When stakedPnk becomes lower than lockedPnk count the locked tokens in when transferring tokens from juror.\\n // (E.g. stakedPnk = 0, lockedPnk = 150) which can happen if the juror unstaked fully while having some tokens locked.\\n uint256 previouslyLocked = (juror.lockedPnk >= juror.stakedPnk) ? juror.lockedPnk - juror.stakedPnk : 0; // underflow guard\\n transferredAmount = (_newStake >= _currentStake + previouslyLocked) // underflow guard\\n ? _newStake - _currentStake - previouslyLocked\\n : 0;\\n if (_currentStake == 0) {\\n juror.courtIDs.push(_courtID);\\n }\\n // stakedPnk can become async with _currentStake (e.g. after penalty).\\n juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake;\\n }\\n\\n function _decreaseStake(\\n Juror storage juror,\\n uint96 _courtID,\\n uint256 _newStake,\\n uint256 _currentStake\\n ) internal returns (uint256 transferredAmount) {\\n // Stakes can be partially delayed only when stake is increased.\\n // Stake decrease: make sure locked tokens always stay in the contract. They can only be released during Execution.\\n if (juror.stakedPnk >= _currentStake - _newStake + juror.lockedPnk) {\\n // We have enough pnk staked to afford withdrawal while keeping locked tokens.\\n transferredAmount = _currentStake - _newStake;\\n } else if (juror.stakedPnk >= juror.lockedPnk) {\\n // Can't afford withdrawing the current stake fully. Take whatever is available while keeping locked tokens.\\n transferredAmount = juror.stakedPnk - juror.lockedPnk;\\n }\\n if (_newStake == 0) {\\n for (uint256 i = juror.courtIDs.length; i > 0; i--) {\\n if (juror.courtIDs[i - 1] == _courtID) {\\n juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1];\\n juror.courtIDs.pop();\\n break;\\n }\\n }\\n }\\n // stakedPnk can become async with _currentStake (e.g. after penalty).\\n juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake;\\n }\\n\\n function lockStake(address _account, uint256 _relativeAmount) external override onlyByCore {\\n jurors[_account].lockedPnk += _relativeAmount;\\n emit StakeLocked(_account, _relativeAmount, false);\\n }\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external override onlyByCore {\\n jurors[_account].lockedPnk -= _relativeAmount;\\n emit StakeLocked(_account, _relativeAmount, true);\\n }\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external override onlyByCore {\\n Juror storage juror = jurors[_account];\\n if (juror.stakedPnk >= _relativeAmount) {\\n juror.stakedPnk -= _relativeAmount;\\n } else {\\n juror.stakedPnk = 0; // stakedPnk might become lower after manual unstaking, but lockedPnk will always cover the difference.\\n }\\n }\\n\\n /// @dev Unstakes the inactive juror from all courts.\\n /// `O(n * (p * log_k(j)) )` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The juror to unstake.\\n function setJurorInactive(address _account) external override onlyByCore {\\n uint96[] memory courtIDs = getJurorCourtIDs(_account);\\n for (uint256 j = courtIDs.length; j > 0; j--) {\\n core.setStakeBySortitionModule(_account, courtIDs[j - 1], 0, false);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Draw an ID from a tree using a number.\\n /// Note that this function reverts if the sum of all values in the tree is 0.\\n /// @param _key The key of the tree.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core.\\n /// @param _nonce Nonce to hash with random number.\\n /// @return drawnAddress The drawn address.\\n /// `O(k * log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function draw(\\n bytes32 _key,\\n uint256 _coreDisputeID,\\n uint256 _nonce\\n ) public view override returns (address drawnAddress) {\\n require(phase == Phase.drawing, \\\"Wrong phase.\\\");\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n\\n if (tree.nodes[0] == 0) {\\n return address(0); // No jurors staked.\\n }\\n\\n uint256 currentDrawnNumber = uint256(keccak256(abi.encodePacked(randomNumber, _coreDisputeID, _nonce))) %\\n tree.nodes[0];\\n\\n // While it still has children\\n uint256 treeIndex = 0;\\n while ((tree.K * treeIndex) + 1 < tree.nodes.length) {\\n for (uint256 i = 1; i <= tree.K; i++) {\\n // Loop over children.\\n uint256 nodeIndex = (tree.K * treeIndex) + i;\\n uint256 nodeValue = tree.nodes[nodeIndex];\\n\\n if (currentDrawnNumber >= nodeValue) {\\n // Go to the next child.\\n currentDrawnNumber -= nodeValue;\\n } else {\\n // Pick this child.\\n treeIndex = nodeIndex;\\n break;\\n }\\n }\\n }\\n drawnAddress = _stakePathIDToAccount(tree.nodeIndexesToIDs[treeIndex]);\\n }\\n\\n /// @dev Get the stake of a juror in a court.\\n /// @param _juror The address of the juror.\\n /// @param _courtID The ID of the court.\\n /// @return value The stake of the juror in the court.\\n function stakeOf(address _juror, uint96 _courtID) public view returns (uint256) {\\n bytes32 stakePathID = _accountAndCourtIDToStakePathID(_juror, _courtID);\\n return stakeOf(bytes32(uint256(_courtID)), stakePathID);\\n }\\n\\n /// @dev Get the stake of a juror in a court.\\n /// @param _key The key of the tree, corresponding to a court.\\n /// @param _ID The stake path ID, corresponding to a juror.\\n /// @return The stake of the juror in the court.\\n function stakeOf(bytes32 _key, bytes32 _ID) public view returns (uint256) {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint treeIndex = tree.IDsToNodeIndexes[_ID];\\n if (treeIndex == 0) {\\n return 0;\\n }\\n return tree.nodes[treeIndex];\\n }\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n )\\n external\\n view\\n override\\n returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts)\\n {\\n Juror storage juror = jurors[_juror];\\n totalStaked = juror.stakedPnk;\\n totalLocked = juror.lockedPnk;\\n stakedInCourt = stakeOf(_juror, _courtID);\\n nbCourts = juror.courtIDs.length;\\n }\\n\\n /// @dev Gets the court identifiers where a specific `_juror` has staked.\\n /// @param _juror The address of the juror.\\n function getJurorCourtIDs(address _juror) public view override returns (uint96[] memory) {\\n return jurors[_juror].courtIDs;\\n }\\n\\n function isJurorStaked(address _juror) external view override returns (bool) {\\n return jurors[_juror].stakedPnk > 0;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Update all the parents of a node.\\n /// @param _key The key of the tree to update.\\n /// @param _treeIndex The index of the node to start from.\\n /// @param _plusOrMinus Whether to add (true) or substract (false).\\n /// @param _value The value to add or substract.\\n /// `O(log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function _updateParents(bytes32 _key, uint256 _treeIndex, bool _plusOrMinus, uint256 _value) private {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n\\n uint256 parentIndex = _treeIndex;\\n while (parentIndex != 0) {\\n parentIndex = (parentIndex - 1) / tree.K;\\n tree.nodes[parentIndex] = _plusOrMinus\\n ? tree.nodes[parentIndex] + _value\\n : tree.nodes[parentIndex] - _value;\\n }\\n }\\n\\n /// @dev Retrieves a juror's address from the stake path ID.\\n /// @param _stakePathID The stake path ID to unpack.\\n /// @return account The account.\\n function _stakePathIDToAccount(bytes32 _stakePathID) internal pure returns (address account) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n let ptr := mload(0x40)\\n for {\\n let i := 0x00\\n } lt(i, 0x14) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(add(ptr, 0x0c), i), byte(i, _stakePathID))\\n }\\n account := mload(ptr)\\n }\\n }\\n\\n function _extraDataToTreeK(bytes memory _extraData) internal pure returns (uint256 K) {\\n if (_extraData.length >= 32) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n K := mload(add(_extraData, 0x20))\\n }\\n } else {\\n K = DEFAULT_K;\\n }\\n }\\n\\n /// @dev Set a value in a tree.\\n /// @param _key The key of the tree.\\n /// @param _value The new value.\\n /// @param _ID The ID of the value.\\n /// `O(log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function _set(bytes32 _key, uint256 _value, bytes32 _ID) internal {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint256 treeIndex = tree.IDsToNodeIndexes[_ID];\\n\\n if (treeIndex == 0) {\\n // No existing node.\\n if (_value != 0) {\\n // Non zero value.\\n // Append.\\n // Add node.\\n if (tree.stack.length == 0) {\\n // No vacant spots.\\n // Get the index and append the value.\\n treeIndex = tree.nodes.length;\\n tree.nodes.push(_value);\\n\\n // Potentially append a new node and make the parent a sum node.\\n if (treeIndex != 1 && (treeIndex - 1) % tree.K == 0) {\\n // Is first child.\\n uint256 parentIndex = treeIndex / tree.K;\\n bytes32 parentID = tree.nodeIndexesToIDs[parentIndex];\\n uint256 newIndex = treeIndex + 1;\\n tree.nodes.push(tree.nodes[parentIndex]);\\n delete tree.nodeIndexesToIDs[parentIndex];\\n tree.IDsToNodeIndexes[parentID] = newIndex;\\n tree.nodeIndexesToIDs[newIndex] = parentID;\\n }\\n } else {\\n // Some vacant spot.\\n // Pop the stack and append the value.\\n treeIndex = tree.stack[tree.stack.length - 1];\\n tree.stack.pop();\\n tree.nodes[treeIndex] = _value;\\n }\\n\\n // Add label.\\n tree.IDsToNodeIndexes[_ID] = treeIndex;\\n tree.nodeIndexesToIDs[treeIndex] = _ID;\\n\\n _updateParents(_key, treeIndex, true, _value);\\n }\\n } else {\\n // Existing node.\\n if (_value == 0) {\\n // Zero value.\\n // Remove.\\n // Remember value and set to 0.\\n uint256 value = tree.nodes[treeIndex];\\n tree.nodes[treeIndex] = 0;\\n\\n // Push to stack.\\n tree.stack.push(treeIndex);\\n\\n // Clear label.\\n delete tree.IDsToNodeIndexes[_ID];\\n delete tree.nodeIndexesToIDs[treeIndex];\\n\\n _updateParents(_key, treeIndex, false, value);\\n } else if (_value != tree.nodes[treeIndex]) {\\n // New, non zero value.\\n // Set.\\n bool plusOrMinus = tree.nodes[treeIndex] <= _value;\\n uint256 plusOrMinusValue = plusOrMinus\\n ? _value - tree.nodes[treeIndex]\\n : tree.nodes[treeIndex] - _value;\\n tree.nodes[treeIndex] = _value;\\n\\n _updateParents(_key, treeIndex, plusOrMinus, plusOrMinusValue);\\n }\\n }\\n }\\n\\n /// @dev Packs an account and a court ID into a stake path ID.\\n /// @param _account The address of the juror to pack.\\n /// @param _courtID The court ID to pack.\\n /// @return stakePathID The stake path ID.\\n function _accountAndCourtIDToStakePathID(\\n address _account,\\n uint96 _courtID\\n ) internal pure returns (bytes32 stakePathID) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n let ptr := mload(0x40)\\n for {\\n let i := 0x00\\n } lt(i, 0x14) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(ptr, i), byte(add(0x0c, i), _account))\\n }\\n for {\\n let i := 0x14\\n } lt(i, 0x20) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(ptr, i), byte(i, _courtID))\\n }\\n stakePathID := mload(ptr)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xe94da92dcc9e4035ecf238233499eb2233f3b6b6ffb1945a682e8e6fc4befdea\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _juror Address of the juror.\\n /// @param _voteIDs The identifiers of the votes in the dispute.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event VoteCast(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256[] _voteIDs,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _nonce Nonce.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID, uint256 _nonce) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0x7fe6b1d9b991cc327cc5895f34208a7b1e3b6ebf8efb20fcb9f3ff0f40d2d209\",\"license\":\"MIT\"},\"src/arbitration/interfaces/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external returns (uint256 pnkDeposit, uint256 pnkWithdrawal, bool succeeded);\\n\\n function setJurorInactive(address _account) external;\\n\\n function lockStake(address _account, uint256 _relativeAmount) external;\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external;\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _nonce) external view returns (address);\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts);\\n\\n function getJurorCourtIDs(address _juror) external view returns (uint96[] memory);\\n\\n function isJurorStaked(address _juror) external view returns (bool);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0xa6d79053edfe04f7d3c8ad9b9ce3f182e45f2f74be40a77a304a93168549c474\",\"license\":\"MIT\"},\"src/libraries/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title Constants\\nlibrary Constants {\\n // Courts\\n uint96 public constant FORKING_COURT = 0; // Index of the forking court.\\n uint96 public constant GENERAL_COURT = 1; // Index of the default (general) court.\\n\\n // Dispute Kits\\n uint256 public constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\n uint256 public constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n\\n // Defaults\\n uint256 public constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute.\\n IERC20 public constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1.\\n}\\n\",\"keccak256\":\"0xde8fd28a18669261b052aebb00bf09ec592bb9298fa5efc76ca8606e0c7dbb25\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"},\"src/libraries/Types.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nenum OnError {\\n Revert,\\n Return\\n}\\n\",\"keccak256\":\"0xc7deebd8227dfaa46a36ae8d2c24fe1b5d5c776ab963b44943829ab4058b5701\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"},\"src/rng/RNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\ninterface RNG {\\n /// @dev Request a random number.\\n /// @param _block Block linked to the request.\\n function requestRandomness(uint256 _block) external;\\n\\n /// @dev Receive the random number.\\n /// @param _block Block the random number is linked to.\\n /// @return randomNumber Random Number. If the number is not ready or has not been required 0 instead.\\n function receiveRandomness(uint256 _block) external returns (uint256 randomNumber);\\n}\\n\",\"keccak256\":\"0x5afe7121f49aebe72218df356bd91b66c2171b9ad15e7945a15a091784291a43\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000d9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff1615620000765760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b0390811614620000d65780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051612e7e62000103600039600081816112550152818161127e01526114760152612e7e6000f3fe6080604052600436106102465760003560e01c80637dc38f1411610139578063c1572618116100b6578063dca5f6b01161007a578063dca5f6b0146106c6578063dd5e5cb514610712578063e534710d14610732578063f216de4c1461076a578063f2f4eb261461078a578063f6b4d82d146107aa57600080fd5b8063c15726181461061a578063ccbac9f514610630578063d09f392d14610646578063d1c1df4814610666578063d605787b146106a657600080fd5b8063b1c9fe6e116100fd578063b1c9fe6e1461058b578063b4a61608146105b9578063b5d69e99146105ce578063b888adfa146105ee578063c057eca71461060457600080fd5b80637dc38f14146104d8578063823cfd70146104ee578063965af6c71461050e578063a2473cc11461052e578063a5861b901461054e57600080fd5b80634c70a0d6116101c757806354812d171161018b57806354812d171461041757806356acb050146104375780635d2d78461461044d5780636624192f1461046d57806376fa9fc5146104b857600080fd5b80634c70a0d6146103825780634dbbebbc146103a25780634f1ef286146103c257806352d1902d146103d5578063543f8a36146103ea57600080fd5b80631b92bbbe1161020e5780631b92bbbe146102ee57806321e1625e1461030457806321ea9b3f1461032457806335975f4a14610342578063477a655c1461036257600080fd5b8063034327441461024b5780630b274f2e146102745780630b51806d1461028b5780630c340a24146102a05780630e083ec9146102d8575b600080fd5b34801561025757600080fd5b5061026160065481565b6040519081526020015b60405180910390f35b34801561028057600080fd5b50610289610814565b005b34801561029757600080fd5b50610261600681565b3480156102ac57600080fd5b506000546102c0906001600160a01b031681565b6040516001600160a01b03909116815260200161026b565b3480156102e457600080fd5b50610261600a5481565b3480156102fa57600080fd5b5061026160035481565b34801561031057600080fd5b5061028961031f366004612852565b610bec565b34801561033057600080fd5b5061028961033f36600461287e565b50565b34801561034e57600080fd5b5061028961035d36600461287e565b610c8f565b34801561036e57600080fd5b5061028961037d36600461293a565b610e7d565b34801561038e57600080fd5b506102c061039d366004612981565b610f74565b3480156103ae57600080fd5b506102896103bd366004612852565b611158565b6102896103d03660046129ad565b611241565b3480156103e157600080fd5b50610261611469565b3480156103f657600080fd5b5061040a6104053660046129e7565b6114c7565b60405161026b9190612a04565b34801561042357600080fd5b50610289610432366004612a51565b611565565b34801561044357600080fd5b50610261600b5481565b34801561045957600080fd5b50610289610468366004612ab8565b61168b565b34801561047957600080fd5b506104a86104883660046129e7565b6001600160a01b03166000908152600d6020526040902060010154151590565b604051901515815260200161026b565b3480156104c457600080fd5b506102616104d3366004612ab8565b6116ce565b3480156104e457600080fd5b5061026160095481565b3480156104fa57600080fd5b5061028961050936600461287e565b611729565b34801561051a57600080fd5b50610289610529366004612852565b611758565b34801561053a57600080fd5b50610261610549366004612aef565b6117f3565b34801561055a57600080fd5b5061056e610569366004612b36565b61181d565b60408051938452602084019290925215159082015260600161026b565b34801561059757600080fd5b506001546105ac90600160a01b900460ff1681565b60405161026b9190612b9f565b3480156105c557600080fd5b50610261600481565b3480156105da57600080fd5b506102896105e93660046129e7565b611be4565b3480156105fa57600080fd5b5061026160045481565b34801561061057600080fd5b5061026160025481565b34801561062657600080fd5b5061026160055481565b34801561063c57600080fd5b5061026160085481565b34801561065257600080fd5b50610289610661366004612ab8565b611cc6565b34801561067257600080fd5b50610686610681366004612aef565b611d00565b60408051948552602085019390935291830152606082015260800161026b565b3480156106b257600080fd5b506007546102c0906001600160a01b031681565b3480156106d257600080fd5b506106fd6106e13660046129e7565b600d602052600090815260409020600181015460029091015482565b6040805192835260208301919091520161026b565b34801561071e57600080fd5b5061028961072d36600461287e565b611d3f565b34801561073e57600080fd5b5061026161074d366004612aef565b600f60209081526000928352604080842090915290825290205481565b34801561077657600080fd5b50610289610785366004612852565b611d6e565b34801561079657600080fd5b506001546102c0906001600160a01b031681565b3480156107b657600080fd5b506108046107c536600461287e565b600e602052600090815260409020805460018201546002909201546001600160a01b03821692600160a01b9092046001600160601b0316919060ff1684565b60405161026b9493929190612bc7565b6000600154600160a01b900460ff16600281111561083457610834612b89565b036109a7576002546004546108499042612c0e565b10156108b15760405162461bcd60e51b815260206004820152602c60248201527f546865206d696e696d756d207374616b696e672074696d6520686173206e6f7460448201526b103830b9b9b2b2103cb2ba1760a11b60648201526084015b60405180910390fd5b6000600654116109135760405162461bcd60e51b815260206004820152602760248201527f546865726520617265206e6f2064697370757465732074686174206e65656420604482015266353ab937b9399760c91b60648201526084016108a8565b6007546009546001600160a01b0390911690637363ae1f906109359043612c21565b6040518263ffffffff1660e01b815260040161095391815260200190565b600060405180830381600087803b15801561096d57600080fd5b505af1158015610981573d6000803e3d6000fd5b505043600555505060018054819060ff60a01b1916600160a01b825b0217905550610ba1565b60018054600160a01b900460ff1660028111156109c6576109c6612b89565b03610abe576007546009546005546001600160a01b03909216916313cf9054916109ef91612c21565b6040518263ffffffff1660e01b8152600401610a0d91815260200190565b6020604051808303816000875af1158015610a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a509190612c34565b6008819055600003610aa45760405162461bcd60e51b815260206004820152601e60248201527f52616e646f6d206e756d626572206973206e6f7420726561647920796574000060448201526064016108a8565b600180546002919060ff60a01b1916600160a01b8361099d565b6002600154600160a01b900460ff166002811115610ade57610ade612b89565b03610ba1576006541580610b005750600354600454610afd9042612c0e565b10155b610b935760405162461bcd60e51b815260206004820152605860248201527f546865726520617265207374696c6c20646973707574657320776974686f757460448201527f206a75726f727320616e6420746865206d6178696d756d2064726177696e67206064820152773a34b6b2903430b9903737ba103830b9b9b2b2103cb2ba1760411b608482015260a4016108a8565b6001805460ff60a01b191690555b426004556001546040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b9391610be291600160a01b90910460ff1690612b9f565b60405180910390a1565b6001546001600160a01b03163314610c165760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d602052604081206002018054839290610c41908490612c21565b909155505060408051828152600060208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b091015b60405180910390a25050565b6000600154600160a01b900460ff166002811115610caf57610caf612b89565b14610cfc5760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520696e205374616b696e672070686173652e000000000060448201526064016108a8565b6000600a54600183600b54610d119190612c21565b610d1b9190612c0e565b11610d265781610d41565b600b54600a54610d369190612c0e565b610d41906001612c21565b9050600081600b54610d539190612c21565b600b549091505b81811015610e75576000818152600e6020526040902080546001600160a01b031615610e625760018054825491830154600284015460405163fbb519e760e01b81526001600160a01b039384169463fbb519e794610dd69490821693600160a01b9092046001600160601b031692909160ff1690600401612bc7565b600060405180830381600087803b158015610df057600080fd5b505af1158015610e04573d6000803e3d6000fd5b505082546001600160a01b0381166000908152600f60209081526040808320600160a01b9094046001600160601b03168352928152828220829055868252600e90529081208181556001810191909155600201805460ff1916905550505b5080610e6d81612c91565b915050610d5a565b50600b555050565b6001546001600160a01b03163314610ea75760405162461bcd60e51b81526004016108a890612c4d565b6000828152600c6020526040812090610ebf83611de6565b825490915015610f085760405162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b60448201526064016108a8565b60018111610f585760405162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e000000000060448201526064016108a8565b8155600201805460018101825560009182526020822001555050565b60006002600154600160a01b900460ff166002811115610f9657610f96612b89565b14610fd25760405162461bcd60e51b815260206004820152600c60248201526b2bb937b73390383430b9b29760a11b60448201526064016108a8565b6000848152600c6020526040812060028101805491929091610ff657610ff6612caa565b9060005260206000200154600003611012576000915050611151565b60008160020160008154811061102a5761102a612caa565b9060005260206000200154600854868660405160200161105d939291909283526020830191909152604082015260600190565b6040516020818303038152906040528051906020012060001c6110809190612cd6565b905060005b60028301548354611097908390612cea565b6110a2906001612c21565b10156111315760015b8354811161112b576000818386600001546110c69190612cea565b6110d09190612c21565b905060008560020182815481106110e9576110e9612caa565b9060005260206000200154905080851061110e576111078186612c0e565b9450611116565b50915061112b565b5050808061112390612c91565b9150506110ab565b50611085565b600081815260048401602052604090205461114b90611e01565b93505050505b9392505050565b6000546001600160a01b031633146111825760405162461bcd60e51b81526004016108a890612d01565b600780546001600160a01b0319166001600160a01b038416179055600981905560018054600160a01b900460ff1660028111156111c1576111c1612b89565b0361123d576007546009546001600160a01b0390911690637363ae1f906111e89043612c21565b6040518263ffffffff1660e01b815260040161120691815260200190565b600060405180830381600087803b15801561122057600080fd5b505af1158015611234573d6000803e3d6000fd5b50504360055550505b5050565b61124a82611e2c565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806112c857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166112bc600080516020612e298339815191525490565b6001600160a01b031614155b156112e65760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611340575060408051601f3d908101601f1916820190925261133d91810190612c34565b60015b61136857604051630c76093760e01b81526001600160a01b03831660048201526024016108a8565b600080516020612e29833981519152811461139957604051632a87526960e21b8152600481018290526024016108a8565b600080516020612e298339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611464576000836001600160a01b0316836040516114009190612d43565b600060405180830381855af49150503d806000811461143b576040519150601f19603f3d011682016040523d82523d6000602084013e611440565b606091505b5050905080611462576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114b45760405163703e46dd60e11b815260040160405180910390fd5b50600080516020612e2983398151915290565b6001600160a01b0381166000908152600d602090815260409182902080548351818402810184019094528084526060939283018282801561155957602002820191906000526020600020906000905b82829054906101000a90046001600160601b03166001600160601b0316815260200190600c0190602082600b010492830192600103820291508084116115165790505b50505050509050919050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806115af5750805467ffffffffffffffff808416911610155b156115cc5760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff8316908117600160401b178255600080546001600160a01b038b81166001600160a01b031992831617909255600180548b841690831617815560028a905560038990554260045560078054938916939092169290921790556009859055600b55815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050505050565b6001546001600160a01b031633146116b55760405162461bcd60e51b81526004016108a890612c4d565b600680549060006116c583612d72565b91905055505050565b6000828152600c60209081526040808320848452600381019092528220548083036116fe57600092505050611723565b81600201818154811061171357611713612caa565b9060005260206000200154925050505b92915050565b6000546001600160a01b031633146117535760405162461bcd60e51b81526004016108a890612d01565b600255565b6001546001600160a01b031633146117825760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d6020526040812060020180548392906117ad908490612c0e565b909155505060408051828152600160208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b09101610c83565b6000806118008484611e56565b90506118156001600160601b038416826116ce565b949350505050565b600154600090819081906001600160a01b0316331461184e5760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0387166000908152600d602052604081209061187189896117f3565b82549091508715801561188d575060048110158061188d575081155b156118a5576000806000955095509550505050611bda565b6118af898b611e9e565b94506000600154600160a01b900460ff1660028111156118d1576118d1612b89565b14611a7f576000600e6000600a600081546118eb90612c91565b919050819055815260200190815260200160002090508a8160000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550898160000160146101000a8154816001600160601b0302191690836001600160601b03160217905550888160010181905550600a54600f60008d6001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160601b03166001600160601b031681526020019081526020016000208190555082891115611a235760028101805460ff191660011790556119ce848b8b86612155565b604080516001600160601b038d168152602081018c90529198506001600160a01b038d16917f792235ed84e4d70219b4fc973c509bbbdc2d3e22578dceea671f48829db949b0910160405180910390a2611a71565b604080516001600160601b038c168152602081018b90526001600160a01b038d16917fe9a844153bbed760d95005e769b4ef97fab26f7b01305c7028a0493b833bdbae910160405180910390a25b5060019350611bda92505050565b818810611a9f5786611a9a57611a97838a8a85612155565b95505b611ab8565b611aab838a8a85612235565b611ab59086612c21565b94505b6000611ac48b8b611e56565b905060008a5b81611b8257611ae36001600160601b0382168c8561242c565b6000196001600160601b03821601611afe5760019150611aca565b600154604051630fad06e960e11b81526001600160601b03831660048201526001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa158015611b4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b739190612d89565b50949550611aca945050505050565b604080516001600160601b038e168152602081018d90526001600160a01b038f16917f4732545d01e38980276a17e6d394f01577ba63f2fea5eba41af0757d9c060c5c910160405180910390a2506001955050505050505b9450945094915050565b6001546001600160a01b03163314611c0e5760405162461bcd60e51b81526004016108a890612c4d565b6000611c19826114c7565b80519091505b801561146457600180546001600160a01b03169063fbb519e79085908590611c479086612c0e565b81518110611c5757611c57612caa565b60200260200101516000806040518563ffffffff1660e01b8152600401611c819493929190612bc7565b600060405180830381600087803b158015611c9b57600080fd5b505af1158015611caf573d6000803e3d6000fd5b505050508080611cbe90612d72565b915050611c1f565b6001546001600160a01b03163314611cf05760405162461bcd60e51b81526004016108a890612c4d565b600680549060006116c583612c91565b6001600160a01b0382166000908152600d6020526040812060018101546002820154909290918190611d3287876117f3565b9054949793965094505050565b6000546001600160a01b03163314611d695760405162461bcd60e51b81526004016108a890612d01565b600355565b6001546001600160a01b03163314611d985760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d6020526040902060018101548211611dda5781816001016000828254611dcf9190612c0e565b909155506114649050565b60006001820155505050565b60006020825110611df957506020015190565b506006919050565b600060405160005b6014811015611e245783811a81600c84010153600101611e09565b505192915050565b6000546001600160a01b0316331461033f5760405162461bcd60e51b81526004016108a890612d01565b600060405160005b6014811015611e79578481600c011a81830153600101611e5e565b5060145b6020811015611e955783811a81830153600101611e7d565b50519392505050565b6001600160a01b0381166000908152600f602090815260408083206001600160601b0386168452909152812054801561214e576000818152600e60205260409020600281015460ff1615612101576000611ef885876117f3565b90506000818360010154611f0c9190612c0e565b6001600160a01b0387166000908152600d602052604090206001810154919650869250908210611f3e57806001015495505b85816001016000828254611f529190612c0e565b90915550506040518281526001600160601b038916906001600160a01b038916907f1222c35b9c82812f1fda75e2b299043b079c0bb3b53d44aee1ae96a97263ca699060200160405180910390a3826000036120fd5780545b80156120fb576001600160601b03891682611fc7600184612c0e565b81548110611fd757611fd7612caa565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036120e9578154829061201390600190612c0e565b8154811061202357612023612caa565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169083906120579084612c0e565b8154811061206757612067612caa565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550816000018054806120b3576120b3612dfe565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556120fb565b806120f381612d72565b915050611fab565b505b5050505b506000818152600e6020908152604080832083815560018101849055600201805460ff191690556001600160a01b0386168352600f82528083206001600160601b03881684529091528120555b5092915050565b60008085600101548660020154101561216f576000612183565b856001015486600201546121839190612c0e565b905061218f8184612c21565b84101561219d5760006121b2565b806121a88486612c0e565b6121b29190612c0e565b9150826000036121f7578554600180820188556000888152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918816021790555b82866001015410156122095783612224565b8383876001015461221a9190612c0e565b6122249190612c21565b866001018190555050949350505050565b60028401546000906122478484612c0e565b6122519190612c21565b85600101541061226c576122658383612c0e565b9050612292565b8460020154856001015410612292578460020154856001015461228f9190612c0e565b90505b826000036123ef5784545b80156123ed576001600160601b038516866122b9600184612c0e565b815481106122c9576122c9612caa565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036123db578554869061230590600190612c0e565b8154811061231557612315612caa565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169087906123499084612c0e565b8154811061235957612359612caa565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550856000018054806123a5576123a5612dfe565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556123ed565b806123e581612d72565b91505061229d565b505b8185600101541015612401578261241c565b828286600101546124129190612c0e565b61241c9190612c21565b8560010181905550949350505050565b6000838152600c602090815260408083208484526003810190925282205490918190036125f95783156125f45760018201546000036125475750600281018054600180820183556000928352602090922081018590559081148015906124a65750815461249a600183612c0e565b6124a49190612cd6565b155b156125425781546000906124ba9083612e14565b60008181526004850160205260408120549192506124d9846001612c21565b9050846002018560020184815481106124f4576124f4612caa565b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b6125c2565b60018083018054909161255991612c0e565b8154811061256957612569612caa565b906000526020600020015490508160010180548061258957612589612dfe565b60019003818190600052602060002001600090559055838260020182815481106125b5576125b5612caa565b6000918252602090912001555b600083815260038301602090815260408083208490558383526004850190915290208390556125f48582600187612780565b612779565b8360000361269757600082600201828154811061261857612618612caa565b90600052602060002001549050600083600201838154811061263c5761263c612caa565b6000918252602080832090910192909255600180860180549182018155825282822001849055858152600385018252604080822082905584825260048601909252908120819055612691908790849084612780565b50612779565b8160020181815481106126ac576126ac612caa565b90600052602060002001548414612779576000848360020183815481106126d5576126d5612caa565b90600052602060002001541115905060008161271b578584600201848154811061270157612701612caa565b90600052602060002001546127169190612c0e565b612746565b83600201838154811061273057612730612caa565b9060005260206000200154866127469190612c0e565b90508584600201848154811061275e5761275e612caa565b60009182526020909120015561277687848484612780565b50505b5050505050565b6000848152600c60205260409020835b80156128355781546127a3600183612c0e565b6127ad9190612e14565b9050836127e457828260020182815481106127ca576127ca612caa565b90600052602060002001546127df9190612c0e565b61280f565b828260020182815481106127fa576127fa612caa565b906000526020600020015461280f9190612c21565b82600201828154811061282457612824612caa565b600091825260209091200155612790565b505050505050565b6001600160a01b038116811461033f57600080fd5b6000806040838503121561286557600080fd5b82356128708161283d565b946020939093013593505050565b60006020828403121561289057600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126128be57600080fd5b813567ffffffffffffffff808211156128d9576128d9612897565b604051601f8301601f19908116603f0116810190828211818310171561290157612901612897565b8160405283815286602085880101111561291a57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561294d57600080fd5b82359150602083013567ffffffffffffffff81111561296b57600080fd5b612977858286016128ad565b9150509250929050565b60008060006060848603121561299657600080fd5b505081359360208301359350604090920135919050565b600080604083850312156129c057600080fd5b82356129cb8161283d565b9150602083013567ffffffffffffffff81111561296b57600080fd5b6000602082840312156129f957600080fd5b81356111518161283d565b6020808252825182820181905260009190848201906040850190845b81811015612a455783516001600160601b031683529284019291840191600101612a20565b50909695505050505050565b60008060008060008060c08789031215612a6a57600080fd5b8635612a758161283d565b95506020870135612a858161283d565b945060408701359350606087013592506080870135612aa38161283d565b8092505060a087013590509295509295509295565b60008060408385031215612acb57600080fd5b50508035926020909101359150565b6001600160601b038116811461033f57600080fd5b60008060408385031215612b0257600080fd5b8235612b0d8161283d565b91506020830135612b1d81612ada565b809150509250929050565b801515811461033f57600080fd5b60008060008060808587031215612b4c57600080fd5b8435612b578161283d565b93506020850135612b6781612ada565b9250604085013591506060850135612b7e81612b28565b939692955090935050565b634e487b7160e01b600052602160045260246000fd5b6020810160038310612bc157634e487b7160e01b600052602160045260246000fd5b91905290565b6001600160a01b039490941684526001600160601b0392909216602084015260408301521515606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561172357611723612bf8565b8082018082111561172357611723612bf8565b600060208284031215612c4657600080fd5b5051919050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600060018201612ca357612ca3612bf8565b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082612ce557612ce5612cc0565b500690565b808202811582820484141761172357611723612bf8565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b6000825160005b81811015612d645760208186018101518583015201612d4a565b506000920191825250919050565b600081612d8157612d81612bf8565b506000190190565b600080600080600080600060e0888a031215612da457600080fd5b8751612daf81612ada565b6020890151909750612dc081612b28565b8096505060408801519450606088015193506080880151925060a0880151915060c0880151612dee81612b28565b8091505092959891949750929550565b634e487b7160e01b600052603160045260246000fd5b600082612e2357612e23612cc0565b50049056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220a033b17b17f53b80ffc9b458b580d8ec4bab3d5c2ab361b7830d67fa9faab2df64736f6c63430008120033", - "deployedBytecode": "0x6080604052600436106102465760003560e01c80637dc38f1411610139578063c1572618116100b6578063dca5f6b01161007a578063dca5f6b0146106c6578063dd5e5cb514610712578063e534710d14610732578063f216de4c1461076a578063f2f4eb261461078a578063f6b4d82d146107aa57600080fd5b8063c15726181461061a578063ccbac9f514610630578063d09f392d14610646578063d1c1df4814610666578063d605787b146106a657600080fd5b8063b1c9fe6e116100fd578063b1c9fe6e1461058b578063b4a61608146105b9578063b5d69e99146105ce578063b888adfa146105ee578063c057eca71461060457600080fd5b80637dc38f14146104d8578063823cfd70146104ee578063965af6c71461050e578063a2473cc11461052e578063a5861b901461054e57600080fd5b80634c70a0d6116101c757806354812d171161018b57806354812d171461041757806356acb050146104375780635d2d78461461044d5780636624192f1461046d57806376fa9fc5146104b857600080fd5b80634c70a0d6146103825780634dbbebbc146103a25780634f1ef286146103c257806352d1902d146103d5578063543f8a36146103ea57600080fd5b80631b92bbbe1161020e5780631b92bbbe146102ee57806321e1625e1461030457806321ea9b3f1461032457806335975f4a14610342578063477a655c1461036257600080fd5b8063034327441461024b5780630b274f2e146102745780630b51806d1461028b5780630c340a24146102a05780630e083ec9146102d8575b600080fd5b34801561025757600080fd5b5061026160065481565b6040519081526020015b60405180910390f35b34801561028057600080fd5b50610289610814565b005b34801561029757600080fd5b50610261600681565b3480156102ac57600080fd5b506000546102c0906001600160a01b031681565b6040516001600160a01b03909116815260200161026b565b3480156102e457600080fd5b50610261600a5481565b3480156102fa57600080fd5b5061026160035481565b34801561031057600080fd5b5061028961031f366004612852565b610bec565b34801561033057600080fd5b5061028961033f36600461287e565b50565b34801561034e57600080fd5b5061028961035d36600461287e565b610c8f565b34801561036e57600080fd5b5061028961037d36600461293a565b610e7d565b34801561038e57600080fd5b506102c061039d366004612981565b610f74565b3480156103ae57600080fd5b506102896103bd366004612852565b611158565b6102896103d03660046129ad565b611241565b3480156103e157600080fd5b50610261611469565b3480156103f657600080fd5b5061040a6104053660046129e7565b6114c7565b60405161026b9190612a04565b34801561042357600080fd5b50610289610432366004612a51565b611565565b34801561044357600080fd5b50610261600b5481565b34801561045957600080fd5b50610289610468366004612ab8565b61168b565b34801561047957600080fd5b506104a86104883660046129e7565b6001600160a01b03166000908152600d6020526040902060010154151590565b604051901515815260200161026b565b3480156104c457600080fd5b506102616104d3366004612ab8565b6116ce565b3480156104e457600080fd5b5061026160095481565b3480156104fa57600080fd5b5061028961050936600461287e565b611729565b34801561051a57600080fd5b50610289610529366004612852565b611758565b34801561053a57600080fd5b50610261610549366004612aef565b6117f3565b34801561055a57600080fd5b5061056e610569366004612b36565b61181d565b60408051938452602084019290925215159082015260600161026b565b34801561059757600080fd5b506001546105ac90600160a01b900460ff1681565b60405161026b9190612b9f565b3480156105c557600080fd5b50610261600481565b3480156105da57600080fd5b506102896105e93660046129e7565b611be4565b3480156105fa57600080fd5b5061026160045481565b34801561061057600080fd5b5061026160025481565b34801561062657600080fd5b5061026160055481565b34801561063c57600080fd5b5061026160085481565b34801561065257600080fd5b50610289610661366004612ab8565b611cc6565b34801561067257600080fd5b50610686610681366004612aef565b611d00565b60408051948552602085019390935291830152606082015260800161026b565b3480156106b257600080fd5b506007546102c0906001600160a01b031681565b3480156106d257600080fd5b506106fd6106e13660046129e7565b600d602052600090815260409020600181015460029091015482565b6040805192835260208301919091520161026b565b34801561071e57600080fd5b5061028961072d36600461287e565b611d3f565b34801561073e57600080fd5b5061026161074d366004612aef565b600f60209081526000928352604080842090915290825290205481565b34801561077657600080fd5b50610289610785366004612852565b611d6e565b34801561079657600080fd5b506001546102c0906001600160a01b031681565b3480156107b657600080fd5b506108046107c536600461287e565b600e602052600090815260409020805460018201546002909201546001600160a01b03821692600160a01b9092046001600160601b0316919060ff1684565b60405161026b9493929190612bc7565b6000600154600160a01b900460ff16600281111561083457610834612b89565b036109a7576002546004546108499042612c0e565b10156108b15760405162461bcd60e51b815260206004820152602c60248201527f546865206d696e696d756d207374616b696e672074696d6520686173206e6f7460448201526b103830b9b9b2b2103cb2ba1760a11b60648201526084015b60405180910390fd5b6000600654116109135760405162461bcd60e51b815260206004820152602760248201527f546865726520617265206e6f2064697370757465732074686174206e65656420604482015266353ab937b9399760c91b60648201526084016108a8565b6007546009546001600160a01b0390911690637363ae1f906109359043612c21565b6040518263ffffffff1660e01b815260040161095391815260200190565b600060405180830381600087803b15801561096d57600080fd5b505af1158015610981573d6000803e3d6000fd5b505043600555505060018054819060ff60a01b1916600160a01b825b0217905550610ba1565b60018054600160a01b900460ff1660028111156109c6576109c6612b89565b03610abe576007546009546005546001600160a01b03909216916313cf9054916109ef91612c21565b6040518263ffffffff1660e01b8152600401610a0d91815260200190565b6020604051808303816000875af1158015610a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a509190612c34565b6008819055600003610aa45760405162461bcd60e51b815260206004820152601e60248201527f52616e646f6d206e756d626572206973206e6f7420726561647920796574000060448201526064016108a8565b600180546002919060ff60a01b1916600160a01b8361099d565b6002600154600160a01b900460ff166002811115610ade57610ade612b89565b03610ba1576006541580610b005750600354600454610afd9042612c0e565b10155b610b935760405162461bcd60e51b815260206004820152605860248201527f546865726520617265207374696c6c20646973707574657320776974686f757460448201527f206a75726f727320616e6420746865206d6178696d756d2064726177696e67206064820152773a34b6b2903430b9903737ba103830b9b9b2b2103cb2ba1760411b608482015260a4016108a8565b6001805460ff60a01b191690555b426004556001546040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b9391610be291600160a01b90910460ff1690612b9f565b60405180910390a1565b6001546001600160a01b03163314610c165760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d602052604081206002018054839290610c41908490612c21565b909155505060408051828152600060208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b091015b60405180910390a25050565b6000600154600160a01b900460ff166002811115610caf57610caf612b89565b14610cfc5760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520696e205374616b696e672070686173652e000000000060448201526064016108a8565b6000600a54600183600b54610d119190612c21565b610d1b9190612c0e565b11610d265781610d41565b600b54600a54610d369190612c0e565b610d41906001612c21565b9050600081600b54610d539190612c21565b600b549091505b81811015610e75576000818152600e6020526040902080546001600160a01b031615610e625760018054825491830154600284015460405163fbb519e760e01b81526001600160a01b039384169463fbb519e794610dd69490821693600160a01b9092046001600160601b031692909160ff1690600401612bc7565b600060405180830381600087803b158015610df057600080fd5b505af1158015610e04573d6000803e3d6000fd5b505082546001600160a01b0381166000908152600f60209081526040808320600160a01b9094046001600160601b03168352928152828220829055868252600e90529081208181556001810191909155600201805460ff1916905550505b5080610e6d81612c91565b915050610d5a565b50600b555050565b6001546001600160a01b03163314610ea75760405162461bcd60e51b81526004016108a890612c4d565b6000828152600c6020526040812090610ebf83611de6565b825490915015610f085760405162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b60448201526064016108a8565b60018111610f585760405162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e000000000060448201526064016108a8565b8155600201805460018101825560009182526020822001555050565b60006002600154600160a01b900460ff166002811115610f9657610f96612b89565b14610fd25760405162461bcd60e51b815260206004820152600c60248201526b2bb937b73390383430b9b29760a11b60448201526064016108a8565b6000848152600c6020526040812060028101805491929091610ff657610ff6612caa565b9060005260206000200154600003611012576000915050611151565b60008160020160008154811061102a5761102a612caa565b9060005260206000200154600854868660405160200161105d939291909283526020830191909152604082015260600190565b6040516020818303038152906040528051906020012060001c6110809190612cd6565b905060005b60028301548354611097908390612cea565b6110a2906001612c21565b10156111315760015b8354811161112b576000818386600001546110c69190612cea565b6110d09190612c21565b905060008560020182815481106110e9576110e9612caa565b9060005260206000200154905080851061110e576111078186612c0e565b9450611116565b50915061112b565b5050808061112390612c91565b9150506110ab565b50611085565b600081815260048401602052604090205461114b90611e01565b93505050505b9392505050565b6000546001600160a01b031633146111825760405162461bcd60e51b81526004016108a890612d01565b600780546001600160a01b0319166001600160a01b038416179055600981905560018054600160a01b900460ff1660028111156111c1576111c1612b89565b0361123d576007546009546001600160a01b0390911690637363ae1f906111e89043612c21565b6040518263ffffffff1660e01b815260040161120691815260200190565b600060405180830381600087803b15801561122057600080fd5b505af1158015611234573d6000803e3d6000fd5b50504360055550505b5050565b61124a82611e2c565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806112c857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166112bc600080516020612e298339815191525490565b6001600160a01b031614155b156112e65760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611340575060408051601f3d908101601f1916820190925261133d91810190612c34565b60015b61136857604051630c76093760e01b81526001600160a01b03831660048201526024016108a8565b600080516020612e29833981519152811461139957604051632a87526960e21b8152600481018290526024016108a8565b600080516020612e298339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611464576000836001600160a01b0316836040516114009190612d43565b600060405180830381855af49150503d806000811461143b576040519150601f19603f3d011682016040523d82523d6000602084013e611440565b606091505b5050905080611462576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114b45760405163703e46dd60e11b815260040160405180910390fd5b50600080516020612e2983398151915290565b6001600160a01b0381166000908152600d602090815260409182902080548351818402810184019094528084526060939283018282801561155957602002820191906000526020600020906000905b82829054906101000a90046001600160601b03166001600160601b0316815260200190600c0190602082600b010492830192600103820291508084116115165790505b50505050509050919050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806115af5750805467ffffffffffffffff808416911610155b156115cc5760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff8316908117600160401b178255600080546001600160a01b038b81166001600160a01b031992831617909255600180548b841690831617815560028a905560038990554260045560078054938916939092169290921790556009859055600b55815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050505050565b6001546001600160a01b031633146116b55760405162461bcd60e51b81526004016108a890612c4d565b600680549060006116c583612d72565b91905055505050565b6000828152600c60209081526040808320848452600381019092528220548083036116fe57600092505050611723565b81600201818154811061171357611713612caa565b9060005260206000200154925050505b92915050565b6000546001600160a01b031633146117535760405162461bcd60e51b81526004016108a890612d01565b600255565b6001546001600160a01b031633146117825760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d6020526040812060020180548392906117ad908490612c0e565b909155505060408051828152600160208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b09101610c83565b6000806118008484611e56565b90506118156001600160601b038416826116ce565b949350505050565b600154600090819081906001600160a01b0316331461184e5760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0387166000908152600d602052604081209061187189896117f3565b82549091508715801561188d575060048110158061188d575081155b156118a5576000806000955095509550505050611bda565b6118af898b611e9e565b94506000600154600160a01b900460ff1660028111156118d1576118d1612b89565b14611a7f576000600e6000600a600081546118eb90612c91565b919050819055815260200190815260200160002090508a8160000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550898160000160146101000a8154816001600160601b0302191690836001600160601b03160217905550888160010181905550600a54600f60008d6001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160601b03166001600160601b031681526020019081526020016000208190555082891115611a235760028101805460ff191660011790556119ce848b8b86612155565b604080516001600160601b038d168152602081018c90529198506001600160a01b038d16917f792235ed84e4d70219b4fc973c509bbbdc2d3e22578dceea671f48829db949b0910160405180910390a2611a71565b604080516001600160601b038c168152602081018b90526001600160a01b038d16917fe9a844153bbed760d95005e769b4ef97fab26f7b01305c7028a0493b833bdbae910160405180910390a25b5060019350611bda92505050565b818810611a9f5786611a9a57611a97838a8a85612155565b95505b611ab8565b611aab838a8a85612235565b611ab59086612c21565b94505b6000611ac48b8b611e56565b905060008a5b81611b8257611ae36001600160601b0382168c8561242c565b6000196001600160601b03821601611afe5760019150611aca565b600154604051630fad06e960e11b81526001600160601b03831660048201526001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa158015611b4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b739190612d89565b50949550611aca945050505050565b604080516001600160601b038e168152602081018d90526001600160a01b038f16917f4732545d01e38980276a17e6d394f01577ba63f2fea5eba41af0757d9c060c5c910160405180910390a2506001955050505050505b9450945094915050565b6001546001600160a01b03163314611c0e5760405162461bcd60e51b81526004016108a890612c4d565b6000611c19826114c7565b80519091505b801561146457600180546001600160a01b03169063fbb519e79085908590611c479086612c0e565b81518110611c5757611c57612caa565b60200260200101516000806040518563ffffffff1660e01b8152600401611c819493929190612bc7565b600060405180830381600087803b158015611c9b57600080fd5b505af1158015611caf573d6000803e3d6000fd5b505050508080611cbe90612d72565b915050611c1f565b6001546001600160a01b03163314611cf05760405162461bcd60e51b81526004016108a890612c4d565b600680549060006116c583612c91565b6001600160a01b0382166000908152600d6020526040812060018101546002820154909290918190611d3287876117f3565b9054949793965094505050565b6000546001600160a01b03163314611d695760405162461bcd60e51b81526004016108a890612d01565b600355565b6001546001600160a01b03163314611d985760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d6020526040902060018101548211611dda5781816001016000828254611dcf9190612c0e565b909155506114649050565b60006001820155505050565b60006020825110611df957506020015190565b506006919050565b600060405160005b6014811015611e245783811a81600c84010153600101611e09565b505192915050565b6000546001600160a01b0316331461033f5760405162461bcd60e51b81526004016108a890612d01565b600060405160005b6014811015611e79578481600c011a81830153600101611e5e565b5060145b6020811015611e955783811a81830153600101611e7d565b50519392505050565b6001600160a01b0381166000908152600f602090815260408083206001600160601b0386168452909152812054801561214e576000818152600e60205260409020600281015460ff1615612101576000611ef885876117f3565b90506000818360010154611f0c9190612c0e565b6001600160a01b0387166000908152600d602052604090206001810154919650869250908210611f3e57806001015495505b85816001016000828254611f529190612c0e565b90915550506040518281526001600160601b038916906001600160a01b038916907f1222c35b9c82812f1fda75e2b299043b079c0bb3b53d44aee1ae96a97263ca699060200160405180910390a3826000036120fd5780545b80156120fb576001600160601b03891682611fc7600184612c0e565b81548110611fd757611fd7612caa565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036120e9578154829061201390600190612c0e565b8154811061202357612023612caa565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169083906120579084612c0e565b8154811061206757612067612caa565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550816000018054806120b3576120b3612dfe565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556120fb565b806120f381612d72565b915050611fab565b505b5050505b506000818152600e6020908152604080832083815560018101849055600201805460ff191690556001600160a01b0386168352600f82528083206001600160601b03881684529091528120555b5092915050565b60008085600101548660020154101561216f576000612183565b856001015486600201546121839190612c0e565b905061218f8184612c21565b84101561219d5760006121b2565b806121a88486612c0e565b6121b29190612c0e565b9150826000036121f7578554600180820188556000888152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918816021790555b82866001015410156122095783612224565b8383876001015461221a9190612c0e565b6122249190612c21565b866001018190555050949350505050565b60028401546000906122478484612c0e565b6122519190612c21565b85600101541061226c576122658383612c0e565b9050612292565b8460020154856001015410612292578460020154856001015461228f9190612c0e565b90505b826000036123ef5784545b80156123ed576001600160601b038516866122b9600184612c0e565b815481106122c9576122c9612caa565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036123db578554869061230590600190612c0e565b8154811061231557612315612caa565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169087906123499084612c0e565b8154811061235957612359612caa565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550856000018054806123a5576123a5612dfe565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556123ed565b806123e581612d72565b91505061229d565b505b8185600101541015612401578261241c565b828286600101546124129190612c0e565b61241c9190612c21565b8560010181905550949350505050565b6000838152600c602090815260408083208484526003810190925282205490918190036125f95783156125f45760018201546000036125475750600281018054600180820183556000928352602090922081018590559081148015906124a65750815461249a600183612c0e565b6124a49190612cd6565b155b156125425781546000906124ba9083612e14565b60008181526004850160205260408120549192506124d9846001612c21565b9050846002018560020184815481106124f4576124f4612caa565b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b6125c2565b60018083018054909161255991612c0e565b8154811061256957612569612caa565b906000526020600020015490508160010180548061258957612589612dfe565b60019003818190600052602060002001600090559055838260020182815481106125b5576125b5612caa565b6000918252602090912001555b600083815260038301602090815260408083208490558383526004850190915290208390556125f48582600187612780565b612779565b8360000361269757600082600201828154811061261857612618612caa565b90600052602060002001549050600083600201838154811061263c5761263c612caa565b6000918252602080832090910192909255600180860180549182018155825282822001849055858152600385018252604080822082905584825260048601909252908120819055612691908790849084612780565b50612779565b8160020181815481106126ac576126ac612caa565b90600052602060002001548414612779576000848360020183815481106126d5576126d5612caa565b90600052602060002001541115905060008161271b578584600201848154811061270157612701612caa565b90600052602060002001546127169190612c0e565b612746565b83600201838154811061273057612730612caa565b9060005260206000200154866127469190612c0e565b90508584600201848154811061275e5761275e612caa565b60009182526020909120015561277687848484612780565b50505b5050505050565b6000848152600c60205260409020835b80156128355781546127a3600183612c0e565b6127ad9190612e14565b9050836127e457828260020182815481106127ca576127ca612caa565b90600052602060002001546127df9190612c0e565b61280f565b828260020182815481106127fa576127fa612caa565b906000526020600020015461280f9190612c21565b82600201828154811061282457612824612caa565b600091825260209091200155612790565b505050505050565b6001600160a01b038116811461033f57600080fd5b6000806040838503121561286557600080fd5b82356128708161283d565b946020939093013593505050565b60006020828403121561289057600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126128be57600080fd5b813567ffffffffffffffff808211156128d9576128d9612897565b604051601f8301601f19908116603f0116810190828211818310171561290157612901612897565b8160405283815286602085880101111561291a57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561294d57600080fd5b82359150602083013567ffffffffffffffff81111561296b57600080fd5b612977858286016128ad565b9150509250929050565b60008060006060848603121561299657600080fd5b505081359360208301359350604090920135919050565b600080604083850312156129c057600080fd5b82356129cb8161283d565b9150602083013567ffffffffffffffff81111561296b57600080fd5b6000602082840312156129f957600080fd5b81356111518161283d565b6020808252825182820181905260009190848201906040850190845b81811015612a455783516001600160601b031683529284019291840191600101612a20565b50909695505050505050565b60008060008060008060c08789031215612a6a57600080fd5b8635612a758161283d565b95506020870135612a858161283d565b945060408701359350606087013592506080870135612aa38161283d565b8092505060a087013590509295509295509295565b60008060408385031215612acb57600080fd5b50508035926020909101359150565b6001600160601b038116811461033f57600080fd5b60008060408385031215612b0257600080fd5b8235612b0d8161283d565b91506020830135612b1d81612ada565b809150509250929050565b801515811461033f57600080fd5b60008060008060808587031215612b4c57600080fd5b8435612b578161283d565b93506020850135612b6781612ada565b9250604085013591506060850135612b7e81612b28565b939692955090935050565b634e487b7160e01b600052602160045260246000fd5b6020810160038310612bc157634e487b7160e01b600052602160045260246000fd5b91905290565b6001600160a01b039490941684526001600160601b0392909216602084015260408301521515606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561172357611723612bf8565b8082018082111561172357611723612bf8565b600060208284031215612c4657600080fd5b5051919050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600060018201612ca357612ca3612bf8565b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082612ce557612ce5612cc0565b500690565b808202811582820484141761172357611723612bf8565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b6000825160005b81811015612d645760208186018101518583015201612d4a565b506000920191825250919050565b600081612d8157612d81612bf8565b506000190190565b600080600080600080600060e0888a031215612da457600080fd5b8751612daf81612ada565b6020890151909750612dc081612b28565b8096505060408801519450606088015193506080880151925060a0880151915060c0880151612dee81612b28565b8091505092959891949750929550565b634e487b7160e01b600052603160045260246000fd5b600082612e2357612e23612cc0565b50049056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220a033b17b17f53b80ffc9b458b580d8ec4bab3d5c2ab361b7830d67fa9faab2df64736f6c63430008120033", + "solcInputHash": "3f329281196df29e7a5c0426794280b8", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"enum ISortitionModule.Phase\",\"name\":\"_phase\",\"type\":\"uint8\"}],\"name\":\"NewPhase\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeDelayedAlreadyTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeDelayedAlreadyTransferredWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeDelayedNotTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_unlock\",\"type\":\"bool\"}],\"name\":\"StakeLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_K\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_STAKE_PATHS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxDrawingTime\",\"type\":\"uint256\"}],\"name\":\"changeMaxDrawingTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minStakingTime\",\"type\":\"uint256\"}],\"name\":\"changeMinStakingTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_rngLookahead\",\"type\":\"uint256\"}],\"name\":\"changeRandomNumberGenerator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"core\",\"outputs\":[{\"internalType\":\"contract KlerosCore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"createDisputeHook\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createTree\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"delayedStakeReadIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"delayedStakeWriteIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"delayedStakes\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"alreadyTransferred\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disputesWithoutJurors\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"drawnAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"executeDelayedStakes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"getJurorBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalStaked\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalLocked\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"stakedInCourt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbCourts\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"}],\"name\":\"getJurorCourtIDs\",\"outputs\":[{\"internalType\":\"uint96[]\",\"name\":\"\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract KlerosCore\",\"name\":\"_core\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_minStakingTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxDrawingTime\",\"type\":\"uint256\"},{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_rngLookahead\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"}],\"name\":\"isJurorStaked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"jurors\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"stakedPnk\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lockedPnk\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastPhaseChange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"name\":\"latestDelayedStakeIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"}],\"name\":\"lockStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxDrawingTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minStakingTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_randomNumber\",\"type\":\"uint256\"}],\"name\":\"notifyRandomNumber\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passPhase\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"}],\"name\":\"penalizeStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"phase\",\"outputs\":[{\"internalType\":\"enum ISortitionModule.Phase\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"postDrawHook\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomNumberRequestBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rng\",\"outputs\":[{\"internalType\":\"contract RNG\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rngLookahead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"setJurorInactive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_newStake\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"_alreadyTransferred\",\"type\":\"bool\"}],\"name\":\"setStake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"pnkDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pnkWithdrawal\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"succeeded\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_ID\",\"type\":\"bytes32\"}],\"name\":\"stakeOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"stakeOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"}],\"name\":\"unlockStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"A factory of trees that keeps track of staked values for sortition.\",\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"changeMaxDrawingTime(uint256)\":{\"details\":\"Changes the `maxDrawingTime` storage variable.\",\"params\":{\"_maxDrawingTime\":\"The new value for the `maxDrawingTime` storage variable.\"}},\"changeMinStakingTime(uint256)\":{\"details\":\"Changes the `minStakingTime` storage variable.\",\"params\":{\"_minStakingTime\":\"The new value for the `minStakingTime` storage variable.\"}},\"changeRandomNumberGenerator(address,uint256)\":{\"details\":\"Changes the `_rng` and `_rngLookahead` storage variables.\",\"params\":{\"_rng\":\"The new value for the `RNGenerator` storage variable.\",\"_rngLookahead\":\"The new value for the `rngLookahead` storage variable.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"createTree(bytes32,bytes)\":{\"details\":\"Create a sortition sum tree at the specified key.\",\"params\":{\"_extraData\":\"Extra data that contains the number of children each node in the tree should have.\",\"_key\":\"The key of the new tree.\"}},\"draw(bytes32,uint256,uint256)\":{\"details\":\"Draw an ID from a tree using a number. Note that this function reverts if the sum of all values in the tree is 0.\",\"params\":{\"_coreDisputeID\":\"Index of the dispute in Kleros Core.\",\"_key\":\"The key of the tree.\",\"_nonce\":\"Nonce to hash with random number.\"},\"returns\":{\"drawnAddress\":\"The drawn address. `O(k * log_k(n))` where `k` is the maximum number of children per node in the tree, and `n` is the maximum number of nodes ever appended.\"}},\"executeDelayedStakes(uint256)\":{\"details\":\"Executes the next delayed stakes.\",\"params\":{\"_iterations\":\"The number of delayed stakes to execute.\"}},\"getJurorCourtIDs(address)\":{\"details\":\"Gets the court identifiers where a specific `_juror` has staked.\",\"params\":{\"_juror\":\"The address of the juror.\"}},\"initialize(address,address,uint256,uint256,address,uint256)\":{\"details\":\"Initializer (constructor equivalent for upgradable contracts).\",\"params\":{\"_core\":\"The KlerosCore.\",\"_maxDrawingTime\":\"Time after which the drawing phase can be switched\",\"_minStakingTime\":\"Minimal time to stake\",\"_rng\":\"The random number generator.\",\"_rngLookahead\":\"Lookahead value for rng.\"}},\"notifyRandomNumber(uint256)\":{\"details\":\"Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().\",\"params\":{\"_randomNumber\":\"Random number returned by RNG contract.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"setJurorInactive(address)\":{\"details\":\"Unstakes the inactive juror from all courts. `O(n * (p * log_k(j)) )` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\",\"params\":{\"_account\":\"The juror to unstake.\"}},\"setStake(address,uint96,uint256,bool)\":{\"details\":\"Sets the specified juror's stake in a court. `O(n + p * log_k(j))` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\",\"params\":{\"_account\":\"The address of the juror.\",\"_alreadyTransferred\":\"True if the tokens were already transferred from juror. Only relevant for delayed stakes.\",\"_courtID\":\"The ID of the court.\",\"_newStake\":\"The new stake.\"},\"returns\":{\"pnkDeposit\":\"The amount of PNK to be deposited.\",\"pnkWithdrawal\":\"The amount of PNK to be withdrawn.\",\"succeeded\":\"True if the call succeeded, false otherwise.\"}},\"stakeOf(address,uint96)\":{\"details\":\"Get the stake of a juror in a court.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_juror\":\"The address of the juror.\"},\"returns\":{\"_0\":\"value The stake of the juror in the court.\"}},\"stakeOf(bytes32,bytes32)\":{\"details\":\"Get the stake of a juror in a court.\",\"params\":{\"_ID\":\"The stake path ID, corresponding to a juror.\",\"_key\":\"The key of the tree, corresponding to a court.\"},\"returns\":{\"_0\":\"The stake of the juror in the court.\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"SortitionModule\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/SortitionModule.sol\":\"SortitionModule\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/KlerosCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"./interfaces/IArbitratorV2.sol\\\";\\nimport {IDisputeKit} from \\\"./interfaces/IDisputeKit.sol\\\";\\nimport {ISortitionModule} from \\\"./interfaces/ISortitionModule.sol\\\";\\nimport {SafeERC20, IERC20} from \\\"../libraries/SafeERC20.sol\\\";\\nimport {Constants} from \\\"../libraries/Constants.sol\\\";\\nimport {OnError} from \\\"../libraries/Types.sol\\\";\\nimport {UUPSProxiable} from \\\"../proxy/UUPSProxiable.sol\\\";\\nimport {Initializable} from \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title KlerosCore\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\ncontract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum PNKs needed to stake in the court.\\n uint256 alpha; // Basis point of PNKs that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court. Note that each court must support classic dispute kit.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrableV2 arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 pnkAtStakePerJuror; // The amount of PNKs at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 pnkPenalties; // The amount of PNKs collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumFeeRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumPnkRewardPaid; // Total sum of PNK paid to coherent jurors as a reward in this round.\\n IERC20 feeToken; // The token used for paying fees in this round.\\n uint256 drawIterations; // The number of iterations passed drawing the jurors for this round.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 pnkPenaltiesInRound; // The amount of PNKs collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n struct CurrencyRate {\\n bool feePaymentAccepted;\\n uint64 rateInEth;\\n uint8 rateDecimals;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 private constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 private constant NON_PAYABLE_AMOUNT = (2 ** 256 - 2) / 2; // An amount higher than the supply of ETH.\\n\\n address public governor; // The governor of the contract.\\n IERC20 public pinakion; // The Pinakion token contract.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n Court[] public courts; // The courts.\\n IDisputeKit[] public disputeKits; // Array of dispute kits.\\n Dispute[] public disputes; // The disputes.\\n mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(\\n uint96 indexed _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod\\n );\\n event DisputeKitCreated(uint256 indexed _disputeKitID, IDisputeKit indexed _disputeKitAddress);\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _pnkAmount,\\n int256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _pnkAmount,\\n uint256 _feeAmount,\\n IERC20 _feeToken\\n );\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _governor The governor's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n function initialize(\\n address _governor,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) external reinitializer(1) {\\n governor = _governor;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a dispute kit is not supported.\\n disputeKits.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKits.push(_disputeKit);\\n\\n emit DisputeKitCreated(Constants.DISPUTE_KIT_CLASSIC, _disputeKit);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(Constants.FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = Constants.FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(Constants.GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(Constants.GENERAL_COURT, Constants.DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /* @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n if (!success) revert UnsuccessfulCall();\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress) external onlyByGovernor {\\n uint256 disputeKitID = disputeKits.length;\\n disputeKits.push(_disputeKitAddress);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress);\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt();\\n if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit();\\n if (_parent == Constants.FORKING_COURT) revert InvalidForkingCourtAsParent();\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n // Check that Classic DK support was added.\\n if (!court.supportedDisputeKits[Constants.DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic();\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n function changeCourtParameters(\\n uint96 _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod\\n ) external onlyByGovernor {\\n Court storage court = courts[_courtID];\\n if (_courtID != Constants.GENERAL_COURT && courts[court.parent].minStake > _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n for (uint256 i = 0; i < court.children.length; i++) {\\n if (courts[court.children[i]].minStake < _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n }\\n court.minStake = _minStake;\\n court.hiddenVotes = _hiddenVotes;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(\\n _courtID,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod\\n );\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n // Classic dispute kit must be supported by all courts.\\n if (_disputeKitIDs[i] == Constants.DISPUTE_KIT_CLASSIC) {\\n revert CannotDisableClassicDK();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n /// @dev Changes the supported fee tokens.\\n /// @param _feeToken The fee token.\\n /// @param _accepted Whether the token is supported or not as a method of fee payment.\\n function changeAcceptedFeeTokens(IERC20 _feeToken, bool _accepted) external onlyByGovernor {\\n currencyRates[_feeToken].feePaymentAccepted = _accepted;\\n emit AcceptedFeeToken(_feeToken, _accepted);\\n }\\n\\n /// @dev Changes the currency rate of a fee token.\\n /// @param _feeToken The fee token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n function changeCurrencyRates(IERC20 _feeToken, uint64 _rateInEth, uint8 _rateDecimals) external onlyByGovernor {\\n currencyRates[_feeToken].rateInEth = _rateInEth;\\n currencyRates[_feeToken].rateDecimals = _rateDecimals;\\n emit NewCurrencyRate(_feeToken, _rateInEth, _rateDecimals);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// Note that the existing delayed stake will be nullified as non-relevant.\\n function setStake(uint96 _courtID, uint256 _newStake) external {\\n _setStake(msg.sender, _courtID, _newStake, false, OnError.Revert);\\n }\\n\\n /// @dev Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.\\n /// @param _account The account whose stake is being set.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs have already been transferred to the contract.\\n function setStakeBySortitionModule(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external {\\n if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly();\\n _setStake(_account, _courtID, _newStake, _alreadyTransferred, OnError.Return);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough();\\n\\n return _createDispute(_numberOfChoices, _extraData, Constants.NATIVE_CURRENCY, msg.value);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external override returns (uint256 disputeID) {\\n if (!currencyRates[_feeToken].feePaymentAccepted) revert TokenNotAccepted();\\n if (_feeAmount < arbitrationCost(_extraData, _feeToken)) revert ArbitrationFeesNotEnough();\\n\\n if (!_feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount)) revert TransferFailed();\\n return _createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount);\\n }\\n\\n function _createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) internal returns (uint256 disputeID) {\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n if (!courts[courtID].supportedDisputeKits[disputeKitID]) revert DisputeKitNotSupportedByCourt();\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrableV2(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKits[disputeKitID];\\n Court storage court = courts[dispute.courtID];\\n Round storage round = dispute.rounds.push();\\n\\n // Obtain the feeForJuror in the same currency as the _feeAmount\\n uint256 feeForJuror = (_feeToken == Constants.NATIVE_CURRENCY)\\n ? court.feeForJuror\\n : convertEthToTokenAmount(_feeToken, court.feeForJuror);\\n round.nbVotes = _feeAmount / feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = _feeAmount;\\n round.feeToken = IERC20(_feeToken);\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrableV2(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n if (\\n currentRound == 0 &&\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]\\n ) {\\n revert EvidenceNotPassedAndNotAppeal();\\n }\\n if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing();\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areCommitsAllCast(_disputeID)\\n ) {\\n revert CommitPeriodNotPassed();\\n }\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areVotesAllCast(_disputeID)\\n ) {\\n revert VotePeriodNotPassed();\\n }\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) {\\n revert AppealPeriodNotPassed();\\n }\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert DisputePeriodIsFinal();\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period != Period.evidence) revert NotEvidencePeriod();\\n\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 startIndex = round.drawIterations; // for gas: less storage reads\\n uint256 i;\\n while (i < _iterations && round.drawnJurors.length < round.nbVotes) {\\n address drawnAddress = disputeKit.draw(_disputeID, startIndex + i++);\\n if (drawnAddress == address(0)) {\\n continue;\\n }\\n sortitionModule.lockStake(drawnAddress, round.pnkAtStakePerJuror);\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n round.drawIterations += i;\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n if (msg.value < appealCost(_disputeID)) revert AppealFeesNotEnough();\\n\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.appeal) revert DisputeNotAppealable();\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n if (msg.sender != address(disputeKits[round.disputeKitID])) revert DisputeKitOnly();\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n // Switch to classic dispute kit if parent court doesn't support the current one.\\n newDisputeKitID = Constants.DISPUTE_KIT_CLASSIC;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKits[extraRound.disputeKitID].createDispute(\\n _disputeID,\\n _numberOfChoices,\\n _extraData,\\n extraRound.nbVotes\\n );\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n\\n Round storage round = dispute.rounds[_round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 pnkPenaltiesInRoundCache = round.pnkPenalties; // For saving gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect the PNK penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n pnkPenaltiesInRoundCache = _executePenalties(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n }\\n }\\n if (round.pnkPenalties != pnkPenaltiesInRoundCache) {\\n round.pnkPenalties = pnkPenaltiesInRoundCache; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return pnkPenaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.pnkAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.pnkPenaltiesInRound += penalty;\\n\\n // Unlock the PNKs affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n sortitionModule.unlockStake(account, penalty);\\n\\n // Apply the penalty to the staked PNKs.\\n sortitionModule.penalizeStake(account, penalty);\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n -int256(penalty),\\n 0,\\n round.feeToken\\n );\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(round.totalFeesForJurors);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, round.totalFeesForJurors);\\n }\\n pinakion.safeTransfer(governor, _params.pnkPenaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.pnkPenaltiesInRound,\\n round.totalFeesForJurors,\\n round.feeToken\\n );\\n }\\n return _params.pnkPenaltiesInRound;\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the PNKs of the juror for this round.\\n sortitionModule.unlockStake(account, pnkLocked);\\n\\n // Give back the locked PNKs in case the juror fully unstaked earlier.\\n if (!sortitionModule.isJurorStaked(account)) {\\n pinakion.safeTransfer(account, pnkLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumPnkRewardPaid += pnkReward;\\n uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumFeeRewardPaid += feeReward;\\n pinakion.safeTransfer(account, pnkReward);\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(account).send(feeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(account, feeReward);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(pnkReward),\\n int256(feeReward),\\n round.feeToken\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverPnkReward = _params.pnkPenaltiesInRound - round.sumPnkRewardPaid;\\n uint256 leftoverFeeReward = round.totalFeesForJurors - round.sumFeeRewardPaid;\\n if (leftoverPnkReward != 0 || leftoverFeeReward != 0) {\\n if (leftoverPnkReward != 0) {\\n pinakion.safeTransfer(governor, leftoverPnkReward);\\n }\\n if (leftoverFeeReward != 0) {\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(leftoverFeeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, leftoverFeeReward);\\n }\\n }\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n leftoverPnkReward,\\n leftoverFeeReward,\\n round.feeToken\\n );\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n if (dispute.ruled) revert RulingAlreadyExecuted();\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Compute the cost of arbitration denominated in ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) public view override returns (uint256 cost) {\\n cost = convertEthToTokenAmount(_feeToken, arbitrationCost(_extraData));\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == Constants.GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(uint256 _disputeID, uint256 _round) external view returns (Round memory) {\\n return disputes[_disputeID].rounds[_round];\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n timesPerPeriod = courts[_courtID].timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitsLength() external view returns (uint256) {\\n return disputeKits.length;\\n }\\n\\n function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) {\\n return (_amountInEth * 10 ** currencyRates[_toToken].rateDecimals) / currencyRates[_toToken].rateInEth;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support. Note that classic dispute kit should always be enabled.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev If called only once then set _onError to Revert, otherwise set it to Return\\n /// @param _account The account to set the stake for.\\n /// @param _courtID The ID of the court to set the stake for.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs were already transferred to/from the staking contract.\\n /// @param _onError Whether to revert or return false on error.\\n /// @return Whether the stake was successfully set or not.\\n function _setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred,\\n OnError _onError\\n ) internal returns (bool) {\\n if (_courtID == Constants.FORKING_COURT || _courtID > courts.length) {\\n _stakingFailed(_onError); // Staking directly into the forking court is not allowed.\\n return false;\\n }\\n if (_newStake != 0 && _newStake < courts[_courtID].minStake) {\\n _stakingFailed(_onError); // Staking less than the minimum stake is not allowed.\\n return false;\\n }\\n (uint256 pnkDeposit, uint256 pnkWithdrawal, bool sortitionSuccess) = sortitionModule.setStake(\\n _account,\\n _courtID,\\n _newStake,\\n _alreadyTransferred\\n );\\n if (!sortitionSuccess) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n if (pnkDeposit > 0) {\\n if (!pinakion.safeTransferFrom(_account, address(this), pnkDeposit)) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n }\\n if (pnkWithdrawal > 0) {\\n if (!pinakion.safeTransfer(_account, pnkWithdrawal)) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @dev It may revert depending on the _onError parameter.\\n function _stakingFailed(OnError _onError) internal pure {\\n if (_onError == OnError.Return) return;\\n revert StakingFailed();\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == Constants.FORKING_COURT || courtID >= courts.length) {\\n courtID = Constants.GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = Constants.DEFAULT_NB_OF_JURORS;\\n }\\n if (disputeKitID == Constants.NULL_DISPUTE_KIT || disputeKitID >= disputeKits.length) {\\n disputeKitID = Constants.DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = Constants.GENERAL_COURT;\\n minJurors = Constants.DEFAULT_NB_OF_JURORS;\\n disputeKitID = Constants.DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error DisputeKitOnly();\\n error SortitionModuleOnly();\\n error UnsuccessfulCall();\\n error InvalidDisputKitParent();\\n error DepthLevelMax();\\n error MinStakeLowerThanParentCourt();\\n error UnsupportedDisputeKit();\\n error InvalidForkingCourtAsParent();\\n error WrongDisputeKitIndex();\\n error CannotDisableClassicDK();\\n error ArraysLengthMismatch();\\n error StakingFailed();\\n error ArbitrationFeesNotEnough();\\n error DisputeKitNotSupportedByCourt();\\n error MustSupportDisputeKitClassic();\\n error TokenNotAccepted();\\n error EvidenceNotPassedAndNotAppeal();\\n error DisputeStillDrawing();\\n error CommitPeriodNotPassed();\\n error VotePeriodNotPassed();\\n error AppealPeriodNotPassed();\\n error NotEvidencePeriod();\\n error AppealFeesNotEnough();\\n error DisputeNotAppealable();\\n error NotExecutionPeriod();\\n error RulingAlreadyExecuted();\\n error DisputePeriodIsFinal();\\n error TransferFailed();\\n}\\n\",\"keccak256\":\"0x43205bc90f6965b5c1380effd2c29994f6dfea074696e39d5df037343a768d6b\",\"license\":\"MIT\"},\"src/arbitration/SortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @custom:authors: [@epiqueras, @unknownunknown1, @jaybuidl, @shotaronowhere]\\n * @custom:reviewers: []\\n * @custom:auditors: []\\n * @custom:bounties: []\\n * @custom:deployments: []\\n */\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./KlerosCore.sol\\\";\\nimport \\\"./interfaces/ISortitionModule.sol\\\";\\nimport \\\"./interfaces/IDisputeKit.sol\\\";\\nimport \\\"../rng/RNG.sol\\\";\\nimport \\\"../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../proxy/Initializable.sol\\\";\\nimport \\\"../libraries/Constants.sol\\\";\\n\\n/// @title SortitionModule\\n/// @dev A factory of trees that keeps track of staked values for sortition.\\ncontract SortitionModule is ISortitionModule, UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum PreStakeHookResult {\\n ok, // Correct phase. All checks are passed.\\n stakeDelayedAlreadyTransferred, // Wrong phase but stake is increased, so transfer the tokens without updating the drawing chance.\\n stakeDelayedNotTransferred, // Wrong phase and stake is decreased. Delay the token transfer and drawing chance update.\\n failed // Checks didn't pass. Do no changes.\\n }\\n\\n struct SortitionSumTree {\\n uint256 K; // The maximum number of children per node.\\n // We use this to keep track of vacant positions in the tree after removing a leaf. This is for keeping the tree as balanced as possible without spending gas on moving nodes around.\\n uint256[] stack;\\n uint256[] nodes;\\n // Two-way mapping of IDs to node indexes. Note that node index 0 is reserved for the root node, and means the ID does not have a node.\\n mapping(bytes32 => uint256) IDsToNodeIndexes;\\n mapping(uint256 => bytes32) nodeIndexesToIDs;\\n }\\n\\n struct DelayedStake {\\n address account; // The address of the juror.\\n uint96 courtID; // The ID of the court.\\n uint256 stake; // The new stake.\\n bool alreadyTransferred; // True if tokens were already transferred before delayed stake's execution.\\n }\\n\\n struct Juror {\\n uint96[] courtIDs; // The IDs of courts where the juror's stake path ends. A stake path is a path from the general court to a court the juror directly staked in using `_setStake`.\\n uint256 stakedPnk; // The juror's total amount of tokens staked in subcourts. Reflects actual pnk balance.\\n uint256 lockedPnk; // The juror's total amount of tokens locked in disputes. Can reflect actual pnk balance when stakedPnk are fully withdrawn.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant MAX_STAKE_PATHS = 4; // The maximum number of stake paths a juror can have.\\n uint256 public constant DEFAULT_K = 6; // Default number of children per node.\\n\\n address public governor; // The governor of the contract.\\n KlerosCore public core; // The core arbitrator contract.\\n Phase public phase; // The current phase.\\n uint256 public minStakingTime; // The time after which the phase can be switched to Drawing if there are open disputes.\\n uint256 public maxDrawingTime; // The time after which the phase can be switched back to Staking.\\n uint256 public lastPhaseChange; // The last time the phase was changed.\\n uint256 public randomNumberRequestBlock; // Number of the block when RNG request was made.\\n uint256 public disputesWithoutJurors; // The number of disputes that have not finished drawing jurors.\\n RNG public rng; // The random number generator.\\n uint256 public randomNumber; // Random number returned by RNG.\\n uint256 public rngLookahead; // Minimal block distance between requesting and obtaining a random number.\\n uint256 public delayedStakeWriteIndex; // The index of the last `delayedStake` item that was written to the array. 0 index is skipped.\\n uint256 public delayedStakeReadIndex; // The index of the next `delayedStake` item that should be processed. Starts at 1 because 0 index is skipped.\\n mapping(bytes32 => SortitionSumTree) sortitionSumTrees; // The mapping trees by keys.\\n mapping(address => Juror) public jurors; // The jurors.\\n mapping(uint256 => DelayedStake) public delayedStakes; // Stores the stakes that were changed during Drawing phase, to update them when the phase is switched to Staking.\\n mapping(address => mapping(uint96 => uint256)) public latestDelayedStakeIndex; // Maps the juror to its latest delayed stake. If there is already a delayed stake for this juror then it'll be replaced. latestDelayedStakeIndex[juror][courtID].\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event StakeSet(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayedNotTransferred(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayedAlreadyTransferred(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayedAlreadyTransferredWithdrawn(address indexed _address, uint96 indexed _courtID, uint256 _amount);\\n event StakeLocked(address indexed _address, uint256 _relativeAmount, bool _unlock);\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(address(governor) == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n modifier onlyByCore() {\\n require(address(core) == msg.sender, \\\"Access not allowed: KlerosCore only.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _core The KlerosCore.\\n /// @param _minStakingTime Minimal time to stake\\n /// @param _maxDrawingTime Time after which the drawing phase can be switched\\n /// @param _rng The random number generator.\\n /// @param _rngLookahead Lookahead value for rng.\\n function initialize(\\n address _governor,\\n KlerosCore _core,\\n uint256 _minStakingTime,\\n uint256 _maxDrawingTime,\\n RNG _rng,\\n uint256 _rngLookahead\\n ) external reinitializer(1) {\\n governor = _governor;\\n core = _core;\\n minStakingTime = _minStakingTime;\\n maxDrawingTime = _maxDrawingTime;\\n lastPhaseChange = block.timestamp;\\n rng = _rng;\\n rngLookahead = _rngLookahead;\\n delayedStakeReadIndex = 1;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Changes the `minStakingTime` storage variable.\\n /// @param _minStakingTime The new value for the `minStakingTime` storage variable.\\n function changeMinStakingTime(uint256 _minStakingTime) external onlyByGovernor {\\n minStakingTime = _minStakingTime;\\n }\\n\\n /// @dev Changes the `maxDrawingTime` storage variable.\\n /// @param _maxDrawingTime The new value for the `maxDrawingTime` storage variable.\\n function changeMaxDrawingTime(uint256 _maxDrawingTime) external onlyByGovernor {\\n maxDrawingTime = _maxDrawingTime;\\n }\\n\\n /// @dev Changes the `_rng` and `_rngLookahead` storage variables.\\n /// @param _rng The new value for the `RNGenerator` storage variable.\\n /// @param _rngLookahead The new value for the `rngLookahead` storage variable.\\n function changeRandomNumberGenerator(RNG _rng, uint256 _rngLookahead) external onlyByGovernor {\\n rng = _rng;\\n rngLookahead = _rngLookahead;\\n if (phase == Phase.generating) {\\n rng.requestRandomness(block.number + rngLookahead);\\n randomNumberRequestBlock = block.number;\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function passPhase() external {\\n if (phase == Phase.staking) {\\n require(\\n block.timestamp - lastPhaseChange >= minStakingTime,\\n \\\"The minimum staking time has not passed yet.\\\"\\n );\\n require(disputesWithoutJurors > 0, \\\"There are no disputes that need jurors.\\\");\\n rng.requestRandomness(block.number + rngLookahead);\\n randomNumberRequestBlock = block.number;\\n phase = Phase.generating;\\n } else if (phase == Phase.generating) {\\n randomNumber = rng.receiveRandomness(randomNumberRequestBlock + rngLookahead);\\n require(randomNumber != 0, \\\"Random number is not ready yet\\\");\\n phase = Phase.drawing;\\n } else if (phase == Phase.drawing) {\\n require(\\n disputesWithoutJurors == 0 || block.timestamp - lastPhaseChange >= maxDrawingTime,\\n \\\"There are still disputes without jurors and the maximum drawing time has not passed yet.\\\"\\n );\\n phase = Phase.staking;\\n }\\n\\n lastPhaseChange = block.timestamp;\\n emit NewPhase(phase);\\n }\\n\\n /// @dev Create a sortition sum tree at the specified key.\\n /// @param _key The key of the new tree.\\n /// @param _extraData Extra data that contains the number of children each node in the tree should have.\\n function createTree(bytes32 _key, bytes memory _extraData) external override onlyByCore {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint256 K = _extraDataToTreeK(_extraData);\\n require(tree.K == 0, \\\"Tree already exists.\\\");\\n require(K > 1, \\\"K must be greater than one.\\\");\\n tree.K = K;\\n tree.nodes.push(0);\\n }\\n\\n /// @dev Executes the next delayed stakes.\\n /// @param _iterations The number of delayed stakes to execute.\\n function executeDelayedStakes(uint256 _iterations) external {\\n require(phase == Phase.staking, \\\"Should be in Staking phase.\\\");\\n\\n uint256 actualIterations = (delayedStakeReadIndex + _iterations) - 1 > delayedStakeWriteIndex\\n ? (delayedStakeWriteIndex - delayedStakeReadIndex) + 1\\n : _iterations;\\n uint256 newDelayedStakeReadIndex = delayedStakeReadIndex + actualIterations;\\n\\n for (uint256 i = delayedStakeReadIndex; i < newDelayedStakeReadIndex; i++) {\\n DelayedStake storage delayedStake = delayedStakes[i];\\n // Delayed stake could've been manually removed already. In this case simply move on to the next item.\\n if (delayedStake.account != address(0)) {\\n core.setStakeBySortitionModule(\\n delayedStake.account,\\n delayedStake.courtID,\\n delayedStake.stake,\\n delayedStake.alreadyTransferred\\n );\\n delete latestDelayedStakeIndex[delayedStake.account][delayedStake.courtID];\\n delete delayedStakes[i];\\n }\\n }\\n delayedStakeReadIndex = newDelayedStakeReadIndex;\\n }\\n\\n function createDisputeHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore {\\n disputesWithoutJurors++;\\n }\\n\\n function postDrawHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore {\\n disputesWithoutJurors--;\\n }\\n\\n /// @dev Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().\\n /// @param _randomNumber Random number returned by RNG contract.\\n function notifyRandomNumber(uint256 _randomNumber) public override {}\\n\\n /// @dev Sets the specified juror's stake in a court.\\n /// `O(n + p * log_k(j))` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The address of the juror.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred True if the tokens were already transferred from juror. Only relevant for delayed stakes.\\n /// @return pnkDeposit The amount of PNK to be deposited.\\n /// @return pnkWithdrawal The amount of PNK to be withdrawn.\\n /// @return succeeded True if the call succeeded, false otherwise.\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external override onlyByCore returns (uint256 pnkDeposit, uint256 pnkWithdrawal, bool succeeded) {\\n Juror storage juror = jurors[_account];\\n uint256 currentStake = stakeOf(_account, _courtID);\\n\\n uint256 nbCourts = juror.courtIDs.length;\\n if (_newStake == 0 && (nbCourts >= MAX_STAKE_PATHS || currentStake == 0)) {\\n return (0, 0, false); // Prevent staking beyond MAX_STAKE_PATHS but unstaking is always allowed.\\n }\\n\\n if (phase != Phase.staking) {\\n pnkWithdrawal = _deleteDelayedStake(_courtID, _account);\\n\\n // Store the stake change as delayed, to be applied when the phase switches back to Staking.\\n DelayedStake storage delayedStake = delayedStakes[++delayedStakeWriteIndex];\\n delayedStake.account = _account;\\n delayedStake.courtID = _courtID;\\n delayedStake.stake = _newStake;\\n latestDelayedStakeIndex[_account][_courtID] = delayedStakeWriteIndex;\\n if (_newStake > currentStake) {\\n // PNK deposit: tokens are transferred now.\\n delayedStake.alreadyTransferred = true;\\n pnkDeposit = _increaseStake(juror, _courtID, _newStake, currentStake);\\n emit StakeDelayedAlreadyTransferred(_account, _courtID, _newStake);\\n } else {\\n // PNK withdrawal: tokens are not transferred yet.\\n emit StakeDelayedNotTransferred(_account, _courtID, _newStake);\\n }\\n return (pnkDeposit, pnkWithdrawal, true);\\n }\\n\\n // Current phase is Staking: set normal stakes or delayed stakes (which may have been already transferred).\\n if (_newStake >= currentStake) {\\n if (!_alreadyTransferred) {\\n pnkDeposit = _increaseStake(juror, _courtID, _newStake, currentStake);\\n }\\n } else {\\n pnkWithdrawal += _decreaseStake(juror, _courtID, _newStake, currentStake);\\n }\\n\\n bytes32 stakePathID = _accountAndCourtIDToStakePathID(_account, _courtID);\\n bool finished = false;\\n uint96 currenCourtID = _courtID;\\n while (!finished) {\\n // Tokens are also implicitly staked in parent courts through sortition module to increase the chance of being drawn.\\n _set(bytes32(uint256(currenCourtID)), _newStake, stakePathID);\\n if (currenCourtID == Constants.GENERAL_COURT) {\\n finished = true;\\n } else {\\n (currenCourtID, , , , , , ) = core.courts(currenCourtID);\\n }\\n }\\n emit StakeSet(_account, _courtID, _newStake);\\n return (pnkDeposit, pnkWithdrawal, true);\\n }\\n\\n /// @dev Checks if there is already a delayed stake. In this case consider it irrelevant and remove it.\\n /// @param _courtID ID of the court.\\n /// @param _juror Juror whose stake to check.\\n function _deleteDelayedStake(uint96 _courtID, address _juror) internal returns (uint256 actualAmountToWithdraw) {\\n uint256 latestIndex = latestDelayedStakeIndex[_juror][_courtID];\\n if (latestIndex != 0) {\\n DelayedStake storage delayedStake = delayedStakes[latestIndex];\\n if (delayedStake.alreadyTransferred) {\\n // Sortition stake represents the stake value that was last updated during Staking phase.\\n uint256 sortitionStake = stakeOf(_juror, _courtID);\\n\\n // Withdraw the tokens that were added with the latest delayed stake.\\n uint256 amountToWithdraw = delayedStake.stake - sortitionStake;\\n actualAmountToWithdraw = amountToWithdraw;\\n Juror storage juror = jurors[_juror];\\n if (juror.stakedPnk <= actualAmountToWithdraw) {\\n actualAmountToWithdraw = juror.stakedPnk;\\n }\\n\\n // StakePnk can become lower because of penalty.\\n juror.stakedPnk -= actualAmountToWithdraw;\\n emit StakeDelayedAlreadyTransferredWithdrawn(_juror, _courtID, amountToWithdraw);\\n\\n if (sortitionStake == 0) {\\n // Delete the court otherwise it will be duplicated after staking.\\n for (uint256 i = juror.courtIDs.length; i > 0; i--) {\\n if (juror.courtIDs[i - 1] == _courtID) {\\n juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1];\\n juror.courtIDs.pop();\\n break;\\n }\\n }\\n }\\n }\\n delete delayedStakes[latestIndex];\\n delete latestDelayedStakeIndex[_juror][_courtID];\\n }\\n }\\n\\n function _increaseStake(\\n Juror storage juror,\\n uint96 _courtID,\\n uint256 _newStake,\\n uint256 _currentStake\\n ) internal returns (uint256 transferredAmount) {\\n // Stake increase\\n // When stakedPnk becomes lower than lockedPnk count the locked tokens in when transferring tokens from juror.\\n // (E.g. stakedPnk = 0, lockedPnk = 150) which can happen if the juror unstaked fully while having some tokens locked.\\n uint256 previouslyLocked = (juror.lockedPnk >= juror.stakedPnk) ? juror.lockedPnk - juror.stakedPnk : 0; // underflow guard\\n transferredAmount = (_newStake >= _currentStake + previouslyLocked) // underflow guard\\n ? _newStake - _currentStake - previouslyLocked\\n : 0;\\n if (_currentStake == 0) {\\n juror.courtIDs.push(_courtID);\\n }\\n // stakedPnk can become async with _currentStake (e.g. after penalty).\\n juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake;\\n }\\n\\n function _decreaseStake(\\n Juror storage juror,\\n uint96 _courtID,\\n uint256 _newStake,\\n uint256 _currentStake\\n ) internal returns (uint256 transferredAmount) {\\n // Stakes can be partially delayed only when stake is increased.\\n // Stake decrease: make sure locked tokens always stay in the contract. They can only be released during Execution.\\n if (juror.stakedPnk >= _currentStake - _newStake + juror.lockedPnk) {\\n // We have enough pnk staked to afford withdrawal while keeping locked tokens.\\n transferredAmount = _currentStake - _newStake;\\n } else if (juror.stakedPnk >= juror.lockedPnk) {\\n // Can't afford withdrawing the current stake fully. Take whatever is available while keeping locked tokens.\\n transferredAmount = juror.stakedPnk - juror.lockedPnk;\\n }\\n if (_newStake == 0) {\\n for (uint256 i = juror.courtIDs.length; i > 0; i--) {\\n if (juror.courtIDs[i - 1] == _courtID) {\\n juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1];\\n juror.courtIDs.pop();\\n break;\\n }\\n }\\n }\\n // stakedPnk can become async with _currentStake (e.g. after penalty).\\n juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake;\\n }\\n\\n function lockStake(address _account, uint256 _relativeAmount) external override onlyByCore {\\n jurors[_account].lockedPnk += _relativeAmount;\\n emit StakeLocked(_account, _relativeAmount, false);\\n }\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external override onlyByCore {\\n jurors[_account].lockedPnk -= _relativeAmount;\\n emit StakeLocked(_account, _relativeAmount, true);\\n }\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external override onlyByCore {\\n Juror storage juror = jurors[_account];\\n if (juror.stakedPnk >= _relativeAmount) {\\n juror.stakedPnk -= _relativeAmount;\\n } else {\\n juror.stakedPnk = 0; // stakedPnk might become lower after manual unstaking, but lockedPnk will always cover the difference.\\n }\\n }\\n\\n /// @dev Unstakes the inactive juror from all courts.\\n /// `O(n * (p * log_k(j)) )` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The juror to unstake.\\n function setJurorInactive(address _account) external override onlyByCore {\\n uint96[] memory courtIDs = getJurorCourtIDs(_account);\\n for (uint256 j = courtIDs.length; j > 0; j--) {\\n core.setStakeBySortitionModule(_account, courtIDs[j - 1], 0, false);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Draw an ID from a tree using a number.\\n /// Note that this function reverts if the sum of all values in the tree is 0.\\n /// @param _key The key of the tree.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core.\\n /// @param _nonce Nonce to hash with random number.\\n /// @return drawnAddress The drawn address.\\n /// `O(k * log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function draw(\\n bytes32 _key,\\n uint256 _coreDisputeID,\\n uint256 _nonce\\n ) public view override returns (address drawnAddress) {\\n require(phase == Phase.drawing, \\\"Wrong phase.\\\");\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n\\n if (tree.nodes[0] == 0) {\\n return address(0); // No jurors staked.\\n }\\n\\n uint256 currentDrawnNumber = uint256(keccak256(abi.encodePacked(randomNumber, _coreDisputeID, _nonce))) %\\n tree.nodes[0];\\n\\n // While it still has children\\n uint256 treeIndex = 0;\\n while ((tree.K * treeIndex) + 1 < tree.nodes.length) {\\n for (uint256 i = 1; i <= tree.K; i++) {\\n // Loop over children.\\n uint256 nodeIndex = (tree.K * treeIndex) + i;\\n uint256 nodeValue = tree.nodes[nodeIndex];\\n\\n if (currentDrawnNumber >= nodeValue) {\\n // Go to the next child.\\n currentDrawnNumber -= nodeValue;\\n } else {\\n // Pick this child.\\n treeIndex = nodeIndex;\\n break;\\n }\\n }\\n }\\n drawnAddress = _stakePathIDToAccount(tree.nodeIndexesToIDs[treeIndex]);\\n }\\n\\n /// @dev Get the stake of a juror in a court.\\n /// @param _juror The address of the juror.\\n /// @param _courtID The ID of the court.\\n /// @return value The stake of the juror in the court.\\n function stakeOf(address _juror, uint96 _courtID) public view returns (uint256) {\\n bytes32 stakePathID = _accountAndCourtIDToStakePathID(_juror, _courtID);\\n return stakeOf(bytes32(uint256(_courtID)), stakePathID);\\n }\\n\\n /// @dev Get the stake of a juror in a court.\\n /// @param _key The key of the tree, corresponding to a court.\\n /// @param _ID The stake path ID, corresponding to a juror.\\n /// @return The stake of the juror in the court.\\n function stakeOf(bytes32 _key, bytes32 _ID) public view returns (uint256) {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint treeIndex = tree.IDsToNodeIndexes[_ID];\\n if (treeIndex == 0) {\\n return 0;\\n }\\n return tree.nodes[treeIndex];\\n }\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n )\\n external\\n view\\n override\\n returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts)\\n {\\n Juror storage juror = jurors[_juror];\\n totalStaked = juror.stakedPnk;\\n totalLocked = juror.lockedPnk;\\n stakedInCourt = stakeOf(_juror, _courtID);\\n nbCourts = juror.courtIDs.length;\\n }\\n\\n /// @dev Gets the court identifiers where a specific `_juror` has staked.\\n /// @param _juror The address of the juror.\\n function getJurorCourtIDs(address _juror) public view override returns (uint96[] memory) {\\n return jurors[_juror].courtIDs;\\n }\\n\\n function isJurorStaked(address _juror) external view override returns (bool) {\\n return jurors[_juror].stakedPnk > 0;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Update all the parents of a node.\\n /// @param _key The key of the tree to update.\\n /// @param _treeIndex The index of the node to start from.\\n /// @param _plusOrMinus Whether to add (true) or substract (false).\\n /// @param _value The value to add or substract.\\n /// `O(log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function _updateParents(bytes32 _key, uint256 _treeIndex, bool _plusOrMinus, uint256 _value) private {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n\\n uint256 parentIndex = _treeIndex;\\n while (parentIndex != 0) {\\n parentIndex = (parentIndex - 1) / tree.K;\\n tree.nodes[parentIndex] = _plusOrMinus\\n ? tree.nodes[parentIndex] + _value\\n : tree.nodes[parentIndex] - _value;\\n }\\n }\\n\\n /// @dev Retrieves a juror's address from the stake path ID.\\n /// @param _stakePathID The stake path ID to unpack.\\n /// @return account The account.\\n function _stakePathIDToAccount(bytes32 _stakePathID) internal pure returns (address account) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n let ptr := mload(0x40)\\n for {\\n let i := 0x00\\n } lt(i, 0x14) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(add(ptr, 0x0c), i), byte(i, _stakePathID))\\n }\\n account := mload(ptr)\\n }\\n }\\n\\n function _extraDataToTreeK(bytes memory _extraData) internal pure returns (uint256 K) {\\n if (_extraData.length >= 32) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n K := mload(add(_extraData, 0x20))\\n }\\n } else {\\n K = DEFAULT_K;\\n }\\n }\\n\\n /// @dev Set a value in a tree.\\n /// @param _key The key of the tree.\\n /// @param _value The new value.\\n /// @param _ID The ID of the value.\\n /// `O(log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function _set(bytes32 _key, uint256 _value, bytes32 _ID) internal {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint256 treeIndex = tree.IDsToNodeIndexes[_ID];\\n\\n if (treeIndex == 0) {\\n // No existing node.\\n if (_value != 0) {\\n // Non zero value.\\n // Append.\\n // Add node.\\n if (tree.stack.length == 0) {\\n // No vacant spots.\\n // Get the index and append the value.\\n treeIndex = tree.nodes.length;\\n tree.nodes.push(_value);\\n\\n // Potentially append a new node and make the parent a sum node.\\n if (treeIndex != 1 && (treeIndex - 1) % tree.K == 0) {\\n // Is first child.\\n uint256 parentIndex = treeIndex / tree.K;\\n bytes32 parentID = tree.nodeIndexesToIDs[parentIndex];\\n uint256 newIndex = treeIndex + 1;\\n tree.nodes.push(tree.nodes[parentIndex]);\\n delete tree.nodeIndexesToIDs[parentIndex];\\n tree.IDsToNodeIndexes[parentID] = newIndex;\\n tree.nodeIndexesToIDs[newIndex] = parentID;\\n }\\n } else {\\n // Some vacant spot.\\n // Pop the stack and append the value.\\n treeIndex = tree.stack[tree.stack.length - 1];\\n tree.stack.pop();\\n tree.nodes[treeIndex] = _value;\\n }\\n\\n // Add label.\\n tree.IDsToNodeIndexes[_ID] = treeIndex;\\n tree.nodeIndexesToIDs[treeIndex] = _ID;\\n\\n _updateParents(_key, treeIndex, true, _value);\\n }\\n } else {\\n // Existing node.\\n if (_value == 0) {\\n // Zero value.\\n // Remove.\\n // Remember value and set to 0.\\n uint256 value = tree.nodes[treeIndex];\\n tree.nodes[treeIndex] = 0;\\n\\n // Push to stack.\\n tree.stack.push(treeIndex);\\n\\n // Clear label.\\n delete tree.IDsToNodeIndexes[_ID];\\n delete tree.nodeIndexesToIDs[treeIndex];\\n\\n _updateParents(_key, treeIndex, false, value);\\n } else if (_value != tree.nodes[treeIndex]) {\\n // New, non zero value.\\n // Set.\\n bool plusOrMinus = tree.nodes[treeIndex] <= _value;\\n uint256 plusOrMinusValue = plusOrMinus\\n ? _value - tree.nodes[treeIndex]\\n : tree.nodes[treeIndex] - _value;\\n tree.nodes[treeIndex] = _value;\\n\\n _updateParents(_key, treeIndex, plusOrMinus, plusOrMinusValue);\\n }\\n }\\n }\\n\\n /// @dev Packs an account and a court ID into a stake path ID.\\n /// @param _account The address of the juror to pack.\\n /// @param _courtID The court ID to pack.\\n /// @return stakePathID The stake path ID.\\n function _accountAndCourtIDToStakePathID(\\n address _account,\\n uint96 _courtID\\n ) internal pure returns (bytes32 stakePathID) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n let ptr := mload(0x40)\\n for {\\n let i := 0x00\\n } lt(i, 0x14) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(ptr, i), byte(add(0x0c, i), _account))\\n }\\n for {\\n let i := 0x14\\n } lt(i, 0x20) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(ptr, i), byte(i, _courtID))\\n }\\n stakePathID := mload(ptr)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4dd725bb26738ca3d7caa389f80fd50c10de2a9925b3f1d7e70348885c108102\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _juror Address of the juror.\\n /// @param _voteIDs The identifiers of the votes in the dispute.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event VoteCast(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256[] _voteIDs,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _nonce Nonce.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID, uint256 _nonce) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0x7fe6b1d9b991cc327cc5895f34208a7b1e3b6ebf8efb20fcb9f3ff0f40d2d209\",\"license\":\"MIT\"},\"src/arbitration/interfaces/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external returns (uint256 pnkDeposit, uint256 pnkWithdrawal, bool succeeded);\\n\\n function setJurorInactive(address _account) external;\\n\\n function lockStake(address _account, uint256 _relativeAmount) external;\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external;\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _nonce) external view returns (address);\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts);\\n\\n function getJurorCourtIDs(address _juror) external view returns (uint96[] memory);\\n\\n function isJurorStaked(address _juror) external view returns (bool);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0xa6d79053edfe04f7d3c8ad9b9ce3f182e45f2f74be40a77a304a93168549c474\",\"license\":\"MIT\"},\"src/libraries/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title Constants\\nlibrary Constants {\\n // Courts\\n uint96 public constant FORKING_COURT = 0; // Index of the forking court.\\n uint96 public constant GENERAL_COURT = 1; // Index of the default (general) court.\\n\\n // Dispute Kits\\n uint256 public constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\n uint256 public constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n\\n // Defaults\\n uint256 public constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute.\\n IERC20 public constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1.\\n}\\n\",\"keccak256\":\"0xde8fd28a18669261b052aebb00bf09ec592bb9298fa5efc76ca8606e0c7dbb25\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"},\"src/libraries/Types.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nenum OnError {\\n Revert,\\n Return\\n}\\n\",\"keccak256\":\"0xc7deebd8227dfaa46a36ae8d2c24fe1b5d5c776ab963b44943829ab4058b5701\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"},\"src/rng/RNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\ninterface RNG {\\n /// @dev Request a random number.\\n /// @param _block Block linked to the request.\\n function requestRandomness(uint256 _block) external;\\n\\n /// @dev Receive the random number.\\n /// @param _block Block the random number is linked to.\\n /// @return randomNumber Random Number. If the number is not ready or has not been required 0 instead.\\n function receiveRandomness(uint256 _block) external returns (uint256 randomNumber);\\n}\\n\",\"keccak256\":\"0x5afe7121f49aebe72218df356bd91b66c2171b9ad15e7945a15a091784291a43\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000d9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff1615620000765760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b0390811614620000d65780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051612e7e62000103600039600081816112550152818161127e01526114760152612e7e6000f3fe6080604052600436106102465760003560e01c80637dc38f1411610139578063c1572618116100b6578063dca5f6b01161007a578063dca5f6b0146106c6578063dd5e5cb514610712578063e534710d14610732578063f216de4c1461076a578063f2f4eb261461078a578063f6b4d82d146107aa57600080fd5b8063c15726181461061a578063ccbac9f514610630578063d09f392d14610646578063d1c1df4814610666578063d605787b146106a657600080fd5b8063b1c9fe6e116100fd578063b1c9fe6e1461058b578063b4a61608146105b9578063b5d69e99146105ce578063b888adfa146105ee578063c057eca71461060457600080fd5b80637dc38f14146104d8578063823cfd70146104ee578063965af6c71461050e578063a2473cc11461052e578063a5861b901461054e57600080fd5b80634c70a0d6116101c757806354812d171161018b57806354812d171461041757806356acb050146104375780635d2d78461461044d5780636624192f1461046d57806376fa9fc5146104b857600080fd5b80634c70a0d6146103825780634dbbebbc146103a25780634f1ef286146103c257806352d1902d146103d5578063543f8a36146103ea57600080fd5b80631b92bbbe1161020e5780631b92bbbe146102ee57806321e1625e1461030457806321ea9b3f1461032457806335975f4a14610342578063477a655c1461036257600080fd5b8063034327441461024b5780630b274f2e146102745780630b51806d1461028b5780630c340a24146102a05780630e083ec9146102d8575b600080fd5b34801561025757600080fd5b5061026160065481565b6040519081526020015b60405180910390f35b34801561028057600080fd5b50610289610814565b005b34801561029757600080fd5b50610261600681565b3480156102ac57600080fd5b506000546102c0906001600160a01b031681565b6040516001600160a01b03909116815260200161026b565b3480156102e457600080fd5b50610261600a5481565b3480156102fa57600080fd5b5061026160035481565b34801561031057600080fd5b5061028961031f366004612852565b610bec565b34801561033057600080fd5b5061028961033f36600461287e565b50565b34801561034e57600080fd5b5061028961035d36600461287e565b610c8f565b34801561036e57600080fd5b5061028961037d36600461293a565b610e7d565b34801561038e57600080fd5b506102c061039d366004612981565b610f74565b3480156103ae57600080fd5b506102896103bd366004612852565b611158565b6102896103d03660046129ad565b611241565b3480156103e157600080fd5b50610261611469565b3480156103f657600080fd5b5061040a6104053660046129e7565b6114c7565b60405161026b9190612a04565b34801561042357600080fd5b50610289610432366004612a51565b611565565b34801561044357600080fd5b50610261600b5481565b34801561045957600080fd5b50610289610468366004612ab8565b61168b565b34801561047957600080fd5b506104a86104883660046129e7565b6001600160a01b03166000908152600d6020526040902060010154151590565b604051901515815260200161026b565b3480156104c457600080fd5b506102616104d3366004612ab8565b6116ce565b3480156104e457600080fd5b5061026160095481565b3480156104fa57600080fd5b5061028961050936600461287e565b611729565b34801561051a57600080fd5b50610289610529366004612852565b611758565b34801561053a57600080fd5b50610261610549366004612aef565b6117f3565b34801561055a57600080fd5b5061056e610569366004612b36565b61181d565b60408051938452602084019290925215159082015260600161026b565b34801561059757600080fd5b506001546105ac90600160a01b900460ff1681565b60405161026b9190612b9f565b3480156105c557600080fd5b50610261600481565b3480156105da57600080fd5b506102896105e93660046129e7565b611be4565b3480156105fa57600080fd5b5061026160045481565b34801561061057600080fd5b5061026160025481565b34801561062657600080fd5b5061026160055481565b34801561063c57600080fd5b5061026160085481565b34801561065257600080fd5b50610289610661366004612ab8565b611cc6565b34801561067257600080fd5b50610686610681366004612aef565b611d00565b60408051948552602085019390935291830152606082015260800161026b565b3480156106b257600080fd5b506007546102c0906001600160a01b031681565b3480156106d257600080fd5b506106fd6106e13660046129e7565b600d602052600090815260409020600181015460029091015482565b6040805192835260208301919091520161026b565b34801561071e57600080fd5b5061028961072d36600461287e565b611d3f565b34801561073e57600080fd5b5061026161074d366004612aef565b600f60209081526000928352604080842090915290825290205481565b34801561077657600080fd5b50610289610785366004612852565b611d6e565b34801561079657600080fd5b506001546102c0906001600160a01b031681565b3480156107b657600080fd5b506108046107c536600461287e565b600e602052600090815260409020805460018201546002909201546001600160a01b03821692600160a01b9092046001600160601b0316919060ff1684565b60405161026b9493929190612bc7565b6000600154600160a01b900460ff16600281111561083457610834612b89565b036109a7576002546004546108499042612c0e565b10156108b15760405162461bcd60e51b815260206004820152602c60248201527f546865206d696e696d756d207374616b696e672074696d6520686173206e6f7460448201526b103830b9b9b2b2103cb2ba1760a11b60648201526084015b60405180910390fd5b6000600654116109135760405162461bcd60e51b815260206004820152602760248201527f546865726520617265206e6f2064697370757465732074686174206e65656420604482015266353ab937b9399760c91b60648201526084016108a8565b6007546009546001600160a01b0390911690637363ae1f906109359043612c21565b6040518263ffffffff1660e01b815260040161095391815260200190565b600060405180830381600087803b15801561096d57600080fd5b505af1158015610981573d6000803e3d6000fd5b505043600555505060018054819060ff60a01b1916600160a01b825b0217905550610ba1565b60018054600160a01b900460ff1660028111156109c6576109c6612b89565b03610abe576007546009546005546001600160a01b03909216916313cf9054916109ef91612c21565b6040518263ffffffff1660e01b8152600401610a0d91815260200190565b6020604051808303816000875af1158015610a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a509190612c34565b6008819055600003610aa45760405162461bcd60e51b815260206004820152601e60248201527f52616e646f6d206e756d626572206973206e6f7420726561647920796574000060448201526064016108a8565b600180546002919060ff60a01b1916600160a01b8361099d565b6002600154600160a01b900460ff166002811115610ade57610ade612b89565b03610ba1576006541580610b005750600354600454610afd9042612c0e565b10155b610b935760405162461bcd60e51b815260206004820152605860248201527f546865726520617265207374696c6c20646973707574657320776974686f757460448201527f206a75726f727320616e6420746865206d6178696d756d2064726177696e67206064820152773a34b6b2903430b9903737ba103830b9b9b2b2103cb2ba1760411b608482015260a4016108a8565b6001805460ff60a01b191690555b426004556001546040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b9391610be291600160a01b90910460ff1690612b9f565b60405180910390a1565b6001546001600160a01b03163314610c165760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d602052604081206002018054839290610c41908490612c21565b909155505060408051828152600060208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b091015b60405180910390a25050565b6000600154600160a01b900460ff166002811115610caf57610caf612b89565b14610cfc5760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520696e205374616b696e672070686173652e000000000060448201526064016108a8565b6000600a54600183600b54610d119190612c21565b610d1b9190612c0e565b11610d265781610d41565b600b54600a54610d369190612c0e565b610d41906001612c21565b9050600081600b54610d539190612c21565b600b549091505b81811015610e75576000818152600e6020526040902080546001600160a01b031615610e625760018054825491830154600284015460405163fbb519e760e01b81526001600160a01b039384169463fbb519e794610dd69490821693600160a01b9092046001600160601b031692909160ff1690600401612bc7565b600060405180830381600087803b158015610df057600080fd5b505af1158015610e04573d6000803e3d6000fd5b505082546001600160a01b0381166000908152600f60209081526040808320600160a01b9094046001600160601b03168352928152828220829055868252600e90529081208181556001810191909155600201805460ff1916905550505b5080610e6d81612c91565b915050610d5a565b50600b555050565b6001546001600160a01b03163314610ea75760405162461bcd60e51b81526004016108a890612c4d565b6000828152600c6020526040812090610ebf83611de6565b825490915015610f085760405162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b60448201526064016108a8565b60018111610f585760405162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e000000000060448201526064016108a8565b8155600201805460018101825560009182526020822001555050565b60006002600154600160a01b900460ff166002811115610f9657610f96612b89565b14610fd25760405162461bcd60e51b815260206004820152600c60248201526b2bb937b73390383430b9b29760a11b60448201526064016108a8565b6000848152600c6020526040812060028101805491929091610ff657610ff6612caa565b9060005260206000200154600003611012576000915050611151565b60008160020160008154811061102a5761102a612caa565b9060005260206000200154600854868660405160200161105d939291909283526020830191909152604082015260600190565b6040516020818303038152906040528051906020012060001c6110809190612cd6565b905060005b60028301548354611097908390612cea565b6110a2906001612c21565b10156111315760015b8354811161112b576000818386600001546110c69190612cea565b6110d09190612c21565b905060008560020182815481106110e9576110e9612caa565b9060005260206000200154905080851061110e576111078186612c0e565b9450611116565b50915061112b565b5050808061112390612c91565b9150506110ab565b50611085565b600081815260048401602052604090205461114b90611e01565b93505050505b9392505050565b6000546001600160a01b031633146111825760405162461bcd60e51b81526004016108a890612d01565b600780546001600160a01b0319166001600160a01b038416179055600981905560018054600160a01b900460ff1660028111156111c1576111c1612b89565b0361123d576007546009546001600160a01b0390911690637363ae1f906111e89043612c21565b6040518263ffffffff1660e01b815260040161120691815260200190565b600060405180830381600087803b15801561122057600080fd5b505af1158015611234573d6000803e3d6000fd5b50504360055550505b5050565b61124a82611e2c565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806112c857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166112bc600080516020612e298339815191525490565b6001600160a01b031614155b156112e65760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611340575060408051601f3d908101601f1916820190925261133d91810190612c34565b60015b61136857604051630c76093760e01b81526001600160a01b03831660048201526024016108a8565b600080516020612e29833981519152811461139957604051632a87526960e21b8152600481018290526024016108a8565b600080516020612e298339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611464576000836001600160a01b0316836040516114009190612d43565b600060405180830381855af49150503d806000811461143b576040519150601f19603f3d011682016040523d82523d6000602084013e611440565b606091505b5050905080611462576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114b45760405163703e46dd60e11b815260040160405180910390fd5b50600080516020612e2983398151915290565b6001600160a01b0381166000908152600d602090815260409182902080548351818402810184019094528084526060939283018282801561155957602002820191906000526020600020906000905b82829054906101000a90046001600160601b03166001600160601b0316815260200190600c0190602082600b010492830192600103820291508084116115165790505b50505050509050919050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806115af5750805467ffffffffffffffff808416911610155b156115cc5760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff8316908117600160401b178255600080546001600160a01b038b81166001600160a01b031992831617909255600180548b841690831617815560028a905560038990554260045560078054938916939092169290921790556009859055600b55815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050505050565b6001546001600160a01b031633146116b55760405162461bcd60e51b81526004016108a890612c4d565b600680549060006116c583612d72565b91905055505050565b6000828152600c60209081526040808320848452600381019092528220548083036116fe57600092505050611723565b81600201818154811061171357611713612caa565b9060005260206000200154925050505b92915050565b6000546001600160a01b031633146117535760405162461bcd60e51b81526004016108a890612d01565b600255565b6001546001600160a01b031633146117825760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d6020526040812060020180548392906117ad908490612c0e565b909155505060408051828152600160208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b09101610c83565b6000806118008484611e56565b90506118156001600160601b038416826116ce565b949350505050565b600154600090819081906001600160a01b0316331461184e5760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0387166000908152600d602052604081209061187189896117f3565b82549091508715801561188d575060048110158061188d575081155b156118a5576000806000955095509550505050611bda565b6000600154600160a01b900460ff1660028111156118c5576118c5612b89565b14611a7f576118d4898b611e9e565b94506000600e6000600a600081546118eb90612c91565b919050819055815260200190815260200160002090508a8160000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550898160000160146101000a8154816001600160601b0302191690836001600160601b03160217905550888160010181905550600a54600f60008d6001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160601b03166001600160601b031681526020019081526020016000208190555082891115611a235760028101805460ff191660011790556119ce848b8b86612155565b604080516001600160601b038d168152602081018c90529198506001600160a01b038d16917f792235ed84e4d70219b4fc973c509bbbdc2d3e22578dceea671f48829db949b0910160405180910390a2611a71565b604080516001600160601b038c168152602081018b90526001600160a01b038d16917fe9a844153bbed760d95005e769b4ef97fab26f7b01305c7028a0493b833bdbae910160405180910390a25b5060019350611bda92505050565b818810611a9f5786611a9a57611a97838a8a85612155565b95505b611ab8565b611aab838a8a85612235565b611ab59086612c21565b94505b6000611ac48b8b611e56565b905060008a5b81611b8257611ae36001600160601b0382168c8561242c565b6000196001600160601b03821601611afe5760019150611aca565b600154604051630fad06e960e11b81526001600160601b03831660048201526001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa158015611b4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b739190612d89565b50949550611aca945050505050565b604080516001600160601b038e168152602081018d90526001600160a01b038f16917f4732545d01e38980276a17e6d394f01577ba63f2fea5eba41af0757d9c060c5c910160405180910390a2506001955050505050505b9450945094915050565b6001546001600160a01b03163314611c0e5760405162461bcd60e51b81526004016108a890612c4d565b6000611c19826114c7565b80519091505b801561146457600180546001600160a01b03169063fbb519e79085908590611c479086612c0e565b81518110611c5757611c57612caa565b60200260200101516000806040518563ffffffff1660e01b8152600401611c819493929190612bc7565b600060405180830381600087803b158015611c9b57600080fd5b505af1158015611caf573d6000803e3d6000fd5b505050508080611cbe90612d72565b915050611c1f565b6001546001600160a01b03163314611cf05760405162461bcd60e51b81526004016108a890612c4d565b600680549060006116c583612c91565b6001600160a01b0382166000908152600d6020526040812060018101546002820154909290918190611d3287876117f3565b9054949793965094505050565b6000546001600160a01b03163314611d695760405162461bcd60e51b81526004016108a890612d01565b600355565b6001546001600160a01b03163314611d985760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d6020526040902060018101548211611dda5781816001016000828254611dcf9190612c0e565b909155506114649050565b60006001820155505050565b60006020825110611df957506020015190565b506006919050565b600060405160005b6014811015611e245783811a81600c84010153600101611e09565b505192915050565b6000546001600160a01b0316331461033f5760405162461bcd60e51b81526004016108a890612d01565b600060405160005b6014811015611e79578481600c011a81830153600101611e5e565b5060145b6020811015611e955783811a81830153600101611e7d565b50519392505050565b6001600160a01b0381166000908152600f602090815260408083206001600160601b0386168452909152812054801561214e576000818152600e60205260409020600281015460ff1615612101576000611ef885876117f3565b90506000818360010154611f0c9190612c0e565b6001600160a01b0387166000908152600d602052604090206001810154919650869250908210611f3e57806001015495505b85816001016000828254611f529190612c0e565b90915550506040518281526001600160601b038916906001600160a01b038916907f1222c35b9c82812f1fda75e2b299043b079c0bb3b53d44aee1ae96a97263ca699060200160405180910390a3826000036120fd5780545b80156120fb576001600160601b03891682611fc7600184612c0e565b81548110611fd757611fd7612caa565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036120e9578154829061201390600190612c0e565b8154811061202357612023612caa565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169083906120579084612c0e565b8154811061206757612067612caa565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550816000018054806120b3576120b3612dfe565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556120fb565b806120f381612d72565b915050611fab565b505b5050505b506000818152600e6020908152604080832083815560018101849055600201805460ff191690556001600160a01b0386168352600f82528083206001600160601b03881684529091528120555b5092915050565b60008085600101548660020154101561216f576000612183565b856001015486600201546121839190612c0e565b905061218f8184612c21565b84101561219d5760006121b2565b806121a88486612c0e565b6121b29190612c0e565b9150826000036121f7578554600180820188556000888152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918816021790555b82866001015410156122095783612224565b8383876001015461221a9190612c0e565b6122249190612c21565b866001018190555050949350505050565b60028401546000906122478484612c0e565b6122519190612c21565b85600101541061226c576122658383612c0e565b9050612292565b8460020154856001015410612292578460020154856001015461228f9190612c0e565b90505b826000036123ef5784545b80156123ed576001600160601b038516866122b9600184612c0e565b815481106122c9576122c9612caa565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036123db578554869061230590600190612c0e565b8154811061231557612315612caa565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169087906123499084612c0e565b8154811061235957612359612caa565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550856000018054806123a5576123a5612dfe565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556123ed565b806123e581612d72565b91505061229d565b505b8185600101541015612401578261241c565b828286600101546124129190612c0e565b61241c9190612c21565b8560010181905550949350505050565b6000838152600c602090815260408083208484526003810190925282205490918190036125f95783156125f45760018201546000036125475750600281018054600180820183556000928352602090922081018590559081148015906124a65750815461249a600183612c0e565b6124a49190612cd6565b155b156125425781546000906124ba9083612e14565b60008181526004850160205260408120549192506124d9846001612c21565b9050846002018560020184815481106124f4576124f4612caa565b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b6125c2565b60018083018054909161255991612c0e565b8154811061256957612569612caa565b906000526020600020015490508160010180548061258957612589612dfe565b60019003818190600052602060002001600090559055838260020182815481106125b5576125b5612caa565b6000918252602090912001555b600083815260038301602090815260408083208490558383526004850190915290208390556125f48582600187612780565b612779565b8360000361269757600082600201828154811061261857612618612caa565b90600052602060002001549050600083600201838154811061263c5761263c612caa565b6000918252602080832090910192909255600180860180549182018155825282822001849055858152600385018252604080822082905584825260048601909252908120819055612691908790849084612780565b50612779565b8160020181815481106126ac576126ac612caa565b90600052602060002001548414612779576000848360020183815481106126d5576126d5612caa565b90600052602060002001541115905060008161271b578584600201848154811061270157612701612caa565b90600052602060002001546127169190612c0e565b612746565b83600201838154811061273057612730612caa565b9060005260206000200154866127469190612c0e565b90508584600201848154811061275e5761275e612caa565b60009182526020909120015561277687848484612780565b50505b5050505050565b6000848152600c60205260409020835b80156128355781546127a3600183612c0e565b6127ad9190612e14565b9050836127e457828260020182815481106127ca576127ca612caa565b90600052602060002001546127df9190612c0e565b61280f565b828260020182815481106127fa576127fa612caa565b906000526020600020015461280f9190612c21565b82600201828154811061282457612824612caa565b600091825260209091200155612790565b505050505050565b6001600160a01b038116811461033f57600080fd5b6000806040838503121561286557600080fd5b82356128708161283d565b946020939093013593505050565b60006020828403121561289057600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126128be57600080fd5b813567ffffffffffffffff808211156128d9576128d9612897565b604051601f8301601f19908116603f0116810190828211818310171561290157612901612897565b8160405283815286602085880101111561291a57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561294d57600080fd5b82359150602083013567ffffffffffffffff81111561296b57600080fd5b612977858286016128ad565b9150509250929050565b60008060006060848603121561299657600080fd5b505081359360208301359350604090920135919050565b600080604083850312156129c057600080fd5b82356129cb8161283d565b9150602083013567ffffffffffffffff81111561296b57600080fd5b6000602082840312156129f957600080fd5b81356111518161283d565b6020808252825182820181905260009190848201906040850190845b81811015612a455783516001600160601b031683529284019291840191600101612a20565b50909695505050505050565b60008060008060008060c08789031215612a6a57600080fd5b8635612a758161283d565b95506020870135612a858161283d565b945060408701359350606087013592506080870135612aa38161283d565b8092505060a087013590509295509295509295565b60008060408385031215612acb57600080fd5b50508035926020909101359150565b6001600160601b038116811461033f57600080fd5b60008060408385031215612b0257600080fd5b8235612b0d8161283d565b91506020830135612b1d81612ada565b809150509250929050565b801515811461033f57600080fd5b60008060008060808587031215612b4c57600080fd5b8435612b578161283d565b93506020850135612b6781612ada565b9250604085013591506060850135612b7e81612b28565b939692955090935050565b634e487b7160e01b600052602160045260246000fd5b6020810160038310612bc157634e487b7160e01b600052602160045260246000fd5b91905290565b6001600160a01b039490941684526001600160601b0392909216602084015260408301521515606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561172357611723612bf8565b8082018082111561172357611723612bf8565b600060208284031215612c4657600080fd5b5051919050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600060018201612ca357612ca3612bf8565b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082612ce557612ce5612cc0565b500690565b808202811582820484141761172357611723612bf8565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b6000825160005b81811015612d645760208186018101518583015201612d4a565b506000920191825250919050565b600081612d8157612d81612bf8565b506000190190565b600080600080600080600060e0888a031215612da457600080fd5b8751612daf81612ada565b6020890151909750612dc081612b28565b8096505060408801519450606088015193506080880151925060a0880151915060c0880151612dee81612b28565b8091505092959891949750929550565b634e487b7160e01b600052603160045260246000fd5b600082612e2357612e23612cc0565b50049056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122096a3d02e0db395d3df3fc713d6999d1c1e4d07c048a1fdcb01d322750a00dd6164736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106102465760003560e01c80637dc38f1411610139578063c1572618116100b6578063dca5f6b01161007a578063dca5f6b0146106c6578063dd5e5cb514610712578063e534710d14610732578063f216de4c1461076a578063f2f4eb261461078a578063f6b4d82d146107aa57600080fd5b8063c15726181461061a578063ccbac9f514610630578063d09f392d14610646578063d1c1df4814610666578063d605787b146106a657600080fd5b8063b1c9fe6e116100fd578063b1c9fe6e1461058b578063b4a61608146105b9578063b5d69e99146105ce578063b888adfa146105ee578063c057eca71461060457600080fd5b80637dc38f14146104d8578063823cfd70146104ee578063965af6c71461050e578063a2473cc11461052e578063a5861b901461054e57600080fd5b80634c70a0d6116101c757806354812d171161018b57806354812d171461041757806356acb050146104375780635d2d78461461044d5780636624192f1461046d57806376fa9fc5146104b857600080fd5b80634c70a0d6146103825780634dbbebbc146103a25780634f1ef286146103c257806352d1902d146103d5578063543f8a36146103ea57600080fd5b80631b92bbbe1161020e5780631b92bbbe146102ee57806321e1625e1461030457806321ea9b3f1461032457806335975f4a14610342578063477a655c1461036257600080fd5b8063034327441461024b5780630b274f2e146102745780630b51806d1461028b5780630c340a24146102a05780630e083ec9146102d8575b600080fd5b34801561025757600080fd5b5061026160065481565b6040519081526020015b60405180910390f35b34801561028057600080fd5b50610289610814565b005b34801561029757600080fd5b50610261600681565b3480156102ac57600080fd5b506000546102c0906001600160a01b031681565b6040516001600160a01b03909116815260200161026b565b3480156102e457600080fd5b50610261600a5481565b3480156102fa57600080fd5b5061026160035481565b34801561031057600080fd5b5061028961031f366004612852565b610bec565b34801561033057600080fd5b5061028961033f36600461287e565b50565b34801561034e57600080fd5b5061028961035d36600461287e565b610c8f565b34801561036e57600080fd5b5061028961037d36600461293a565b610e7d565b34801561038e57600080fd5b506102c061039d366004612981565b610f74565b3480156103ae57600080fd5b506102896103bd366004612852565b611158565b6102896103d03660046129ad565b611241565b3480156103e157600080fd5b50610261611469565b3480156103f657600080fd5b5061040a6104053660046129e7565b6114c7565b60405161026b9190612a04565b34801561042357600080fd5b50610289610432366004612a51565b611565565b34801561044357600080fd5b50610261600b5481565b34801561045957600080fd5b50610289610468366004612ab8565b61168b565b34801561047957600080fd5b506104a86104883660046129e7565b6001600160a01b03166000908152600d6020526040902060010154151590565b604051901515815260200161026b565b3480156104c457600080fd5b506102616104d3366004612ab8565b6116ce565b3480156104e457600080fd5b5061026160095481565b3480156104fa57600080fd5b5061028961050936600461287e565b611729565b34801561051a57600080fd5b50610289610529366004612852565b611758565b34801561053a57600080fd5b50610261610549366004612aef565b6117f3565b34801561055a57600080fd5b5061056e610569366004612b36565b61181d565b60408051938452602084019290925215159082015260600161026b565b34801561059757600080fd5b506001546105ac90600160a01b900460ff1681565b60405161026b9190612b9f565b3480156105c557600080fd5b50610261600481565b3480156105da57600080fd5b506102896105e93660046129e7565b611be4565b3480156105fa57600080fd5b5061026160045481565b34801561061057600080fd5b5061026160025481565b34801561062657600080fd5b5061026160055481565b34801561063c57600080fd5b5061026160085481565b34801561065257600080fd5b50610289610661366004612ab8565b611cc6565b34801561067257600080fd5b50610686610681366004612aef565b611d00565b60408051948552602085019390935291830152606082015260800161026b565b3480156106b257600080fd5b506007546102c0906001600160a01b031681565b3480156106d257600080fd5b506106fd6106e13660046129e7565b600d602052600090815260409020600181015460029091015482565b6040805192835260208301919091520161026b565b34801561071e57600080fd5b5061028961072d36600461287e565b611d3f565b34801561073e57600080fd5b5061026161074d366004612aef565b600f60209081526000928352604080842090915290825290205481565b34801561077657600080fd5b50610289610785366004612852565b611d6e565b34801561079657600080fd5b506001546102c0906001600160a01b031681565b3480156107b657600080fd5b506108046107c536600461287e565b600e602052600090815260409020805460018201546002909201546001600160a01b03821692600160a01b9092046001600160601b0316919060ff1684565b60405161026b9493929190612bc7565b6000600154600160a01b900460ff16600281111561083457610834612b89565b036109a7576002546004546108499042612c0e565b10156108b15760405162461bcd60e51b815260206004820152602c60248201527f546865206d696e696d756d207374616b696e672074696d6520686173206e6f7460448201526b103830b9b9b2b2103cb2ba1760a11b60648201526084015b60405180910390fd5b6000600654116109135760405162461bcd60e51b815260206004820152602760248201527f546865726520617265206e6f2064697370757465732074686174206e65656420604482015266353ab937b9399760c91b60648201526084016108a8565b6007546009546001600160a01b0390911690637363ae1f906109359043612c21565b6040518263ffffffff1660e01b815260040161095391815260200190565b600060405180830381600087803b15801561096d57600080fd5b505af1158015610981573d6000803e3d6000fd5b505043600555505060018054819060ff60a01b1916600160a01b825b0217905550610ba1565b60018054600160a01b900460ff1660028111156109c6576109c6612b89565b03610abe576007546009546005546001600160a01b03909216916313cf9054916109ef91612c21565b6040518263ffffffff1660e01b8152600401610a0d91815260200190565b6020604051808303816000875af1158015610a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a509190612c34565b6008819055600003610aa45760405162461bcd60e51b815260206004820152601e60248201527f52616e646f6d206e756d626572206973206e6f7420726561647920796574000060448201526064016108a8565b600180546002919060ff60a01b1916600160a01b8361099d565b6002600154600160a01b900460ff166002811115610ade57610ade612b89565b03610ba1576006541580610b005750600354600454610afd9042612c0e565b10155b610b935760405162461bcd60e51b815260206004820152605860248201527f546865726520617265207374696c6c20646973707574657320776974686f757460448201527f206a75726f727320616e6420746865206d6178696d756d2064726177696e67206064820152773a34b6b2903430b9903737ba103830b9b9b2b2103cb2ba1760411b608482015260a4016108a8565b6001805460ff60a01b191690555b426004556001546040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b9391610be291600160a01b90910460ff1690612b9f565b60405180910390a1565b6001546001600160a01b03163314610c165760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d602052604081206002018054839290610c41908490612c21565b909155505060408051828152600060208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b091015b60405180910390a25050565b6000600154600160a01b900460ff166002811115610caf57610caf612b89565b14610cfc5760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520696e205374616b696e672070686173652e000000000060448201526064016108a8565b6000600a54600183600b54610d119190612c21565b610d1b9190612c0e565b11610d265781610d41565b600b54600a54610d369190612c0e565b610d41906001612c21565b9050600081600b54610d539190612c21565b600b549091505b81811015610e75576000818152600e6020526040902080546001600160a01b031615610e625760018054825491830154600284015460405163fbb519e760e01b81526001600160a01b039384169463fbb519e794610dd69490821693600160a01b9092046001600160601b031692909160ff1690600401612bc7565b600060405180830381600087803b158015610df057600080fd5b505af1158015610e04573d6000803e3d6000fd5b505082546001600160a01b0381166000908152600f60209081526040808320600160a01b9094046001600160601b03168352928152828220829055868252600e90529081208181556001810191909155600201805460ff1916905550505b5080610e6d81612c91565b915050610d5a565b50600b555050565b6001546001600160a01b03163314610ea75760405162461bcd60e51b81526004016108a890612c4d565b6000828152600c6020526040812090610ebf83611de6565b825490915015610f085760405162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b60448201526064016108a8565b60018111610f585760405162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e000000000060448201526064016108a8565b8155600201805460018101825560009182526020822001555050565b60006002600154600160a01b900460ff166002811115610f9657610f96612b89565b14610fd25760405162461bcd60e51b815260206004820152600c60248201526b2bb937b73390383430b9b29760a11b60448201526064016108a8565b6000848152600c6020526040812060028101805491929091610ff657610ff6612caa565b9060005260206000200154600003611012576000915050611151565b60008160020160008154811061102a5761102a612caa565b9060005260206000200154600854868660405160200161105d939291909283526020830191909152604082015260600190565b6040516020818303038152906040528051906020012060001c6110809190612cd6565b905060005b60028301548354611097908390612cea565b6110a2906001612c21565b10156111315760015b8354811161112b576000818386600001546110c69190612cea565b6110d09190612c21565b905060008560020182815481106110e9576110e9612caa565b9060005260206000200154905080851061110e576111078186612c0e565b9450611116565b50915061112b565b5050808061112390612c91565b9150506110ab565b50611085565b600081815260048401602052604090205461114b90611e01565b93505050505b9392505050565b6000546001600160a01b031633146111825760405162461bcd60e51b81526004016108a890612d01565b600780546001600160a01b0319166001600160a01b038416179055600981905560018054600160a01b900460ff1660028111156111c1576111c1612b89565b0361123d576007546009546001600160a01b0390911690637363ae1f906111e89043612c21565b6040518263ffffffff1660e01b815260040161120691815260200190565b600060405180830381600087803b15801561122057600080fd5b505af1158015611234573d6000803e3d6000fd5b50504360055550505b5050565b61124a82611e2c565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806112c857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166112bc600080516020612e298339815191525490565b6001600160a01b031614155b156112e65760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611340575060408051601f3d908101601f1916820190925261133d91810190612c34565b60015b61136857604051630c76093760e01b81526001600160a01b03831660048201526024016108a8565b600080516020612e29833981519152811461139957604051632a87526960e21b8152600481018290526024016108a8565b600080516020612e298339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611464576000836001600160a01b0316836040516114009190612d43565b600060405180830381855af49150503d806000811461143b576040519150601f19603f3d011682016040523d82523d6000602084013e611440565b606091505b5050905080611462576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114b45760405163703e46dd60e11b815260040160405180910390fd5b50600080516020612e2983398151915290565b6001600160a01b0381166000908152600d602090815260409182902080548351818402810184019094528084526060939283018282801561155957602002820191906000526020600020906000905b82829054906101000a90046001600160601b03166001600160601b0316815260200190600c0190602082600b010492830192600103820291508084116115165790505b50505050509050919050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806115af5750805467ffffffffffffffff808416911610155b156115cc5760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff8316908117600160401b178255600080546001600160a01b038b81166001600160a01b031992831617909255600180548b841690831617815560028a905560038990554260045560078054938916939092169290921790556009859055600b55815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050505050565b6001546001600160a01b031633146116b55760405162461bcd60e51b81526004016108a890612c4d565b600680549060006116c583612d72565b91905055505050565b6000828152600c60209081526040808320848452600381019092528220548083036116fe57600092505050611723565b81600201818154811061171357611713612caa565b9060005260206000200154925050505b92915050565b6000546001600160a01b031633146117535760405162461bcd60e51b81526004016108a890612d01565b600255565b6001546001600160a01b031633146117825760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d6020526040812060020180548392906117ad908490612c0e565b909155505060408051828152600160208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b09101610c83565b6000806118008484611e56565b90506118156001600160601b038416826116ce565b949350505050565b600154600090819081906001600160a01b0316331461184e5760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0387166000908152600d602052604081209061187189896117f3565b82549091508715801561188d575060048110158061188d575081155b156118a5576000806000955095509550505050611bda565b6000600154600160a01b900460ff1660028111156118c5576118c5612b89565b14611a7f576118d4898b611e9e565b94506000600e6000600a600081546118eb90612c91565b919050819055815260200190815260200160002090508a8160000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550898160000160146101000a8154816001600160601b0302191690836001600160601b03160217905550888160010181905550600a54600f60008d6001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160601b03166001600160601b031681526020019081526020016000208190555082891115611a235760028101805460ff191660011790556119ce848b8b86612155565b604080516001600160601b038d168152602081018c90529198506001600160a01b038d16917f792235ed84e4d70219b4fc973c509bbbdc2d3e22578dceea671f48829db949b0910160405180910390a2611a71565b604080516001600160601b038c168152602081018b90526001600160a01b038d16917fe9a844153bbed760d95005e769b4ef97fab26f7b01305c7028a0493b833bdbae910160405180910390a25b5060019350611bda92505050565b818810611a9f5786611a9a57611a97838a8a85612155565b95505b611ab8565b611aab838a8a85612235565b611ab59086612c21565b94505b6000611ac48b8b611e56565b905060008a5b81611b8257611ae36001600160601b0382168c8561242c565b6000196001600160601b03821601611afe5760019150611aca565b600154604051630fad06e960e11b81526001600160601b03831660048201526001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa158015611b4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b739190612d89565b50949550611aca945050505050565b604080516001600160601b038e168152602081018d90526001600160a01b038f16917f4732545d01e38980276a17e6d394f01577ba63f2fea5eba41af0757d9c060c5c910160405180910390a2506001955050505050505b9450945094915050565b6001546001600160a01b03163314611c0e5760405162461bcd60e51b81526004016108a890612c4d565b6000611c19826114c7565b80519091505b801561146457600180546001600160a01b03169063fbb519e79085908590611c479086612c0e565b81518110611c5757611c57612caa565b60200260200101516000806040518563ffffffff1660e01b8152600401611c819493929190612bc7565b600060405180830381600087803b158015611c9b57600080fd5b505af1158015611caf573d6000803e3d6000fd5b505050508080611cbe90612d72565b915050611c1f565b6001546001600160a01b03163314611cf05760405162461bcd60e51b81526004016108a890612c4d565b600680549060006116c583612c91565b6001600160a01b0382166000908152600d6020526040812060018101546002820154909290918190611d3287876117f3565b9054949793965094505050565b6000546001600160a01b03163314611d695760405162461bcd60e51b81526004016108a890612d01565b600355565b6001546001600160a01b03163314611d985760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d6020526040902060018101548211611dda5781816001016000828254611dcf9190612c0e565b909155506114649050565b60006001820155505050565b60006020825110611df957506020015190565b506006919050565b600060405160005b6014811015611e245783811a81600c84010153600101611e09565b505192915050565b6000546001600160a01b0316331461033f5760405162461bcd60e51b81526004016108a890612d01565b600060405160005b6014811015611e79578481600c011a81830153600101611e5e565b5060145b6020811015611e955783811a81830153600101611e7d565b50519392505050565b6001600160a01b0381166000908152600f602090815260408083206001600160601b0386168452909152812054801561214e576000818152600e60205260409020600281015460ff1615612101576000611ef885876117f3565b90506000818360010154611f0c9190612c0e565b6001600160a01b0387166000908152600d602052604090206001810154919650869250908210611f3e57806001015495505b85816001016000828254611f529190612c0e565b90915550506040518281526001600160601b038916906001600160a01b038916907f1222c35b9c82812f1fda75e2b299043b079c0bb3b53d44aee1ae96a97263ca699060200160405180910390a3826000036120fd5780545b80156120fb576001600160601b03891682611fc7600184612c0e565b81548110611fd757611fd7612caa565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036120e9578154829061201390600190612c0e565b8154811061202357612023612caa565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169083906120579084612c0e565b8154811061206757612067612caa565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550816000018054806120b3576120b3612dfe565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556120fb565b806120f381612d72565b915050611fab565b505b5050505b506000818152600e6020908152604080832083815560018101849055600201805460ff191690556001600160a01b0386168352600f82528083206001600160601b03881684529091528120555b5092915050565b60008085600101548660020154101561216f576000612183565b856001015486600201546121839190612c0e565b905061218f8184612c21565b84101561219d5760006121b2565b806121a88486612c0e565b6121b29190612c0e565b9150826000036121f7578554600180820188556000888152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918816021790555b82866001015410156122095783612224565b8383876001015461221a9190612c0e565b6122249190612c21565b866001018190555050949350505050565b60028401546000906122478484612c0e565b6122519190612c21565b85600101541061226c576122658383612c0e565b9050612292565b8460020154856001015410612292578460020154856001015461228f9190612c0e565b90505b826000036123ef5784545b80156123ed576001600160601b038516866122b9600184612c0e565b815481106122c9576122c9612caa565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036123db578554869061230590600190612c0e565b8154811061231557612315612caa565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169087906123499084612c0e565b8154811061235957612359612caa565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550856000018054806123a5576123a5612dfe565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556123ed565b806123e581612d72565b91505061229d565b505b8185600101541015612401578261241c565b828286600101546124129190612c0e565b61241c9190612c21565b8560010181905550949350505050565b6000838152600c602090815260408083208484526003810190925282205490918190036125f95783156125f45760018201546000036125475750600281018054600180820183556000928352602090922081018590559081148015906124a65750815461249a600183612c0e565b6124a49190612cd6565b155b156125425781546000906124ba9083612e14565b60008181526004850160205260408120549192506124d9846001612c21565b9050846002018560020184815481106124f4576124f4612caa565b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b6125c2565b60018083018054909161255991612c0e565b8154811061256957612569612caa565b906000526020600020015490508160010180548061258957612589612dfe565b60019003818190600052602060002001600090559055838260020182815481106125b5576125b5612caa565b6000918252602090912001555b600083815260038301602090815260408083208490558383526004850190915290208390556125f48582600187612780565b612779565b8360000361269757600082600201828154811061261857612618612caa565b90600052602060002001549050600083600201838154811061263c5761263c612caa565b6000918252602080832090910192909255600180860180549182018155825282822001849055858152600385018252604080822082905584825260048601909252908120819055612691908790849084612780565b50612779565b8160020181815481106126ac576126ac612caa565b90600052602060002001548414612779576000848360020183815481106126d5576126d5612caa565b90600052602060002001541115905060008161271b578584600201848154811061270157612701612caa565b90600052602060002001546127169190612c0e565b612746565b83600201838154811061273057612730612caa565b9060005260206000200154866127469190612c0e565b90508584600201848154811061275e5761275e612caa565b60009182526020909120015561277687848484612780565b50505b5050505050565b6000848152600c60205260409020835b80156128355781546127a3600183612c0e565b6127ad9190612e14565b9050836127e457828260020182815481106127ca576127ca612caa565b90600052602060002001546127df9190612c0e565b61280f565b828260020182815481106127fa576127fa612caa565b906000526020600020015461280f9190612c21565b82600201828154811061282457612824612caa565b600091825260209091200155612790565b505050505050565b6001600160a01b038116811461033f57600080fd5b6000806040838503121561286557600080fd5b82356128708161283d565b946020939093013593505050565b60006020828403121561289057600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126128be57600080fd5b813567ffffffffffffffff808211156128d9576128d9612897565b604051601f8301601f19908116603f0116810190828211818310171561290157612901612897565b8160405283815286602085880101111561291a57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561294d57600080fd5b82359150602083013567ffffffffffffffff81111561296b57600080fd5b612977858286016128ad565b9150509250929050565b60008060006060848603121561299657600080fd5b505081359360208301359350604090920135919050565b600080604083850312156129c057600080fd5b82356129cb8161283d565b9150602083013567ffffffffffffffff81111561296b57600080fd5b6000602082840312156129f957600080fd5b81356111518161283d565b6020808252825182820181905260009190848201906040850190845b81811015612a455783516001600160601b031683529284019291840191600101612a20565b50909695505050505050565b60008060008060008060c08789031215612a6a57600080fd5b8635612a758161283d565b95506020870135612a858161283d565b945060408701359350606087013592506080870135612aa38161283d565b8092505060a087013590509295509295509295565b60008060408385031215612acb57600080fd5b50508035926020909101359150565b6001600160601b038116811461033f57600080fd5b60008060408385031215612b0257600080fd5b8235612b0d8161283d565b91506020830135612b1d81612ada565b809150509250929050565b801515811461033f57600080fd5b60008060008060808587031215612b4c57600080fd5b8435612b578161283d565b93506020850135612b6781612ada565b9250604085013591506060850135612b7e81612b28565b939692955090935050565b634e487b7160e01b600052602160045260246000fd5b6020810160038310612bc157634e487b7160e01b600052602160045260246000fd5b91905290565b6001600160a01b039490941684526001600160601b0392909216602084015260408301521515606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561172357611723612bf8565b8082018082111561172357611723612bf8565b600060208284031215612c4657600080fd5b5051919050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600060018201612ca357612ca3612bf8565b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082612ce557612ce5612cc0565b500690565b808202811582820484141761172357611723612bf8565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b6000825160005b81811015612d645760208186018101518583015201612d4a565b506000920191825250919050565b600081612d8157612d81612bf8565b506000190190565b600080600080600080600060e0888a031215612da457600080fd5b8751612daf81612ada565b6020890151909750612dc081612b28565b8096505060408801519450606088015193506080880151925060a0880151915060c0880151612dee81612b28565b8091505092959891949750929550565b634e487b7160e01b600052603160045260246000fd5b600082612e2357612e23612cc0565b50049056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122096a3d02e0db395d3df3fc713d6999d1c1e4d07c048a1fdcb01d322750a00dd6164736f6c63430008120033", "devdoc": { "details": "A factory of trees that keeps track of staked values for sortition.", "errors": { @@ -1173,7 +1173,7 @@ "storageLayout": { "storage": [ { - "astId": 7917, + "astId": 3582, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "governor", "offset": 0, @@ -1181,23 +1181,23 @@ "type": "t_address" }, { - "astId": 7920, + "astId": 3585, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "core", "offset": 0, "slot": "1", - "type": "t_contract(KlerosCore)6383" + "type": "t_contract(KlerosCore)3519" }, { - "astId": 7923, + "astId": 3588, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "phase", "offset": 20, "slot": "1", - "type": "t_enum(Phase)17235" + "type": "t_enum(Phase)5779" }, { - "astId": 7925, + "astId": 3590, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "minStakingTime", "offset": 0, @@ -1205,7 +1205,7 @@ "type": "t_uint256" }, { - "astId": 7927, + "astId": 3592, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "maxDrawingTime", "offset": 0, @@ -1213,7 +1213,7 @@ "type": "t_uint256" }, { - "astId": 7929, + "astId": 3594, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "lastPhaseChange", "offset": 0, @@ -1221,7 +1221,7 @@ "type": "t_uint256" }, { - "astId": 7931, + "astId": 3596, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "randomNumberRequestBlock", "offset": 0, @@ -1229,7 +1229,7 @@ "type": "t_uint256" }, { - "astId": 7933, + "astId": 3598, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "disputesWithoutJurors", "offset": 0, @@ -1237,15 +1237,15 @@ "type": "t_uint256" }, { - "astId": 7936, + "astId": 3601, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "rng", "offset": 0, "slot": "7", - "type": "t_contract(RNG)24286" + "type": "t_contract(RNG)6482" }, { - "astId": 7938, + "astId": 3603, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "randomNumber", "offset": 0, @@ -1253,7 +1253,7 @@ "type": "t_uint256" }, { - "astId": 7940, + "astId": 3605, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "rngLookahead", "offset": 0, @@ -1261,7 +1261,7 @@ "type": "t_uint256" }, { - "astId": 7942, + "astId": 3607, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "delayedStakeWriteIndex", "offset": 0, @@ -1269,7 +1269,7 @@ "type": "t_uint256" }, { - "astId": 7944, + "astId": 3609, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "delayedStakeReadIndex", "offset": 0, @@ -1277,31 +1277,31 @@ "type": "t_uint256" }, { - "astId": 7949, + "astId": 3614, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "sortitionSumTrees", "offset": 0, "slot": "12", - "type": "t_mapping(t_bytes32,t_struct(SortitionSumTree)7892_storage)" + "type": "t_mapping(t_bytes32,t_struct(SortitionSumTree)3557_storage)" }, { - "astId": 7954, + "astId": 3619, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "jurors", "offset": 0, "slot": "13", - "type": "t_mapping(t_address,t_struct(Juror)7909_storage)" + "type": "t_mapping(t_address,t_struct(Juror)3574_storage)" }, { - "astId": 7959, + "astId": 3624, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "delayedStakes", "offset": 0, "slot": "14", - "type": "t_mapping(t_uint256,t_struct(DelayedStake)7901_storage)" + "type": "t_mapping(t_uint256,t_struct(DelayedStake)3566_storage)" }, { - "astId": 7965, + "astId": 3630, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "latestDelayedStakeIndex", "offset": 0, @@ -1337,17 +1337,17 @@ "label": "bytes32", "numberOfBytes": "32" }, - "t_contract(KlerosCore)6383": { + "t_contract(KlerosCore)3519": { "encoding": "inplace", "label": "contract KlerosCore", "numberOfBytes": "20" }, - "t_contract(RNG)24286": { + "t_contract(RNG)6482": { "encoding": "inplace", "label": "contract RNG", "numberOfBytes": "20" }, - "t_enum(Phase)17235": { + "t_enum(Phase)5779": { "encoding": "inplace", "label": "enum ISortitionModule.Phase", "numberOfBytes": "1" @@ -1359,19 +1359,19 @@ "numberOfBytes": "32", "value": "t_mapping(t_uint96,t_uint256)" }, - "t_mapping(t_address,t_struct(Juror)7909_storage)": { + "t_mapping(t_address,t_struct(Juror)3574_storage)": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => struct SortitionModule.Juror)", "numberOfBytes": "32", - "value": "t_struct(Juror)7909_storage" + "value": "t_struct(Juror)3574_storage" }, - "t_mapping(t_bytes32,t_struct(SortitionSumTree)7892_storage)": { + "t_mapping(t_bytes32,t_struct(SortitionSumTree)3557_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct SortitionModule.SortitionSumTree)", "numberOfBytes": "32", - "value": "t_struct(SortitionSumTree)7892_storage" + "value": "t_struct(SortitionSumTree)3557_storage" }, "t_mapping(t_bytes32,t_uint256)": { "encoding": "mapping", @@ -1387,12 +1387,12 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_uint256,t_struct(DelayedStake)7901_storage)": { + "t_mapping(t_uint256,t_struct(DelayedStake)3566_storage)": { "encoding": "mapping", "key": "t_uint256", "label": "mapping(uint256 => struct SortitionModule.DelayedStake)", "numberOfBytes": "32", - "value": "t_struct(DelayedStake)7901_storage" + "value": "t_struct(DelayedStake)3566_storage" }, "t_mapping(t_uint96,t_uint256)": { "encoding": "mapping", @@ -1401,12 +1401,12 @@ "numberOfBytes": "32", "value": "t_uint256" }, - "t_struct(DelayedStake)7901_storage": { + "t_struct(DelayedStake)3566_storage": { "encoding": "inplace", "label": "struct SortitionModule.DelayedStake", "members": [ { - "astId": 7894, + "astId": 3559, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "account", "offset": 0, @@ -1414,7 +1414,7 @@ "type": "t_address" }, { - "astId": 7896, + "astId": 3561, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "courtID", "offset": 20, @@ -1422,7 +1422,7 @@ "type": "t_uint96" }, { - "astId": 7898, + "astId": 3563, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "stake", "offset": 0, @@ -1430,7 +1430,7 @@ "type": "t_uint256" }, { - "astId": 7900, + "astId": 3565, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "alreadyTransferred", "offset": 0, @@ -1440,12 +1440,12 @@ ], "numberOfBytes": "96" }, - "t_struct(Juror)7909_storage": { + "t_struct(Juror)3574_storage": { "encoding": "inplace", "label": "struct SortitionModule.Juror", "members": [ { - "astId": 7904, + "astId": 3569, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "courtIDs", "offset": 0, @@ -1453,7 +1453,7 @@ "type": "t_array(t_uint96)dyn_storage" }, { - "astId": 7906, + "astId": 3571, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "stakedPnk", "offset": 0, @@ -1461,7 +1461,7 @@ "type": "t_uint256" }, { - "astId": 7908, + "astId": 3573, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "lockedPnk", "offset": 0, @@ -1471,12 +1471,12 @@ ], "numberOfBytes": "96" }, - "t_struct(SortitionSumTree)7892_storage": { + "t_struct(SortitionSumTree)3557_storage": { "encoding": "inplace", "label": "struct SortitionModule.SortitionSumTree", "members": [ { - "astId": 7877, + "astId": 3542, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "K", "offset": 0, @@ -1484,7 +1484,7 @@ "type": "t_uint256" }, { - "astId": 7880, + "astId": 3545, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "stack", "offset": 0, @@ -1492,7 +1492,7 @@ "type": "t_array(t_uint256)dyn_storage" }, { - "astId": 7883, + "astId": 3548, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "nodes", "offset": 0, @@ -1500,7 +1500,7 @@ "type": "t_array(t_uint256)dyn_storage" }, { - "astId": 7887, + "astId": 3552, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "IDsToNodeIndexes", "offset": 0, @@ -1508,7 +1508,7 @@ "type": "t_mapping(t_bytes32,t_uint256)" }, { - "astId": 7891, + "astId": 3556, "contract": "src/arbitration/SortitionModule.sol:SortitionModule", "label": "nodeIndexesToIDs", "offset": 0, diff --git a/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule_Proxy.json b/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule_Proxy.json index eec613b8e..5805d01a9 100644 --- a/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule_Proxy.json +++ b/contracts/deployments/arbitrumSepoliaDevnet/SortitionModule_Proxy.json @@ -1,5 +1,5 @@ { - "address": "0xf327200420F21BAafce8F1C03B1EEdF926074B95", + "address": "0x19cb28BAB40C3585955798f5EEabd71Eec14471C", "abi": [ { "inputs": [ @@ -26,38 +26,38 @@ "type": "receive" } ], - "transactionHash": "0x586f56da98113e584a9355075402333309687bf056333595d5407301acfa14c0", + "transactionHash": "0x6b82e5e6e508a7995dc9f85efaf52e02cece2d3a3d21d48f09551e33c1f8fd53", "receipt": { "to": null, "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "contractAddress": "0xf327200420F21BAafce8F1C03B1EEdF926074B95", - "transactionIndex": 1, - "gasUsed": "332147", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000100000000000400000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xd68a4f4bfb4408a7c73c9b14bea1403fa89ec354d86f7e85df074b9104d9b6f7", - "transactionHash": "0x586f56da98113e584a9355075402333309687bf056333595d5407301acfa14c0", + "contractAddress": "0x19cb28BAB40C3585955798f5EEabd71Eec14471C", + "transactionIndex": 2, + "gasUsed": "4675242", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000080000000800000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x857666f5788ef3b02fdc024472ba4f415ecc2b99bfb574382311c73be9c019ae", + "transactionHash": "0x6b82e5e6e508a7995dc9f85efaf52e02cece2d3a3d21d48f09551e33c1f8fd53", "logs": [ { - "transactionIndex": 1, - "blockNumber": 3084593, - "transactionHash": "0x586f56da98113e584a9355075402333309687bf056333595d5407301acfa14c0", - "address": "0xf327200420F21BAafce8F1C03B1EEdF926074B95", + "transactionIndex": 2, + "blockNumber": 3638850, + "transactionHash": "0x6b82e5e6e508a7995dc9f85efaf52e02cece2d3a3d21d48f09551e33c1f8fd53", + "address": "0x19cb28BAB40C3585955798f5EEabd71Eec14471C", "topics": [ "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", "logIndex": 0, - "blockHash": "0xd68a4f4bfb4408a7c73c9b14bea1403fa89ec354d86f7e85df074b9104d9b6f7" + "blockHash": "0x857666f5788ef3b02fdc024472ba4f415ecc2b99bfb574382311c73be9c019ae" } ], - "blockNumber": 3084593, - "cumulativeGasUsed": "332147", + "blockNumber": 3638850, + "cumulativeGasUsed": "5561170", "status": 1, "byzantium": true }, "args": [ - "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9", - "0x54812d17000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c590000000000000000000000004dd8b69958ef1d7d5da9347e9d9f57adfc3dc28400000000000000000000000000000000000000000000000000000000000000b40000000000000000000000000000000000000000000000000000000000000258000000000000000000000000a995c172d286f8f4ee137cc662e2844e59cf48360000000000000000000000000000000000000000000000000000000000000014" + "0xBC82B29e5aE8a749D82b7919118Ab7C0D41fA3D3", + "0x54812d17000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59000000000000000000000000a54e7a16d7460e38a8f324ef46782fb520d58ce800000000000000000000000000000000000000000000000000000000000000b40000000000000000000000000000000000000000000000000000000000000258000000000000000000000000a995c172d286f8f4ee137cc662e2844e59cf48360000000000000000000000000000000000000000000000000000000000000014" ], "numDeployments": 1, "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", diff --git a/contracts/scripts/generateDeploymentArtifact.sh b/contracts/scripts/generateDeploymentArtifact.sh index fa7b87a27..dedcf1c0b 100755 --- a/contracts/scripts/generateDeploymentArtifact.sh +++ b/contracts/scripts/generateDeploymentArtifact.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -source $SCRIPT_DIR/../.env if [[ $# < 2 ]] then @@ -19,7 +18,7 @@ address=$2 case $network in gnosischain) url="https://api.gnosisscan.io" - apiKey="$GNOSISSCAN_API_KEY" + apiKey=$($SCRIPT_DIR/dotenv.sh GNOSISSCAN_API_KEY) ;; chiado) # Warning: these are distinct instances! @@ -30,19 +29,19 @@ chiado) ;; arbitrum) url="https://api.arbiscan.io" - apiKey="$ARBISCAN_API_KEY" + apiKey=$($SCRIPT_DIR/dotenv.sh ARBISCAN_API_KEY) ;; arbitrumSepolia) url="https://api-sepolia.arbiscan.io" - apiKey="$ARBISCAN_API_KEY" + apiKey=$($SCRIPT_DIR/dotenv.sh ARBISCAN_API_KEY) ;; mainnet) url="https://api.etherscan.io" - apiKey="$ETHERSCAN_API_KEY" + apiKey=$($SCRIPT_DIR/dotenv.sh ETHERSCAN_API_KEY) ;; sepolia) url="https://api-sepolia.etherscan.io" - apiKey="$ETHERSCAN_API_KEY" + apiKey=$($SCRIPT_DIR/dotenv.sh ETHERSCAN_API_KEY) ;; *) echo "error: unknown network $network" diff --git a/contracts/scripts/verifyProxies.sh b/contracts/scripts/verifyProxies.sh index 58efcae50..31dec9f4a 100755 --- a/contracts/scripts/verifyProxies.sh +++ b/contracts/scripts/verifyProxies.sh @@ -20,10 +20,10 @@ function verify() { #deploymentDir #explorerApiUrl #apiKey done } -. $SCRIPT_DIR/../.env +apiKey=$($SCRIPT_DIR/dotenv.sh ARBISCAN_API_KEY) -verify "$SCRIPT_DIR/../deployments/arbitrumSepoliaDevnet" "https://api-testnet.arbiscan.io/api" $ARBISCAN_API_KEY +verify "$SCRIPT_DIR/../deployments/arbitrumSepoliaDevnet" "https://api-sepolia.arbiscan.io/api" $apiKey echo -verify "$SCRIPT_DIR/../deployments/arbitrumSepolia" "https://api-testnet.arbiscan.io/api" $ARBISCAN_API_KEY +verify "$SCRIPT_DIR/../deployments/arbitrumSepolia" "https://api-sepolia.arbiscan.io/api" $apiKey echo -verify "$SCRIPT_DIR/../deployments/arbitrum" "https://api.arbiscan.io/api" $ARBISCAN_API_KEY +verify "$SCRIPT_DIR/../deployments/arbitrum" "https://api.arbiscan.io/api" $apiKey From 9c1ef8137848753714b7996185f560ba4412988b Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Wed, 27 Dec 2023 19:02:17 +0100 Subject: [PATCH 57/77] chore: subgraph redeploy --- subgraph/core/subgraph.yaml | 16 ++++++++-------- subgraph/dispute-template-registry/subgraph.yaml | 4 ++-- subgraph/package.json | 10 +++++----- web/.env.devnet.public | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/subgraph/core/subgraph.yaml b/subgraph/core/subgraph.yaml index 6ef2a43a7..8bd10e01a 100644 --- a/subgraph/core/subgraph.yaml +++ b/subgraph/core/subgraph.yaml @@ -6,9 +6,9 @@ dataSources: name: KlerosCore network: arbitrum-sepolia source: - address: "0x4DD8B69958eF1D7d5dA9347E9d9F57ADFC3dc284" + address: "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8" abi: KlerosCore - startBlock: 3084598 + startBlock: 3638878 mapping: kind: ethereum/events apiVersion: 0.0.6 @@ -81,9 +81,9 @@ dataSources: name: DisputeKitClassic network: arbitrum-sepolia source: - address: "0x86Ac67e5550F837a650B4B0Cd4778D4293a2bDe3" + address: "0x9426F127116C3652A262AE1eA48391AC8F44D35b" abi: DisputeKitClassic - startBlock: 3084586 + startBlock: 3638835 mapping: kind: ethereum/events apiVersion: 0.0.6 @@ -116,9 +116,9 @@ dataSources: name: EvidenceModule network: arbitrum-sepolia source: - address: "0x827411b3e98bAe8c441efBf26842A1670f8f378F" + address: "0x57fd453FB0d16f8ca174E7386102D7170E17Be09" abi: EvidenceModule - startBlock: 3084571 + startBlock: 3638735 mapping: kind: ethereum/events apiVersion: 0.0.6 @@ -137,9 +137,9 @@ dataSources: name: SortitionModule network: arbitrum-sepolia source: - address: "0xf327200420F21BAafce8F1C03B1EEdF926074B95" + address: "0x19cb28BAB40C3585955798f5EEabd71Eec14471C" abi: SortitionModule - startBlock: 3084593 + startBlock: 3638850 mapping: kind: ethereum/events apiVersion: 0.0.6 diff --git a/subgraph/dispute-template-registry/subgraph.yaml b/subgraph/dispute-template-registry/subgraph.yaml index de3fa1446..3c35d7ca2 100644 --- a/subgraph/dispute-template-registry/subgraph.yaml +++ b/subgraph/dispute-template-registry/subgraph.yaml @@ -6,9 +6,9 @@ dataSources: name: DisputeTemplateRegistry network: arbitrum-sepolia source: - address: "0xc60e862273c1eAa1F9afBC69b39cee30270A2419" + address: "0x596D3B09E684D62217682216e9b7a0De75933391" abi: DisputeTemplateRegistry - startBlock: 3087464 + startBlock: 3639191 mapping: kind: ethereum/events apiVersion: 0.0.6 diff --git a/subgraph/package.json b/subgraph/package.json index 93d089be5..77b5255fd 100644 --- a/subgraph/package.json +++ b/subgraph/package.json @@ -10,9 +10,9 @@ "build:core": "graph build --output-dir core/build/ core/subgraph.yaml", "test:core": "cd core && graph test", "clean:core": "graph clean --codegen-dir core/generated/ --build-dir core/build/ && rm core/subgraph.yaml.bak.*", - "deploy:core:arbitrum-sepolia-devnet": "graph deploy --product subgraph-studio kleros-v2-core-devnet -l v0.0.1 core/subgraph.yaml", - "deploy:core:arbitrum-sepolia": "graph deploy --product subgraph-studio kleros-v2-core-testnet -l v0.0.1 core/subgraph.yaml", - "deploy:core:arbitrum": "graph deploy --product subgraph-studio kleros-v2-core -l v0.0.1 core/subgraph.yaml", + "deploy:core:arbitrum-sepolia-devnet": "graph deploy --product subgraph-studio kleros-v2-core-devnet -l v0.0.2 core/subgraph.yaml", + "deploy:core:arbitrum-sepolia": "graph deploy --product subgraph-studio kleros-v2-core-testnet -l v0.0.2 core/subgraph.yaml", + "deploy:core:arbitrum": "graph deploy --product subgraph-studio kleros-v2-core -l v0.0.2 core/subgraph.yaml", "": "------------------------------------------------------------------------------------------", "update:drt:arbitrum-sepolia-devnet": "./scripts/update.sh arbitrumSepoliaDevnet arbitrum-sepolia dispute-template-registry/subgraph.yaml", "update:drt:arbitrum-sepolia": "./scripts/update.sh arbitrumSepolia arbitrum-sepolia dispute-template-registry/subgraph.yaml", @@ -22,8 +22,8 @@ "build:drt": "graph build --output-dir dispute-template-registry/generated/ dispute-template-registry/subgraph.yaml", "test:drt": "cd dispute-template-registry && graph test ", "clean:drt": "graph clean --codegen-dir dispute-template-registry/generated/ --build-dir dispute-template-registry/build/ && rm dispute-template-registry/subgraph.yaml.bak.*", - "deploy:drt:arbitrum-sepolia-devnet": "graph deploy --product subgraph-studio kleros-v2-drt-arbisep-devnet -l v0.0.1 dispute-template-registry/subgraph.yaml", - "deploy:drt:arbitrum-sepolia": "graph deploy --product subgraph-studio kleros-v2-drt-arbisep-testnet -l v0.0.1 dispute-template-registry/subgraph.yaml", + "deploy:drt:arbitrum-sepolia-devnet": "graph deploy --product subgraph-studio kleros-v2-drt-arbisep-devnet -l v0.0.2 dispute-template-registry/subgraph.yaml", + "deploy:drt:arbitrum-sepolia": "graph deploy --product subgraph-studio kleros-v2-drt-arbisep-testnet -l v0.0.2 dispute-template-registry/subgraph.yaml", " ": "-----------------------------------------------------------------------------------------", "update:arbitrum-sepolia-devnet": "./scripts/all.sh update arbitrum-sepolia-devnet", "update:arbitrum-sepolia": "./scripts/all.sh update arbitrum-sepolia", diff --git a/web/.env.devnet.public b/web/.env.devnet.public index 9f89e2e16..4df05b6e3 100644 --- a/web/.env.devnet.public +++ b/web/.env.devnet.public @@ -1,6 +1,6 @@ # Do not enter sensitive information here. export REACT_APP_DEPLOYMENT=devnet -export REACT_APP_CORE_SUBGRAPH=https://api.studio.thegraph.com/query/61738/kleros-v2-core-devnet/v0.0.1 -export REACT_APP_DRT_ARBSEPOLIA_SUBGRAPH=https://api.studio.thegraph.com/query/61738/kleros-v2-drt-arbisep-devnet/v0.0.1 +export REACT_APP_CORE_SUBGRAPH=https://api.studio.thegraph.com/query/61738/kleros-v2-core-devnet/version/latest +export REACT_APP_DRT_ARBSEPOLIA_SUBGRAPH=https://api.studio.thegraph.com/query/61738/kleros-v2-drt-arbisep-devnet/version/latest export REACT_APP_STATUS_URL=https://kleros-v2-devnet.betteruptime.com/badge export REACT_APP_GENESIS_BLOCK_ARBSEPOLIA=3084598 \ No newline at end of file From ffdb0c2d93c0f7d754e1519cf8d64d1a6155ebd5 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Wed, 26 Jul 2023 19:28:53 +0100 Subject: [PATCH 58/77] feat: viem setup and hello world script --- contracts/package.json | 3 +++ contracts/scripts/viem-test.ts | 25 +++++++++++++++++++++++ contracts/wagmi.config.hardhat.ts | 12 +++++++++++ contracts/wagmi.config.ts | 34 +++++++++++++++++++++++++++++++ yarn.lock | 1 + 5 files changed, 75 insertions(+) create mode 100644 contracts/scripts/viem-test.ts create mode 100644 contracts/wagmi.config.hardhat.ts create mode 100644 contracts/wagmi.config.ts diff --git a/contracts/package.json b/contracts/package.json index 0c3699c1b..ea6e513ef 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -25,6 +25,8 @@ "deploy-local": "hardhat deploy --tags Arbitration,HomeArbitrable --network localhost", "simulate": "hardhat simulate:all", "simulate-local": "hardhat simulate:all --network localhost", + "viem:generate": "NODE_NO_WARNINGS=1 wagmi generate", + "viem:test": "NODE_NO_WARNINGS=1 NODE_OPTIONS=--experimental-fetch ts-node ./scripts/viem-test.ts", "bot:keeper": "NODE_NO_WARNINGS=1 NODE_OPTIONS=--experimental-fetch hardhat run ./scripts/keeperBot.ts", "bot:relayer-from-chiado": "NODE_NO_WARNINGS=1 NODE_OPTIONS=--experimental-fetch hardhat run ./scripts/disputeRelayerBotFromChiado.ts", "bot:relayer-from-sepolia": "NODE_NO_WARNINGS=1 NODE_OPTIONS=--experimental-fetch hardhat run ./scripts/disputeRelayerBotFromSepolia.ts", @@ -55,6 +57,7 @@ "@types/chai": "^4.3.11", "@types/mocha": "^10.0.6", "@types/node": "^16.18.68", + "@wagmi/cli": "^1.5.2", "chai": "^4.3.10", "dotenv": "^16.3.1", "ethereumjs-util": "^7.1.5", diff --git a/contracts/scripts/viem-test.ts b/contracts/scripts/viem-test.ts new file mode 100644 index 000000000..752e51be8 --- /dev/null +++ b/contracts/scripts/viem-test.ts @@ -0,0 +1,25 @@ +import { createPublicClient, http, getContract } from "viem"; +import { arbitrumGoerli } from "viem/chains"; +import { homeGatewayToGnosisConfig } from "../viem/generated"; + +const main = async () => { + const client = createPublicClient({ + chain: arbitrumGoerli, + transport: http(), + }); + + const homeGateway = getContract({ + address: homeGatewayToGnosisConfig.address[arbitrumGoerli.id], + abi: homeGatewayToGnosisConfig.abi, + publicClient: client, + }); + + await homeGateway.read.governor().then(console.log); +}; + +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + }); diff --git a/contracts/wagmi.config.hardhat.ts b/contracts/wagmi.config.hardhat.ts new file mode 100644 index 000000000..497ae6a49 --- /dev/null +++ b/contracts/wagmi.config.hardhat.ts @@ -0,0 +1,12 @@ +import { defineConfig } from "@wagmi/cli"; +import { hardhat } from "@wagmi/cli/plugins"; + +export default defineConfig({ + out: "viem/generated.hardhat.ts", + contracts: [], + plugins: [ + hardhat({ + project: ".", + }), + ], +}); diff --git a/contracts/wagmi.config.ts b/contracts/wagmi.config.ts new file mode 100644 index 000000000..62a90cf2b --- /dev/null +++ b/contracts/wagmi.config.ts @@ -0,0 +1,34 @@ +import { Config, ContractConfig, defineConfig } from "@wagmi/cli"; +import { arbitrumGoerli, gnosisChiado } from "wagmi/chains"; +import HomeGatewayToGnosis from "@kleros/kleros-v2-contracts/deployments/arbitrumGoerli/HomeGatewayToGnosis.json" assert { type: "json" }; +import IHomeGateway from "@kleros/kleros-v2-contracts/artifacts/src/gateway/interfaces/IHomeGateway.sol/IHomeGateway.json" assert { type: "json" }; +import { Abi } from "viem"; + +type ArtifactPartial = { + abi: Abi; +}; + +const getAbi = (artifact: any) => { + return (artifact as ArtifactPartial).abi; +}; + +const getConfig = async (): Promise => { + return { + out: "viem/generated.ts", + contracts: [ + { + name: "HomeGatewayToGnosis", + address: { + [arbitrumGoerli.id]: HomeGatewayToGnosis.address as `0x{string}`, + }, + abi: getAbi(HomeGatewayToGnosis), + }, + { + name: "IHomeGateway", + abi: getAbi(IHomeGateway), + }, + ], + }; +}; + +export default defineConfig(getConfig); diff --git a/yarn.lock b/yarn.lock index 99598bc3f..01b2f210a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5363,6 +5363,7 @@ __metadata: "@types/chai": ^4.3.11 "@types/mocha": ^10.0.6 "@types/node": ^16.18.68 + "@wagmi/cli": ^1.5.2 chai: ^4.3.10 dotenv: ^16.3.1 ethereumjs-util: ^7.1.5 From a6b0dee232d4ccde22c0cd0f3b05f072bcd24112 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Wed, 26 Jul 2023 20:52:14 +0100 Subject: [PATCH 59/77] feat: generate the wagmi config dynamically by reading the deployment artifacts from all the chains --- contracts/wagmi.config.ts | 88 ++++++++++++++++++++++++++++++++++----- 1 file changed, 78 insertions(+), 10 deletions(-) diff --git a/contracts/wagmi.config.ts b/contracts/wagmi.config.ts index 62a90cf2b..7d35a08c7 100644 --- a/contracts/wagmi.config.ts +++ b/contracts/wagmi.config.ts @@ -1,8 +1,9 @@ +import { readdir, readFile } from "fs/promises"; +import { parse, join } from "path"; import { Config, ContractConfig, defineConfig } from "@wagmi/cli"; -import { arbitrumGoerli, gnosisChiado } from "wagmi/chains"; -import HomeGatewayToGnosis from "@kleros/kleros-v2-contracts/deployments/arbitrumGoerli/HomeGatewayToGnosis.json" assert { type: "json" }; -import IHomeGateway from "@kleros/kleros-v2-contracts/artifacts/src/gateway/interfaces/IHomeGateway.sol/IHomeGateway.json" assert { type: "json" }; import { Abi } from "viem"; +import { Chain } from "@wagmi/chains"; +import IHomeGateway from "@kleros/kleros-v2-contracts/artifacts/src/gateway/interfaces/IHomeGateway.sol/IHomeGateway.json" assert { type: "json" }; type ArtifactPartial = { abi: Abi; @@ -12,17 +13,84 @@ const getAbi = (artifact: any) => { return (artifact as ArtifactPartial).abi; }; +const readArtifacts = async (viemChainName: string, hardhatChainName?: string) => { + const chains = await import("wagmi/chains"); + const chain = chains[viemChainName] as Chain; + if (!chain) { + throw new Error(`Viem chain ${viemChainName} not found`); + } + + const directoryPath = `./deployments/${hardhatChainName ?? viemChainName}`; + const files = await readdir(directoryPath); + + const results: ContractConfig[] = []; + for (const file of files) { + const { name, ext } = parse(file); + if (ext === ".json") { + const filePath = join(directoryPath, file); + const fileContent = await readFile(filePath, "utf-8"); + const jsonContent = JSON.parse(fileContent); + results.push({ + name: name, + address: { + [chain.id]: jsonContent.address as `0x{string}`, + }, + abi: jsonContent.abi, + }); + } + } + return results; +}; + +// Group contracts by name and merge the address dictionary +function merge(arr1: ContractConfig[], arr2: ContractConfig[]) { + const mergedArr: ContractConfig[] = [...arr1]; + for (const contract of arr2) { + const index = mergedArr.findIndex((c) => c.name === contract.name); + if (index === -1) { + mergedArr.push(contract); + } else { + mergedArr[index] = { + ...mergedArr[index], + address: { + ...(mergedArr[index].address as Record), + ...(contract.address as Record), + }, + }; + } + } + return mergedArr; +} + const getConfig = async (): Promise => { + const arbitrumGoerliContracts = await readArtifacts("arbitrumGoerli"); + arbitrumGoerliContracts.forEach((c) => console.log("✔ Found arbitrumGoerli artifact: %s", c.name)); + let contracts = arbitrumGoerliContracts; + + const chiadoContracts = await readArtifacts("gnosisChiado", "chiado"); // renaming the Hardhat network improves this but breaks many other scripts + chiadoContracts.forEach((c) => console.log("✔ Found chiado artifact: %s", c.name)); + contracts = merge(contracts, chiadoContracts); + + const goerliContracts = await readArtifacts("goerli"); + goerliContracts.forEach((c) => console.log("✔ Found goerli artifact: %s", c.name)); + contracts = merge(contracts, goerliContracts); + + const arbitrumContracts = await readArtifacts("arbitrum"); + arbitrumContracts.forEach((c) => console.log("✔ Found arbitrum artifact: %s", c.name)); + contracts = merge(contracts, arbitrumContracts); + + const gnosisContracts = await readArtifacts("gnosis", "gnosischain"); + gnosisContracts.forEach((c) => console.log("✔ Found gnosis artifact: %s", c.name)); + contracts = merge(contracts, gnosisContracts); + + const mainnetContracts = await readArtifacts("mainnet"); + mainnetContracts.forEach((c) => console.log("✔ Found mainnet artifact: %s", c.name)); + contracts = merge(contracts, mainnetContracts); + return { out: "viem/generated.ts", contracts: [ - { - name: "HomeGatewayToGnosis", - address: { - [arbitrumGoerli.id]: HomeGatewayToGnosis.address as `0x{string}`, - }, - abi: getAbi(HomeGatewayToGnosis), - }, + ...contracts, { name: "IHomeGateway", abi: getAbi(IHomeGateway), From c146566456ecbc19866266fda800fd40d0041359 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Thu, 28 Dec 2023 00:11:13 +0100 Subject: [PATCH 60/77] chore: migration to arbi sepolia, bumped typescription beause viem requires v5 --- contracts/package.json | 2 +- contracts/scripts/viem-test.ts | 14 +++++++------- contracts/wagmi.config.ts | 12 ++++++------ eslint-config/package.json | 2 +- web/package.json | 4 ++-- yarn.lock | 32 ++++++++++++++++---------------- 6 files changed, 33 insertions(+), 33 deletions(-) diff --git a/contracts/package.json b/contracts/package.json index ea6e513ef..d99586502 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -81,7 +81,7 @@ "solidity-coverage": "0.8.2", "ts-node": "^10.9.2", "typechain": "^8.3.2", - "typescript": "^4.9.5" + "typescript": "^5.3.3" }, "dependencies": { "@kleros/vea-contracts": "^0.3.2" diff --git a/contracts/scripts/viem-test.ts b/contracts/scripts/viem-test.ts index 752e51be8..3e4dffe9c 100644 --- a/contracts/scripts/viem-test.ts +++ b/contracts/scripts/viem-test.ts @@ -1,20 +1,20 @@ import { createPublicClient, http, getContract } from "viem"; -import { arbitrumGoerli } from "viem/chains"; -import { homeGatewayToGnosisConfig } from "../viem/generated"; +import { arbitrumSepolia } from "viem/chains"; +import { disputeKitClassicConfig } from "../viem/generated"; const main = async () => { const client = createPublicClient({ - chain: arbitrumGoerli, + chain: arbitrumSepolia, transport: http(), }); - const homeGateway = getContract({ - address: homeGatewayToGnosisConfig.address[arbitrumGoerli.id], - abi: homeGatewayToGnosisConfig.abi, + const disputeKit = getContract({ + address: disputeKitClassicConfig.address[arbitrumSepolia.id], + abi: disputeKitClassicConfig.abi, publicClient: client, }); - await homeGateway.read.governor().then(console.log); + await disputeKit.read.governor().then(console.log); }; main() diff --git a/contracts/wagmi.config.ts b/contracts/wagmi.config.ts index 7d35a08c7..4e22e9425 100644 --- a/contracts/wagmi.config.ts +++ b/contracts/wagmi.config.ts @@ -63,17 +63,17 @@ function merge(arr1: ContractConfig[], arr2: ContractConfig[]) { } const getConfig = async (): Promise => { - const arbitrumGoerliContracts = await readArtifacts("arbitrumGoerli"); - arbitrumGoerliContracts.forEach((c) => console.log("✔ Found arbitrumGoerli artifact: %s", c.name)); - let contracts = arbitrumGoerliContracts; + const arbitrumSepoliaContracts = await readArtifacts("arbitrumSepolia", "arbitrumSepoliaDevnet"); + arbitrumSepoliaContracts.forEach((c) => console.log("✔ Found arbitrumSepolia artifact: %s", c.name)); + let contracts = arbitrumSepoliaContracts; const chiadoContracts = await readArtifacts("gnosisChiado", "chiado"); // renaming the Hardhat network improves this but breaks many other scripts chiadoContracts.forEach((c) => console.log("✔ Found chiado artifact: %s", c.name)); contracts = merge(contracts, chiadoContracts); - const goerliContracts = await readArtifacts("goerli"); - goerliContracts.forEach((c) => console.log("✔ Found goerli artifact: %s", c.name)); - contracts = merge(contracts, goerliContracts); + const sepoliaContracts = await readArtifacts("sepolia"); + sepoliaContracts.forEach((c) => console.log("✔ Found sepolia artifact: %s", c.name)); + contracts = merge(contracts, sepoliaContracts); const arbitrumContracts = await readArtifacts("arbitrum"); arbitrumContracts.forEach((c) => console.log("✔ Found arbitrum artifact: %s", c.name)); diff --git a/eslint-config/package.json b/eslint-config/package.json index 8764a6c99..f1bc07a90 100644 --- a/eslint-config/package.json +++ b/eslint-config/package.json @@ -18,7 +18,7 @@ "eslint-utils": "^3.0.0" }, "devDependencies": { - "typescript": "^4.9.5" + "typescript": "^5.3.3" }, "peerDependencies": { "eslint": "8.x" diff --git a/web/package.json b/web/package.json index 258e7cc63..e86fc436f 100644 --- a/web/package.json +++ b/web/package.json @@ -67,7 +67,7 @@ "lru-cache": "^7.18.3", "parcel": "2.8.3", "supabase": "^1.102.2", - "typescript": "^4.9.5" + "typescript": "^5.3.3" }, "dependencies": { "@filebase/client": "^0.0.5", @@ -104,7 +104,7 @@ "react-toastify": "^9.1.3", "react-use": "^17.4.0", "styled-components": "^5.3.9", - "viem": "^1.20.3", + "viem": "^1.21.1", "wagmi": "^1.4.12" }, "volta": { diff --git a/yarn.lock b/yarn.lock index 01b2f210a..ced0b478b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5387,7 +5387,7 @@ __metadata: solidity-coverage: 0.8.2 ts-node: ^10.9.2 typechain: ^8.3.2 - typescript: ^4.9.5 + typescript: ^5.3.3 languageName: unknown linkType: soft @@ -5406,7 +5406,7 @@ __metadata: eslint-plugin-promise: ^5.2.0 eslint-plugin-security: ^1.7.1 eslint-utils: ^3.0.0 - typescript: ^4.9.5 + typescript: ^5.3.3 peerDependencies: eslint: 8.x languageName: unknown @@ -5506,8 +5506,8 @@ __metadata: react-use: ^17.4.0 styled-components: ^5.3.9 supabase: ^1.102.2 - typescript: ^4.9.5 - viem: ^1.20.3 + typescript: ^5.3.3 + viem: ^1.21.1 wagmi: ^1.4.12 languageName: unknown linkType: soft @@ -31730,13 +31730,13 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^4.9.5": - version: 4.9.5 - resolution: "typescript@npm:4.9.5" +"typescript@npm:^5.3.3": + version: 5.3.3 + resolution: "typescript@npm:5.3.3" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: ee000bc26848147ad423b581bd250075662a354d84f0e06eb76d3b892328d8d4440b7487b5a83e851b12b255f55d71835b008a66cbf8f255a11e4400159237db + checksum: 2007ccb6e51bbbf6fde0a78099efe04dc1c3dfbdff04ca3b6a8bc717991862b39fd6126c0c3ebf2d2d98ac5e960bcaa873826bb2bb241f14277034148f41f6a2 languageName: node linkType: hard @@ -31750,13 +31750,13 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@^4.9.5#~builtin": - version: 4.9.5 - resolution: "typescript@patch:typescript@npm%3A4.9.5#~builtin::version=4.9.5&hash=ad5954" +"typescript@patch:typescript@^5.3.3#~builtin": + version: 5.3.3 + resolution: "typescript@patch:typescript@npm%3A5.3.3#~builtin::version=5.3.3&hash=ad5954" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 8f6260acc86b56bfdda6004bc53f32ea548f543e8baef7071c8e34d29d292f3e375c8416556c8de10b24deef6933cd1c16a8233dc84a3dd43a13a13265d0faab + checksum: f61375590b3162599f0f0d5b8737877ac0a7bc52761dbb585d67e7b8753a3a4c42d9a554c4cc929f591ffcf3a2b0602f65ae3ce74714fd5652623a816862b610 languageName: node linkType: hard @@ -32469,9 +32469,9 @@ __metadata: languageName: node linkType: hard -"viem@npm:^1.20.3": - version: 1.20.3 - resolution: "viem@npm:1.20.3" +"viem@npm:^1.21.1": + version: 1.21.1 + resolution: "viem@npm:1.21.1" dependencies: "@adraffy/ens-normalize": 1.10.0 "@noble/curves": 1.2.0 @@ -32486,7 +32486,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 92fffbc1715482969b6af7ac6df51cbd4cfe4e6d55226562eb0658a16b9a9b3df743c1ec1aebb63221b5117d4956fb2f71788bc06f6316d054ac402406614b31 + checksum: ba6d296ce271e8068d0dd3cecfbe254cc046cda4acf9393f36045d1a60aa6c669b259dc82a09a3a100c8cb0930142906280782181f341b43496789239332cd9b languageName: node linkType: hard From 9030b51f5f3367517a3ea006a3157cc4e10088d0 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Thu, 28 Dec 2023 00:14:36 +0100 Subject: [PATCH 61/77] chore: updated browserslist db --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index ced0b478b..e18b15aad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13029,9 +13029,9 @@ __metadata: linkType: hard "caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001464, caniuse-lite@npm:^1.0.30001503": - version: 1.0.30001506 - resolution: "caniuse-lite@npm:1.0.30001506" - checksum: 0a090745824622df146e2f6dde79c7f7920a899dec1b3a599d2ef9acf41cef5e179fd133bb59f2030286a4ea935f4230e05438d7394694c414e8ada345eb5268 + version: 1.0.30001572 + resolution: "caniuse-lite@npm:1.0.30001572" + checksum: 7d017a99a38e29ccee4ed3fc0ef1eb90cf082fcd3a7909c5c536c4ba1d55c5b26ecc1e4ad82c1caa6bfadce526764b354608710c9b61a75bdc7ce8ca15c5fcf2 languageName: node linkType: hard From 16d8dc63d431178c3bcf8a60970e8b2711fdfa15 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Thu, 28 Dec 2023 01:13:07 +0100 Subject: [PATCH 62/77] refactor: extracted deployment-specific wagmi configs --- contracts/package.json | 5 +- contracts/tsconfig.json | 3 +- contracts/wagmi.config.devnet.ts | 30 +++++++++ contracts/wagmi.config.hardhat.ts | 4 +- contracts/wagmi.config.mainnet.ts | 30 +++++++++ contracts/wagmi.config.testnet.ts | 30 +++++++++ contracts/wagmi.config.ts | 102 ------------------------------ 7 files changed, 99 insertions(+), 105 deletions(-) create mode 100644 contracts/wagmi.config.devnet.ts create mode 100644 contracts/wagmi.config.mainnet.ts create mode 100644 contracts/wagmi.config.testnet.ts delete mode 100644 contracts/wagmi.config.ts diff --git a/contracts/package.json b/contracts/package.json index d99586502..f2c791b18 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -25,7 +25,10 @@ "deploy-local": "hardhat deploy --tags Arbitration,HomeArbitrable --network localhost", "simulate": "hardhat simulate:all", "simulate-local": "hardhat simulate:all --network localhost", - "viem:generate": "NODE_NO_WARNINGS=1 wagmi generate", + "viem:generate-devnet": "NODE_NO_WARNINGS=1 wagmi generate -c wagmi.config.devnet.ts", + "viem:generate-testnet": "NODE_NO_WARNINGS=1 wagmi generate -c wagmi.config.testnet.ts", + "viem:generate-mainnet": "NODE_NO_WARNINGS=1 wagmi generate -c wagmi.config.mainnet.ts", + "viem:generate-hardhat": "NODE_NO_WARNINGS=1 wagmi generate -c wagmi.config.hardhat.ts", "viem:test": "NODE_NO_WARNINGS=1 NODE_OPTIONS=--experimental-fetch ts-node ./scripts/viem-test.ts", "bot:keeper": "NODE_NO_WARNINGS=1 NODE_OPTIONS=--experimental-fetch hardhat run ./scripts/keeperBot.ts", "bot:relayer-from-chiado": "NODE_NO_WARNINGS=1 NODE_OPTIONS=--experimental-fetch hardhat run ./scripts/disputeRelayerBotFromChiado.ts", diff --git a/contracts/tsconfig.json b/contracts/tsconfig.json index b6d222642..585063970 100644 --- a/contracts/tsconfig.json +++ b/contracts/tsconfig.json @@ -5,7 +5,8 @@ "./scripts", "./test", "./typechain-types", - "./deploy" + "./deploy", + "./viem" ], "files": [ "./hardhat.config.ts" diff --git a/contracts/wagmi.config.devnet.ts b/contracts/wagmi.config.devnet.ts new file mode 100644 index 000000000..3f21f32a4 --- /dev/null +++ b/contracts/wagmi.config.devnet.ts @@ -0,0 +1,30 @@ +import { Config, defineConfig } from "@wagmi/cli"; +import IHomeGateway from "@kleros/kleros-v2-contracts/artifacts/src/gateway/interfaces/IHomeGateway.sol/IHomeGateway.json" assert { type: "json" }; +import { getAbi, readArtifacts, merge } from "./scripts/wagmiHelpers"; + +const getConfig = async (): Promise => { + const arbitrumSepoliaContracts = await readArtifacts("arbitrumSepolia", "arbitrumSepoliaDevnet"); + arbitrumSepoliaContracts.forEach((c) => console.log("✔ Found arbitrumSepolia artifact: %s", c.name)); + let contracts = arbitrumSepoliaContracts; + + const chiadoContracts = await readArtifacts("gnosisChiado", "chiadoDevnet"); // renaming the Hardhat network improves this but breaks many other scripts + chiadoContracts.forEach((c) => console.log("✔ Found chiado artifact: %s", c.name)); + contracts = merge(contracts, chiadoContracts); + + const sepoliaContracts = await readArtifacts("sepolia", "sepoliaDevnet"); + sepoliaContracts.forEach((c) => console.log("✔ Found sepolia artifact: %s", c.name)); + contracts = merge(contracts, sepoliaContracts); + + return { + out: "viem/generated.devnet.ts", + contracts: [ + ...contracts, + { + name: "IHomeGateway", + abi: getAbi(IHomeGateway), + }, + ], + }; +}; + +export default defineConfig(getConfig); diff --git a/contracts/wagmi.config.hardhat.ts b/contracts/wagmi.config.hardhat.ts index 497ae6a49..41735176b 100644 --- a/contracts/wagmi.config.hardhat.ts +++ b/contracts/wagmi.config.hardhat.ts @@ -1,12 +1,14 @@ import { defineConfig } from "@wagmi/cli"; import { hardhat } from "@wagmi/cli/plugins"; +// Useful for contracts which are not deployed yet export default defineConfig({ out: "viem/generated.hardhat.ts", - contracts: [], plugins: [ hardhat({ project: ".", + namePrefix: "Hardhat", + exclude: ["Initializable.json", "UpgradedByRewrite.json"], // These artifacts crash the wagmi cli name generator }), ], }); diff --git a/contracts/wagmi.config.mainnet.ts b/contracts/wagmi.config.mainnet.ts new file mode 100644 index 000000000..c02e9e99c --- /dev/null +++ b/contracts/wagmi.config.mainnet.ts @@ -0,0 +1,30 @@ +import { Config, defineConfig } from "@wagmi/cli"; +import IHomeGateway from "@kleros/kleros-v2-contracts/artifacts/src/gateway/interfaces/IHomeGateway.sol/IHomeGateway.json" assert { type: "json" }; +import { getAbi, readArtifacts, merge } from "./scripts/wagmiHelpers"; + +const getConfig = async (): Promise => { + const arbitrumContracts = await readArtifacts("arbitrum"); + arbitrumContracts.forEach((c) => console.log("✔ Found arbitrum artifact: %s", c.name)); + let contracts = arbitrumContracts; + + const gnosisContracts = await readArtifacts("gnosis", "gnosischain"); + gnosisContracts.forEach((c) => console.log("✔ Found gnosis artifact: %s", c.name)); + contracts = merge(contracts, gnosisContracts); + + const mainnetContracts = await readArtifacts("mainnet"); + mainnetContracts.forEach((c) => console.log("✔ Found mainnet artifact: %s", c.name)); + contracts = merge(contracts, mainnetContracts); + + return { + out: "viem/generated.mainnet.ts", + contracts: [ + ...contracts, + { + name: "IHomeGateway", + abi: getAbi(IHomeGateway), + }, + ], + }; +}; + +export default defineConfig(getConfig); diff --git a/contracts/wagmi.config.testnet.ts b/contracts/wagmi.config.testnet.ts new file mode 100644 index 000000000..07c307510 --- /dev/null +++ b/contracts/wagmi.config.testnet.ts @@ -0,0 +1,30 @@ +import { Config, defineConfig } from "@wagmi/cli"; +import IHomeGateway from "@kleros/kleros-v2-contracts/artifacts/src/gateway/interfaces/IHomeGateway.sol/IHomeGateway.json" assert { type: "json" }; +import { getAbi, readArtifacts, merge } from "./scripts/wagmiHelpers"; + +const getConfig = async (): Promise => { + const arbitrumSepoliaContracts = await readArtifacts("arbitrumSepolia"); + arbitrumSepoliaContracts.forEach((c) => console.log("✔ Found arbitrumSepolia artifact: %s", c.name)); + let contracts = arbitrumSepoliaContracts; + + const chiadoContracts = await readArtifacts("gnosisChiado", "chiado"); // renaming the Hardhat network improves this but breaks many other scripts + chiadoContracts.forEach((c) => console.log("✔ Found chiado artifact: %s", c.name)); + contracts = merge(contracts, chiadoContracts); + + const sepoliaContracts = await readArtifacts("sepolia"); + sepoliaContracts.forEach((c) => console.log("✔ Found sepolia artifact: %s", c.name)); + contracts = merge(contracts, sepoliaContracts); + + return { + out: "viem/generated.testnet.ts", + contracts: [ + ...contracts, + { + name: "IHomeGateway", + abi: getAbi(IHomeGateway), + }, + ], + }; +}; + +export default defineConfig(getConfig); diff --git a/contracts/wagmi.config.ts b/contracts/wagmi.config.ts deleted file mode 100644 index 4e22e9425..000000000 --- a/contracts/wagmi.config.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { readdir, readFile } from "fs/promises"; -import { parse, join } from "path"; -import { Config, ContractConfig, defineConfig } from "@wagmi/cli"; -import { Abi } from "viem"; -import { Chain } from "@wagmi/chains"; -import IHomeGateway from "@kleros/kleros-v2-contracts/artifacts/src/gateway/interfaces/IHomeGateway.sol/IHomeGateway.json" assert { type: "json" }; - -type ArtifactPartial = { - abi: Abi; -}; - -const getAbi = (artifact: any) => { - return (artifact as ArtifactPartial).abi; -}; - -const readArtifacts = async (viemChainName: string, hardhatChainName?: string) => { - const chains = await import("wagmi/chains"); - const chain = chains[viemChainName] as Chain; - if (!chain) { - throw new Error(`Viem chain ${viemChainName} not found`); - } - - const directoryPath = `./deployments/${hardhatChainName ?? viemChainName}`; - const files = await readdir(directoryPath); - - const results: ContractConfig[] = []; - for (const file of files) { - const { name, ext } = parse(file); - if (ext === ".json") { - const filePath = join(directoryPath, file); - const fileContent = await readFile(filePath, "utf-8"); - const jsonContent = JSON.parse(fileContent); - results.push({ - name: name, - address: { - [chain.id]: jsonContent.address as `0x{string}`, - }, - abi: jsonContent.abi, - }); - } - } - return results; -}; - -// Group contracts by name and merge the address dictionary -function merge(arr1: ContractConfig[], arr2: ContractConfig[]) { - const mergedArr: ContractConfig[] = [...arr1]; - for (const contract of arr2) { - const index = mergedArr.findIndex((c) => c.name === contract.name); - if (index === -1) { - mergedArr.push(contract); - } else { - mergedArr[index] = { - ...mergedArr[index], - address: { - ...(mergedArr[index].address as Record), - ...(contract.address as Record), - }, - }; - } - } - return mergedArr; -} - -const getConfig = async (): Promise => { - const arbitrumSepoliaContracts = await readArtifacts("arbitrumSepolia", "arbitrumSepoliaDevnet"); - arbitrumSepoliaContracts.forEach((c) => console.log("✔ Found arbitrumSepolia artifact: %s", c.name)); - let contracts = arbitrumSepoliaContracts; - - const chiadoContracts = await readArtifacts("gnosisChiado", "chiado"); // renaming the Hardhat network improves this but breaks many other scripts - chiadoContracts.forEach((c) => console.log("✔ Found chiado artifact: %s", c.name)); - contracts = merge(contracts, chiadoContracts); - - const sepoliaContracts = await readArtifacts("sepolia"); - sepoliaContracts.forEach((c) => console.log("✔ Found sepolia artifact: %s", c.name)); - contracts = merge(contracts, sepoliaContracts); - - const arbitrumContracts = await readArtifacts("arbitrum"); - arbitrumContracts.forEach((c) => console.log("✔ Found arbitrum artifact: %s", c.name)); - contracts = merge(contracts, arbitrumContracts); - - const gnosisContracts = await readArtifacts("gnosis", "gnosischain"); - gnosisContracts.forEach((c) => console.log("✔ Found gnosis artifact: %s", c.name)); - contracts = merge(contracts, gnosisContracts); - - const mainnetContracts = await readArtifacts("mainnet"); - mainnetContracts.forEach((c) => console.log("✔ Found mainnet artifact: %s", c.name)); - contracts = merge(contracts, mainnetContracts); - - return { - out: "viem/generated.ts", - contracts: [ - ...contracts, - { - name: "IHomeGateway", - abi: getAbi(IHomeGateway), - }, - ], - }; -}; - -export default defineConfig(getConfig); From d8e6f2aabd52b17ba2abd03fba0013854b5c7573 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Thu, 28 Dec 2023 01:14:06 +0100 Subject: [PATCH 63/77] fix: making the Constants library members internal so it doesn't produce its own ABI --- contracts/src/libraries/Constants.sol | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/src/libraries/Constants.sol b/contracts/src/libraries/Constants.sol index 3f0b41409..ddf0adcb5 100644 --- a/contracts/src/libraries/Constants.sol +++ b/contracts/src/libraries/Constants.sol @@ -7,14 +7,14 @@ import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /// @title Constants library Constants { // Courts - uint96 public constant FORKING_COURT = 0; // Index of the forking court. - uint96 public constant GENERAL_COURT = 1; // Index of the default (general) court. + uint96 internal constant FORKING_COURT = 0; // Index of the forking court. + uint96 internal constant GENERAL_COURT = 1; // Index of the default (general) court. // Dispute Kits - uint256 public constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent. - uint256 public constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped. + uint256 internal constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent. + uint256 internal constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped. // Defaults - uint256 public constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute. - IERC20 public constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1. + uint256 internal constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute. + IERC20 internal constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1. } From 106a2d98d03d28e281b75ac7533a4d28a99bab1f Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Thu, 28 Dec 2023 01:36:46 +0100 Subject: [PATCH 64/77] fix(CVE-2023-45133): forced resolution of @babel/traverse to the latest version --- package.json | 3 +- yarn.lock | 126 ++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 117 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 840717250..629534917 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,8 @@ "node-fetch": "^2.6.7", "underscore@npm^3.0.4": "^1.12.1", "eth-sig-util@npm:^1.4.2": "3.0.0", - "fast-xml-parser": "^4.2.5" + "fast-xml-parser": "^4.2.5", + "@babel/traverse:^7.22.5": "^7.23.6" }, "scripts": { "check-prerequisites": "scripts/check-prerequisites.sh", diff --git a/yarn.lock b/yarn.lock index e18b15aad..0ba7433f5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1266,6 +1266,16 @@ __metadata: languageName: node linkType: hard +"@babel/code-frame@npm:^7.22.13, @babel/code-frame@npm:^7.23.5": + version: 7.23.5 + resolution: "@babel/code-frame@npm:7.23.5" + dependencies: + "@babel/highlight": ^7.23.4 + chalk: ^2.4.2 + checksum: d90981fdf56a2824a9b14d19a4c0e8db93633fd488c772624b4e83e0ceac6039a27cd298a247c3214faa952bf803ba23696172ae7e7235f3b97f43ba278c569a + languageName: node + linkType: hard + "@babel/compat-data@npm:^7.17.7, @babel/compat-data@npm:^7.20.5, @babel/compat-data@npm:^7.22.5": version: 7.22.5 resolution: "@babel/compat-data@npm:7.22.5" @@ -1322,6 +1332,18 @@ __metadata: languageName: node linkType: hard +"@babel/generator@npm:^7.23.6": + version: 7.23.6 + resolution: "@babel/generator@npm:7.23.6" + dependencies: + "@babel/types": ^7.23.6 + "@jridgewell/gen-mapping": ^0.3.2 + "@jridgewell/trace-mapping": ^0.3.17 + jsesc: ^2.5.1 + checksum: 1a1a1c4eac210f174cd108d479464d053930a812798e09fee069377de39a893422df5b5b146199ead7239ae6d3a04697b45fc9ac6e38e0f6b76374390f91fc6c + languageName: node + linkType: hard + "@babel/helper-annotate-as-pure@npm:^7.18.6, @babel/helper-annotate-as-pure@npm:^7.22.5": version: 7.22.5 resolution: "@babel/helper-annotate-as-pure@npm:7.22.5" @@ -1403,6 +1425,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-environment-visitor@npm:^7.22.20": + version: 7.22.20 + resolution: "@babel/helper-environment-visitor@npm:7.22.20" + checksum: d80ee98ff66f41e233f36ca1921774c37e88a803b2f7dca3db7c057a5fea0473804db9fb6729e5dbfd07f4bed722d60f7852035c2c739382e84c335661590b69 + languageName: node + linkType: hard + "@babel/helper-environment-visitor@npm:^7.22.5": version: 7.22.5 resolution: "@babel/helper-environment-visitor@npm:7.22.5" @@ -1420,6 +1449,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-function-name@npm:^7.23.0": + version: 7.23.0 + resolution: "@babel/helper-function-name@npm:7.23.0" + dependencies: + "@babel/template": ^7.22.15 + "@babel/types": ^7.23.0 + checksum: e44542257b2d4634a1f979244eb2a4ad8e6d75eb6761b4cfceb56b562f7db150d134bc538c8e6adca3783e3bc31be949071527aa8e3aab7867d1ad2d84a26e10 + languageName: node + linkType: hard + "@babel/helper-hoist-variables@npm:^7.22.5": version: 7.22.5 resolution: "@babel/helper-hoist-variables@npm:7.22.5" @@ -1534,6 +1573,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-split-export-declaration@npm:^7.22.6": + version: 7.22.6 + resolution: "@babel/helper-split-export-declaration@npm:7.22.6" + dependencies: + "@babel/types": ^7.22.5 + checksum: e141cace583b19d9195f9c2b8e17a3ae913b7ee9b8120246d0f9ca349ca6f03cb2c001fd5ec57488c544347c0bb584afec66c936511e447fd20a360e591ac921 + languageName: node + linkType: hard + "@babel/helper-string-parser@npm:^7.22.5": version: 7.22.5 resolution: "@babel/helper-string-parser@npm:7.22.5" @@ -1541,6 +1589,20 @@ __metadata: languageName: node linkType: hard +"@babel/helper-string-parser@npm:^7.23.4": + version: 7.23.4 + resolution: "@babel/helper-string-parser@npm:7.23.4" + checksum: c0641144cf1a7e7dc93f3d5f16d5327465b6cf5d036b48be61ecba41e1eece161b48f46b7f960951b67f8c3533ce506b16dece576baef4d8b3b49f8c65410f90 + languageName: node + linkType: hard + +"@babel/helper-validator-identifier@npm:^7.22.20": + version: 7.22.20 + resolution: "@babel/helper-validator-identifier@npm:7.22.20" + checksum: 136412784d9428266bcdd4d91c32bcf9ff0e8d25534a9d94b044f77fe76bc50f941a90319b05aafd1ec04f7d127cd57a179a3716009ff7f3412ef835ada95bdc + languageName: node + linkType: hard + "@babel/helper-validator-identifier@npm:^7.22.5": version: 7.22.5 resolution: "@babel/helper-validator-identifier@npm:7.22.5" @@ -1589,6 +1651,17 @@ __metadata: languageName: node linkType: hard +"@babel/highlight@npm:^7.23.4": + version: 7.23.4 + resolution: "@babel/highlight@npm:7.23.4" + dependencies: + "@babel/helper-validator-identifier": ^7.22.20 + chalk: ^2.4.2 + js-tokens: ^4.0.0 + checksum: 643acecdc235f87d925979a979b539a5d7d1f31ae7db8d89047269082694122d11aa85351304c9c978ceeb6d250591ccadb06c366f358ccee08bb9c122476b89 + languageName: node + linkType: hard + "@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.16.8, @babel/parser@npm:^7.18.4, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.22.5": version: 7.22.5 resolution: "@babel/parser@npm:7.22.5" @@ -1598,6 +1671,15 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.22.15, @babel/parser@npm:^7.23.6": + version: 7.23.6 + resolution: "@babel/parser@npm:7.23.6" + bin: + parser: ./bin/babel-parser.js + checksum: 140801c43731a6c41fd193f5c02bc71fd647a0360ca616b23d2db8be4b9739b9f951a03fc7c2db4f9b9214f4b27c1074db0f18bc3fa653783082d5af7c8860d5 + languageName: node + linkType: hard + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.22.5": version: 7.22.5 resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.22.5" @@ -2847,21 +2929,32 @@ __metadata: languageName: node linkType: hard +"@babel/template@npm:^7.22.15": + version: 7.22.15 + resolution: "@babel/template@npm:7.22.15" + dependencies: + "@babel/code-frame": ^7.22.13 + "@babel/parser": ^7.22.15 + "@babel/types": ^7.22.15 + checksum: 1f3e7dcd6c44f5904c184b3f7fe280394b191f2fed819919ffa1e529c259d5b197da8981b6ca491c235aee8dbad4a50b7e31304aa531271cb823a4a24a0dd8fd + languageName: node + linkType: hard + "@babel/traverse@npm:^7.14.0, @babel/traverse@npm:^7.16.8, @babel/traverse@npm:^7.22.5, @babel/traverse@npm:^7.4.5, @babel/traverse@npm:^7.7.2": - version: 7.22.5 - resolution: "@babel/traverse@npm:7.22.5" + version: 7.23.6 + resolution: "@babel/traverse@npm:7.23.6" dependencies: - "@babel/code-frame": ^7.22.5 - "@babel/generator": ^7.22.5 - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-function-name": ^7.22.5 + "@babel/code-frame": ^7.23.5 + "@babel/generator": ^7.23.6 + "@babel/helper-environment-visitor": ^7.22.20 + "@babel/helper-function-name": ^7.23.0 "@babel/helper-hoist-variables": ^7.22.5 - "@babel/helper-split-export-declaration": ^7.22.5 - "@babel/parser": ^7.22.5 - "@babel/types": ^7.22.5 - debug: ^4.1.0 + "@babel/helper-split-export-declaration": ^7.22.6 + "@babel/parser": ^7.23.6 + "@babel/types": ^7.23.6 + debug: ^4.3.1 globals: ^11.1.0 - checksum: 560931422dc1761f2df723778dcb4e51ce0d02e560cf2caa49822921578f49189a5a7d053b78a32dca33e59be886a6b2200a6e24d4ae9b5086ca0ba803815694 + checksum: 48f2eac0e86b6cb60dab13a5ea6a26ba45c450262fccdffc334c01089e75935f7546be195e260e97f6e43cea419862eda095018531a2718fef8189153d479f88 languageName: node linkType: hard @@ -2876,6 +2969,17 @@ __metadata: languageName: node linkType: hard +"@babel/types@npm:^7.22.15, @babel/types@npm:^7.23.0, @babel/types@npm:^7.23.6": + version: 7.23.6 + resolution: "@babel/types@npm:7.23.6" + dependencies: + "@babel/helper-string-parser": ^7.23.4 + "@babel/helper-validator-identifier": ^7.22.20 + to-fast-properties: ^2.0.0 + checksum: 68187dbec0d637f79bc96263ac95ec8b06d424396678e7e225492be866414ce28ebc918a75354d4c28659be6efe30020b4f0f6df81cc418a2d30645b690a8de0 + languageName: node + linkType: hard + "@balena/dockerignore@npm:^1.0.2": version: 1.0.2 resolution: "@balena/dockerignore@npm:1.0.2" From 51af9ed6c938d36e640cfe68d9427fd6f29f82de Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Mon, 25 Dec 2023 15:46:26 +0530 Subject: [PATCH 65/77] fix(web): fix-minor-spacing-issue --- web/src/components/Popup/index.tsx | 4 ++-- web/src/pages/Cases/CaseDetails/Timeline.tsx | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/web/src/components/Popup/index.tsx b/web/src/components/Popup/index.tsx index 1e3d58396..e1b285230 100644 --- a/web/src/components/Popup/index.tsx +++ b/web/src/components/Popup/index.tsx @@ -73,8 +73,8 @@ const VoteDescriptionContainer = styled.div` display: flex; flex-direction: column; margin-bottom: ${responsiveSize(16, 32)}; - margin-left: ${responsiveSize(8, 12)}; - margin-right: ${responsiveSize(8, 12)}; + margin-left: ${responsiveSize(8, 32)}; + margin-right: ${responsiveSize(8, 32)}; color: ${({ theme }) => theme.secondaryText}; text-align: center; line-height: 21.8px; diff --git a/web/src/pages/Cases/CaseDetails/Timeline.tsx b/web/src/pages/Cases/CaseDetails/Timeline.tsx index a2e04429e..58e703ae0 100644 --- a/web/src/pages/Cases/CaseDetails/Timeline.tsx +++ b/web/src/pages/Cases/CaseDetails/Timeline.tsx @@ -15,6 +15,8 @@ const TimeLineContainer = styled(Box)` height: 98px; border-radius: 0px; padding: ${responsiveSize(16, 48)} 8px 0px ${responsiveSize(12, 22)}; + margin-top: ${responsiveSize(16, 48)}; + margin-bottom: ${responsiveSize(12, 22)}; background-color: ${({ theme }) => theme.whiteBackground}; ${landscapeStyle( From e345d8fa22f0e6416d15057031be2d9cf8e10150 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Thu, 28 Dec 2023 18:59:35 +0100 Subject: [PATCH 66/77] chore: bots config update --- services/bots/devnet/bots.env.devnet.example | 2 +- services/bots/devnet/compose.yml | 10 ++++++++++ services/bots/devnet/pm2.config.keeper-bot.devnet.js | 2 +- .../pm2.config.relayer-bot-from-chiado.devnet.js | 2 +- .../pm2.config.relayer-bot-from-goerli.devnet.js | 2 +- services/bots/testnet/compose.yml | 2 +- .../bots/testnet/pm2.config.disputor-bot.testnet.js | 2 +- services/bots/testnet/pm2.config.keeper-bot.testnet.js | 2 +- .../pm2.config.relayer-bot-from-chiado.testnet.js | 2 +- .../pm2.config.relayer-bot-from-goerli.testnet.js | 2 +- web/.env.testnet.public | 4 ++-- 11 files changed, 21 insertions(+), 11 deletions(-) diff --git a/services/bots/devnet/bots.env.devnet.example b/services/bots/devnet/bots.env.devnet.example index 890b874ed..6c99db90b 100644 --- a/services/bots/devnet/bots.env.devnet.example +++ b/services/bots/devnet/bots.env.devnet.example @@ -2,7 +2,7 @@ PRIVATE_KEY=0x000000.....00000 # Bot subgraph -SUBGRAPH_URL=https://api.thegraph.com/subgraphs/name/ +SUBGRAPH_URL=https://api.thegraph.com/subgraphs/name/ # Logging LOG_LEVEL=debug diff --git a/services/bots/devnet/compose.yml b/services/bots/devnet/compose.yml index e8da805d6..01dab97d1 100644 --- a/services/bots/devnet/compose.yml +++ b/services/bots/devnet/compose.yml @@ -10,6 +10,16 @@ services: source: ./pm2.config.keeper-bot.${DEPLOYMENT}.js target: /usr/src/app/contracts/ecosystem.config.js + disputor-bot: + container_name: disputor-bot-${DEPLOYMENT:?error} + extends: + file: ../base/bot-pm2.yml + service: bot-pm2 + volumes: + - type: bind + source: ./pm2.config.disputor-bot.${DEPLOYMENT}.js + target: /usr/src/app/contracts/ecosystem.config.js + relayer-bot-from-chiado: container_name: relayer-bot-from-chiado-${DEPLOYMENT:?error} extends: diff --git a/services/bots/devnet/pm2.config.keeper-bot.devnet.js b/services/bots/devnet/pm2.config.keeper-bot.devnet.js index 92f6e8162..9517a4787 100644 --- a/services/bots/devnet/pm2.config.keeper-bot.devnet.js +++ b/services/bots/devnet/pm2.config.keeper-bot.devnet.js @@ -5,7 +5,7 @@ module.exports = { interpreter: "sh", script: "yarn", args: "bot:keeper --network arbitrumSepoliaDevnet", - restart_delay: 600000, + restart_delay: 600000, // 10 minutes autorestart: true, }, ], diff --git a/services/bots/devnet/pm2.config.relayer-bot-from-chiado.devnet.js b/services/bots/devnet/pm2.config.relayer-bot-from-chiado.devnet.js index 4ac329193..76acd90a1 100644 --- a/services/bots/devnet/pm2.config.relayer-bot-from-chiado.devnet.js +++ b/services/bots/devnet/pm2.config.relayer-bot-from-chiado.devnet.js @@ -5,7 +5,7 @@ module.exports = { interpreter: "sh", script: "yarn", args: "bot:relayer-from-chiado --network arbitrumSepoliaDevnet", - restart_delay: 5000, + restart_delay: 5000, // 5 seconds autorestart: true, }, ], diff --git a/services/bots/devnet/pm2.config.relayer-bot-from-goerli.devnet.js b/services/bots/devnet/pm2.config.relayer-bot-from-goerli.devnet.js index b75599c69..d450f3b38 100644 --- a/services/bots/devnet/pm2.config.relayer-bot-from-goerli.devnet.js +++ b/services/bots/devnet/pm2.config.relayer-bot-from-goerli.devnet.js @@ -5,7 +5,7 @@ module.exports = { interpreter: "sh", script: "yarn", args: "bot:relayer-from-sepolia --network arbitrumSepoliaDevnet", - restart_delay: 5000, + restart_delay: 5000, // 5 seconds autorestart: true, }, ], diff --git a/services/bots/testnet/compose.yml b/services/bots/testnet/compose.yml index 807e8b4bd..01dab97d1 100644 --- a/services/bots/testnet/compose.yml +++ b/services/bots/testnet/compose.yml @@ -9,7 +9,7 @@ services: - type: bind source: ./pm2.config.keeper-bot.${DEPLOYMENT}.js target: /usr/src/app/contracts/ecosystem.config.js - + disputor-bot: container_name: disputor-bot-${DEPLOYMENT:?error} extends: diff --git a/services/bots/testnet/pm2.config.disputor-bot.testnet.js b/services/bots/testnet/pm2.config.disputor-bot.testnet.js index 146f4e7ff..1c1a435a2 100644 --- a/services/bots/testnet/pm2.config.disputor-bot.testnet.js +++ b/services/bots/testnet/pm2.config.disputor-bot.testnet.js @@ -5,7 +5,7 @@ module.exports = { interpreter: "sh", script: "yarn", args: "bot:disputor --network arbitrumSepolia", - restart_delay: 43200000, // 12 hours + restart_delay: 86400000, // 24 hours autorestart: true, }, ], diff --git a/services/bots/testnet/pm2.config.keeper-bot.testnet.js b/services/bots/testnet/pm2.config.keeper-bot.testnet.js index 21c308dcb..22471c6b4 100644 --- a/services/bots/testnet/pm2.config.keeper-bot.testnet.js +++ b/services/bots/testnet/pm2.config.keeper-bot.testnet.js @@ -5,7 +5,7 @@ module.exports = { interpreter: "sh", script: "yarn", args: "bot:keeper --network arbitrumSepolia", - restart_delay: 600000, + restart_delay: 600000, // 10 minutes autorestart: true, }, ], diff --git a/services/bots/testnet/pm2.config.relayer-bot-from-chiado.testnet.js b/services/bots/testnet/pm2.config.relayer-bot-from-chiado.testnet.js index efa24d648..9265b1cde 100644 --- a/services/bots/testnet/pm2.config.relayer-bot-from-chiado.testnet.js +++ b/services/bots/testnet/pm2.config.relayer-bot-from-chiado.testnet.js @@ -5,7 +5,7 @@ module.exports = { interpreter: "sh", script: "yarn", args: "bot:relayer-from-chiado --network arbitrumSepolia", - restart_delay: 5000, + restart_delay: 5000, // 5 seconds autorestart: true, }, ], diff --git a/services/bots/testnet/pm2.config.relayer-bot-from-goerli.testnet.js b/services/bots/testnet/pm2.config.relayer-bot-from-goerli.testnet.js index 3a9b173af..f8620fafd 100644 --- a/services/bots/testnet/pm2.config.relayer-bot-from-goerli.testnet.js +++ b/services/bots/testnet/pm2.config.relayer-bot-from-goerli.testnet.js @@ -5,7 +5,7 @@ module.exports = { interpreter: "sh", script: "yarn", args: "bot:relayer-from-sepolia --network arbitrumSepolia", - restart_delay: 5000, + restart_delay: 5000, // 5 seconds autorestart: true, }, ], diff --git a/web/.env.testnet.public b/web/.env.testnet.public index daca8c206..5d5f8e3d1 100644 --- a/web/.env.testnet.public +++ b/web/.env.testnet.public @@ -1,5 +1,5 @@ # Do not enter sensitive information here. export REACT_APP_DEPLOYMENT=testnet -export REACT_APP_CORE_SUBGRAPH=REDEPLOY SUBGRAPH IN ARBSEPOLIA AND PUT API THEGRAPH LINK HERE -export REACT_APP_DRT_ARBSEPOLIA_SUBGRAPH=REDEPLOY SUBGRAPH IN ARBSEPOLIA AND PUT API THEGRAPH LINK HERE +export REACT_APP_CORE_SUBGRAPH=https://api.studio.thegraph.com/query/61738/kleros-v2-core-testnet/v0.0.2 +export REACT_APP_DRT_ARBSEPOLIA_SUBGRAPH=https://api.studio.thegraph.com/query/61738/kleros-v2-drt-arbisep-devnet/v0.0.2 export REACT_APP_STATUS_URL=https://kleros-v2.betteruptime.com/badge From 46ad4581d4821d0e1b7ab7426fcbeb5931c4a6cd Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Thu, 28 Dec 2023 19:46:26 +0100 Subject: [PATCH 67/77] chore: deployment artifacts and config --- contracts/README.md | 16 + .../arbitrumSepolia/ArbitrableExample.json | 618 ++++ .../arbitrumSepolia/BlockHashRNG.json | 133 + .../deployments/arbitrumSepolia/DAI.json | 458 +++ .../arbitrumSepolia/DAIFaucet.json | 226 ++ .../arbitrumSepolia/DisputeKitClassic.json | 1011 +++++++ .../DisputeKitClassic_Implementation.json | 1530 ++++++++++ .../DisputeKitClassic_Proxy.json | 93 + .../arbitrumSepolia/DisputeResolver.json | 522 ++++ .../DisputeTemplateRegistry.json | 311 ++ ...isputeTemplateRegistry_Implementation.json | 392 +++ .../DisputeTemplateRegistry_Proxy.json | 93 + .../deployments/arbitrumSepolia/Escrow.json | 1081 +++++++ .../arbitrumSepolia/EvidenceModule.json | 268 ++ .../EvidenceModule_Implementation.json | 327 +++ .../arbitrumSepolia/EvidenceModule_Proxy.json | 93 + .../arbitrumSepolia/KlerosCore.json | 1905 ++++++++++++ .../KlerosCore_Implementation.json | 2571 +++++++++++++++++ .../arbitrumSepolia/KlerosCore_Proxy.json | 136 + .../arbitrumSepolia/PNKFaucet.json | 226 ++ .../arbitrumSepolia/PolicyRegistry.json | 305 ++ .../PolicyRegistry_Implementation.json | 397 +++ .../arbitrumSepolia/PolicyRegistry_Proxy.json | 93 + .../arbitrumSepolia/RandomizerRNG.json | 397 +++ .../RandomizerRNG_Implementation.json | 533 ++++ .../arbitrumSepolia/RandomizerRNG_Proxy.json | 93 + .../arbitrumSepolia/SortitionModule.json | 1053 +++++++ .../SortitionModule_Implementation.json | 1533 ++++++++++ .../SortitionModule_Proxy.json | 93 + .../deployments/arbitrumSepolia/WETH.json | 458 +++ .../arbitrumSepolia/WETHFaucet.json | 226 ++ contracts/hardhat.config.ts | 6 +- .../devnet/pm2.config.disputor-bot.devnet.js | 12 + web/.env.testnet.public | 1 + 34 files changed, 17207 insertions(+), 3 deletions(-) create mode 100644 contracts/deployments/arbitrumSepolia/ArbitrableExample.json create mode 100644 contracts/deployments/arbitrumSepolia/BlockHashRNG.json create mode 100644 contracts/deployments/arbitrumSepolia/DAI.json create mode 100644 contracts/deployments/arbitrumSepolia/DAIFaucet.json create mode 100644 contracts/deployments/arbitrumSepolia/DisputeKitClassic.json create mode 100644 contracts/deployments/arbitrumSepolia/DisputeKitClassic_Implementation.json create mode 100644 contracts/deployments/arbitrumSepolia/DisputeKitClassic_Proxy.json create mode 100644 contracts/deployments/arbitrumSepolia/DisputeResolver.json create mode 100644 contracts/deployments/arbitrumSepolia/DisputeTemplateRegistry.json create mode 100644 contracts/deployments/arbitrumSepolia/DisputeTemplateRegistry_Implementation.json create mode 100644 contracts/deployments/arbitrumSepolia/DisputeTemplateRegistry_Proxy.json create mode 100644 contracts/deployments/arbitrumSepolia/Escrow.json create mode 100644 contracts/deployments/arbitrumSepolia/EvidenceModule.json create mode 100644 contracts/deployments/arbitrumSepolia/EvidenceModule_Implementation.json create mode 100644 contracts/deployments/arbitrumSepolia/EvidenceModule_Proxy.json create mode 100644 contracts/deployments/arbitrumSepolia/KlerosCore.json create mode 100644 contracts/deployments/arbitrumSepolia/KlerosCore_Implementation.json create mode 100644 contracts/deployments/arbitrumSepolia/KlerosCore_Proxy.json create mode 100644 contracts/deployments/arbitrumSepolia/PNKFaucet.json create mode 100644 contracts/deployments/arbitrumSepolia/PolicyRegistry.json create mode 100644 contracts/deployments/arbitrumSepolia/PolicyRegistry_Implementation.json create mode 100644 contracts/deployments/arbitrumSepolia/PolicyRegistry_Proxy.json create mode 100644 contracts/deployments/arbitrumSepolia/RandomizerRNG.json create mode 100644 contracts/deployments/arbitrumSepolia/RandomizerRNG_Implementation.json create mode 100644 contracts/deployments/arbitrumSepolia/RandomizerRNG_Proxy.json create mode 100644 contracts/deployments/arbitrumSepolia/SortitionModule.json create mode 100644 contracts/deployments/arbitrumSepolia/SortitionModule_Implementation.json create mode 100644 contracts/deployments/arbitrumSepolia/SortitionModule_Proxy.json create mode 100644 contracts/deployments/arbitrumSepolia/WETH.json create mode 100644 contracts/deployments/arbitrumSepolia/WETHFaucet.json create mode 100644 services/bots/devnet/pm2.config.disputor-bot.devnet.js diff --git a/contracts/README.md b/contracts/README.md index e0849d831..72c3c4a5a 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -10,7 +10,23 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments #### Arbitrum Sepolia +- [ArbitrableExample](https://sepolia.arbiscan.io/address/0xE22500Fa27f696d06702367246bd17Bd2C8a4c5d) +- [BlockHashRNG](https://sepolia.arbiscan.io/address/0x991d2df165670b9cac3B022f4B68D65b664222ea) +- [DAI](https://sepolia.arbiscan.io/address/0xc34aeFEa232956542C5b2f2EE55fD5c378B35c03) +- [DAIFaucet](https://sepolia.arbiscan.io/address/0x1Fa58B52326488D62A406E71DBaD839560e810fF) +- [DisputeKitClassic: proxy](https://sepolia.arbiscan.io/address/0x8078C2A3bf93f6f69BDD4D38233E7e219eA1914e), [implementation](https://sepolia.arbiscan.io/address/0x2507018D785CE92115CfebE0d92CC496C42e99b7) +- [DisputeResolver](https://sepolia.arbiscan.io/address/0x48e052B4A6dC4F30e90930F1CeaAFd83b3981EB3) +- [DisputeTemplateRegistry: proxy](https://sepolia.arbiscan.io/address/0x553dcbF6aB3aE06a1064b5200Df1B5A9fB403d3c), [implementation](https://sepolia.arbiscan.io/address/0x15E5964C7751dF8563eA4bC000301582C79BC454) +- [Escrow](https://sepolia.arbiscan.io/address/0xF1a7Cd3115F5852966430f8E3877D2221F074A2e) +- [EvidenceModule: proxy](https://sepolia.arbiscan.io/address/0xE4066AE16685F66e30fb22e932B67E49220095c0), [implementation](https://sepolia.arbiscan.io/address/0xD8609345DEe222051337b3A8335581Cc630Df2E9) +- [KlerosCore: proxy](https://sepolia.arbiscan.io/address/0x33d0b8879368acD8ca868e656Ade97bB97b90468), [implementation](https://sepolia.arbiscan.io/address/0x6FDc191b55a03e840b36793e433A932EeCEa40BE) +- [PNKFaucet](https://sepolia.arbiscan.io/address/0x0273512759B5E80031725332da12E91E9F8Bf667) - [PinakionV2](https://sepolia.arbiscan.io/address/0x34B944D42cAcfC8266955D07A80181D2054aa225) +- [PolicyRegistry: proxy](https://sepolia.arbiscan.io/address/0xb177AC8827146AC74C412688c6b10676ca170096), [implementation](https://sepolia.arbiscan.io/address/0xd543D50dcba2c3E067296210D64c8F91206Df908) +- [RandomizerRNG: proxy](https://sepolia.arbiscan.io/address/0xaE7F3AcA5c1E40D5E51eE61e20929bbDA0CAf4DC), [implementation](https://sepolia.arbiscan.io/address/0x121F321f8F803fb88A895b969D6E26C672121149) +- [SortitionModule: proxy](https://sepolia.arbiscan.io/address/0x3645F9e08D80E47c82aD9E33fCB4EA703822C831), [implementation](https://sepolia.arbiscan.io/address/0xAf48e32f89339438572a04455b1C4B2fF1659c8f) +- [WETH](https://sepolia.arbiscan.io/address/0xAEE953CC26DbDeA52beBE3F97f281981f2B9d511) +- [WETHFaucet](https://sepolia.arbiscan.io/address/0x922B84134e41BC5c9EDE7D5EFCE22Ba3D0e71835) #### Sepolia diff --git a/contracts/deployments/arbitrumSepolia/ArbitrableExample.json b/contracts/deployments/arbitrumSepolia/ArbitrableExample.json new file mode 100644 index 000000000..610a73d36 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/ArbitrableExample.json @@ -0,0 +1,618 @@ +{ + "address": "0xE22500Fa27f696d06702367246bd17Bd2C8a4c5d", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + }, + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "_templateRegistry", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_weth", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "string", + "name": "_action", + "type": "string" + } + ], + "name": "Action", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_arbitrableDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_templateId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateUri", + "type": "string" + } + ], + "name": "DisputeRequest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "arbitratorExtraData", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + } + ], + "name": "changeArbitrator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + } + ], + "name": "changeArbitratorExtraData", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + } + ], + "name": "changeDisputeTemplate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "_templateRegistry", + "type": "address" + } + ], + "name": "changeTemplateRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_action", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_feeInWeth", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_action", + "type": "string" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "bool", + "name": "isRuled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numberOfRulingOptions", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "externalIDtoLocalID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "rule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "templateId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "templateRegistry", + "outputs": [ + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "weth", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x280907209f6536cc8cd0559bb4c96bce5337621244baf3d7fa5742e5a1d90b14", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xE22500Fa27f696d06702367246bd17Bd2C8a4c5d", + "transactionIndex": 1, + "gasUsed": "8991892", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800080000000000000000000000000000000000080000000000000000000000000000000000000008000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008020000000002000000400000000000100000000000000000000000000000000000000", + "blockHash": "0xf6d4d0680d334a0fb377950b15131b566fc213c473d04ed353bc2cc8b41f7c9c", + "transactionHash": "0x280907209f6536cc8cd0559bb4c96bce5337621244baf3d7fa5742e5a1d90b14", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842878, + "transactionHash": "0x280907209f6536cc8cd0559bb4c96bce5337621244baf3d7fa5742e5a1d90b14", + "address": "0x553dcbF6aB3aE06a1064b5200Df1B5A9fB403d3c", + "topics": [ + "0x00f7cd7255d1073b4e136dd477c38ea0020c051ab17110cc5bfab0c840ff9924", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c6469737075746554656d706c6174654d617070696e673a20544f444f00000000", + "logIndex": 0, + "blockHash": "0xf6d4d0680d334a0fb377950b15131b566fc213c473d04ed353bc2cc8b41f7c9c" + } + ], + "blockNumber": 3842878, + "cumulativeGasUsed": "8991892", + "status": 1, + "byzantium": true + }, + "args": [ + "0x33d0b8879368acD8ca868e656Ade97bB97b90468", + { + "$schema": "../NewDisputeTemplate.schema.json", + "title": "Let's do this", + "description": "We want to do this: %s", + "question": "Does it comply with the policy?", + "answers": [ + { + "title": "Yes", + "description": "Select this if you agree that it must be done." + }, + { + "title": "No", + "description": "Select this if you do not agree that it must be done." + } + ], + "policyURI": "/ipfs/Qmdvk...rSD6cE/policy.pdf", + "frontendUrl": "https://kleros-v2.netlify.app/#/cases/%s/overview", + "arbitratorChainID": "421614", + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", + "category": "Others", + "specification": "KIP001", + "lang": "en_US" + }, + "disputeTemplateMapping: TODO", + "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003", + "0x553dcbF6aB3aE06a1064b5200Df1B5A9fB403d3c", + "0xAEE953CC26DbDeA52beBE3F97f281981f2B9d511" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"_weth\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"string\",\"name\":\"_action\",\"type\":\"string\"}],\"name\":\"Action\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_arbitrableDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateUri\",\"type\":\"string\"}],\"name\":\"DisputeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"arbitratorExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"name\":\"changeArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"}],\"name\":\"changeArbitratorExtraData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"}],\"name\":\"changeDisputeTemplate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"}],\"name\":\"changeTemplateRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_action\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_feeInWeth\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_action\",\"type\":\"string\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isRuled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRulingOptions\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"externalIDtoLocalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templateId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templateRegistry\",\"outputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"weth\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"DisputeRequest(address,uint256,uint256,uint256,string)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrableDisputeID\":\"The identifier of the dispute in the Arbitrable contract.\",\"_arbitrator\":\"The arbitrator of the contract.\",\"_externalDisputeID\":\"An identifier created outside Kleros by the protocol requesting arbitration.\",\"_templateId\":\"The identifier of the dispute template. Should not be used with _templateUri.\",\"_templateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrator\":\"The arbitrator giving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_arbitrator\":\"The arbitrator to rule on created disputes.\",\"_arbitratorExtraData\":\"The extra data for the arbitrator.\",\"_templateData\":\"The dispute template data.\",\"_templateDataMappings\":\"The dispute template data mappings.\",\"_templateRegistry\":\"The dispute template registry.\",\"_weth\":\"The WETH token.\"}},\"createDispute(string)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_action\":\"The action that requires arbitration.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the dispute created.\"}},\"createDispute(string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_action\":\"The action that requires arbitration.\",\"_feeInWeth\":\"Amount of fees in WETH for the arbitrator.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the dispute created.\"}},\"rule(uint256,uint256)\":{\"details\":\"To be called by the arbitrator of the dispute, to declare the winning ruling.\",\"params\":{\"_externalDisputeID\":\"ID of the dispute in arbitrator contract.\",\"_ruling\":\"The ruling choice of the arbitration.\"}}},\"title\":\"ArbitrableExample An example of an arbitrable contract which connects to the arbitator that implements the updated interface.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/arbitrables/ArbitrableExample.sol\":\"ArbitrableExample\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/arbitrables/ArbitrableExample.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"../interfaces/IArbitrableV2.sol\\\";\\nimport \\\"../interfaces/IDisputeTemplateRegistry.sol\\\";\\nimport \\\"../../libraries/SafeERC20.sol\\\";\\n\\n/// @title ArbitrableExample\\n/// An example of an arbitrable contract which connects to the arbitator that implements the updated interface.\\ncontract ArbitrableExample is IArbitrableV2 {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n struct DisputeStruct {\\n bool isRuled; // Whether the dispute has been ruled or not.\\n uint256 ruling; // Ruling given by the arbitrator.\\n uint256 numberOfRulingOptions; // The number of choices the arbitrator can give.\\n }\\n\\n event Action(string indexed _action);\\n\\n address public immutable governor;\\n IArbitratorV2 public arbitrator; // Arbitrator is set in constructor.\\n IDisputeTemplateRegistry public templateRegistry; // The dispute template registry.\\n uint256 public templateId; // The current dispute template identifier.\\n bytes public arbitratorExtraData; // Extra data to set up the arbitration.\\n IERC20 public immutable weth; // The WETH token.\\n mapping(uint256 => uint256) public externalIDtoLocalID; // Maps external (arbitrator side) dispute IDs to local dispute IDs.\\n DisputeStruct[] public disputes; // Stores the disputes' info. disputes[disputeID].\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(address(this) == msg.sender, \\\"Only the governor allowed.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor\\n /// @param _arbitrator The arbitrator to rule on created disputes.\\n /// @param _templateData The dispute template data.\\n /// @param _templateDataMappings The dispute template data mappings.\\n /// @param _arbitratorExtraData The extra data for the arbitrator.\\n /// @param _templateRegistry The dispute template registry.\\n /// @param _weth The WETH token.\\n constructor(\\n IArbitratorV2 _arbitrator,\\n string memory _templateData,\\n string memory _templateDataMappings,\\n bytes memory _arbitratorExtraData,\\n IDisputeTemplateRegistry _templateRegistry,\\n IERC20 _weth\\n ) {\\n governor = msg.sender;\\n arbitrator = _arbitrator;\\n arbitratorExtraData = _arbitratorExtraData;\\n templateRegistry = _templateRegistry;\\n weth = _weth;\\n\\n templateId = templateRegistry.setDisputeTemplate(\\\"\\\", _templateData, _templateDataMappings);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n function changeArbitrator(IArbitratorV2 _arbitrator) external onlyByGovernor {\\n arbitrator = _arbitrator;\\n }\\n\\n function changeArbitratorExtraData(bytes calldata _arbitratorExtraData) external onlyByGovernor {\\n arbitratorExtraData = _arbitratorExtraData;\\n }\\n\\n function changeTemplateRegistry(IDisputeTemplateRegistry _templateRegistry) external onlyByGovernor {\\n templateRegistry = _templateRegistry;\\n }\\n\\n function changeDisputeTemplate(\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external onlyByGovernor {\\n templateId = templateRegistry.setDisputeTemplate(\\\"\\\", _templateData, _templateDataMappings);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _action The action that requires arbitration.\\n /// @return disputeID Dispute id (on arbitrator side) of the dispute created.\\n function createDispute(string calldata _action) external payable returns (uint256 disputeID) {\\n emit Action(_action);\\n\\n uint256 numberOfRulingOptions = 2;\\n uint256 localDisputeID = disputes.length;\\n disputes.push(DisputeStruct({isRuled: false, ruling: 0, numberOfRulingOptions: numberOfRulingOptions}));\\n\\n disputeID = arbitrator.createDispute{value: msg.value}(numberOfRulingOptions, arbitratorExtraData);\\n externalIDtoLocalID[disputeID] = localDisputeID;\\n\\n uint256 externalDisputeID = uint256(keccak256(abi.encodePacked(_action)));\\n emit DisputeRequest(arbitrator, disputeID, externalDisputeID, templateId, \\\"\\\");\\n }\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _action The action that requires arbitration.\\n /// @param _feeInWeth Amount of fees in WETH for the arbitrator.\\n /// @return disputeID Dispute id (on arbitrator side) of the dispute created.\\n function createDispute(string calldata _action, uint256 _feeInWeth) external returns (uint256 disputeID) {\\n emit Action(_action);\\n\\n uint256 numberOfRulingOptions = 2;\\n uint256 localDisputeID = disputes.length;\\n disputes.push(DisputeStruct({isRuled: false, ruling: 0, numberOfRulingOptions: numberOfRulingOptions}));\\n\\n require(weth.safeTransferFrom(msg.sender, address(this), _feeInWeth), \\\"Transfer failed\\\");\\n require(weth.increaseAllowance(address(arbitrator), _feeInWeth), \\\"Allowance increase failed\\\");\\n\\n disputeID = arbitrator.createDispute(numberOfRulingOptions, arbitratorExtraData, weth, _feeInWeth);\\n externalIDtoLocalID[disputeID] = localDisputeID;\\n\\n uint256 externalDisputeID = uint256(keccak256(abi.encodePacked(_action)));\\n emit DisputeRequest(arbitrator, disputeID, externalDisputeID, templateId, \\\"\\\");\\n }\\n\\n /// @dev To be called by the arbitrator of the dispute, to declare the winning ruling.\\n /// @param _externalDisputeID ID of the dispute in arbitrator contract.\\n /// @param _ruling The ruling choice of the arbitration.\\n function rule(uint256 _externalDisputeID, uint256 _ruling) external override {\\n uint256 localDisputeID = externalIDtoLocalID[_externalDisputeID];\\n DisputeStruct storage dispute = disputes[localDisputeID];\\n require(msg.sender == address(arbitrator), \\\"Only the arbitrator can execute this.\\\");\\n require(_ruling <= dispute.numberOfRulingOptions, \\\"Invalid ruling.\\\");\\n require(dispute.isRuled == false, \\\"This dispute has been ruled already.\\\");\\n\\n dispute.isRuled = true;\\n dispute.ruling = _ruling;\\n\\n emit Ruling(IArbitratorV2(msg.sender), _externalDisputeID, dispute.ruling);\\n }\\n}\\n\",\"keccak256\":\"0x19d38e04eed4156c108539f5ac7c98af87d1d457ef40b5d52bd1aa592c8b0df3\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeTemplateRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n/// @title IDisputeTemplate\\n/// @notice Dispute Template interface.\\ninterface IDisputeTemplateRegistry {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n /// @param _templateDataMappings The data mappings.\\n event DisputeTemplate(\\n uint256 indexed _templateId,\\n string indexed _templateTag,\\n string _templateData,\\n string _templateDataMappings\\n );\\n\\n function setDisputeTemplate(\\n string memory _templateTag,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external returns (uint256 templateId);\\n}\\n\",\"keccak256\":\"0x88b0038d226532e6cf862a485d162f7bca61ac3d361d6801146b55a240f091ac\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60c06040523480156200001157600080fd5b506040516200191a3803806200191a83398101604081905262000034916200020f565b33608052600080546001600160a01b0319166001600160a01b03881617905560036200006184826200037e565b50600180546001600160a01b0319166001600160a01b0384811691821790925590821660a0526040516312a6505d60e21b8152634a99417490620000ac908890889060040162000478565b6020604051808303816000875af1158015620000cc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000f29190620004b8565b60025550620004d2945050505050565b6001600160a01b03811681146200011857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200014e57818101518382015260200162000134565b50506000910152565b60006001600160401b03808411156200017457620001746200011b565b604051601f8501601f19908116603f011681019082821181831017156200019f576200019f6200011b565b81604052809350858152868686011115620001b957600080fd5b620001c986602083018762000131565b5050509392505050565b600082601f830112620001e557600080fd5b620001f68383516020850162000157565b9392505050565b80516200020a8162000102565b919050565b60008060008060008060c087890312156200022957600080fd5b8651620002368162000102565b60208801519096506001600160401b03808211156200025457600080fd5b620002628a838b01620001d3565b965060408901519150808211156200027957600080fd5b620002878a838b01620001d3565b955060608901519150808211156200029e57600080fd5b508701601f81018913620002b157600080fd5b620002c28982516020840162000157565b935050620002d360808801620001fd565b9150620002e360a08801620001fd565b90509295509295509295565b600181811c908216806200030457607f821691505b6020821081036200032557634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200037957600081815260208120601f850160051c81016020861015620003545750805b601f850160051c820191505b81811015620003755782815560010162000360565b5050505b505050565b81516001600160401b038111156200039a576200039a6200011b565b620003b281620003ab8454620002ef565b846200032b565b602080601f831160018114620003ea5760008415620003d15750858301515b600019600386901b1c1916600185901b17855562000375565b600085815260208120601f198616915b828110156200041b57888601518255948401946001909101908401620003fa565b50858210156200043a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600081518084526200046481602086016020860162000131565b601f01601f19169290920160200192915050565b60608152600060608201526080602082015260006200049b60808301856200044a565b8281036040840152620004af81856200044a565b95945050505050565b600060208284031215620004cb57600080fd5b5051919050565b60805160a05161140e6200050c60003960008181610194015281816106e40152818161076301526108010152600060df015261140e6000f3fe6080604052600436106100c85760003560e01c8063654692871161007a578063654692871461021357806368175996146102415780636cc6cde1146102545780637aa77f2914610274578063a0af81f01461028a578063c21ae061146102aa578063c5d55288146102d7578063fc548f08146102f757600080fd5b80630c340a24146100cd5780630c7ac7b61461011e578063311a6c561461014057806334e2672d146101625780633fc8cef3146101825780634660ebbe146101b6578063564a565d146101d6575b600080fd5b3480156100d957600080fd5b506101017f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561012a57600080fd5b50610133610317565b6040516101159190610e3d565b34801561014c57600080fd5b5061016061015b366004610e57565b6103a5565b005b34801561016e57600080fd5b5061016061017d366004610ec2565b61053e565b34801561018e57600080fd5b506101017f000000000000000000000000000000000000000000000000000000000000000081565b3480156101c257600080fd5b506101606101d1366004610f1c565b61056f565b3480156101e257600080fd5b506101f66101f1366004610f39565b6105b0565b604080519315158452602084019290925290820152606001610115565b34801561021f57600080fd5b5061023361022e366004610f52565b6105e7565b604051908152602001610115565b61023361024f366004610ec2565b61091b565b34801561026057600080fd5b50600054610101906001600160a01b031681565b34801561028057600080fd5b5061023360025481565b34801561029657600080fd5b50600154610101906001600160a01b031681565b3480156102b657600080fd5b506102336102c5366004610f39565b60046020526000908152604090205481565b3480156102e357600080fd5b506101606102f2366004611041565b610b31565b34801561030357600080fd5b50610160610312366004610f1c565b610bcc565b60038054610324906110a5565b80601f0160208091040260200160405190810160405280929190818152602001828054610350906110a5565b801561039d5780601f106103725761010080835404028352916020019161039d565b820191906000526020600020905b81548152906001019060200180831161038057829003601f168201915b505050505081565b60008281526004602052604081205460058054919291839081106103cb576103cb6110df565b600091825260208220915460039190910290910191506001600160a01b0316331461044b5760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600201548311156104915760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b6044820152606401610442565b805460ff16156104ef5760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b6064820152608401610442565b805460ff1916600190811782558101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b30331461055d5760405162461bcd60e51b8152600401610442906110f5565b600361056a82848361117a565b505050565b30331461058e5760405162461bcd60e51b8152600401610442906110f5565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600581815481106105c057600080fd5b600091825260209091206003909102018054600182015460029092015460ff909116925083565b600083836040516105f992919061123b565b604051908190038120907f8b2c14fe955d044ef95ba32b88d2ceb87c6f73fcefdcebe906063a6d75690f2790600090a2600580546040805160608101825260008082526020820181815260029383018481526001860187559590915290517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db060038502908101805460ff19169215159290921790915590517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db182015592517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db2909301929092556107147f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316333087610c0d565b6107525760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606401610442565b60005461078c906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911686610ce9565b6107d45760405162461bcd60e51b8152602060048201526019602482015278105b1b1bddd85b98d9481a5b98dc99585cd94819985a5b1959603a1b6044820152606401610442565b600054604051633d941b6d60e21b81526001600160a01b039091169063f6506db49061082b9085906003907f0000000000000000000000000000000000000000000000000000000000000000908a906004016112c8565b6020604051808303816000875af115801561084a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086e91906112fd565b600081815260046020908152604080832085905551929550909161089691899189910161123b565b60408051601f1981840301815290829052805160209091012060005460025491935086926001600160a01b03909116917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e271869161090991868252602082015260606040820181905260009082015260800190565b60405180910390a35050509392505050565b6000828260405161092d92919061123b565b604051908190038120907f8b2c14fe955d044ef95ba32b88d2ceb87c6f73fcefdcebe906063a6d75690f2790600090a26005805460408051606081018252600080825260208201818152600283850181815260018701885596835292517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db06003808802918201805460ff19169315159390931790925591517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db183015595517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db29091015554915163c13517e160e01b815290936001600160a01b039092169163c13517e1913491610a4291879190600401611316565b60206040518083038185885af1158015610a60573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a8591906112fd565b6000818152600460209081526040808320859055519295509091610aad91889188910161123b565b60408051601f1981840301815290829052805160209091012060005460025491935086926001600160a01b03909116917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e2718691610b2091868252602082015260606040820181905260009082015260800190565b60405180910390a350505092915050565b303314610b505760405162461bcd60e51b8152600401610442906110f5565b6001546040516312a6505d60e21b81526001600160a01b0390911690634a99417490610b829085908590600401611337565b6020604051808303816000875af1158015610ba1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc591906112fd565b6002555050565b303314610beb5760405162461bcd60e51b8152600401610442906110f5565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b17905251610c729190611373565b6000604051808303816000865af19150503d8060008114610caf576040519150601f19603f3d011682016040523d82523d6000602084013e610cb4565b606091505b5091509150818015610cde575080511580610cde575080806020019051810190610cde919061138f565b979650505050505050565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063095ea7b39085908590849063dd62ed3e90604401602060405180830381865afa158015610d45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6991906112fd565b610d7391906113b1565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de2919061138f565b506001949350505050565b60005b83811015610e08578181015183820152602001610df0565b50506000910152565b60008151808452610e29816020860160208601610ded565b601f01601f19169290920160200192915050565b602081526000610e506020830184610e11565b9392505050565b60008060408385031215610e6a57600080fd5b50508035926020909101359150565b60008083601f840112610e8b57600080fd5b50813567ffffffffffffffff811115610ea357600080fd5b602083019150836020828501011115610ebb57600080fd5b9250929050565b60008060208385031215610ed557600080fd5b823567ffffffffffffffff811115610eec57600080fd5b610ef885828601610e79565b90969095509350505050565b6001600160a01b0381168114610f1957600080fd5b50565b600060208284031215610f2e57600080fd5b8135610e5081610f04565b600060208284031215610f4b57600080fd5b5035919050565b600080600060408486031215610f6757600080fd5b833567ffffffffffffffff811115610f7e57600080fd5b610f8a86828701610e79565b909790965060209590950135949350505050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112610fc557600080fd5b813567ffffffffffffffff80821115610fe057610fe0610f9e565b604051601f8301601f19908116603f0116810190828211818310171561100857611008610f9e565b8160405283815286602085880101111561102157600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561105457600080fd5b823567ffffffffffffffff8082111561106c57600080fd5b61107886838701610fb4565b9350602085013591508082111561108e57600080fd5b5061109b85828601610fb4565b9150509250929050565b600181811c908216806110b957607f821691505b6020821081036110d957634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b6020808252601a908201527f4f6e6c792074686520676f7665726e6f7220616c6c6f7765642e000000000000604082015260600190565b601f82111561056a57600081815260208120601f850160051c810160208610156111535750805b601f850160051c820191505b818110156111725782815560010161115f565b505050505050565b67ffffffffffffffff83111561119257611192610f9e565b6111a6836111a083546110a5565b8361112c565b6000601f8411600181146111da57600085156111c25750838201355b600019600387901b1c1916600186901b178355611234565b600083815260209020601f19861690835b8281101561120b57868501358255602094850194600190920191016111eb565b50868210156112285760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b8183823760009101908152919050565b60008154611258816110a5565b808552602060018381168015611275576001811461128f576112bd565b60ff1985168884015283151560051b8801830195506112bd565b866000528260002060005b858110156112b55781548a820186015290830190840161129a565b890184019650505b505050505092915050565b8481526080602082015260006112e1608083018661124b565b6001600160a01b03949094166040830152506060015292915050565b60006020828403121561130f57600080fd5b5051919050565b82815260406020820152600061132f604083018461124b565b949350505050565b60608152600060608201526080602082015260006113586080830185610e11565b828103604084015261136a8185610e11565b95945050505050565b60008251611385818460208701610ded565b9190910192915050565b6000602082840312156113a157600080fd5b81518015158114610e5057600080fd5b808201808211156113d257634e487b7160e01b600052601160045260246000fd5b9291505056fea264697066735822122084881e01383e37e86fd1919d8c218c3fb5e00372697336cc5557215eecd6e56964736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106100c85760003560e01c8063654692871161007a578063654692871461021357806368175996146102415780636cc6cde1146102545780637aa77f2914610274578063a0af81f01461028a578063c21ae061146102aa578063c5d55288146102d7578063fc548f08146102f757600080fd5b80630c340a24146100cd5780630c7ac7b61461011e578063311a6c561461014057806334e2672d146101625780633fc8cef3146101825780634660ebbe146101b6578063564a565d146101d6575b600080fd5b3480156100d957600080fd5b506101017f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561012a57600080fd5b50610133610317565b6040516101159190610e3d565b34801561014c57600080fd5b5061016061015b366004610e57565b6103a5565b005b34801561016e57600080fd5b5061016061017d366004610ec2565b61053e565b34801561018e57600080fd5b506101017f000000000000000000000000000000000000000000000000000000000000000081565b3480156101c257600080fd5b506101606101d1366004610f1c565b61056f565b3480156101e257600080fd5b506101f66101f1366004610f39565b6105b0565b604080519315158452602084019290925290820152606001610115565b34801561021f57600080fd5b5061023361022e366004610f52565b6105e7565b604051908152602001610115565b61023361024f366004610ec2565b61091b565b34801561026057600080fd5b50600054610101906001600160a01b031681565b34801561028057600080fd5b5061023360025481565b34801561029657600080fd5b50600154610101906001600160a01b031681565b3480156102b657600080fd5b506102336102c5366004610f39565b60046020526000908152604090205481565b3480156102e357600080fd5b506101606102f2366004611041565b610b31565b34801561030357600080fd5b50610160610312366004610f1c565b610bcc565b60038054610324906110a5565b80601f0160208091040260200160405190810160405280929190818152602001828054610350906110a5565b801561039d5780601f106103725761010080835404028352916020019161039d565b820191906000526020600020905b81548152906001019060200180831161038057829003601f168201915b505050505081565b60008281526004602052604081205460058054919291839081106103cb576103cb6110df565b600091825260208220915460039190910290910191506001600160a01b0316331461044b5760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b80600201548311156104915760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b6044820152606401610442565b805460ff16156104ef5760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b6064820152608401610442565b805460ff1916600190811782558101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b30331461055d5760405162461bcd60e51b8152600401610442906110f5565b600361056a82848361117a565b505050565b30331461058e5760405162461bcd60e51b8152600401610442906110f5565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600581815481106105c057600080fd5b600091825260209091206003909102018054600182015460029092015460ff909116925083565b600083836040516105f992919061123b565b604051908190038120907f8b2c14fe955d044ef95ba32b88d2ceb87c6f73fcefdcebe906063a6d75690f2790600090a2600580546040805160608101825260008082526020820181815260029383018481526001860187559590915290517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db060038502908101805460ff19169215159290921790915590517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db182015592517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db2909301929092556107147f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316333087610c0d565b6107525760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606401610442565b60005461078c906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911686610ce9565b6107d45760405162461bcd60e51b8152602060048201526019602482015278105b1b1bddd85b98d9481a5b98dc99585cd94819985a5b1959603a1b6044820152606401610442565b600054604051633d941b6d60e21b81526001600160a01b039091169063f6506db49061082b9085906003907f0000000000000000000000000000000000000000000000000000000000000000908a906004016112c8565b6020604051808303816000875af115801561084a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086e91906112fd565b600081815260046020908152604080832085905551929550909161089691899189910161123b565b60408051601f1981840301815290829052805160209091012060005460025491935086926001600160a01b03909116917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e271869161090991868252602082015260606040820181905260009082015260800190565b60405180910390a35050509392505050565b6000828260405161092d92919061123b565b604051908190038120907f8b2c14fe955d044ef95ba32b88d2ceb87c6f73fcefdcebe906063a6d75690f2790600090a26005805460408051606081018252600080825260208201818152600283850181815260018701885596835292517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db06003808802918201805460ff19169315159390931790925591517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db183015595517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db29091015554915163c13517e160e01b815290936001600160a01b039092169163c13517e1913491610a4291879190600401611316565b60206040518083038185885af1158015610a60573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a8591906112fd565b6000818152600460209081526040808320859055519295509091610aad91889188910161123b565b60408051601f1981840301815290829052805160209091012060005460025491935086926001600160a01b03909116917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e2718691610b2091868252602082015260606040820181905260009082015260800190565b60405180910390a350505092915050565b303314610b505760405162461bcd60e51b8152600401610442906110f5565b6001546040516312a6505d60e21b81526001600160a01b0390911690634a99417490610b829085908590600401611337565b6020604051808303816000875af1158015610ba1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc591906112fd565b6002555050565b303314610beb5760405162461bcd60e51b8152600401610442906110f5565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b17905251610c729190611373565b6000604051808303816000865af19150503d8060008114610caf576040519150601f19603f3d011682016040523d82523d6000602084013e610cb4565b606091505b5091509150818015610cde575080511580610cde575080806020019051810190610cde919061138f565b979650505050505050565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063095ea7b39085908590849063dd62ed3e90604401602060405180830381865afa158015610d45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6991906112fd565b610d7391906113b1565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de2919061138f565b506001949350505050565b60005b83811015610e08578181015183820152602001610df0565b50506000910152565b60008151808452610e29816020860160208601610ded565b601f01601f19169290920160200192915050565b602081526000610e506020830184610e11565b9392505050565b60008060408385031215610e6a57600080fd5b50508035926020909101359150565b60008083601f840112610e8b57600080fd5b50813567ffffffffffffffff811115610ea357600080fd5b602083019150836020828501011115610ebb57600080fd5b9250929050565b60008060208385031215610ed557600080fd5b823567ffffffffffffffff811115610eec57600080fd5b610ef885828601610e79565b90969095509350505050565b6001600160a01b0381168114610f1957600080fd5b50565b600060208284031215610f2e57600080fd5b8135610e5081610f04565b600060208284031215610f4b57600080fd5b5035919050565b600080600060408486031215610f6757600080fd5b833567ffffffffffffffff811115610f7e57600080fd5b610f8a86828701610e79565b909790965060209590950135949350505050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112610fc557600080fd5b813567ffffffffffffffff80821115610fe057610fe0610f9e565b604051601f8301601f19908116603f0116810190828211818310171561100857611008610f9e565b8160405283815286602085880101111561102157600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561105457600080fd5b823567ffffffffffffffff8082111561106c57600080fd5b61107886838701610fb4565b9350602085013591508082111561108e57600080fd5b5061109b85828601610fb4565b9150509250929050565b600181811c908216806110b957607f821691505b6020821081036110d957634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b6020808252601a908201527f4f6e6c792074686520676f7665726e6f7220616c6c6f7765642e000000000000604082015260600190565b601f82111561056a57600081815260208120601f850160051c810160208610156111535750805b601f850160051c820191505b818110156111725782815560010161115f565b505050505050565b67ffffffffffffffff83111561119257611192610f9e565b6111a6836111a083546110a5565b8361112c565b6000601f8411600181146111da57600085156111c25750838201355b600019600387901b1c1916600186901b178355611234565b600083815260209020601f19861690835b8281101561120b57868501358255602094850194600190920191016111eb565b50868210156112285760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b8183823760009101908152919050565b60008154611258816110a5565b808552602060018381168015611275576001811461128f576112bd565b60ff1985168884015283151560051b8801830195506112bd565b866000528260002060005b858110156112b55781548a820186015290830190840161129a565b890184019650505b505050505092915050565b8481526080602082015260006112e1608083018661124b565b6001600160a01b03949094166040830152506060015292915050565b60006020828403121561130f57600080fd5b5051919050565b82815260406020820152600061132f604083018461124b565b949350505050565b60608152600060608201526080602082015260006113586080830185610e11565b828103604084015261136a8185610e11565b95945050505050565b60008251611385818460208701610ded565b9190910192915050565b6000602082840312156113a157600080fd5b81518015158114610e5057600080fd5b808201808211156113d257634e487b7160e01b600052601160045260246000fd5b9291505056fea264697066735822122084881e01383e37e86fd1919d8c218c3fb5e00372697336cc5557215eecd6e56964736f6c63430008120033", + "devdoc": { + "events": { + "DisputeRequest(address,uint256,uint256,uint256,string)": { + "details": "To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.", + "params": { + "_arbitrableDisputeID": "The identifier of the dispute in the Arbitrable contract.", + "_arbitrator": "The arbitrator of the contract.", + "_externalDisputeID": "An identifier created outside Kleros by the protocol requesting arbitration.", + "_templateId": "The identifier of the dispute template. Should not be used with _templateUri.", + "_templateUri": "The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId." + } + }, + "Ruling(address,uint256,uint256)": { + "details": "To be raised when a ruling is given.", + "params": { + "_arbitrator": "The arbitrator giving the ruling.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract.", + "_ruling": "The ruling which was given." + } + } + }, + "kind": "dev", + "methods": { + "constructor": { + "details": "Constructor", + "params": { + "_arbitrator": "The arbitrator to rule on created disputes.", + "_arbitratorExtraData": "The extra data for the arbitrator.", + "_templateData": "The dispute template data.", + "_templateDataMappings": "The dispute template data mappings.", + "_templateRegistry": "The dispute template registry.", + "_weth": "The WETH token." + } + }, + "createDispute(string)": { + "details": "Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "params": { + "_action": "The action that requires arbitration." + }, + "returns": { + "disputeID": "Dispute id (on arbitrator side) of the dispute created." + } + }, + "createDispute(string,uint256)": { + "details": "Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "params": { + "_action": "The action that requires arbitration.", + "_feeInWeth": "Amount of fees in WETH for the arbitrator." + }, + "returns": { + "disputeID": "Dispute id (on arbitrator side) of the dispute created." + } + }, + "rule(uint256,uint256)": { + "details": "To be called by the arbitrator of the dispute, to declare the winning ruling.", + "params": { + "_externalDisputeID": "ID of the dispute in arbitrator contract.", + "_ruling": "The ruling choice of the arbitration." + } + } + }, + "title": "ArbitrableExample An example of an arbitrable contract which connects to the arbitator that implements the updated interface.", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 9862, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "arbitrator", + "offset": 0, + "slot": "0", + "type": "t_contract(IArbitratorV2)17049" + }, + { + "astId": 9865, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "templateRegistry", + "offset": 0, + "slot": "1", + "type": "t_contract(IDisputeTemplateRegistry)17216" + }, + { + "astId": 9867, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "templateId", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 9869, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "arbitratorExtraData", + "offset": 0, + "slot": "3", + "type": "t_bytes_storage" + }, + { + "astId": 9876, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "externalIDtoLocalID", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 9880, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "disputes", + "offset": 0, + "slot": "5", + "type": "t_array(t_struct(DisputeStruct)9853_storage)dyn_storage" + } + ], + "types": { + "t_array(t_struct(DisputeStruct)9853_storage)dyn_storage": { + "base": "t_struct(DisputeStruct)9853_storage", + "encoding": "dynamic_array", + "label": "struct ArbitrableExample.DisputeStruct[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(IArbitratorV2)17049": { + "encoding": "inplace", + "label": "contract IArbitratorV2", + "numberOfBytes": "20" + }, + "t_contract(IDisputeTemplateRegistry)17216": { + "encoding": "inplace", + "label": "contract IDisputeTemplateRegistry", + "numberOfBytes": "20" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(DisputeStruct)9853_storage": { + "encoding": "inplace", + "label": "struct ArbitrableExample.DisputeStruct", + "members": [ + { + "astId": 9848, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "isRuled", + "offset": 0, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 9850, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "ruling", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 9852, + "contract": "src/arbitration/arbitrables/ArbitrableExample.sol:ArbitrableExample", + "label": "numberOfRulingOptions", + "offset": 0, + "slot": "2", + "type": "t_uint256" + } + ], + "numberOfBytes": "96" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepolia/BlockHashRNG.json b/contracts/deployments/arbitrumSepolia/BlockHashRNG.json new file mode 100644 index 000000000..e25f70e48 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/BlockHashRNG.json @@ -0,0 +1,133 @@ +{ + "address": "0x991d2df165670b9cac3B022f4B68D65b664222ea", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "randomNumbers", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_block", + "type": "uint256" + } + ], + "name": "receiveRandomness", + "outputs": [ + { + "internalType": "uint256", + "name": "randomNumber", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_block", + "type": "uint256" + } + ], + "name": "requestRandomness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xcda19649f0f1f6f6ba44981cd55cdc2ca1aa5a36c124d0e0a1b9350c8424d915", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x991d2df165670b9cac3B022f4B68D65b664222ea", + "transactionIndex": 1, + "gasUsed": "817813", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x5f4f9c43a267ef56bee9e255003d40c681f33ce453b45475650cfeee2958ce3d", + "transactionHash": "0xcda19649f0f1f6f6ba44981cd55cdc2ca1aa5a36c124d0e0a1b9350c8424d915", + "logs": [], + "blockNumber": 3843190, + "cumulativeGasUsed": "817813", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"randomNumbers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_block\",\"type\":\"uint256\"}],\"name\":\"receiveRandomness\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"randomNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_block\",\"type\":\"uint256\"}],\"name\":\"requestRandomness\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Cl\\u00e9ment Lesaege - \",\"details\":\"Random Number Generator returning the blockhash with a fallback behaviour. In case no one called it within the 256 blocks, it returns the previous blockhash. This contract must be used when returning 0 is a worse failure mode than returning another blockhash. Allows saving the random number for use in the future. It allows the contract to still access the blockhash even after 256 blocks.\",\"kind\":\"dev\",\"methods\":{\"receiveRandomness(uint256)\":{\"details\":\"Return the random number. If it has not been saved and is still computable compute it.\",\"params\":{\"_block\":\"Block the random number is linked to.\"},\"returns\":{\"randomNumber\":\"The random number or 0 if it is not ready or has not been requested.\"}},\"requestRandomness(uint256)\":{\"details\":\"Request a random number.\",\"params\":{\"_block\":\"Block the random number is linked to.\"}}},\"title\":\"Random Number Generator using blockhash with fallback.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/rng/BlockhashRNG.sol\":\"BlockHashRNG\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/rng/BlockhashRNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./RNG.sol\\\";\\n\\n/// @title Random Number Generator using blockhash with fallback.\\n/// @author Cl\\u00e9ment Lesaege - \\n/// @dev\\n/// Random Number Generator returning the blockhash with a fallback behaviour.\\n/// In case no one called it within the 256 blocks, it returns the previous blockhash.\\n/// This contract must be used when returning 0 is a worse failure mode than returning another blockhash.\\n/// Allows saving the random number for use in the future. It allows the contract to still access the blockhash even after 256 blocks.\\ncontract BlockHashRNG is RNG {\\n mapping(uint256 => uint256) public randomNumbers; // randomNumbers[block] is the random number for this block, 0 otherwise.\\n\\n /// @dev Request a random number.\\n /// @param _block Block the random number is linked to.\\n function requestRandomness(uint256 _block) external override {\\n // nop\\n }\\n\\n /// @dev Return the random number. If it has not been saved and is still computable compute it.\\n /// @param _block Block the random number is linked to.\\n /// @return randomNumber The random number or 0 if it is not ready or has not been requested.\\n function receiveRandomness(uint256 _block) external override returns (uint256 randomNumber) {\\n randomNumber = randomNumbers[_block];\\n if (randomNumber != 0) {\\n return randomNumber;\\n }\\n\\n if (_block < block.number) {\\n // The random number is not already set and can be.\\n if (blockhash(_block) != 0x0) {\\n // Normal case.\\n randomNumber = uint256(blockhash(_block));\\n } else {\\n // The contract was not called in time. Fallback to returning previous blockhash.\\n randomNumber = uint256(blockhash(block.number - 1));\\n }\\n }\\n randomNumbers[_block] = randomNumber;\\n }\\n}\\n\",\"keccak256\":\"0xbec8950b4a908f498273fb7c678f66ffbe08433009d5161545de9a3369eae1ea\",\"license\":\"MIT\"},\"src/rng/RNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\ninterface RNG {\\n /// @dev Request a random number.\\n /// @param _block Block linked to the request.\\n function requestRandomness(uint256 _block) external;\\n\\n /// @dev Receive the random number.\\n /// @param _block Block the random number is linked to.\\n /// @return randomNumber Random Number. If the number is not ready or has not been required 0 instead.\\n function receiveRandomness(uint256 _block) external returns (uint256 randomNumber);\\n}\\n\",\"keccak256\":\"0x5afe7121f49aebe72218df356bd91b66c2171b9ad15e7945a15a091784291a43\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50610169806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806313cf9054146100465780635257cd901461006b5780637363ae1f1461008b575b600080fd5b6100596100543660046100f3565b61009e565b60405190815260200160405180910390f35b6100596100793660046100f3565b60006020819052908152604090205481565b61009c6100993660046100f3565b50565b005b60008181526020819052604090205480156100b857919050565b438210156100de578140156100cf575080406100de565b6100da60014361010c565b4090505b60009182526020829052604090912081905590565b60006020828403121561010557600080fd5b5035919050565b8181038181111561012d57634e487b7160e01b600052601160045260246000fd5b9291505056fea2646970667358221220d8343029f3281984aa61880b071de45f3d714f660c2a6c1973b488429c50c84e64736f6c63430008120033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c806313cf9054146100465780635257cd901461006b5780637363ae1f1461008b575b600080fd5b6100596100543660046100f3565b61009e565b60405190815260200160405180910390f35b6100596100793660046100f3565b60006020819052908152604090205481565b61009c6100993660046100f3565b50565b005b60008181526020819052604090205480156100b857919050565b438210156100de578140156100cf575080406100de565b6100da60014361010c565b4090505b60009182526020829052604090912081905590565b60006020828403121561010557600080fd5b5035919050565b8181038181111561012d57634e487b7160e01b600052601160045260246000fd5b9291505056fea2646970667358221220d8343029f3281984aa61880b071de45f3d714f660c2a6c1973b488429c50c84e64736f6c63430008120033", + "devdoc": { + "author": "Clément Lesaege - ", + "details": "Random Number Generator returning the blockhash with a fallback behaviour. In case no one called it within the 256 blocks, it returns the previous blockhash. This contract must be used when returning 0 is a worse failure mode than returning another blockhash. Allows saving the random number for use in the future. It allows the contract to still access the blockhash even after 256 blocks.", + "kind": "dev", + "methods": { + "receiveRandomness(uint256)": { + "details": "Return the random number. If it has not been saved and is still computable compute it.", + "params": { + "_block": "Block the random number is linked to." + }, + "returns": { + "randomNumber": "The random number or 0 if it is not ready or has not been requested." + } + }, + "requestRandomness(uint256)": { + "details": "Request a random number.", + "params": { + "_block": "Block the random number is linked to." + } + } + }, + "title": "Random Number Generator using blockhash with fallback.", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 24139, + "contract": "src/rng/BlockhashRNG.sol:BlockHashRNG", + "label": "randomNumbers", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_uint256,t_uint256)" + } + ], + "types": { + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepolia/DAI.json b/contracts/deployments/arbitrumSepolia/DAI.json new file mode 100644 index 000000000..c989bb132 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/DAI.json @@ -0,0 +1,458 @@ +{ + "address": "0xc34aeFEa232956542C5b2f2EE55fD5c378B35c03", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xf26e505115f57eeee85b2a1258a27f3560ce1d6dd0c8d5fdec02a38a90f68a0c", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xc34aeFEa232956542C5b2f2EE55fD5c378B35c03", + "transactionIndex": 1, + "gasUsed": "4834117", + "logsBloom": "0x00000020000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000400000000000000000000000000000000000000000020000000000000000000800000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000040000000000000000000000000000002000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000100000000000000000", + "blockHash": "0xd28cc28660f187697c493cbcec57764f6912bd6042cb970f2fe51b74fc4fc6e9", + "transactionHash": "0xf26e505115f57eeee85b2a1258a27f3560ce1d6dd0c8d5fdec02a38a90f68a0c", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842783, + "transactionHash": "0xf26e505115f57eeee85b2a1258a27f3560ce1d6dd0c8d5fdec02a38a90f68a0c", + "address": "0xc34aeFEa232956542C5b2f2EE55fD5c378B35c03", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "data": "0x00000000000000000000000000000000000000000000d3c21bcecceda1000000", + "logIndex": 0, + "blockHash": "0xd28cc28660f187697c493cbcec57764f6912bd6042cb970f2fe51b74fc4fc6e9" + } + ], + "blockNumber": 3842783, + "cumulativeGasUsed": "4834117", + "status": 1, + "byzantium": true + }, + "args": [ + "DAI", + "DAI" + ], + "numDeployments": 1, + "solcInputHash": "8e9cc2476be2df2a66044335eb796b9b", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/token/TestERC20.sol\":\"TestERC20\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * The default value of {decimals} is 18. To change this, you should override\\n * this function so it returns a different value.\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20 is Context, IERC20, IERC20Metadata {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the default value returned by this function, unless\\n * it's overridden.\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(address from, address to, uint256 amount) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(address owner, address spender, uint256 amount) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\\n}\\n\",\"keccak256\":\"0xa56ca923f70c1748830700250b19c61b70db9a683516dc5e216694a50445d99c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0xa92e4fa126feb6907daa0513ddd816b2eb91f30a808de54f63c17d0e162c3439\",\"license\":\"MIT\"},\"src/token/TestERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\n\\ncontract TestERC20 is ERC20 {\\n constructor(string memory _name, string memory _symbol) ERC20(_name, _symbol) {\\n _mint(msg.sender, 1000000 ether);\\n }\\n}\\n\",\"keccak256\":\"0x9f67e6b63ca87e6c98b2986364ce16a747ce4098e9146fffb17ea13863c0b7e4\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162000c5838038062000c5883398101604081905262000034916200020a565b8181600362000044838262000302565b50600462000053828262000302565b505050620000723369d3c21bcecceda10000006200007a60201b60201c565b5050620003f6565b6001600160a01b038216620000d55760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060026000828254620000e99190620003ce565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b505050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200016d57600080fd5b81516001600160401b03808211156200018a576200018a62000145565b604051601f8301601f19908116603f01168101908282118183101715620001b557620001b562000145565b81604052838152602092508683858801011115620001d257600080fd5b600091505b83821015620001f65785820183015181830184015290820190620001d7565b600093810190920192909252949350505050565b600080604083850312156200021e57600080fd5b82516001600160401b03808211156200023657600080fd5b62000244868387016200015b565b935060208501519150808211156200025b57600080fd5b506200026a858286016200015b565b9150509250929050565b600181811c908216806200028957607f821691505b602082108103620002aa57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200014057600081815260208120601f850160051c81016020861015620002d95750805b601f850160051c820191505b81811015620002fa57828155600101620002e5565b505050505050565b81516001600160401b038111156200031e576200031e62000145565b62000336816200032f845462000274565b84620002b0565b602080601f8311600181146200036e5760008415620003555750858301515b600019600386901b1c1916600185901b178555620002fa565b600085815260208120601f198616915b828110156200039f578886015182559484019460019091019084016200037e565b5085821015620003be5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80820180821115620003f057634e487b7160e01b600052601160045260246000fd5b92915050565b61085280620004066000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b411461015f578063a457c2d714610167578063a9059cbb1461017a578063dd62ed3e1461018d57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101a0565b6040516100c3919061069c565b60405180910390f35b6100df6100da366004610706565b610232565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610730565b61024c565b604051601281526020016100c3565b6100df610131366004610706565b610270565b6100f361014436600461076c565b6001600160a01b031660009081526020819052604090205490565b6100b6610292565b6100df610175366004610706565b6102a1565b6100df610188366004610706565b610321565b6100f361019b36600461078e565b61032f565b6060600380546101af906107c1565b80601f01602080910402602001604051908101604052809291908181526020018280546101db906107c1565b80156102285780601f106101fd57610100808354040283529160200191610228565b820191906000526020600020905b81548152906001019060200180831161020b57829003601f168201915b5050505050905090565b60003361024081858561035a565b60019150505b92915050565b60003361025a85828561047e565b6102658585856104f8565b506001949350505050565b600033610240818585610283838361032f565b61028d91906107fb565b61035a565b6060600480546101af906107c1565b600033816102af828661032f565b9050838110156103145760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b610265828686840361035a565b6000336102408185856104f8565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166103bc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161030b565b6001600160a01b03821661041d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161030b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600061048a848461032f565b905060001981146104f257818110156104e55760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161030b565b6104f2848484840361035a565b50505050565b6001600160a01b03831661055c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161030b565b6001600160a01b0382166105be5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161030b565b6001600160a01b038316600090815260208190526040902054818110156106365760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161030b565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36104f2565b600060208083528351808285015260005b818110156106c9578581018301518582016040015282016106ad565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b038116811461070157600080fd5b919050565b6000806040838503121561071957600080fd5b610722836106ea565b946020939093013593505050565b60008060006060848603121561074557600080fd5b61074e846106ea565b925061075c602085016106ea565b9150604084013590509250925092565b60006020828403121561077e57600080fd5b610787826106ea565b9392505050565b600080604083850312156107a157600080fd5b6107aa836106ea565b91506107b8602084016106ea565b90509250929050565b600181811c908216806107d557607f821691505b6020821081036107f557634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561024657634e487b7160e01b600052601160045260246000fdfea26469706673582212203a956e65a766c03ac95ae037cbdfb51b56810340c98132c2d2482405d386101b64736f6c63430008120033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b411461015f578063a457c2d714610167578063a9059cbb1461017a578063dd62ed3e1461018d57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101a0565b6040516100c3919061069c565b60405180910390f35b6100df6100da366004610706565b610232565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610730565b61024c565b604051601281526020016100c3565b6100df610131366004610706565b610270565b6100f361014436600461076c565b6001600160a01b031660009081526020819052604090205490565b6100b6610292565b6100df610175366004610706565b6102a1565b6100df610188366004610706565b610321565b6100f361019b36600461078e565b61032f565b6060600380546101af906107c1565b80601f01602080910402602001604051908101604052809291908181526020018280546101db906107c1565b80156102285780601f106101fd57610100808354040283529160200191610228565b820191906000526020600020905b81548152906001019060200180831161020b57829003601f168201915b5050505050905090565b60003361024081858561035a565b60019150505b92915050565b60003361025a85828561047e565b6102658585856104f8565b506001949350505050565b600033610240818585610283838361032f565b61028d91906107fb565b61035a565b6060600480546101af906107c1565b600033816102af828661032f565b9050838110156103145760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b610265828686840361035a565b6000336102408185856104f8565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166103bc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161030b565b6001600160a01b03821661041d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161030b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600061048a848461032f565b905060001981146104f257818110156104e55760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161030b565b6104f2848484840361035a565b50505050565b6001600160a01b03831661055c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161030b565b6001600160a01b0382166105be5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161030b565b6001600160a01b038316600090815260208190526040902054818110156106365760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161030b565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36104f2565b600060208083528351808285015260005b818110156106c9578581018301518582016040015282016106ad565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b038116811461070157600080fd5b919050565b6000806040838503121561071957600080fd5b610722836106ea565b946020939093013593505050565b60008060006060848603121561074557600080fd5b61074e846106ea565b925061075c602085016106ea565b9150604084013590509250925092565b60006020828403121561077e57600080fd5b610787826106ea565b9392505050565b600080604083850312156107a157600080fd5b6107aa836106ea565b91506107b8602084016106ea565b90509250929050565b600181811c908216806107d557607f821691505b6020821081036107f557634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561024657634e487b7160e01b600052601160045260246000fdfea26469706673582212203a956e65a766c03ac95ae037cbdfb51b56810340c98132c2d2482405d386101b64736f6c63430008120033", + "devdoc": { + "events": { + "Approval(address,address,uint256)": { + "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." + }, + "Transfer(address,address,uint256)": { + "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." + } + }, + "kind": "dev", + "methods": { + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "decimals()": { + "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." + }, + "decreaseAllowance(address,uint256)": { + "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." + }, + "increaseAllowance(address,uint256)": { + "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." + }, + "name()": { + "details": "Returns the name of the token." + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 128, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_balances", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 134, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_allowances", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 136, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_totalSupply", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 138, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_name", + "offset": 0, + "slot": "3", + "type": "t_string_storage" + }, + { + "astId": 140, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_symbol", + "offset": 0, + "slot": "4", + "type": "t_string_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepolia/DAIFaucet.json b/contracts/deployments/arbitrumSepolia/DAIFaucet.json new file mode 100644 index 000000000..5c5e31c1d --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/DAIFaucet.json @@ -0,0 +1,226 @@ +{ + "address": "0x1Fa58B52326488D62A406E71DBaD839560e810fF", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "amount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "balance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "changeAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "request", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "withdrewAlready", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x703c6d2439eb53f2dce47dc5a223e73a1e1399e3058a9fc2d375ff7818a9f7e6", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x1Fa58B52326488D62A406E71DBaD839560e810fF", + "transactionIndex": 1, + "gasUsed": "2769180", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x3d50a6300d95258d1cdc93f2f0f6fd62d46e5be5926c545230fd95071dd07610", + "transactionHash": "0x703c6d2439eb53f2dce47dc5a223e73a1e1399e3058a9fc2d375ff7818a9f7e6", + "logs": [], + "blockNumber": 3842785, + "cumulativeGasUsed": "2769180", + "status": 1, + "byzantium": true + }, + "args": [ + "0xc34aeFEa232956542C5b2f2EE55fD5c378B35c03" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"amount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"balance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"changeAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"request\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"withdrewAlready\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/token/Faucet.sol\":\"Faucet\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/token/Faucet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ncontract Faucet {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n IERC20 public token;\\n address public governor;\\n mapping(address => bool) public withdrewAlready;\\n uint256 public amount = 10_000 ether;\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(address(governor) == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n constructor(IERC20 _token) {\\n token = _token;\\n governor = msg.sender;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n function changeGovernor(address _governor) public onlyByGovernor {\\n governor = _governor;\\n }\\n\\n function changeAmount(uint256 _amount) public onlyByGovernor {\\n amount = _amount;\\n }\\n\\n function withdraw() public onlyByGovernor {\\n token.transfer(governor, token.balanceOf(address(this)));\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function request() public {\\n require(\\n !withdrewAlready[msg.sender],\\n \\\"You have used this faucet already. If you need more tokens, please use another address.\\\"\\n );\\n token.transfer(msg.sender, amount);\\n withdrewAlready[msg.sender] = true;\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n function balance() public view returns (uint) {\\n return token.balanceOf(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x3a54681cc304ccbfdb42215104b63809919a432ac5d3986d3021a11fcc7a1cc3\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405269021e19e0c9bab240000060035534801561001e57600080fd5b5060405161065538038061065583398101604081905261003d9161006b565b600080546001600160a01b039092166001600160a01b0319928316179055600180549091163317905561009b565b60006020828403121561007d57600080fd5b81516001600160a01b038116811461009457600080fd5b9392505050565b6105ab806100aa6000396000f3fe608060405234801561001057600080fd5b50600436106100835760003560e01c80630c340a2414610088578063338cdca1146100b15780633ccfd60b146100bb5780635c320516146100c3578063aa8c217c146100d6578063b69ef8a8146100ed578063d61c40dc146100f5578063e4c0aaf414610128578063fc0c546a1461013b575b600080fd5b60015461009b906001600160a01b031681565b6040516100a8919061049b565b60405180910390f35b6100b961014e565b005b6100b961028f565b6100b96100d13660046104af565b6103a9565b6100df60035481565b6040519081526020016100a8565b6100df6103d8565b6101186101033660046104c8565b60026020526000908152604090205460ff1681565b60405190151581526020016100a8565b6100b96101363660046104c8565b61044f565b60005461009b906001600160a01b031681565b3360009081526002602052604090205460ff16156101f95760405162461bcd60e51b815260206004820152605760248201527f596f752068617665207573656420746869732066617563657420616c7265616460448201527f792e20496620796f75206e656564206d6f726520746f6b656e732c20706c656160648201527639b2903ab9b29030b737ba3432b91030b2323932b9b99760491b608482015260a4015b60405180910390fd5b60005460035460405163a9059cbb60e01b815233600482015260248101919091526001600160a01b039091169063a9059cbb906044016020604051808303816000875af115801561024e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027291906104f8565b50336000908152600260205260409020805460ff19166001179055565b6001546001600160a01b031633146102b95760405162461bcd60e51b81526004016101f09061051a565b6000546001546040516370a0823160e01b81526001600160a01b039283169263a9059cbb92169083906370a08231906102f690309060040161049b565b602060405180830381865afa158015610313573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610337919061055c565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a691906104f8565b50565b6001546001600160a01b031633146103d35760405162461bcd60e51b81526004016101f09061051a565b600355565b600080546040516370a0823160e01b81526001600160a01b03909116906370a082319061040990309060040161049b565b602060405180830381865afa158015610426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a919061055c565b905090565b6001546001600160a01b031633146104795760405162461bcd60e51b81526004016101f09061051a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0391909116815260200190565b6000602082840312156104c157600080fd5b5035919050565b6000602082840312156104da57600080fd5b81356001600160a01b03811681146104f157600080fd5b9392505050565b60006020828403121561050a57600080fd5b815180151581146104f157600080fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60006020828403121561056e57600080fd5b505191905056fea26469706673582212204f7fd812260eacd88f23b436eb40b4943480e914005f0a0f2738f0d3c9696a5964736f6c63430008120033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100835760003560e01c80630c340a2414610088578063338cdca1146100b15780633ccfd60b146100bb5780635c320516146100c3578063aa8c217c146100d6578063b69ef8a8146100ed578063d61c40dc146100f5578063e4c0aaf414610128578063fc0c546a1461013b575b600080fd5b60015461009b906001600160a01b031681565b6040516100a8919061049b565b60405180910390f35b6100b961014e565b005b6100b961028f565b6100b96100d13660046104af565b6103a9565b6100df60035481565b6040519081526020016100a8565b6100df6103d8565b6101186101033660046104c8565b60026020526000908152604090205460ff1681565b60405190151581526020016100a8565b6100b96101363660046104c8565b61044f565b60005461009b906001600160a01b031681565b3360009081526002602052604090205460ff16156101f95760405162461bcd60e51b815260206004820152605760248201527f596f752068617665207573656420746869732066617563657420616c7265616460448201527f792e20496620796f75206e656564206d6f726520746f6b656e732c20706c656160648201527639b2903ab9b29030b737ba3432b91030b2323932b9b99760491b608482015260a4015b60405180910390fd5b60005460035460405163a9059cbb60e01b815233600482015260248101919091526001600160a01b039091169063a9059cbb906044016020604051808303816000875af115801561024e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027291906104f8565b50336000908152600260205260409020805460ff19166001179055565b6001546001600160a01b031633146102b95760405162461bcd60e51b81526004016101f09061051a565b6000546001546040516370a0823160e01b81526001600160a01b039283169263a9059cbb92169083906370a08231906102f690309060040161049b565b602060405180830381865afa158015610313573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610337919061055c565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a691906104f8565b50565b6001546001600160a01b031633146103d35760405162461bcd60e51b81526004016101f09061051a565b600355565b600080546040516370a0823160e01b81526001600160a01b03909116906370a082319061040990309060040161049b565b602060405180830381865afa158015610426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a919061055c565b905090565b6001546001600160a01b031633146104795760405162461bcd60e51b81526004016101f09061051a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0391909116815260200190565b6000602082840312156104c157600080fd5b5035919050565b6000602082840312156104da57600080fd5b81356001600160a01b03811681146104f157600080fd5b9392505050565b60006020828403121561050a57600080fd5b815180151581146104f157600080fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60006020828403121561056e57600080fd5b505191905056fea26469706673582212204f7fd812260eacd88f23b436eb40b4943480e914005f0a0f2738f0d3c9696a5964736f6c63430008120033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 24559, + "contract": "src/token/Faucet.sol:Faucet", + "label": "token", + "offset": 0, + "slot": "0", + "type": "t_contract(IERC20)1042" + }, + { + "astId": 24561, + "contract": "src/token/Faucet.sol:Faucet", + "label": "governor", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 24565, + "contract": "src/token/Faucet.sol:Faucet", + "label": "withdrewAlready", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 24568, + "contract": "src/token/Faucet.sol:Faucet", + "label": "amount", + "offset": 0, + "slot": "3", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)1042": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepolia/DisputeKitClassic.json b/contracts/deployments/arbitrumSepolia/DisputeKitClassic.json new file mode 100644 index 000000000..e2c354302 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/DisputeKitClassic.json @@ -0,0 +1,1011 @@ +{ + "address": "0x8078C2A3bf93f6f69BDD4D38233E7e219eA1914e", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "ChoiceFunded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "_commit", + "type": "bytes32" + } + ], + "name": "CommitCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "Contribution", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_justification", + "type": "string" + } + ], + "name": "VoteCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "Withdrawal", + "type": "event" + }, + { + "inputs": [], + "name": "LOSER_APPEAL_PERIOD_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "LOSER_STAKE_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ONE_BASIS_POINT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WINNER_STAKE_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "areCommitsAllCast", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "areVotesAllCast", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "internalType": "bytes32", + "name": "_commit", + "type": "bytes32" + } + ], + "name": "castCommit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_salt", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_justification", + "type": "string" + } + ], + "name": "castVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_core", + "type": "address" + } + ], + "name": "changeCore", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "core", + "outputs": [ + { + "internalType": "contract KlerosCore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "coreDisputeIDToLocal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_nbVotes", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "currentRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "bool", + "name": "overridden", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "uint256", + "name": "numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "jumped", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [ + { + "internalType": "address", + "name": "drawnAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeGovernorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "fundAppeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + } + ], + "name": "getCoherentCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "getDegreeOfCoherence", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "getFundedChoices", + "outputs": [ + { + "internalType": "uint256[]", + "name": "fundedChoices", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "getRoundInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "winningChoice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "totalVoted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCommited", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbVoters", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "choiceCount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "getVoteInfo", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "commit", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "choice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "voted", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract KlerosCore", + "name": "_core", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "isVoteActive", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "withdrawFeesAndRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0x8c2fc255b80094a5e3c06421c7d686512871b10f7923623008a4c1b662a56151", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x8078C2A3bf93f6f69BDD4D38233E7e219eA1914e", + "transactionIndex": 1, + "gasUsed": "1856905", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080800000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x0b9827ecf499650f1b62c557bbc62c407f3aaf0028c5155f190292a3e40c026b", + "transactionHash": "0x8c2fc255b80094a5e3c06421c7d686512871b10f7923623008a4c1b662a56151", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842823, + "transactionHash": "0x8c2fc255b80094a5e3c06421c7d686512871b10f7923623008a4c1b662a56151", + "address": "0x8078C2A3bf93f6f69BDD4D38233E7e219eA1914e", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x0b9827ecf499650f1b62c557bbc62c407f3aaf0028c5155f190292a3e40c026b" + } + ], + "blockNumber": 3842823, + "cumulativeGasUsed": "1856905", + "status": 1, + "byzantium": true + }, + "args": [ + "0x2507018D785CE92115CfebE0d92CC496C42e99b7", + "0x485cc955000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c590000000000000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "0x0000000000000000000000000000000000000000" + ] + }, + "implementation": "0x2507018D785CE92115CfebE0d92CC496C42e99b7", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepolia/DisputeKitClassic_Implementation.json b/contracts/deployments/arbitrumSepolia/DisputeKitClassic_Implementation.json new file mode 100644 index 000000000..ec0b1c1cd --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/DisputeKitClassic_Implementation.json @@ -0,0 +1,1530 @@ +{ + "address": "0x2507018D785CE92115CfebE0d92CC496C42e99b7", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "ChoiceFunded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "_commit", + "type": "bytes32" + } + ], + "name": "CommitCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "Contribution", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_justification", + "type": "string" + } + ], + "name": "VoteCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "Withdrawal", + "type": "event" + }, + { + "inputs": [], + "name": "LOSER_APPEAL_PERIOD_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "LOSER_STAKE_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ONE_BASIS_POINT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WINNER_STAKE_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "areCommitsAllCast", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "areVotesAllCast", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "internalType": "bytes32", + "name": "_commit", + "type": "bytes32" + } + ], + "name": "castCommit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_voteIDs", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_salt", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_justification", + "type": "string" + } + ], + "name": "castVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_core", + "type": "address" + } + ], + "name": "changeCore", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "core", + "outputs": [ + { + "internalType": "contract KlerosCore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "coreDisputeIDToLocal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_nbVotes", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "currentRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "bool", + "name": "overridden", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "uint256", + "name": "numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "jumped", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [ + { + "internalType": "address", + "name": "drawnAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeGovernorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "fundAppeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + } + ], + "name": "getCoherentCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "getDegreeOfCoherence", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + } + ], + "name": "getFundedChoices", + "outputs": [ + { + "internalType": "uint256[]", + "name": "fundedChoices", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "getRoundInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "winningChoice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "totalVoted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalCommited", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbVoters", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "choiceCount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "getVoteInfo", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "commit", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "choice", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "voted", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract KlerosCore", + "name": "_core", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "isVoteActive", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_coreRoundID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_choice", + "type": "uint256" + } + ], + "name": "withdrawFeesAndRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xef0acc55c3e28c3d83d1faf0c5486b3c3b00845cb3acd054b5f9c912d6eb3ca1", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x2507018D785CE92115CfebE0d92CC496C42e99b7", + "transactionIndex": 1, + "gasUsed": "19434594", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000800000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xe69b796968062394b40a4c1bdd40f02272efb2085c7508fb3a5851452f2ad1b3", + "transactionHash": "0xef0acc55c3e28c3d83d1faf0c5486b3c3b00845cb3acd054b5f9c912d6eb3ca1", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842820, + "transactionHash": "0xef0acc55c3e28c3d83d1faf0c5486b3c3b00845cb3acd054b5f9c912d6eb3ca1", + "address": "0x2507018D785CE92115CfebE0d92CC496C42e99b7", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 0, + "blockHash": "0xe69b796968062394b40a4c1bdd40f02272efb2085c7508fb3a5851452f2ad1b3" + } + ], + "blockNumber": 3842820, + "cumulativeGasUsed": "19434594", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "e9fdf269c6fad89c4e78ca88d7e75f64", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"ChoiceFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_commit\",\"type\":\"bytes32\"}],\"name\":\"CommitCast\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Contribution\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"DisputeCreation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_justification\",\"type\":\"string\"}],\"name\":\"VoteCast\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_contributor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"LOSER_APPEAL_PERIOD_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LOSER_STAKE_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ONE_BASIS_POINT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WINNER_STAKE_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"areCommitsAllCast\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"areVotesAllCast\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes32\",\"name\":\"_commit\",\"type\":\"bytes32\"}],\"name\":\"castCommit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_voteIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_salt\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_justification\",\"type\":\"string\"}],\"name\":\"castVote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_core\",\"type\":\"address\"}],\"name\":\"changeCore\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"core\",\"outputs\":[{\"internalType\":\"contract KlerosCore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"coreDisputeIDToLocal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_nbVotes\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"currentRuling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"overridden\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"jumped\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"drawnAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_destination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"executeGovernorProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"fundAppeal\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"}],\"name\":\"getCoherentCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"getDegreeOfCoherence\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"}],\"name\":\"getFundedChoices\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"fundedChoices\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"getRoundInfo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"winningChoice\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"totalVoted\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalCommited\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbVoters\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"choiceCount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"getVoteInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"commit\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"choice\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"voted\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract KlerosCore\",\"name\":\"_core\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"isVoteActive\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_coreRoundID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"withdrawFeesAndRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"ChoiceFunded(uint256,uint256,uint256)\":{\"details\":\"To be emitted when a choice is fully funded for an appeal.\",\"params\":{\"_choice\":\"The choice that is being funded.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_coreRoundID\":\"The identifier of the round in the Arbitrator contract.\"}},\"CommitCast(uint256,address,uint256[],bytes32)\":{\"details\":\"To be emitted when a vote commitment is cast.\",\"params\":{\"_commit\":\"The commitment of the juror.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_juror\":\"The address of the juror casting the vote commitment.\",\"_voteIDs\":\"The identifiers of the votes in the dispute.\"}},\"Contribution(uint256,uint256,uint256,address,uint256)\":{\"details\":\"To be emitted when a funding contribution is made.\",\"params\":{\"_amount\":\"The amount contributed.\",\"_choice\":\"The choice that is being funded.\",\"_contributor\":\"The address of the contributor.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_coreRoundID\":\"The identifier of the round in the Arbitrator contract.\"}},\"DisputeCreation(uint256,uint256,bytes)\":{\"details\":\"To be emitted when a dispute is created.\",\"params\":{\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_extraData\":\"The extra data for the dispute.\",\"_numberOfChoices\":\"The number of choices available in the dispute.\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}},\"VoteCast(uint256,address,uint256[],uint256,string)\":{\"details\":\"Emitted when casting a vote to provide the justification of juror's choice.\",\"params\":{\"_choice\":\"The choice juror voted for.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_juror\":\"Address of the juror.\",\"_justification\":\"Justification of the choice.\",\"_voteIDs\":\"The identifiers of the votes in the dispute.\"}},\"Withdrawal(uint256,uint256,uint256,address,uint256)\":{\"details\":\"To be emitted when the contributed funds are withdrawn.\",\"params\":{\"_amount\":\"The amount withdrawn.\",\"_choice\":\"The choice that is being funded.\",\"_contributor\":\"The address of the contributor.\",\"_coreDisputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_coreRoundID\":\"The identifier of the round in the Arbitrator contract.\"}}},\"kind\":\"dev\",\"methods\":{\"areCommitsAllCast(uint256)\":{\"details\":\"Returns true if all of the jurors have cast their commits for the last round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"_0\":\"Whether all of the jurors have cast their commits for the last round.\"}},\"areVotesAllCast(uint256)\":{\"details\":\"Returns true if all of the jurors have cast their votes for the last round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"_0\":\"Whether all of the jurors have cast their votes for the last round.\"}},\"castCommit(uint256,uint256[],bytes32)\":{\"details\":\"Sets the caller's commit for the specified votes. It can be called multiple times during the commit period, each call overrides the commits of the previous one. `O(n)` where `n` is the number of votes.\",\"params\":{\"_commit\":\"The commit. Note that justification string is a part of the commit.\",\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_voteIDs\":\"The IDs of the votes.\"}},\"castVote(uint256,uint256[],uint256,uint256,string)\":{\"details\":\"Sets the caller's choices for the specified votes. `O(n)` where `n` is the number of votes.\",\"params\":{\"_choice\":\"The choice.\",\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_justification\":\"Justification of the choice.\",\"_salt\":\"The salt for the commit if the votes were hidden.\",\"_voteIDs\":\"The IDs of the votes.\"}},\"changeCore(address)\":{\"details\":\"Changes the `core` storage variable.\",\"params\":{\"_core\":\"The new value for the `core` storage variable.\"}},\"changeGovernor(address)\":{\"details\":\"Changes the `governor` storage variable.\",\"params\":{\"_governor\":\"The new value for the `governor` storage variable.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"createDispute(uint256,uint256,bytes,uint256)\":{\"details\":\"Creates a local dispute and maps it to the dispute ID in the Core contract. Note: Access restricted to Kleros Core only.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_extraData\":\"Additional info about the dispute, for possible use in future dispute kits.\",\"_nbVotes\":\"Number of votes for this dispute.\",\"_numberOfChoices\":\"Number of choices of the dispute\"}},\"currentRuling(uint256)\":{\"details\":\"Gets the current ruling of a specified dispute.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\"},\"returns\":{\"overridden\":\"Whether the ruling was overridden by appeal funding or not.\",\"ruling\":\"The current ruling.\",\"tied\":\"Whether it's a tie or not.\"}},\"draw(uint256,uint256)\":{\"details\":\"Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core. Note: Access restricted to Kleros Core only.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core.\",\"_nonce\":\"Nonce of the drawing iteration.\"},\"returns\":{\"drawnAddress\":\"The drawn address.\"}},\"executeGovernorProposal(address,uint256,bytes)\":{\"details\":\"Allows the governor to call anything on behalf of the contract.\",\"params\":{\"_amount\":\"The value sent with the call.\",\"_data\":\"The data sent with the call.\",\"_destination\":\"The destination of the call.\"}},\"fundAppeal(uint256,uint256)\":{\"details\":\"Manages contributions, and appeals a dispute if at least two choices are fully funded. Note that the surplus deposit will be reimbursed.\",\"params\":{\"_choice\":\"A choice that receives funding.\",\"_coreDisputeID\":\"Index of the dispute in Kleros Core.\"}},\"getCoherentCount(uint256,uint256)\":{\"details\":\"Gets the number of jurors who are eligible to a reward in this round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core, not in the Dispute Kit.\",\"_coreRoundID\":\"The ID of the round in Kleros Core, not in the Dispute Kit.\"},\"returns\":{\"_0\":\"The number of coherent jurors.\"}},\"getDegreeOfCoherence(uint256,uint256,uint256)\":{\"details\":\"Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core, not in the Dispute Kit.\",\"_coreRoundID\":\"The ID of the round in Kleros Core, not in the Dispute Kit.\",\"_voteID\":\"The ID of the vote.\"},\"returns\":{\"_0\":\"The degree of coherence in basis points.\"}},\"initialize(address,address)\":{\"details\":\"Initializer.\",\"params\":{\"_core\":\"The KlerosCore arbitrator.\",\"_governor\":\"The governor's address.\"}},\"isVoteActive(uint256,uint256,uint256)\":{\"details\":\"Returns true if the specified voter was active in this round.\",\"params\":{\"_coreDisputeID\":\"The ID of the dispute in Kleros Core, not in the Dispute Kit.\",\"_coreRoundID\":\"The ID of the round in Kleros Core, not in the Dispute Kit.\",\"_voteID\":\"The ID of the voter.\"},\"returns\":{\"_0\":\"Whether the voter was active or not.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}},\"withdrawFeesAndRewards(uint256,address,uint256,uint256)\":{\"details\":\"Allows those contributors who attempted to fund an appeal round to withdraw any reimbursable fees or rewards after the dispute gets resolved.\",\"params\":{\"_beneficiary\":\"The address whose rewards to withdraw.\",\"_choice\":\"The ruling option that the caller wants to withdraw from.\",\"_coreDisputeID\":\"Index of the dispute in Kleros Core contract.\",\"_coreRoundID\":\"The round in the Kleros Core contract the caller wants to withdraw from.\"},\"returns\":{\"amount\":\"The withdrawn amount.\"}}},\"title\":\"DisputeKitClassic Dispute kit implementation of the Kleros v1 features including: - a drawing system: proportional to staked PNK, - a vote aggregation system: plurality, - an incentive system: equal split between coherent votes, - an appeal system: fund 2 choices only, vote on any choice.\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/dispute-kits/DisputeKitClassic.sol\":\"DisputeKitClassic\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/KlerosCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"./interfaces/IArbitratorV2.sol\\\";\\nimport {IDisputeKit} from \\\"./interfaces/IDisputeKit.sol\\\";\\nimport {ISortitionModule} from \\\"./interfaces/ISortitionModule.sol\\\";\\nimport {SafeERC20, IERC20} from \\\"../libraries/SafeERC20.sol\\\";\\nimport {Constants} from \\\"../libraries/Constants.sol\\\";\\nimport {OnError} from \\\"../libraries/Types.sol\\\";\\nimport {UUPSProxiable} from \\\"../proxy/UUPSProxiable.sol\\\";\\nimport {Initializable} from \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title KlerosCore\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\ncontract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum PNKs needed to stake in the court.\\n uint256 alpha; // Basis point of PNKs that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court. Note that each court must support classic dispute kit.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrableV2 arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 pnkAtStakePerJuror; // The amount of PNKs at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 pnkPenalties; // The amount of PNKs collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumFeeRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumPnkRewardPaid; // Total sum of PNK paid to coherent jurors as a reward in this round.\\n IERC20 feeToken; // The token used for paying fees in this round.\\n uint256 drawIterations; // The number of iterations passed drawing the jurors for this round.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 pnkPenaltiesInRound; // The amount of PNKs collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n struct CurrencyRate {\\n bool feePaymentAccepted;\\n uint64 rateInEth;\\n uint8 rateDecimals;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 private constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 private constant NON_PAYABLE_AMOUNT = (2 ** 256 - 2) / 2; // An amount higher than the supply of ETH.\\n\\n address public governor; // The governor of the contract.\\n IERC20 public pinakion; // The Pinakion token contract.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n Court[] public courts; // The courts.\\n IDisputeKit[] public disputeKits; // Array of dispute kits.\\n Dispute[] public disputes; // The disputes.\\n mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(\\n uint96 indexed _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod\\n );\\n event DisputeKitCreated(uint256 indexed _disputeKitID, IDisputeKit indexed _disputeKitAddress);\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _pnkAmount,\\n int256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _pnkAmount,\\n uint256 _feeAmount,\\n IERC20 _feeToken\\n );\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _governor The governor's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n function initialize(\\n address _governor,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) external reinitializer(1) {\\n governor = _governor;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a dispute kit is not supported.\\n disputeKits.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKits.push(_disputeKit);\\n\\n emit DisputeKitCreated(Constants.DISPUTE_KIT_CLASSIC, _disputeKit);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(Constants.FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = Constants.FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(Constants.GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(Constants.GENERAL_COURT, Constants.DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /* @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n if (!success) revert UnsuccessfulCall();\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress) external onlyByGovernor {\\n uint256 disputeKitID = disputeKits.length;\\n disputeKits.push(_disputeKitAddress);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress);\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt();\\n if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit();\\n if (_parent == Constants.FORKING_COURT) revert InvalidForkingCourtAsParent();\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n // Check that Classic DK support was added.\\n if (!court.supportedDisputeKits[Constants.DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic();\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n function changeCourtParameters(\\n uint96 _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod\\n ) external onlyByGovernor {\\n Court storage court = courts[_courtID];\\n if (_courtID != Constants.GENERAL_COURT && courts[court.parent].minStake > _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n for (uint256 i = 0; i < court.children.length; i++) {\\n if (courts[court.children[i]].minStake < _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n }\\n court.minStake = _minStake;\\n court.hiddenVotes = _hiddenVotes;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(\\n _courtID,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod\\n );\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n // Classic dispute kit must be supported by all courts.\\n if (_disputeKitIDs[i] == Constants.DISPUTE_KIT_CLASSIC) {\\n revert CannotDisableClassicDK();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n /// @dev Changes the supported fee tokens.\\n /// @param _feeToken The fee token.\\n /// @param _accepted Whether the token is supported or not as a method of fee payment.\\n function changeAcceptedFeeTokens(IERC20 _feeToken, bool _accepted) external onlyByGovernor {\\n currencyRates[_feeToken].feePaymentAccepted = _accepted;\\n emit AcceptedFeeToken(_feeToken, _accepted);\\n }\\n\\n /// @dev Changes the currency rate of a fee token.\\n /// @param _feeToken The fee token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n function changeCurrencyRates(IERC20 _feeToken, uint64 _rateInEth, uint8 _rateDecimals) external onlyByGovernor {\\n currencyRates[_feeToken].rateInEth = _rateInEth;\\n currencyRates[_feeToken].rateDecimals = _rateDecimals;\\n emit NewCurrencyRate(_feeToken, _rateInEth, _rateDecimals);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// Note that the existing delayed stake will be nullified as non-relevant.\\n function setStake(uint96 _courtID, uint256 _newStake) external {\\n _setStake(msg.sender, _courtID, _newStake, false, OnError.Revert);\\n }\\n\\n /// @dev Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.\\n /// @param _account The account whose stake is being set.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs have already been transferred to the contract.\\n function setStakeBySortitionModule(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external {\\n if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly();\\n _setStake(_account, _courtID, _newStake, _alreadyTransferred, OnError.Return);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough();\\n\\n return _createDispute(_numberOfChoices, _extraData, Constants.NATIVE_CURRENCY, msg.value);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external override returns (uint256 disputeID) {\\n if (!currencyRates[_feeToken].feePaymentAccepted) revert TokenNotAccepted();\\n if (_feeAmount < arbitrationCost(_extraData, _feeToken)) revert ArbitrationFeesNotEnough();\\n\\n if (!_feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount)) revert TransferFailed();\\n return _createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount);\\n }\\n\\n function _createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) internal returns (uint256 disputeID) {\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n if (!courts[courtID].supportedDisputeKits[disputeKitID]) revert DisputeKitNotSupportedByCourt();\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrableV2(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKits[disputeKitID];\\n Court storage court = courts[dispute.courtID];\\n Round storage round = dispute.rounds.push();\\n\\n // Obtain the feeForJuror in the same currency as the _feeAmount\\n uint256 feeForJuror = (_feeToken == Constants.NATIVE_CURRENCY)\\n ? court.feeForJuror\\n : convertEthToTokenAmount(_feeToken, court.feeForJuror);\\n round.nbVotes = _feeAmount / feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = _feeAmount;\\n round.feeToken = IERC20(_feeToken);\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrableV2(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n if (\\n currentRound == 0 &&\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]\\n ) {\\n revert EvidenceNotPassedAndNotAppeal();\\n }\\n if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing();\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areCommitsAllCast(_disputeID)\\n ) {\\n revert CommitPeriodNotPassed();\\n }\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areVotesAllCast(_disputeID)\\n ) {\\n revert VotePeriodNotPassed();\\n }\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) {\\n revert AppealPeriodNotPassed();\\n }\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert DisputePeriodIsFinal();\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period != Period.evidence) revert NotEvidencePeriod();\\n\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 startIndex = round.drawIterations; // for gas: less storage reads\\n uint256 i;\\n while (i < _iterations && round.drawnJurors.length < round.nbVotes) {\\n address drawnAddress = disputeKit.draw(_disputeID, startIndex + i++);\\n if (drawnAddress == address(0)) {\\n continue;\\n }\\n sortitionModule.lockStake(drawnAddress, round.pnkAtStakePerJuror);\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n round.drawIterations += i;\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n if (msg.value < appealCost(_disputeID)) revert AppealFeesNotEnough();\\n\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.appeal) revert DisputeNotAppealable();\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n if (msg.sender != address(disputeKits[round.disputeKitID])) revert DisputeKitOnly();\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n // Switch to classic dispute kit if parent court doesn't support the current one.\\n newDisputeKitID = Constants.DISPUTE_KIT_CLASSIC;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKits[extraRound.disputeKitID].createDispute(\\n _disputeID,\\n _numberOfChoices,\\n _extraData,\\n extraRound.nbVotes\\n );\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n\\n Round storage round = dispute.rounds[_round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 pnkPenaltiesInRoundCache = round.pnkPenalties; // For saving gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect the PNK penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n pnkPenaltiesInRoundCache = _executePenalties(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n }\\n }\\n if (round.pnkPenalties != pnkPenaltiesInRoundCache) {\\n round.pnkPenalties = pnkPenaltiesInRoundCache; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return pnkPenaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.pnkAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.pnkPenaltiesInRound += penalty;\\n\\n // Unlock the PNKs affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n sortitionModule.unlockStake(account, penalty);\\n\\n // Apply the penalty to the staked PNKs.\\n sortitionModule.penalizeStake(account, penalty);\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n -int256(penalty),\\n 0,\\n round.feeToken\\n );\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(round.totalFeesForJurors);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, round.totalFeesForJurors);\\n }\\n pinakion.safeTransfer(governor, _params.pnkPenaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.pnkPenaltiesInRound,\\n round.totalFeesForJurors,\\n round.feeToken\\n );\\n }\\n return _params.pnkPenaltiesInRound;\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the PNKs of the juror for this round.\\n sortitionModule.unlockStake(account, pnkLocked);\\n\\n // Give back the locked PNKs in case the juror fully unstaked earlier.\\n if (!sortitionModule.isJurorStaked(account)) {\\n pinakion.safeTransfer(account, pnkLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumPnkRewardPaid += pnkReward;\\n uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumFeeRewardPaid += feeReward;\\n pinakion.safeTransfer(account, pnkReward);\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(account).send(feeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(account, feeReward);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(pnkReward),\\n int256(feeReward),\\n round.feeToken\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverPnkReward = _params.pnkPenaltiesInRound - round.sumPnkRewardPaid;\\n uint256 leftoverFeeReward = round.totalFeesForJurors - round.sumFeeRewardPaid;\\n if (leftoverPnkReward != 0 || leftoverFeeReward != 0) {\\n if (leftoverPnkReward != 0) {\\n pinakion.safeTransfer(governor, leftoverPnkReward);\\n }\\n if (leftoverFeeReward != 0) {\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(leftoverFeeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, leftoverFeeReward);\\n }\\n }\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n leftoverPnkReward,\\n leftoverFeeReward,\\n round.feeToken\\n );\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n if (dispute.ruled) revert RulingAlreadyExecuted();\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Compute the cost of arbitration denominated in ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) public view override returns (uint256 cost) {\\n cost = convertEthToTokenAmount(_feeToken, arbitrationCost(_extraData));\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == Constants.GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(uint256 _disputeID, uint256 _round) external view returns (Round memory) {\\n return disputes[_disputeID].rounds[_round];\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n timesPerPeriod = courts[_courtID].timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitsLength() external view returns (uint256) {\\n return disputeKits.length;\\n }\\n\\n function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) {\\n return (_amountInEth * 10 ** currencyRates[_toToken].rateDecimals) / currencyRates[_toToken].rateInEth;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support. Note that classic dispute kit should always be enabled.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev If called only once then set _onError to Revert, otherwise set it to Return\\n /// @param _account The account to set the stake for.\\n /// @param _courtID The ID of the court to set the stake for.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs were already transferred to/from the staking contract.\\n /// @param _onError Whether to revert or return false on error.\\n /// @return Whether the stake was successfully set or not.\\n function _setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred,\\n OnError _onError\\n ) internal returns (bool) {\\n if (_courtID == Constants.FORKING_COURT || _courtID > courts.length) {\\n _stakingFailed(_onError); // Staking directly into the forking court is not allowed.\\n return false;\\n }\\n if (_newStake != 0 && _newStake < courts[_courtID].minStake) {\\n _stakingFailed(_onError); // Staking less than the minimum stake is not allowed.\\n return false;\\n }\\n (uint256 pnkDeposit, uint256 pnkWithdrawal, bool sortitionSuccess) = sortitionModule.setStake(\\n _account,\\n _courtID,\\n _newStake,\\n _alreadyTransferred\\n );\\n if (!sortitionSuccess) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n if (pnkDeposit > 0) {\\n if (!pinakion.safeTransferFrom(_account, address(this), pnkDeposit)) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n }\\n if (pnkWithdrawal > 0) {\\n if (!pinakion.safeTransfer(_account, pnkWithdrawal)) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @dev It may revert depending on the _onError parameter.\\n function _stakingFailed(OnError _onError) internal pure {\\n if (_onError == OnError.Return) return;\\n revert StakingFailed();\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == Constants.FORKING_COURT || courtID >= courts.length) {\\n courtID = Constants.GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = Constants.DEFAULT_NB_OF_JURORS;\\n }\\n if (disputeKitID == Constants.NULL_DISPUTE_KIT || disputeKitID >= disputeKits.length) {\\n disputeKitID = Constants.DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = Constants.GENERAL_COURT;\\n minJurors = Constants.DEFAULT_NB_OF_JURORS;\\n disputeKitID = Constants.DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error DisputeKitOnly();\\n error SortitionModuleOnly();\\n error UnsuccessfulCall();\\n error InvalidDisputKitParent();\\n error DepthLevelMax();\\n error MinStakeLowerThanParentCourt();\\n error UnsupportedDisputeKit();\\n error InvalidForkingCourtAsParent();\\n error WrongDisputeKitIndex();\\n error CannotDisableClassicDK();\\n error ArraysLengthMismatch();\\n error StakingFailed();\\n error ArbitrationFeesNotEnough();\\n error DisputeKitNotSupportedByCourt();\\n error MustSupportDisputeKitClassic();\\n error TokenNotAccepted();\\n error EvidenceNotPassedAndNotAppeal();\\n error DisputeStillDrawing();\\n error CommitPeriodNotPassed();\\n error VotePeriodNotPassed();\\n error AppealPeriodNotPassed();\\n error NotEvidencePeriod();\\n error AppealFeesNotEnough();\\n error DisputeNotAppealable();\\n error NotExecutionPeriod();\\n error RulingAlreadyExecuted();\\n error DisputePeriodIsFinal();\\n error TransferFailed();\\n}\\n\",\"keccak256\":\"0x43205bc90f6965b5c1380effd2c29994f6dfea074696e39d5df037343a768d6b\",\"license\":\"MIT\"},\"src/arbitration/dispute-kits/DisputeKitClassic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"../KlerosCore.sol\\\";\\nimport \\\"../interfaces/IDisputeKit.sol\\\";\\nimport \\\"../../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../../proxy/Initializable.sol\\\";\\n\\n/// @title DisputeKitClassic\\n/// Dispute kit implementation of the Kleros v1 features including:\\n/// - a drawing system: proportional to staked PNK,\\n/// - a vote aggregation system: plurality,\\n/// - an incentive system: equal split between coherent votes,\\n/// - an appeal system: fund 2 choices only, vote on any choice.\\ncontract DisputeKitClassic is IDisputeKit, Initializable, UUPSProxiable {\\n // ************************************* //\\n // * Structs * //\\n // ************************************* //\\n\\n struct Dispute {\\n Round[] rounds; // Rounds of the dispute. 0 is the default round, and [1, ..n] are the appeal rounds.\\n uint256 numberOfChoices; // The number of choices jurors have when voting. This does not include choice `0` which is reserved for \\\"refuse to arbitrate\\\".\\n bool jumped; // True if dispute jumped to a parent dispute kit and won't be handled by this DK anymore.\\n mapping(uint256 => uint256) coreRoundIDToLocal; // Maps id of the round in the core contract to the index of the round of related local dispute.\\n bytes extraData; // Extradata for the dispute.\\n }\\n\\n struct Round {\\n Vote[] votes; // Former votes[_appeal][].\\n uint256 winningChoice; // The choice with the most votes. Note that in the case of a tie, it is the choice that reached the tied number of votes first.\\n mapping(uint256 => uint256) counts; // The sum of votes for each choice in the form `counts[choice]`.\\n bool tied; // True if there is a tie, false otherwise.\\n uint256 totalVoted; // Former uint[_appeal] votesInEachRound.\\n uint256 totalCommitted; // Former commitsInRound.\\n mapping(uint256 => uint256) paidFees; // Tracks the fees paid for each choice in this round.\\n mapping(uint256 => bool) hasPaid; // True if this choice was fully funded, false otherwise.\\n mapping(address => mapping(uint256 => uint256)) contributions; // Maps contributors to their contributions for each choice.\\n uint256 feeRewards; // Sum of reimbursable appeal fees available to the parties that made contributions to the ruling that ultimately wins a dispute.\\n uint256[] fundedChoices; // Stores the choices that are fully funded.\\n uint256 nbVotes; // Maximal number of votes this dispute can get.\\n }\\n\\n struct Vote {\\n address account; // The address of the juror.\\n bytes32 commit; // The commit of the juror. For courts with hidden votes.\\n uint256 choice; // The choice of the juror.\\n bool voted; // True if the vote has been cast.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant WINNER_STAKE_MULTIPLIER = 10000; // Multiplier of the appeal cost that the winner has to pay as fee stake for a round in basis points. Default is 1x of appeal fee.\\n uint256 public constant LOSER_STAKE_MULTIPLIER = 20000; // Multiplier of the appeal cost that the loser has to pay as fee stake for a round in basis points. Default is 2x of appeal fee.\\n uint256 public constant LOSER_APPEAL_PERIOD_MULTIPLIER = 5000; // Multiplier of the appeal period for the choice that wasn't voted for in the previous round, in basis points. Default is 1/2 of original appeal period.\\n uint256 public constant ONE_BASIS_POINT = 10000; // One basis point, for scaling.\\n\\n address public governor; // The governor of the contract.\\n KlerosCore public core; // The Kleros Core arbitrator\\n Dispute[] public disputes; // Array of the locally created disputes.\\n mapping(uint256 => uint256) public coreDisputeIDToLocal; // Maps the dispute ID in Kleros Core to the local dispute ID.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n /// @dev To be emitted when a dispute is created.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _numberOfChoices The number of choices available in the dispute.\\n /// @param _extraData The extra data for the dispute.\\n event DisputeCreation(uint256 indexed _coreDisputeID, uint256 _numberOfChoices, bytes _extraData);\\n\\n /// @dev To be emitted when a vote commitment is cast.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _juror The address of the juror casting the vote commitment.\\n /// @param _voteIDs The identifiers of the votes in the dispute.\\n /// @param _commit The commitment of the juror.\\n event CommitCast(uint256 indexed _coreDisputeID, address indexed _juror, uint256[] _voteIDs, bytes32 _commit);\\n\\n /// @dev To be emitted when a funding contribution is made.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _coreRoundID The identifier of the round in the Arbitrator contract.\\n /// @param _choice The choice that is being funded.\\n /// @param _contributor The address of the contributor.\\n /// @param _amount The amount contributed.\\n event Contribution(\\n uint256 indexed _coreDisputeID,\\n uint256 indexed _coreRoundID,\\n uint256 _choice,\\n address indexed _contributor,\\n uint256 _amount\\n );\\n\\n /// @dev To be emitted when the contributed funds are withdrawn.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _coreRoundID The identifier of the round in the Arbitrator contract.\\n /// @param _choice The choice that is being funded.\\n /// @param _contributor The address of the contributor.\\n /// @param _amount The amount withdrawn.\\n event Withdrawal(\\n uint256 indexed _coreDisputeID,\\n uint256 indexed _coreRoundID,\\n uint256 _choice,\\n address indexed _contributor,\\n uint256 _amount\\n );\\n\\n /// @dev To be emitted when a choice is fully funded for an appeal.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _coreRoundID The identifier of the round in the Arbitrator contract.\\n /// @param _choice The choice that is being funded.\\n event ChoiceFunded(uint256 indexed _coreDisputeID, uint256 indexed _coreRoundID, uint256 indexed _choice);\\n\\n // ************************************* //\\n // * Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n modifier onlyByCore() {\\n require(address(core) == msg.sender, \\\"Access not allowed: KlerosCore only.\\\");\\n _;\\n }\\n\\n modifier notJumped(uint256 _coreDisputeID) {\\n require(!disputes[coreDisputeIDToLocal[_coreDisputeID]].jumped, \\\"Dispute jumped to a parent DK!\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer.\\n /// @param _governor The governor's address.\\n /// @param _core The KlerosCore arbitrator.\\n function initialize(address _governor, KlerosCore _core) external reinitializer(1) {\\n governor = _governor;\\n core = _core;\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /**\\n * @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n require(success, \\\"Unsuccessful call\\\");\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `core` storage variable.\\n /// @param _core The new value for the `core` storage variable.\\n function changeCore(address _core) external onlyByGovernor {\\n core = KlerosCore(_core);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n /// @param _nbVotes Number of votes for this dispute.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external override onlyByCore {\\n uint256 localDisputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.numberOfChoices = _numberOfChoices;\\n dispute.extraData = _extraData;\\n\\n // New round in the Core should be created before the dispute creation in DK.\\n dispute.coreRoundIDToLocal[core.getNumberOfRounds(_coreDisputeID) - 1] = dispute.rounds.length;\\n\\n Round storage round = dispute.rounds.push();\\n round.nbVotes = _nbVotes;\\n round.tied = true;\\n\\n coreDisputeIDToLocal[_coreDisputeID] = localDisputeID;\\n emit DisputeCreation(_coreDisputeID, _numberOfChoices, _extraData);\\n }\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _nonce Nonce of the drawing iteration.\\n /// @return drawnAddress The drawn address.\\n function draw(\\n uint256 _coreDisputeID,\\n uint256 _nonce\\n ) external override onlyByCore notJumped(_coreDisputeID) returns (address drawnAddress) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n\\n ISortitionModule sortitionModule = core.sortitionModule();\\n (uint96 courtID, , , , ) = core.disputes(_coreDisputeID);\\n bytes32 key = bytes32(uint256(courtID)); // Get the ID of the tree.\\n\\n // TODO: Handle the situation when no one has staked yet.\\n drawnAddress = sortitionModule.draw(key, _coreDisputeID, _nonce);\\n\\n if (_postDrawCheck(_coreDisputeID, drawnAddress)) {\\n round.votes.push(Vote({account: drawnAddress, commit: bytes32(0), choice: 0, voted: false}));\\n } else {\\n drawnAddress = address(0);\\n }\\n }\\n\\n /// @dev Sets the caller's commit for the specified votes. It can be called multiple times during the\\n /// commit period, each call overrides the commits of the previous one.\\n /// `O(n)` where\\n /// `n` is the number of votes.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _voteIDs The IDs of the votes.\\n /// @param _commit The commit. Note that justification string is a part of the commit.\\n function castCommit(\\n uint256 _coreDisputeID,\\n uint256[] calldata _voteIDs,\\n bytes32 _commit\\n ) external notJumped(_coreDisputeID) {\\n (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID);\\n require(period == KlerosCore.Period.commit, \\\"The dispute should be in Commit period.\\\");\\n require(_commit != bytes32(0), \\\"Empty commit.\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n for (uint256 i = 0; i < _voteIDs.length; i++) {\\n require(round.votes[_voteIDs[i]].account == msg.sender, \\\"The caller has to own the vote.\\\");\\n round.votes[_voteIDs[i]].commit = _commit;\\n }\\n round.totalCommitted += _voteIDs.length;\\n emit CommitCast(_coreDisputeID, msg.sender, _voteIDs, _commit);\\n }\\n\\n /// @dev Sets the caller's choices for the specified votes.\\n /// `O(n)` where\\n /// `n` is the number of votes.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @param _voteIDs The IDs of the votes.\\n /// @param _choice The choice.\\n /// @param _salt The salt for the commit if the votes were hidden.\\n /// @param _justification Justification of the choice.\\n function castVote(\\n uint256 _coreDisputeID,\\n uint256[] calldata _voteIDs,\\n uint256 _choice,\\n uint256 _salt,\\n string memory _justification\\n ) external notJumped(_coreDisputeID) {\\n (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID);\\n require(period == KlerosCore.Period.vote, \\\"The dispute should be in Vote period.\\\");\\n require(_voteIDs.length > 0, \\\"No voteID provided\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n require(_choice <= dispute.numberOfChoices, \\\"Choice out of bounds\\\");\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n (uint96 courtID, , , , ) = core.disputes(_coreDisputeID);\\n (, bool hiddenVotes, , , , , ) = core.courts(courtID);\\n\\n // Save the votes.\\n for (uint256 i = 0; i < _voteIDs.length; i++) {\\n require(round.votes[_voteIDs[i]].account == msg.sender, \\\"The caller has to own the vote.\\\");\\n require(\\n !hiddenVotes || round.votes[_voteIDs[i]].commit == keccak256(abi.encodePacked(_choice, _salt)),\\n \\\"The commit must match the choice in courts with hidden votes.\\\"\\n );\\n require(!round.votes[_voteIDs[i]].voted, \\\"Vote already cast.\\\");\\n round.votes[_voteIDs[i]].choice = _choice;\\n round.votes[_voteIDs[i]].voted = true;\\n }\\n\\n round.totalVoted += _voteIDs.length;\\n\\n round.counts[_choice] += _voteIDs.length;\\n if (_choice == round.winningChoice) {\\n if (round.tied) round.tied = false;\\n } else {\\n // Voted for another choice.\\n if (round.counts[_choice] == round.counts[round.winningChoice]) {\\n // Tie.\\n if (!round.tied) round.tied = true;\\n } else if (round.counts[_choice] > round.counts[round.winningChoice]) {\\n // New winner.\\n round.winningChoice = _choice;\\n round.tied = false;\\n }\\n }\\n emit VoteCast(_coreDisputeID, msg.sender, _voteIDs, _choice, _justification);\\n }\\n\\n /// @dev Manages contributions, and appeals a dispute if at least two choices are fully funded.\\n /// Note that the surplus deposit will be reimbursed.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core.\\n /// @param _choice A choice that receives funding.\\n function fundAppeal(uint256 _coreDisputeID, uint256 _choice) external payable notJumped(_coreDisputeID) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n require(_choice <= dispute.numberOfChoices, \\\"There is no such ruling to fund.\\\");\\n\\n (uint256 appealPeriodStart, uint256 appealPeriodEnd) = core.appealPeriod(_coreDisputeID);\\n require(block.timestamp >= appealPeriodStart && block.timestamp < appealPeriodEnd, \\\"Appeal period is over.\\\");\\n\\n uint256 multiplier;\\n (uint256 ruling, , ) = this.currentRuling(_coreDisputeID);\\n if (ruling == _choice) {\\n multiplier = WINNER_STAKE_MULTIPLIER;\\n } else {\\n require(\\n block.timestamp - appealPeriodStart <\\n ((appealPeriodEnd - appealPeriodStart) * LOSER_APPEAL_PERIOD_MULTIPLIER) / ONE_BASIS_POINT,\\n \\\"Appeal period is over for loser\\\"\\n );\\n multiplier = LOSER_STAKE_MULTIPLIER;\\n }\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n uint256 coreRoundID = core.getNumberOfRounds(_coreDisputeID) - 1;\\n\\n require(!round.hasPaid[_choice], \\\"Appeal fee is already paid.\\\");\\n uint256 appealCost = core.appealCost(_coreDisputeID);\\n uint256 totalCost = appealCost + (appealCost * multiplier) / ONE_BASIS_POINT;\\n\\n // Take up to the amount necessary to fund the current round at the current costs.\\n uint256 contribution;\\n if (totalCost > round.paidFees[_choice]) {\\n contribution = totalCost - round.paidFees[_choice] > msg.value // Overflows and underflows will be managed on the compiler level.\\n ? msg.value\\n : totalCost - round.paidFees[_choice];\\n emit Contribution(_coreDisputeID, coreRoundID, _choice, msg.sender, contribution);\\n }\\n\\n round.contributions[msg.sender][_choice] += contribution;\\n round.paidFees[_choice] += contribution;\\n if (round.paidFees[_choice] >= totalCost) {\\n round.feeRewards += round.paidFees[_choice];\\n round.fundedChoices.push(_choice);\\n round.hasPaid[_choice] = true;\\n emit ChoiceFunded(_coreDisputeID, coreRoundID, _choice);\\n }\\n\\n if (round.fundedChoices.length > 1) {\\n // At least two sides are fully funded.\\n round.feeRewards = round.feeRewards - appealCost;\\n\\n if (core.isDisputeKitJumping(_coreDisputeID)) {\\n // Don't create a new round in case of a jump, and remove local dispute from the flow.\\n dispute.jumped = true;\\n } else {\\n // Don't subtract 1 from length since both round arrays haven't been updated yet.\\n dispute.coreRoundIDToLocal[coreRoundID + 1] = dispute.rounds.length;\\n\\n Round storage newRound = dispute.rounds.push();\\n newRound.nbVotes = core.getNumberOfVotes(_coreDisputeID);\\n newRound.tied = true;\\n }\\n core.appeal{value: appealCost}(_coreDisputeID, dispute.numberOfChoices, dispute.extraData);\\n }\\n\\n if (msg.value > contribution) payable(msg.sender).send(msg.value - contribution);\\n }\\n\\n /// @dev Allows those contributors who attempted to fund an appeal round to withdraw any reimbursable fees or rewards after the dispute gets resolved.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core contract.\\n /// @param _beneficiary The address whose rewards to withdraw.\\n /// @param _coreRoundID The round in the Kleros Core contract the caller wants to withdraw from.\\n /// @param _choice The ruling option that the caller wants to withdraw from.\\n /// @return amount The withdrawn amount.\\n function withdrawFeesAndRewards(\\n uint256 _coreDisputeID,\\n address payable _beneficiary,\\n uint256 _coreRoundID,\\n uint256 _choice\\n ) external returns (uint256 amount) {\\n (, , , bool isRuled, ) = core.disputes(_coreDisputeID);\\n require(isRuled, \\\"Dispute should be resolved.\\\");\\n\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];\\n (uint256 finalRuling, , ) = core.currentRuling(_coreDisputeID);\\n\\n if (!round.hasPaid[_choice]) {\\n // Allow to reimburse if funding was unsuccessful for this ruling option.\\n amount = round.contributions[_beneficiary][_choice];\\n } else {\\n // Funding was successful for this ruling option.\\n if (_choice == finalRuling) {\\n // This ruling option is the ultimate winner.\\n amount = round.paidFees[_choice] > 0\\n ? (round.contributions[_beneficiary][_choice] * round.feeRewards) / round.paidFees[_choice]\\n : 0;\\n } else if (!round.hasPaid[finalRuling]) {\\n // The ultimate winner was not funded in this round. In this case funded ruling option(s) are reimbursed.\\n amount =\\n (round.contributions[_beneficiary][_choice] * round.feeRewards) /\\n (round.paidFees[round.fundedChoices[0]] + round.paidFees[round.fundedChoices[1]]);\\n }\\n }\\n round.contributions[_beneficiary][_choice] = 0;\\n\\n if (amount != 0) {\\n _beneficiary.send(amount); // Deliberate use of send to prevent reverting fallback. It's the user's responsibility to accept ETH.\\n emit Withdrawal(_coreDisputeID, _coreRoundID, _choice, _beneficiary, amount);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n function getFundedChoices(uint256 _coreDisputeID) public view returns (uint256[] memory fundedChoices) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage lastRound = dispute.rounds[dispute.rounds.length - 1];\\n return lastRound.fundedChoices;\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(\\n uint256 _coreDisputeID\\n ) external view override returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n tied = round.tied;\\n ruling = tied ? 0 : round.winningChoice;\\n (, , KlerosCore.Period period, , ) = core.disputes(_coreDisputeID);\\n // Override the final ruling if only one side funded the appeals.\\n if (period == KlerosCore.Period.execution) {\\n uint256[] memory fundedChoices = getFundedChoices(_coreDisputeID);\\n if (fundedChoices.length == 1) {\\n ruling = fundedChoices[0];\\n tied = false;\\n overridden = true;\\n }\\n }\\n }\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view override returns (uint256) {\\n // In this contract this degree can be either 0 or 1, but in other dispute kits this value can be something in between.\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Vote storage vote = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]].votes[_voteID];\\n (uint256 winningChoice, bool tied, ) = core.currentRuling(_coreDisputeID);\\n\\n if (vote.voted && (vote.choice == winningChoice || tied)) {\\n return ONE_BASIS_POINT;\\n } else {\\n return 0;\\n }\\n }\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view override returns (uint256) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage currentRound = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];\\n (uint256 winningChoice, bool tied, ) = core.currentRuling(_coreDisputeID);\\n\\n if (currentRound.totalVoted == 0 || (!tied && currentRound.counts[winningChoice] == 0)) {\\n return 0;\\n } else if (tied) {\\n return currentRound.totalVoted;\\n } else {\\n return currentRound.counts[winningChoice];\\n }\\n }\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n return round.totalCommitted == round.votes.length;\\n }\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n return round.totalVoted == round.votes.length;\\n }\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view override returns (bool) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Vote storage vote = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]].votes[_voteID];\\n return vote.voted;\\n }\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n override\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n )\\n {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Round storage round = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];\\n return (\\n round.winningChoice,\\n round.tied,\\n round.totalVoted,\\n round.totalCommitted,\\n round.votes.length,\\n round.counts[_choice]\\n );\\n }\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view override returns (address account, bytes32 commit, uint256 choice, bool voted) {\\n Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];\\n Vote storage vote = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]].votes[_voteID];\\n return (vote.account, vote.commit, vote.choice, vote.voted);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Checks that the chosen address satisfies certain conditions for being drawn.\\n /// @param _coreDisputeID ID of the dispute in the core contract.\\n /// @param _juror Chosen address.\\n /// @return Whether the address can be drawn or not.\\n function _postDrawCheck(uint256 _coreDisputeID, address _juror) internal view returns (bool) {\\n (uint96 courtID, , , , ) = core.disputes(_coreDisputeID);\\n uint256 lockedAmountPerJuror = core\\n .getRoundInfo(_coreDisputeID, core.getNumberOfRounds(_coreDisputeID) - 1)\\n .pnkAtStakePerJuror;\\n (uint256 totalStaked, uint256 totalLocked, , ) = core.sortitionModule().getJurorBalance(_juror, courtID);\\n return totalStaked >= totalLocked + lockedAmountPerJuror;\\n }\\n}\\n\",\"keccak256\":\"0xdf2e2e6aacabe3323dad6e8d7bbae2d749ebf0d84c3f71f84ec8d8ed918387e1\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _juror Address of the juror.\\n /// @param _voteIDs The identifiers of the votes in the dispute.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event VoteCast(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256[] _voteIDs,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _nonce Nonce.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID, uint256 _nonce) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0x7fe6b1d9b991cc327cc5895f34208a7b1e3b6ebf8efb20fcb9f3ff0f40d2d209\",\"license\":\"MIT\"},\"src/arbitration/interfaces/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external returns (uint256 pnkDeposit, uint256 pnkWithdrawal, bool succeeded);\\n\\n function setJurorInactive(address _account) external;\\n\\n function lockStake(address _account, uint256 _relativeAmount) external;\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external;\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _nonce) external view returns (address);\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts);\\n\\n function getJurorCourtIDs(address _juror) external view returns (uint96[] memory);\\n\\n function isJurorStaked(address _juror) external view returns (bool);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0xa6d79053edfe04f7d3c8ad9b9ce3f182e45f2f74be40a77a304a93168549c474\",\"license\":\"MIT\"},\"src/libraries/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title Constants\\nlibrary Constants {\\n // Courts\\n uint96 internal constant FORKING_COURT = 0; // Index of the forking court.\\n uint96 internal constant GENERAL_COURT = 1; // Index of the default (general) court.\\n\\n // Dispute Kits\\n uint256 internal constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\n uint256 internal constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n\\n // Defaults\\n uint256 internal constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute.\\n IERC20 internal constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1.\\n}\\n\",\"keccak256\":\"0xc1dc3005bd8de9e68b6c8723db40e98c4c9d5e0c4ca444aa8f314866ebd9e73b\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"},\"src/libraries/Types.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nenum OnError {\\n Revert,\\n Return\\n}\\n\",\"keccak256\":\"0xc7deebd8227dfaa46a36ae8d2c24fe1b5d5c776ab963b44943829ab4058b5701\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000d9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff1615620000765760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b0390811614620000d65780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051613dfb62000103600039600081816114d3015281816114fc01526118370152613dfb6000f3fe6080604052600436106101825760003560e01c80636d4cd8ea116100d7578063b6ede54011610085578063b6ede540146104ca578063ba66fde7146104ea578063be4676041461050a578063d2b8035a14610520578063da3beb8c14610540578063e349ad3014610412578063e4c0aaf414610560578063f2f4eb261461058057600080fd5b80636d4cd8ea146103d2578063751accd0146103f2578063796490f9146104125780637c04034e146104285780638e42646014610448578063a7cc08fe14610468578063b34bfaa8146104b457600080fd5b80634f1ef286116101345780634f1ef286146102c15780634fe264fb146102d457806352d1902d146102f4578063564a565d146103095780635c92e2f61461033857806365540b961461035857806369f3f0411461038557600080fd5b80630baa64d1146101875780630c340a24146101bc5780631200aabc146101f45780631c3db16d1461022f578063362c34791461026c578063485cc9551461028c5780634b2f0ea0146102ae575b600080fd5b34801561019357600080fd5b506101a76101a23660046130cf565b6105a0565b60405190151581526020015b60405180910390f35b3480156101c857600080fd5b506000546101dc906001600160a01b031681565b6040516001600160a01b0390911681526020016101b3565b34801561020057600080fd5b5061022161020f3660046130cf565b60036020526000908152604090205481565b6040519081526020016101b3565b34801561023b57600080fd5b5061024f61024a3660046130cf565b610617565b6040805193845291151560208401521515908201526060016101b3565b34801561027857600080fd5b506102216102873660046130fd565b610785565b34801561029857600080fd5b506102ac6102a736600461313a565b610b5b565b005b6102ac6102bc366004613173565b610c58565b6102ac6102cf36600461327b565b6114bf565b3480156102e057600080fd5b506102216102ef3660046132ca565b6116e7565b34801561030057600080fd5b5061022161182a565b34801561031557600080fd5b506103296103243660046130cf565b611888565b6040516101b393929190613346565b34801561034457600080fd5b506102ac6103533660046133bb565b61194e565b34801561036457600080fd5b506103786103733660046130cf565b611c5b565b6040516101b3919061340d565b34801561039157600080fd5b506103a56103a03660046132ca565b611d1f565b604080519687529415156020870152938501929092526060840152608083015260a082015260c0016101b3565b3480156103de57600080fd5b506101a76103ed3660046130cf565b611dd7565b3480156103fe57600080fd5b506102ac61040d366004613451565b611e4e565b34801561041e57600080fd5b5061022161271081565b34801561043457600080fd5b506102ac6104433660046134a9565b611f1a565b34801561045457600080fd5b506102ac610463366004613541565b6125f5565b34801561047457600080fd5b506104886104833660046132ca565b612641565b604080516001600160a01b039095168552602085019390935291830152151560608201526080016101b3565b3480156104c057600080fd5b50610221614e2081565b3480156104d657600080fd5b506102ac6104e536600461355e565b612707565b3480156104f657600080fd5b506101a76105053660046132ca565b6128dc565b34801561051657600080fd5b5061022161138881565b34801561052c57600080fd5b506101dc61053b366004613173565b612977565b34801561054c57600080fd5b5061022161055b366004613173565b612c80565b34801561056c57600080fd5b506102ac61057b366004613541565b612dd3565b34801561058c57600080fd5b506001546101dc906001600160a01b031681565b6000818152600360205260408120546002805483929081106105c4576105c46135e5565b600091825260208220600590910201805490925082906105e690600190613611565b815481106105f6576105f66135e5565b60009182526020909120600c90910201805460059091015414949350505050565b6000806000806002600360008781526020019081526020016000205481548110610643576106436135e5565b6000918252602082206005909102018054909250829061066590600190613611565b81548110610675576106756135e5565b60009182526020909120600c90910201600381015460ff1694509050836106a05780600101546106a3565b60005b60015460405163564a565d60e01b8152600481018990529196506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156106f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107169190613650565b5090935060049250610726915050565b816004811115610738576107386136b7565b0361077b57600061074888611c5b565b905080516001036107795780600081518110610766576107666135e5565b6020026020010151965060009550600194505b505b5050509193909250565b60015460405163564a565d60e01b81526004810186905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156107d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f79190613650565b5093505050508061084f5760405162461bcd60e51b815260206004820152601b60248201527f446973707574652073686f756c64206265207265736f6c7665642e000000000060448201526064015b60405180910390fd5b600086815260036020526040812054600280549091908110610873576108736135e5565b600091825260208083208884526003600590930201918201905260408220548154919350839181106108a7576108a76135e5565b600091825260208220600154604051631c3db16d60e01b8152600481018d9052600c9390930290910193506001600160a01b031690631c3db16d90602401606060405180830381865afa158015610902573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092691906136cd565b5050600087815260078401602052604090205490915060ff16610970576001600160a01b038816600090815260088301602090815260408083208984529091529020549450610ab5565b8086036109e55760008681526006830160205260409020546109935760006109de565b600086815260068301602090815260408083205460098601546001600160a01b038d1685526008870184528285208b86529093529220546109d49190613709565b6109de9190613720565b9450610ab5565b600081815260078301602052604090205460ff16610ab55781600601600083600a01600181548110610a1957610a196135e5565b906000526020600020015481526020019081526020016000205482600601600084600a01600081548110610a4f57610a4f6135e5565b9060005260206000200154815260200190815260200160002054610a739190613742565b60098301546001600160a01b038a16600090815260088501602090815260408083208b8452909152902054610aa89190613709565b610ab29190613720565b94505b6001600160a01b038816600090815260088301602090815260408083208984529091528120558415610b4f576040516001600160a01b0389169086156108fc029087906000818181858888f15050604080518a8152602081018a90526001600160a01b038d1694508b93508d92507f54b3cab3cb5c4aca3209db1151caff092e878011202e43a36782d4ebe0b963ae910160405180910390a45b50505050949350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff1680610ba4575080546001600160401b03808416911610155b15610bc15760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b038316908117600160401b178255600080546001600160a01b038781166001600160a01b0319928316179092556001805492871692909116919091179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b600082815260036020526040902054600280548492908110610c7c57610c7c6135e5565b600091825260209091206002600590920201015460ff1615610cb05760405162461bcd60e51b815260040161084690613755565b600083815260036020526040812054600280549091908110610cd457610cd46135e5565b906000526020600020906005020190508060010154831115610d385760405162461bcd60e51b815260206004820181905260248201527f5468657265206973206e6f20737563682072756c696e6720746f2066756e642e6044820152606401610846565b60015460405163afe15cfb60e01b81526004810186905260009182916001600160a01b039091169063afe15cfb906024016040805180830381865afa158015610d85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da9919061378c565b91509150814210158015610dbc57508042105b610e015760405162461bcd60e51b815260206004820152601660248201527520b83832b0b6103832b934b7b21034b99037bb32b91760511b6044820152606401610846565b604051631c3db16d60e01b81526004810187905260009081903090631c3db16d90602401606060405180830381865afa158015610e42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6691906136cd565b50509050868103610e7b576127109150610efc565b612710611388610e8b8686613611565b610e959190613709565b610e9f9190613720565b610ea98542613611565b10610ef65760405162461bcd60e51b815260206004820152601f60248201527f41707065616c20706572696f64206973206f76657220666f72206c6f736572006044820152606401610846565b614e2091505b84546000908690610f0f90600190613611565b81548110610f1f57610f1f6135e5565b60009182526020822060018054604051637e37c78b60e11b8152600481018f9052600c949094029092019450916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa158015610f7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa291906137b0565b610fac9190613611565b60008a815260078401602052604090205490915060ff16156110105760405162461bcd60e51b815260206004820152601b60248201527f41707065616c2066656520697320616c726561647920706169642e00000000006044820152606401610846565b600154604051632cf6413f60e11b8152600481018c90526000916001600160a01b0316906359ec827e90602401602060405180830381865afa15801561105a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107e91906137b0565b9050600061271061108f8784613709565b6110999190613720565b6110a39083613742565b60008c8152600686016020526040812054919250908211156111545760008c815260068601602052604090205434906110dc9084613611565b116111015760008c81526006860160205260409020546110fc9083613611565b611103565b345b9050336001600160a01b0316848e7fcae597f39a3ad75c2e10d46b031f023c5c2babcd58ca0491b122acda3968d4c08f8560405161114b929190918252602082015260400190565b60405180910390a45b33600090815260088601602090815260408083208f845290915281208054839290611180908490613742565b909155505060008c8152600686016020526040812080548392906111a5908490613742565b909155505060008c815260068601602052604090205482116112775760008c8152600686016020526040812054600987018054919290916111e7908490613742565b9250508190555084600a018c908060018154018082558091505060019003906000526020600020016000909190919091505560018560070160008e815260200190815260200160002060006101000a81548160ff0219169083151502179055508b848e7fed764996238e4c1c873ae3af7ae2f00f1f6f4f10b9ac7d4bbea4a764c5dea00960405160405180910390a45b600a85015460011015611482578285600901546112949190613611565b60098601556001546040516319b8152960e01b8152600481018f90526001600160a01b03909116906319b8152990602401602060405180830381865afa1580156112e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130691906137c9565b1561131f5760028a01805460ff19166001179055611402565b895460038b016000611332876001613742565b81526020019081526020016000208190555060008a6000016001816001815401808255809150500390600052602060002090600c02019050600160009054906101000a90046001600160a01b03166001600160a01b031663c71f42538f6040518263ffffffff1660e01b81526004016113ad91815260200190565b602060405180830381865afa1580156113ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ee91906137b0565b600b820155600301805460ff191660011790555b600160009054906101000a90046001600160a01b03166001600160a01b031663c3569902848f8d600101548e6004016040518563ffffffff1660e01b815260040161144f9392919061381e565b6000604051808303818588803b15801561146857600080fd5b505af115801561147c573d6000803e3d6000fd5b50505050505b803411156114b057336108fc6114988334613611565b6040518115909202916000818181858888f150505050505b50505050505050505050505050565b6114c882612e1f565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061154657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661153a600080516020613da68339815191525490565b6001600160a01b031614155b156115645760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156115be575060408051601f3d908101601f191682019092526115bb918101906137b0565b60015b6115e657604051630c76093760e01b81526001600160a01b0383166004820152602401610846565b600080516020613da6833981519152811461161757604051632a87526960e21b815260048101829052602401610846565b600080516020613da68339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28151156116e2576000836001600160a01b03168360405161167e91906138b8565b600060405180830381855af49150503d80600081146116b9576040519150601f19603f3d011682016040523d82523d6000602084013e6116be565b606091505b50509050806116e0576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b60008381526003602052604081205460028054839290811061170b5761170b6135e5565b6000918252602080832087845260036005909302019182019052604082205481549193508391811061173f5761173f6135e5565b90600052602060002090600c02016000018481548110611761576117616135e5565b600091825260208220600154604051631c3db16d60e01b815260048082018c905293909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa1580156117bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e391906136cd565b506003850154919350915060ff168015611807575081836002015414806118075750805b1561181a57612710945050505050611823565b60009450505050505b9392505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118755760405163703e46dd60e11b815260040160405180910390fd5b50600080516020613da683398151915290565b6002818154811061189857600080fd5b600091825260209091206005909102016001810154600282015460048301805492945060ff90911692916118cb906137e4565b80601f01602080910402602001604051908101604052809291908181526020018280546118f7906137e4565b80156119445780601f1061191957610100808354040283529160200191611944565b820191906000526020600020905b81548152906001019060200180831161192757829003601f168201915b5050505050905083565b600084815260036020526040902054600280548692908110611972576119726135e5565b600091825260209091206002600590920201015460ff16156119a65760405162461bcd60e51b815260040161084690613755565b60015460405163564a565d60e01b8152600481018790526000916001600160a01b03169063564a565d9060240160a060405180830381865afa1580156119f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a149190613650565b5090935060019250611a24915050565b816004811115611a3657611a366136b7565b14611a935760405162461bcd60e51b815260206004820152602760248201527f54686520646973707574652073686f756c6420626520696e20436f6d6d6974206044820152663832b934b7b21760c91b6064820152608401610846565b82611ad05760405162461bcd60e51b815260206004820152600d60248201526c22b6b83a3c9031b7b6b6b4ba1760991b6044820152606401610846565b600086815260036020526040812054600280549091908110611af457611af46135e5565b60009182526020822060059091020180549092508290611b1690600190613611565b81548110611b2657611b266135e5565b90600052602060002090600c0201905060005b86811015611bf4573382898984818110611b5557611b556135e5565b9050602002013581548110611b6c57611b6c6135e5565b60009182526020909120600490910201546001600160a01b031614611ba35760405162461bcd60e51b8152600401610846906138d4565b8582898984818110611bb757611bb76135e5565b9050602002013581548110611bce57611bce6135e5565b600091825260209091206001600490920201015580611bec8161390b565b915050611b39565b5086869050816005016000828254611c0c9190613742565b9091555050604051339089907f05cc2f1c94966f1c961b410a50f3d3ffb64501346753a258177097ea23707f0890611c49908b908b908b90613956565b60405180910390a35050505050505050565b6000818152600360205260408120546002805460609392908110611c8157611c816135e5565b60009182526020822060059091020180549092508290611ca390600190613611565b81548110611cb357611cb36135e5565b90600052602060002090600c0201905080600a01805480602002602001604051908101604052809291908181526020018280548015611d1157602002820191906000526020600020905b815481526020019060010190808311611cfd575b505050505092505050919050565b60008060008060008060006002600360008c81526020019081526020016000205481548110611d5057611d506135e5565b600091825260208083208c8452600360059093020191820190526040822054815491935083918110611d8457611d846135e5565b600091825260208083206001600c909302019182015460038301546004840154600585015485549f87526002909501909352604090942054909f60ff9094169e50909c50909a9950975095505050505050565b600081815260036020526040812054600280548392908110611dfb57611dfb6135e5565b60009182526020822060059091020180549092508290611e1d90600190613611565b81548110611e2d57611e2d6135e5565b60009182526020909120600c90910201805460049091015414949350505050565b6000546001600160a01b03163314611e785760405162461bcd60e51b81526004016108469061397a565b6000836001600160a01b03168383604051611e9391906138b8565b60006040518083038185875af1925050503d8060008114611ed0576040519150601f19603f3d011682016040523d82523d6000602084013e611ed5565b606091505b50509050806116e05760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b6044820152606401610846565b600086815260036020526040902054600280548892908110611f3e57611f3e6135e5565b600091825260209091206002600590920201015460ff1615611f725760405162461bcd60e51b815260040161084690613755565b60015460405163564a565d60e01b8152600481018990526000916001600160a01b03169063564a565d9060240160a060405180830381865afa158015611fbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fe09190613650565b5090935060029250611ff0915050565b816004811115612002576120026136b7565b1461205d5760405162461bcd60e51b815260206004820152602560248201527f54686520646973707574652073686f756c6420626520696e20566f74652070656044820152643934b7b21760d91b6064820152608401610846565b8561209f5760405162461bcd60e51b8152602060048201526012602482015271139bc81d9bdd195251081c1c9bdd9a59195960721b6044820152606401610846565b6000888152600360205260408120546002805490919081106120c3576120c36135e5565b90600052602060002090600502019050806001015486111561211e5760405162461bcd60e51b815260206004820152601460248201527343686f696365206f7574206f6620626f756e647360601b6044820152606401610846565b8054600090829061213190600190613611565b81548110612141576121416135e5565b60009182526020822060015460405163564a565d60e01b8152600481018f9052600c9390930290910193506001600160a01b03169063564a565d9060240160a060405180830381865afa15801561219c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121c09190613650565b5050600154604051630fad06e960e11b81526001600160601b03851660048201529394506000936001600160a01b039091169250631f5a0dd2915060240160e060405180830381865afa15801561221b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061223f91906139bc565b505050505091505060005b8a8110156124bb5733848d8d84818110612266576122666135e5565b905060200201358154811061227d5761227d6135e5565b60009182526020909120600490910201546001600160a01b0316146122b45760405162461bcd60e51b8152600401610846906138d4565b811580612327575060408051602081018c90529081018a905260600160405160208183030381529060405280519060200120846000018d8d848181106122fc576122fc6135e5565b9050602002013581548110612313576123136135e5565b906000526020600020906004020160010154145b6123995760405162461bcd60e51b815260206004820152603d60248201527f54686520636f6d6d6974206d757374206d61746368207468652063686f69636560448201527f20696e20636f7572747320776974682068696464656e20766f7465732e0000006064820152608401610846565b838c8c838181106123ac576123ac6135e5565b90506020020135815481106123c3576123c36135e5565b600091825260209091206003600490920201015460ff161561241c5760405162461bcd60e51b81526020600482015260126024820152712b37ba329030b63932b0b23c9031b0b9ba1760711b6044820152606401610846565b89848d8d84818110612430576124306135e5565b9050602002013581548110612447576124476135e5565b60009182526020909120600260049092020101556001848d8d84818110612470576124706135e5565b9050602002013581548110612487576124876135e5565b60009182526020909120600490910201600301805460ff1916911515919091179055806124b38161390b565b91505061224a565b508a8a90508360040160008282546124d39190613742565b90915550506000898152600284016020526040812080548c92906124f8908490613742565b90915550506001830154890361252757600383015460ff16156125225760038301805460ff191690555b6125a0565b60018301546000908152600284016020526040808220548b83529120540361256957600383015460ff166125225760038301805460ff191660011790556125a0565b60018301546000908152600284016020526040808220548b835291205411156125a0576001830189905560038301805460ff191690555b88336001600160a01b03168d7fa000893c71384499023d2d7b21234f7b9e80c78e0330f357dcd667ff578bd3a48e8e8c6040516125df93929190613a26565b60405180910390a4505050505050505050505050565b6000546001600160a01b0316331461261f5760405162461bcd60e51b81526004016108469061397a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60008060008060006002600360008a8152602001908152602001600020548154811061266f5761266f6135e5565b600091825260208083208a84526003600590930201918201905260408220548154919350839181106126a3576126a36135e5565b90600052602060002090600c020160000187815481106126c5576126c56135e5565b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169c909b5091995060ff16975095505050505050565b6001546001600160a01b031633146127315760405162461bcd60e51b815260040161084690613a56565b60028054600181018255600091909152600581027f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf81018690557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace8101907f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad2016127bc858783613ae8565b50805460018054604051637e37c78b60e11b8152600481018b9052600385019260009290916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa158015612813573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061283791906137b0565b6128419190613611565b81526020808201929092526040908101600090812093909355835460018181018655858552838520600b600c909302019182018890556003808301805460ff19169092179091558b855290925291829020849055905188907fd3106f74c2d30a4b9230e756a3e78bde53865d40f6af4c479bb010ebaab58108906128ca908a908a908a90613ba8565b60405180910390a25050505050505050565b600083815260036020526040812054600280548392908110612900576129006135e5565b60009182526020808320878452600360059093020191820190526040822054815491935083918110612934576129346135e5565b90600052602060002090600c02016000018481548110612956576129566135e5565b600091825260209091206004909102016003015460ff169695505050505050565b6001546000906001600160a01b031633146129a45760405162461bcd60e51b815260040161084690613a56565b6000838152600360205260409020546002805485929081106129c8576129c86135e5565b600091825260209091206002600590920201015460ff16156129fc5760405162461bcd60e51b815260040161084690613755565b600084815260036020526040812054600280549091908110612a2057612a206135e5565b60009182526020822060059091020180549092508290612a4290600190613611565b81548110612a5257612a526135e5565b90600052602060002090600c020190506000600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ab7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612adb9190613bde565b60015460405163564a565d60e01b8152600481018a90529192506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612b2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b4e9190613650565b5050604051632638506b60e11b81526001600160601b03841660048201819052602482018d9052604482018c90529394506001600160a01b0386169250634c70a0d69150606401602060405180830381865afa158015612bb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd69190613bde565b9650612be28988612e4c565b15612c6f57604080516080810182526001600160a01b03898116825260006020808401828152948401828152606085018381528a5460018082018d558c8652939094209551600490940290950180546001600160a01b0319169390941692909217835593519382019390935591516002830155516003909101805460ff1916911515919091179055612c74565b600096505b50505050505092915050565b600082815260036020526040812054600280548392908110612ca457612ca46135e5565b60009182526020808320868452600360059093020191820190526040822054815491935083918110612cd857612cd86135e5565b600091825260208220600154604051631c3db16d60e01b8152600481018a9052600c93909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa158015612d37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d5b91906136cd565b5091509150826004015460001480612d8a575080158015612d8a57506000828152600284016020526040902054155b15612d9c576000945050505050612dcd565b8015612db1575050600401549150612dcd9050565b506000908152600290910160205260409020549150612dcd9050565b92915050565b6000546001600160a01b03163314612dfd5760405162461bcd60e51b81526004016108469061397a565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314612e495760405162461bcd60e51b81526004016108469061397a565b50565b60015460405163564a565d60e01b81526004810184905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612e9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ebe9190613650565b505060018054604051637e37c78b60e11b8152600481018a90529495506000946001600160a01b039091169350638a9bb02a9250889190849063fc6f8f1690602401602060405180830381865afa158015612f1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f4191906137b0565b612f4b9190613611565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381865afa158015612f8c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612fb49190810190613c8e565b602001519050600080600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613010573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130349190613bde565b604051631a383be960e31b81526001600160a01b0388811660048301526001600160601b0387166024830152919091169063d1c1df4890604401608060405180830381865afa15801561308b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130af9190613d6f565b50509150915082816130c19190613742565b909110159695505050505050565b6000602082840312156130e157600080fd5b5035919050565b6001600160a01b0381168114612e4957600080fd5b6000806000806080858703121561311357600080fd5b843593506020850135613125816130e8565b93969395505050506040820135916060013590565b6000806040838503121561314d57600080fd5b8235613158816130e8565b91506020830135613168816130e8565b809150509250929050565b6000806040838503121561318657600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b60405161016081016001600160401b03811182821017156131ce576131ce613195565b60405290565b604051601f8201601f191681016001600160401b03811182821017156131fc576131fc613195565b604052919050565b60006001600160401b0383111561321d5761321d613195565b613230601f8401601f19166020016131d4565b905082815283838301111561324457600080fd5b828260208301376000602084830101529392505050565b600082601f83011261326c57600080fd5b61182383833560208501613204565b6000806040838503121561328e57600080fd5b8235613299816130e8565b915060208301356001600160401b038111156132b457600080fd5b6132c08582860161325b565b9150509250929050565b6000806000606084860312156132df57600080fd5b505081359360208301359350604090920135919050565b60005b838110156133115781810151838201526020016132f9565b50506000910152565b600081518084526133328160208601602086016132f6565b601f01601f19169290920160200192915050565b8381528215156020820152606060408201526000613367606083018461331a565b95945050505050565b60008083601f84011261338257600080fd5b5081356001600160401b0381111561339957600080fd5b6020830191508360208260051b85010111156133b457600080fd5b9250929050565b600080600080606085870312156133d157600080fd5b8435935060208501356001600160401b038111156133ee57600080fd5b6133fa87828801613370565b9598909750949560400135949350505050565b6020808252825182820181905260009190848201906040850190845b8181101561344557835183529284019291840191600101613429565b50909695505050505050565b60008060006060848603121561346657600080fd5b8335613471816130e8565b92506020840135915060408401356001600160401b0381111561349357600080fd5b61349f8682870161325b565b9150509250925092565b60008060008060008060a087890312156134c257600080fd5b8635955060208701356001600160401b03808211156134e057600080fd5b6134ec8a838b01613370565b90975095506040890135945060608901359350608089013591508082111561351357600080fd5b508701601f8101891361352557600080fd5b61353489823560208401613204565b9150509295509295509295565b60006020828403121561355357600080fd5b8135611823816130e8565b60008060008060006080868803121561357657600080fd5b853594506020860135935060408601356001600160401b038082111561359b57600080fd5b818801915088601f8301126135af57600080fd5b8135818111156135be57600080fd5b8960208285010111156135d057600080fd5b96999598505060200195606001359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115612dcd57612dcd6135fb565b80516001600160601b038116811461363b57600080fd5b919050565b8051801515811461363b57600080fd5b600080600080600060a0868803121561366857600080fd5b61367186613624565b94506020860151613681816130e8565b60408701519094506005811061369657600080fd5b92506136a460608701613640565b9150608086015190509295509295909350565b634e487b7160e01b600052602160045260246000fd5b6000806000606084860312156136e257600080fd5b835192506136f260208501613640565b915061370060408501613640565b90509250925092565b8082028115828204841417612dcd57612dcd6135fb565b60008261373d57634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115612dcd57612dcd6135fb565b6020808252601e908201527f44697370757465206a756d70656420746f206120706172656e7420444b210000604082015260600190565b6000806040838503121561379f57600080fd5b505080516020909101519092909150565b6000602082840312156137c257600080fd5b5051919050565b6000602082840312156137db57600080fd5b61182382613640565b600181811c908216806137f857607f821691505b60208210810361381857634e487b7160e01b600052602260045260246000fd5b50919050565b838152600060208481840152606060408401526000845461383e816137e4565b8060608701526080600180841660008114613860576001811461387a576138a8565b60ff1985168984015283151560051b8901830195506138a8565b896000528660002060005b858110156138a05781548b8201860152908301908801613885565b8a0184019650505b50939a9950505050505050505050565b600082516138ca8184602087016132f6565b9190910192915050565b6020808252601f908201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e00604082015260600190565b60006001820161391d5761391d6135fb565b5060010190565b81835260006001600160fb1b0383111561393d57600080fd5b8260051b80836020870137939093016020019392505050565b60408152600061396a604083018587613924565b9050826020830152949350505050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600080600080600080600060e0888a0312156139d757600080fd5b6139e088613624565b96506139ee60208901613640565b955060408801519450606088015193506080880151925060a08801519150613a1860c08901613640565b905092959891949750929550565b604081526000613a3a604083018587613924565b8281036020840152613a4c818561331a565b9695505050505050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b601f8211156116e257600081815260208120601f850160051c81016020861015613ac15750805b601f850160051c820191505b81811015613ae057828155600101613acd565b505050505050565b6001600160401b03831115613aff57613aff613195565b613b1383613b0d83546137e4565b83613a9a565b6000601f841160018114613b475760008515613b2f5750838201355b600019600387901b1c1916600186901b178355613ba1565b600083815260209020601f19861690835b82811015613b785786850135825560209485019460019092019101613b58565b5086821015613b955760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215613bf057600080fd5b8151611823816130e8565b600082601f830112613c0c57600080fd5b815160206001600160401b03821115613c2757613c27613195565b8160051b613c368282016131d4565b9283528481018201928281019087851115613c5057600080fd5b83870192505b84831015613c78578251613c69816130e8565b82529183019190830190613c56565b979650505050505050565b805161363b816130e8565b600060208284031215613ca057600080fd5b81516001600160401b0380821115613cb757600080fd5b908301906101608286031215613ccc57600080fd5b613cd46131ab565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015182811115613d1c57600080fd5b613d2887828601613bfb565b60c08301525060e0838101519082015261010080840151908201526101209150613d53828401613c83565b9181019190915261014091820151918101919091529392505050565b60008060008060808587031215613d8557600080fd5b50508251602084015160408501516060909501519196909550909250905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212209655688b5303e6cd59964bc8679481fb60fc52de05e748af1e7dffe0b3e5b6e764736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106101825760003560e01c80636d4cd8ea116100d7578063b6ede54011610085578063b6ede540146104ca578063ba66fde7146104ea578063be4676041461050a578063d2b8035a14610520578063da3beb8c14610540578063e349ad3014610412578063e4c0aaf414610560578063f2f4eb261461058057600080fd5b80636d4cd8ea146103d2578063751accd0146103f2578063796490f9146104125780637c04034e146104285780638e42646014610448578063a7cc08fe14610468578063b34bfaa8146104b457600080fd5b80634f1ef286116101345780634f1ef286146102c15780634fe264fb146102d457806352d1902d146102f4578063564a565d146103095780635c92e2f61461033857806365540b961461035857806369f3f0411461038557600080fd5b80630baa64d1146101875780630c340a24146101bc5780631200aabc146101f45780631c3db16d1461022f578063362c34791461026c578063485cc9551461028c5780634b2f0ea0146102ae575b600080fd5b34801561019357600080fd5b506101a76101a23660046130cf565b6105a0565b60405190151581526020015b60405180910390f35b3480156101c857600080fd5b506000546101dc906001600160a01b031681565b6040516001600160a01b0390911681526020016101b3565b34801561020057600080fd5b5061022161020f3660046130cf565b60036020526000908152604090205481565b6040519081526020016101b3565b34801561023b57600080fd5b5061024f61024a3660046130cf565b610617565b6040805193845291151560208401521515908201526060016101b3565b34801561027857600080fd5b506102216102873660046130fd565b610785565b34801561029857600080fd5b506102ac6102a736600461313a565b610b5b565b005b6102ac6102bc366004613173565b610c58565b6102ac6102cf36600461327b565b6114bf565b3480156102e057600080fd5b506102216102ef3660046132ca565b6116e7565b34801561030057600080fd5b5061022161182a565b34801561031557600080fd5b506103296103243660046130cf565b611888565b6040516101b393929190613346565b34801561034457600080fd5b506102ac6103533660046133bb565b61194e565b34801561036457600080fd5b506103786103733660046130cf565b611c5b565b6040516101b3919061340d565b34801561039157600080fd5b506103a56103a03660046132ca565b611d1f565b604080519687529415156020870152938501929092526060840152608083015260a082015260c0016101b3565b3480156103de57600080fd5b506101a76103ed3660046130cf565b611dd7565b3480156103fe57600080fd5b506102ac61040d366004613451565b611e4e565b34801561041e57600080fd5b5061022161271081565b34801561043457600080fd5b506102ac6104433660046134a9565b611f1a565b34801561045457600080fd5b506102ac610463366004613541565b6125f5565b34801561047457600080fd5b506104886104833660046132ca565b612641565b604080516001600160a01b039095168552602085019390935291830152151560608201526080016101b3565b3480156104c057600080fd5b50610221614e2081565b3480156104d657600080fd5b506102ac6104e536600461355e565b612707565b3480156104f657600080fd5b506101a76105053660046132ca565b6128dc565b34801561051657600080fd5b5061022161138881565b34801561052c57600080fd5b506101dc61053b366004613173565b612977565b34801561054c57600080fd5b5061022161055b366004613173565b612c80565b34801561056c57600080fd5b506102ac61057b366004613541565b612dd3565b34801561058c57600080fd5b506001546101dc906001600160a01b031681565b6000818152600360205260408120546002805483929081106105c4576105c46135e5565b600091825260208220600590910201805490925082906105e690600190613611565b815481106105f6576105f66135e5565b60009182526020909120600c90910201805460059091015414949350505050565b6000806000806002600360008781526020019081526020016000205481548110610643576106436135e5565b6000918252602082206005909102018054909250829061066590600190613611565b81548110610675576106756135e5565b60009182526020909120600c90910201600381015460ff1694509050836106a05780600101546106a3565b60005b60015460405163564a565d60e01b8152600481018990529196506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156106f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107169190613650565b5090935060049250610726915050565b816004811115610738576107386136b7565b0361077b57600061074888611c5b565b905080516001036107795780600081518110610766576107666135e5565b6020026020010151965060009550600194505b505b5050509193909250565b60015460405163564a565d60e01b81526004810186905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa1580156107d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f79190613650565b5093505050508061084f5760405162461bcd60e51b815260206004820152601b60248201527f446973707574652073686f756c64206265207265736f6c7665642e000000000060448201526064015b60405180910390fd5b600086815260036020526040812054600280549091908110610873576108736135e5565b600091825260208083208884526003600590930201918201905260408220548154919350839181106108a7576108a76135e5565b600091825260208220600154604051631c3db16d60e01b8152600481018d9052600c9390930290910193506001600160a01b031690631c3db16d90602401606060405180830381865afa158015610902573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092691906136cd565b5050600087815260078401602052604090205490915060ff16610970576001600160a01b038816600090815260088301602090815260408083208984529091529020549450610ab5565b8086036109e55760008681526006830160205260409020546109935760006109de565b600086815260068301602090815260408083205460098601546001600160a01b038d1685526008870184528285208b86529093529220546109d49190613709565b6109de9190613720565b9450610ab5565b600081815260078301602052604090205460ff16610ab55781600601600083600a01600181548110610a1957610a196135e5565b906000526020600020015481526020019081526020016000205482600601600084600a01600081548110610a4f57610a4f6135e5565b9060005260206000200154815260200190815260200160002054610a739190613742565b60098301546001600160a01b038a16600090815260088501602090815260408083208b8452909152902054610aa89190613709565b610ab29190613720565b94505b6001600160a01b038816600090815260088301602090815260408083208984529091528120558415610b4f576040516001600160a01b0389169086156108fc029087906000818181858888f15050604080518a8152602081018a90526001600160a01b038d1694508b93508d92507f54b3cab3cb5c4aca3209db1151caff092e878011202e43a36782d4ebe0b963ae910160405180910390a45b50505050949350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff1680610ba4575080546001600160401b03808416911610155b15610bc15760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b038316908117600160401b178255600080546001600160a01b038781166001600160a01b0319928316179092556001805492871692909116919091179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b600082815260036020526040902054600280548492908110610c7c57610c7c6135e5565b600091825260209091206002600590920201015460ff1615610cb05760405162461bcd60e51b815260040161084690613755565b600083815260036020526040812054600280549091908110610cd457610cd46135e5565b906000526020600020906005020190508060010154831115610d385760405162461bcd60e51b815260206004820181905260248201527f5468657265206973206e6f20737563682072756c696e6720746f2066756e642e6044820152606401610846565b60015460405163afe15cfb60e01b81526004810186905260009182916001600160a01b039091169063afe15cfb906024016040805180830381865afa158015610d85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da9919061378c565b91509150814210158015610dbc57508042105b610e015760405162461bcd60e51b815260206004820152601660248201527520b83832b0b6103832b934b7b21034b99037bb32b91760511b6044820152606401610846565b604051631c3db16d60e01b81526004810187905260009081903090631c3db16d90602401606060405180830381865afa158015610e42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6691906136cd565b50509050868103610e7b576127109150610efc565b612710611388610e8b8686613611565b610e959190613709565b610e9f9190613720565b610ea98542613611565b10610ef65760405162461bcd60e51b815260206004820152601f60248201527f41707065616c20706572696f64206973206f76657220666f72206c6f736572006044820152606401610846565b614e2091505b84546000908690610f0f90600190613611565b81548110610f1f57610f1f6135e5565b60009182526020822060018054604051637e37c78b60e11b8152600481018f9052600c949094029092019450916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa158015610f7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa291906137b0565b610fac9190613611565b60008a815260078401602052604090205490915060ff16156110105760405162461bcd60e51b815260206004820152601b60248201527f41707065616c2066656520697320616c726561647920706169642e00000000006044820152606401610846565b600154604051632cf6413f60e11b8152600481018c90526000916001600160a01b0316906359ec827e90602401602060405180830381865afa15801561105a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107e91906137b0565b9050600061271061108f8784613709565b6110999190613720565b6110a39083613742565b60008c8152600686016020526040812054919250908211156111545760008c815260068601602052604090205434906110dc9084613611565b116111015760008c81526006860160205260409020546110fc9083613611565b611103565b345b9050336001600160a01b0316848e7fcae597f39a3ad75c2e10d46b031f023c5c2babcd58ca0491b122acda3968d4c08f8560405161114b929190918252602082015260400190565b60405180910390a45b33600090815260088601602090815260408083208f845290915281208054839290611180908490613742565b909155505060008c8152600686016020526040812080548392906111a5908490613742565b909155505060008c815260068601602052604090205482116112775760008c8152600686016020526040812054600987018054919290916111e7908490613742565b9250508190555084600a018c908060018154018082558091505060019003906000526020600020016000909190919091505560018560070160008e815260200190815260200160002060006101000a81548160ff0219169083151502179055508b848e7fed764996238e4c1c873ae3af7ae2f00f1f6f4f10b9ac7d4bbea4a764c5dea00960405160405180910390a45b600a85015460011015611482578285600901546112949190613611565b60098601556001546040516319b8152960e01b8152600481018f90526001600160a01b03909116906319b8152990602401602060405180830381865afa1580156112e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130691906137c9565b1561131f5760028a01805460ff19166001179055611402565b895460038b016000611332876001613742565b81526020019081526020016000208190555060008a6000016001816001815401808255809150500390600052602060002090600c02019050600160009054906101000a90046001600160a01b03166001600160a01b031663c71f42538f6040518263ffffffff1660e01b81526004016113ad91815260200190565b602060405180830381865afa1580156113ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ee91906137b0565b600b820155600301805460ff191660011790555b600160009054906101000a90046001600160a01b03166001600160a01b031663c3569902848f8d600101548e6004016040518563ffffffff1660e01b815260040161144f9392919061381e565b6000604051808303818588803b15801561146857600080fd5b505af115801561147c573d6000803e3d6000fd5b50505050505b803411156114b057336108fc6114988334613611565b6040518115909202916000818181858888f150505050505b50505050505050505050505050565b6114c882612e1f565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061154657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661153a600080516020613da68339815191525490565b6001600160a01b031614155b156115645760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156115be575060408051601f3d908101601f191682019092526115bb918101906137b0565b60015b6115e657604051630c76093760e01b81526001600160a01b0383166004820152602401610846565b600080516020613da6833981519152811461161757604051632a87526960e21b815260048101829052602401610846565b600080516020613da68339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28151156116e2576000836001600160a01b03168360405161167e91906138b8565b600060405180830381855af49150503d80600081146116b9576040519150601f19603f3d011682016040523d82523d6000602084013e6116be565b606091505b50509050806116e0576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b60008381526003602052604081205460028054839290811061170b5761170b6135e5565b6000918252602080832087845260036005909302019182019052604082205481549193508391811061173f5761173f6135e5565b90600052602060002090600c02016000018481548110611761576117616135e5565b600091825260208220600154604051631c3db16d60e01b815260048082018c905293909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa1580156117bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e391906136cd565b506003850154919350915060ff168015611807575081836002015414806118075750805b1561181a57612710945050505050611823565b60009450505050505b9392505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118755760405163703e46dd60e11b815260040160405180910390fd5b50600080516020613da683398151915290565b6002818154811061189857600080fd5b600091825260209091206005909102016001810154600282015460048301805492945060ff90911692916118cb906137e4565b80601f01602080910402602001604051908101604052809291908181526020018280546118f7906137e4565b80156119445780601f1061191957610100808354040283529160200191611944565b820191906000526020600020905b81548152906001019060200180831161192757829003601f168201915b5050505050905083565b600084815260036020526040902054600280548692908110611972576119726135e5565b600091825260209091206002600590920201015460ff16156119a65760405162461bcd60e51b815260040161084690613755565b60015460405163564a565d60e01b8152600481018790526000916001600160a01b03169063564a565d9060240160a060405180830381865afa1580156119f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a149190613650565b5090935060019250611a24915050565b816004811115611a3657611a366136b7565b14611a935760405162461bcd60e51b815260206004820152602760248201527f54686520646973707574652073686f756c6420626520696e20436f6d6d6974206044820152663832b934b7b21760c91b6064820152608401610846565b82611ad05760405162461bcd60e51b815260206004820152600d60248201526c22b6b83a3c9031b7b6b6b4ba1760991b6044820152606401610846565b600086815260036020526040812054600280549091908110611af457611af46135e5565b60009182526020822060059091020180549092508290611b1690600190613611565b81548110611b2657611b266135e5565b90600052602060002090600c0201905060005b86811015611bf4573382898984818110611b5557611b556135e5565b9050602002013581548110611b6c57611b6c6135e5565b60009182526020909120600490910201546001600160a01b031614611ba35760405162461bcd60e51b8152600401610846906138d4565b8582898984818110611bb757611bb76135e5565b9050602002013581548110611bce57611bce6135e5565b600091825260209091206001600490920201015580611bec8161390b565b915050611b39565b5086869050816005016000828254611c0c9190613742565b9091555050604051339089907f05cc2f1c94966f1c961b410a50f3d3ffb64501346753a258177097ea23707f0890611c49908b908b908b90613956565b60405180910390a35050505050505050565b6000818152600360205260408120546002805460609392908110611c8157611c816135e5565b60009182526020822060059091020180549092508290611ca390600190613611565b81548110611cb357611cb36135e5565b90600052602060002090600c0201905080600a01805480602002602001604051908101604052809291908181526020018280548015611d1157602002820191906000526020600020905b815481526020019060010190808311611cfd575b505050505092505050919050565b60008060008060008060006002600360008c81526020019081526020016000205481548110611d5057611d506135e5565b600091825260208083208c8452600360059093020191820190526040822054815491935083918110611d8457611d846135e5565b600091825260208083206001600c909302019182015460038301546004840154600585015485549f87526002909501909352604090942054909f60ff9094169e50909c50909a9950975095505050505050565b600081815260036020526040812054600280548392908110611dfb57611dfb6135e5565b60009182526020822060059091020180549092508290611e1d90600190613611565b81548110611e2d57611e2d6135e5565b60009182526020909120600c90910201805460049091015414949350505050565b6000546001600160a01b03163314611e785760405162461bcd60e51b81526004016108469061397a565b6000836001600160a01b03168383604051611e9391906138b8565b60006040518083038185875af1925050503d8060008114611ed0576040519150601f19603f3d011682016040523d82523d6000602084013e611ed5565b606091505b50509050806116e05760405162461bcd60e51b8152602060048201526011602482015270155b9cdd58d8d95cdcd99d5b0818d85b1b607a1b6044820152606401610846565b600086815260036020526040902054600280548892908110611f3e57611f3e6135e5565b600091825260209091206002600590920201015460ff1615611f725760405162461bcd60e51b815260040161084690613755565b60015460405163564a565d60e01b8152600481018990526000916001600160a01b03169063564a565d9060240160a060405180830381865afa158015611fbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fe09190613650565b5090935060029250611ff0915050565b816004811115612002576120026136b7565b1461205d5760405162461bcd60e51b815260206004820152602560248201527f54686520646973707574652073686f756c6420626520696e20566f74652070656044820152643934b7b21760d91b6064820152608401610846565b8561209f5760405162461bcd60e51b8152602060048201526012602482015271139bc81d9bdd195251081c1c9bdd9a59195960721b6044820152606401610846565b6000888152600360205260408120546002805490919081106120c3576120c36135e5565b90600052602060002090600502019050806001015486111561211e5760405162461bcd60e51b815260206004820152601460248201527343686f696365206f7574206f6620626f756e647360601b6044820152606401610846565b8054600090829061213190600190613611565b81548110612141576121416135e5565b60009182526020822060015460405163564a565d60e01b8152600481018f9052600c9390930290910193506001600160a01b03169063564a565d9060240160a060405180830381865afa15801561219c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121c09190613650565b5050600154604051630fad06e960e11b81526001600160601b03851660048201529394506000936001600160a01b039091169250631f5a0dd2915060240160e060405180830381865afa15801561221b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061223f91906139bc565b505050505091505060005b8a8110156124bb5733848d8d84818110612266576122666135e5565b905060200201358154811061227d5761227d6135e5565b60009182526020909120600490910201546001600160a01b0316146122b45760405162461bcd60e51b8152600401610846906138d4565b811580612327575060408051602081018c90529081018a905260600160405160208183030381529060405280519060200120846000018d8d848181106122fc576122fc6135e5565b9050602002013581548110612313576123136135e5565b906000526020600020906004020160010154145b6123995760405162461bcd60e51b815260206004820152603d60248201527f54686520636f6d6d6974206d757374206d61746368207468652063686f69636560448201527f20696e20636f7572747320776974682068696464656e20766f7465732e0000006064820152608401610846565b838c8c838181106123ac576123ac6135e5565b90506020020135815481106123c3576123c36135e5565b600091825260209091206003600490920201015460ff161561241c5760405162461bcd60e51b81526020600482015260126024820152712b37ba329030b63932b0b23c9031b0b9ba1760711b6044820152606401610846565b89848d8d84818110612430576124306135e5565b9050602002013581548110612447576124476135e5565b60009182526020909120600260049092020101556001848d8d84818110612470576124706135e5565b9050602002013581548110612487576124876135e5565b60009182526020909120600490910201600301805460ff1916911515919091179055806124b38161390b565b91505061224a565b508a8a90508360040160008282546124d39190613742565b90915550506000898152600284016020526040812080548c92906124f8908490613742565b90915550506001830154890361252757600383015460ff16156125225760038301805460ff191690555b6125a0565b60018301546000908152600284016020526040808220548b83529120540361256957600383015460ff166125225760038301805460ff191660011790556125a0565b60018301546000908152600284016020526040808220548b835291205411156125a0576001830189905560038301805460ff191690555b88336001600160a01b03168d7fa000893c71384499023d2d7b21234f7b9e80c78e0330f357dcd667ff578bd3a48e8e8c6040516125df93929190613a26565b60405180910390a4505050505050505050505050565b6000546001600160a01b0316331461261f5760405162461bcd60e51b81526004016108469061397a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60008060008060006002600360008a8152602001908152602001600020548154811061266f5761266f6135e5565b600091825260208083208a84526003600590930201918201905260408220548154919350839181106126a3576126a36135e5565b90600052602060002090600c020160000187815481106126c5576126c56135e5565b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169c909b5091995060ff16975095505050505050565b6001546001600160a01b031633146127315760405162461bcd60e51b815260040161084690613a56565b60028054600181018255600091909152600581027f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf81018690557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace8101907f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad2016127bc858783613ae8565b50805460018054604051637e37c78b60e11b8152600481018b9052600385019260009290916001600160a01b039091169063fc6f8f1690602401602060405180830381865afa158015612813573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061283791906137b0565b6128419190613611565b81526020808201929092526040908101600090812093909355835460018181018655858552838520600b600c909302019182018890556003808301805460ff19169092179091558b855290925291829020849055905188907fd3106f74c2d30a4b9230e756a3e78bde53865d40f6af4c479bb010ebaab58108906128ca908a908a908a90613ba8565b60405180910390a25050505050505050565b600083815260036020526040812054600280548392908110612900576129006135e5565b60009182526020808320878452600360059093020191820190526040822054815491935083918110612934576129346135e5565b90600052602060002090600c02016000018481548110612956576129566135e5565b600091825260209091206004909102016003015460ff169695505050505050565b6001546000906001600160a01b031633146129a45760405162461bcd60e51b815260040161084690613a56565b6000838152600360205260409020546002805485929081106129c8576129c86135e5565b600091825260209091206002600590920201015460ff16156129fc5760405162461bcd60e51b815260040161084690613755565b600084815260036020526040812054600280549091908110612a2057612a206135e5565b60009182526020822060059091020180549092508290612a4290600190613611565b81548110612a5257612a526135e5565b90600052602060002090600c020190506000600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ab7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612adb9190613bde565b60015460405163564a565d60e01b8152600481018a90529192506000916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612b2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b4e9190613650565b5050604051632638506b60e11b81526001600160601b03841660048201819052602482018d9052604482018c90529394506001600160a01b0386169250634c70a0d69150606401602060405180830381865afa158015612bb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd69190613bde565b9650612be28988612e4c565b15612c6f57604080516080810182526001600160a01b03898116825260006020808401828152948401828152606085018381528a5460018082018d558c8652939094209551600490940290950180546001600160a01b0319169390941692909217835593519382019390935591516002830155516003909101805460ff1916911515919091179055612c74565b600096505b50505050505092915050565b600082815260036020526040812054600280548392908110612ca457612ca46135e5565b60009182526020808320868452600360059093020191820190526040822054815491935083918110612cd857612cd86135e5565b600091825260208220600154604051631c3db16d60e01b8152600481018a9052600c93909302909101935082916001600160a01b0390911690631c3db16d90602401606060405180830381865afa158015612d37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d5b91906136cd565b5091509150826004015460001480612d8a575080158015612d8a57506000828152600284016020526040902054155b15612d9c576000945050505050612dcd565b8015612db1575050600401549150612dcd9050565b506000908152600290910160205260409020549150612dcd9050565b92915050565b6000546001600160a01b03163314612dfd5760405162461bcd60e51b81526004016108469061397a565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314612e495760405162461bcd60e51b81526004016108469061397a565b50565b60015460405163564a565d60e01b81526004810184905260009182916001600160a01b039091169063564a565d9060240160a060405180830381865afa158015612e9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ebe9190613650565b505060018054604051637e37c78b60e11b8152600481018a90529495506000946001600160a01b039091169350638a9bb02a9250889190849063fc6f8f1690602401602060405180830381865afa158015612f1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f4191906137b0565b612f4b9190613611565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381865afa158015612f8c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612fb49190810190613c8e565b602001519050600080600160009054906101000a90046001600160a01b03166001600160a01b0316632e1daf2f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613010573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130349190613bde565b604051631a383be960e31b81526001600160a01b0388811660048301526001600160601b0387166024830152919091169063d1c1df4890604401608060405180830381865afa15801561308b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130af9190613d6f565b50509150915082816130c19190613742565b909110159695505050505050565b6000602082840312156130e157600080fd5b5035919050565b6001600160a01b0381168114612e4957600080fd5b6000806000806080858703121561311357600080fd5b843593506020850135613125816130e8565b93969395505050506040820135916060013590565b6000806040838503121561314d57600080fd5b8235613158816130e8565b91506020830135613168816130e8565b809150509250929050565b6000806040838503121561318657600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b60405161016081016001600160401b03811182821017156131ce576131ce613195565b60405290565b604051601f8201601f191681016001600160401b03811182821017156131fc576131fc613195565b604052919050565b60006001600160401b0383111561321d5761321d613195565b613230601f8401601f19166020016131d4565b905082815283838301111561324457600080fd5b828260208301376000602084830101529392505050565b600082601f83011261326c57600080fd5b61182383833560208501613204565b6000806040838503121561328e57600080fd5b8235613299816130e8565b915060208301356001600160401b038111156132b457600080fd5b6132c08582860161325b565b9150509250929050565b6000806000606084860312156132df57600080fd5b505081359360208301359350604090920135919050565b60005b838110156133115781810151838201526020016132f9565b50506000910152565b600081518084526133328160208601602086016132f6565b601f01601f19169290920160200192915050565b8381528215156020820152606060408201526000613367606083018461331a565b95945050505050565b60008083601f84011261338257600080fd5b5081356001600160401b0381111561339957600080fd5b6020830191508360208260051b85010111156133b457600080fd5b9250929050565b600080600080606085870312156133d157600080fd5b8435935060208501356001600160401b038111156133ee57600080fd5b6133fa87828801613370565b9598909750949560400135949350505050565b6020808252825182820181905260009190848201906040850190845b8181101561344557835183529284019291840191600101613429565b50909695505050505050565b60008060006060848603121561346657600080fd5b8335613471816130e8565b92506020840135915060408401356001600160401b0381111561349357600080fd5b61349f8682870161325b565b9150509250925092565b60008060008060008060a087890312156134c257600080fd5b8635955060208701356001600160401b03808211156134e057600080fd5b6134ec8a838b01613370565b90975095506040890135945060608901359350608089013591508082111561351357600080fd5b508701601f8101891361352557600080fd5b61353489823560208401613204565b9150509295509295509295565b60006020828403121561355357600080fd5b8135611823816130e8565b60008060008060006080868803121561357657600080fd5b853594506020860135935060408601356001600160401b038082111561359b57600080fd5b818801915088601f8301126135af57600080fd5b8135818111156135be57600080fd5b8960208285010111156135d057600080fd5b96999598505060200195606001359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115612dcd57612dcd6135fb565b80516001600160601b038116811461363b57600080fd5b919050565b8051801515811461363b57600080fd5b600080600080600060a0868803121561366857600080fd5b61367186613624565b94506020860151613681816130e8565b60408701519094506005811061369657600080fd5b92506136a460608701613640565b9150608086015190509295509295909350565b634e487b7160e01b600052602160045260246000fd5b6000806000606084860312156136e257600080fd5b835192506136f260208501613640565b915061370060408501613640565b90509250925092565b8082028115828204841417612dcd57612dcd6135fb565b60008261373d57634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115612dcd57612dcd6135fb565b6020808252601e908201527f44697370757465206a756d70656420746f206120706172656e7420444b210000604082015260600190565b6000806040838503121561379f57600080fd5b505080516020909101519092909150565b6000602082840312156137c257600080fd5b5051919050565b6000602082840312156137db57600080fd5b61182382613640565b600181811c908216806137f857607f821691505b60208210810361381857634e487b7160e01b600052602260045260246000fd5b50919050565b838152600060208481840152606060408401526000845461383e816137e4565b8060608701526080600180841660008114613860576001811461387a576138a8565b60ff1985168984015283151560051b8901830195506138a8565b896000528660002060005b858110156138a05781548b8201860152908301908801613885565b8a0184019650505b50939a9950505050505050505050565b600082516138ca8184602087016132f6565b9190910192915050565b6020808252601f908201527f5468652063616c6c65722068617320746f206f776e2074686520766f74652e00604082015260600190565b60006001820161391d5761391d6135fb565b5060010190565b81835260006001600160fb1b0383111561393d57600080fd5b8260051b80836020870137939093016020019392505050565b60408152600061396a604083018587613924565b9050826020830152949350505050565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600080600080600080600060e0888a0312156139d757600080fd5b6139e088613624565b96506139ee60208901613640565b955060408801519450606088015193506080880151925060a08801519150613a1860c08901613640565b905092959891949750929550565b604081526000613a3a604083018587613924565b8281036020840152613a4c818561331a565b9695505050505050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b601f8211156116e257600081815260208120601f850160051c81016020861015613ac15750805b601f850160051c820191505b81811015613ae057828155600101613acd565b505050505050565b6001600160401b03831115613aff57613aff613195565b613b1383613b0d83546137e4565b83613a9a565b6000601f841160018114613b475760008515613b2f5750838201355b600019600387901b1c1916600186901b178355613ba1565b600083815260209020601f19861690835b82811015613b785786850135825560209485019460019092019101613b58565b5086821015613b955760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215613bf057600080fd5b8151611823816130e8565b600082601f830112613c0c57600080fd5b815160206001600160401b03821115613c2757613c27613195565b8160051b613c368282016131d4565b9283528481018201928281019087851115613c5057600080fd5b83870192505b84831015613c78578251613c69816130e8565b82529183019190830190613c56565b979650505050505050565b805161363b816130e8565b600060208284031215613ca057600080fd5b81516001600160401b0380821115613cb757600080fd5b908301906101608286031215613ccc57600080fd5b613cd46131ab565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015182811115613d1c57600080fd5b613d2887828601613bfb565b60c08301525060e0838101519082015261010080840151908201526101209150613d53828401613c83565b9181019190915261014091820151918101919091529392505050565b60008060008060808587031215613d8557600080fd5b50508251602084015160408501516060909501519196909550909250905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212209655688b5303e6cd59964bc8679481fb60fc52de05e748af1e7dffe0b3e5b6e764736f6c63430008120033", + "devdoc": { + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "ChoiceFunded(uint256,uint256,uint256)": { + "details": "To be emitted when a choice is fully funded for an appeal.", + "params": { + "_choice": "The choice that is being funded.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_coreRoundID": "The identifier of the round in the Arbitrator contract." + } + }, + "CommitCast(uint256,address,uint256[],bytes32)": { + "details": "To be emitted when a vote commitment is cast.", + "params": { + "_commit": "The commitment of the juror.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_juror": "The address of the juror casting the vote commitment.", + "_voteIDs": "The identifiers of the votes in the dispute." + } + }, + "Contribution(uint256,uint256,uint256,address,uint256)": { + "details": "To be emitted when a funding contribution is made.", + "params": { + "_amount": "The amount contributed.", + "_choice": "The choice that is being funded.", + "_contributor": "The address of the contributor.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_coreRoundID": "The identifier of the round in the Arbitrator contract." + } + }, + "DisputeCreation(uint256,uint256,bytes)": { + "details": "To be emitted when a dispute is created.", + "params": { + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_extraData": "The extra data for the dispute.", + "_numberOfChoices": "The number of choices available in the dispute." + } + }, + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + }, + "VoteCast(uint256,address,uint256[],uint256,string)": { + "details": "Emitted when casting a vote to provide the justification of juror's choice.", + "params": { + "_choice": "The choice juror voted for.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_juror": "Address of the juror.", + "_justification": "Justification of the choice.", + "_voteIDs": "The identifiers of the votes in the dispute." + } + }, + "Withdrawal(uint256,uint256,uint256,address,uint256)": { + "details": "To be emitted when the contributed funds are withdrawn.", + "params": { + "_amount": "The amount withdrawn.", + "_choice": "The choice that is being funded.", + "_contributor": "The address of the contributor.", + "_coreDisputeID": "The identifier of the dispute in the Arbitrator contract.", + "_coreRoundID": "The identifier of the round in the Arbitrator contract." + } + } + }, + "kind": "dev", + "methods": { + "areCommitsAllCast(uint256)": { + "details": "Returns true if all of the jurors have cast their commits for the last round.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core." + }, + "returns": { + "_0": "Whether all of the jurors have cast their commits for the last round." + } + }, + "areVotesAllCast(uint256)": { + "details": "Returns true if all of the jurors have cast their votes for the last round.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core." + }, + "returns": { + "_0": "Whether all of the jurors have cast their votes for the last round." + } + }, + "castCommit(uint256,uint256[],bytes32)": { + "details": "Sets the caller's commit for the specified votes. It can be called multiple times during the commit period, each call overrides the commits of the previous one. `O(n)` where `n` is the number of votes.", + "params": { + "_commit": "The commit. Note that justification string is a part of the commit.", + "_coreDisputeID": "The ID of the dispute in Kleros Core.", + "_voteIDs": "The IDs of the votes." + } + }, + "castVote(uint256,uint256[],uint256,uint256,string)": { + "details": "Sets the caller's choices for the specified votes. `O(n)` where `n` is the number of votes.", + "params": { + "_choice": "The choice.", + "_coreDisputeID": "The ID of the dispute in Kleros Core.", + "_justification": "Justification of the choice.", + "_salt": "The salt for the commit if the votes were hidden.", + "_voteIDs": "The IDs of the votes." + } + }, + "changeCore(address)": { + "details": "Changes the `core` storage variable.", + "params": { + "_core": "The new value for the `core` storage variable." + } + }, + "changeGovernor(address)": { + "details": "Changes the `governor` storage variable.", + "params": { + "_governor": "The new value for the `governor` storage variable." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "createDispute(uint256,uint256,bytes,uint256)": { + "details": "Creates a local dispute and maps it to the dispute ID in the Core contract. Note: Access restricted to Kleros Core only.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core.", + "_extraData": "Additional info about the dispute, for possible use in future dispute kits.", + "_nbVotes": "Number of votes for this dispute.", + "_numberOfChoices": "Number of choices of the dispute" + } + }, + "currentRuling(uint256)": { + "details": "Gets the current ruling of a specified dispute.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core." + }, + "returns": { + "overridden": "Whether the ruling was overridden by appeal funding or not.", + "ruling": "The current ruling.", + "tied": "Whether it's a tie or not." + } + }, + "draw(uint256,uint256)": { + "details": "Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core. Note: Access restricted to Kleros Core only.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core.", + "_nonce": "Nonce of the drawing iteration." + }, + "returns": { + "drawnAddress": "The drawn address." + } + }, + "executeGovernorProposal(address,uint256,bytes)": { + "details": "Allows the governor to call anything on behalf of the contract.", + "params": { + "_amount": "The value sent with the call.", + "_data": "The data sent with the call.", + "_destination": "The destination of the call." + } + }, + "fundAppeal(uint256,uint256)": { + "details": "Manages contributions, and appeals a dispute if at least two choices are fully funded. Note that the surplus deposit will be reimbursed.", + "params": { + "_choice": "A choice that receives funding.", + "_coreDisputeID": "Index of the dispute in Kleros Core." + } + }, + "getCoherentCount(uint256,uint256)": { + "details": "Gets the number of jurors who are eligible to a reward in this round.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core, not in the Dispute Kit.", + "_coreRoundID": "The ID of the round in Kleros Core, not in the Dispute Kit." + }, + "returns": { + "_0": "The number of coherent jurors." + } + }, + "getDegreeOfCoherence(uint256,uint256,uint256)": { + "details": "Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core, not in the Dispute Kit.", + "_coreRoundID": "The ID of the round in Kleros Core, not in the Dispute Kit.", + "_voteID": "The ID of the vote." + }, + "returns": { + "_0": "The degree of coherence in basis points." + } + }, + "initialize(address,address)": { + "details": "Initializer.", + "params": { + "_core": "The KlerosCore arbitrator.", + "_governor": "The governor's address." + } + }, + "isVoteActive(uint256,uint256,uint256)": { + "details": "Returns true if the specified voter was active in this round.", + "params": { + "_coreDisputeID": "The ID of the dispute in Kleros Core, not in the Dispute Kit.", + "_coreRoundID": "The ID of the round in Kleros Core, not in the Dispute Kit.", + "_voteID": "The ID of the voter." + }, + "returns": { + "_0": "Whether the voter was active or not." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + }, + "withdrawFeesAndRewards(uint256,address,uint256,uint256)": { + "details": "Allows those contributors who attempted to fund an appeal round to withdraw any reimbursable fees or rewards after the dispute gets resolved.", + "params": { + "_beneficiary": "The address whose rewards to withdraw.", + "_choice": "The ruling option that the caller wants to withdraw from.", + "_coreDisputeID": "Index of the dispute in Kleros Core contract.", + "_coreRoundID": "The round in the Kleros Core contract the caller wants to withdraw from." + }, + "returns": { + "amount": "The withdrawn amount." + } + } + }, + "title": "DisputeKitClassic Dispute kit implementation of the Kleros v1 features including: - a drawing system: proportional to staked PNK, - a vote aggregation system: plurality, - an incentive system: equal split between coherent votes, - an appeal system: fund 2 choices only, vote on any choice.", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 5633, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 5636, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "core", + "offset": 0, + "slot": "1", + "type": "t_contract(KlerosCore)3566" + }, + { + "astId": 5640, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "disputes", + "offset": 0, + "slot": "2", + "type": "t_array(t_struct(Dispute)5572_storage)dyn_storage" + }, + { + "astId": 5644, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "coreDisputeIDToLocal", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint256,t_uint256)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(Dispute)5572_storage)dyn_storage": { + "base": "t_struct(Dispute)5572_storage", + "encoding": "dynamic_array", + "label": "struct DisputeKitClassic.Dispute[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Round)5610_storage)dyn_storage": { + "base": "t_struct(Round)5610_storage", + "encoding": "dynamic_array", + "label": "struct DisputeKitClassic.Round[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Vote)5619_storage)dyn_storage": { + "base": "t_struct(Vote)5619_storage", + "encoding": "dynamic_array", + "label": "struct DisputeKitClassic.Vote[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(KlerosCore)3566": { + "encoding": "inplace", + "label": "contract KlerosCore", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_uint256,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(uint256 => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_uint256)" + }, + "t_mapping(t_uint256,t_bool)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(Dispute)5572_storage": { + "encoding": "inplace", + "label": "struct DisputeKitClassic.Dispute", + "members": [ + { + "astId": 5561, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "rounds", + "offset": 0, + "slot": "0", + "type": "t_array(t_struct(Round)5610_storage)dyn_storage" + }, + { + "astId": 5563, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "numberOfChoices", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 5565, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "jumped", + "offset": 0, + "slot": "2", + "type": "t_bool" + }, + { + "astId": 5569, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "coreRoundIDToLocal", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 5571, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "extraData", + "offset": 0, + "slot": "4", + "type": "t_bytes_storage" + } + ], + "numberOfBytes": "160" + }, + "t_struct(Round)5610_storage": { + "encoding": "inplace", + "label": "struct DisputeKitClassic.Round", + "members": [ + { + "astId": 5576, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "votes", + "offset": 0, + "slot": "0", + "type": "t_array(t_struct(Vote)5619_storage)dyn_storage" + }, + { + "astId": 5578, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "winningChoice", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 5582, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "counts", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 5584, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "tied", + "offset": 0, + "slot": "3", + "type": "t_bool" + }, + { + "astId": 5586, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "totalVoted", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 5588, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "totalCommitted", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 5592, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "paidFees", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 5596, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "hasPaid", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_uint256,t_bool)" + }, + { + "astId": 5602, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "contributions", + "offset": 0, + "slot": "8", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))" + }, + { + "astId": 5604, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "feeRewards", + "offset": 0, + "slot": "9", + "type": "t_uint256" + }, + { + "astId": 5607, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "fundedChoices", + "offset": 0, + "slot": "10", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 5609, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "nbVotes", + "offset": 0, + "slot": "11", + "type": "t_uint256" + } + ], + "numberOfBytes": "384" + }, + "t_struct(Vote)5619_storage": { + "encoding": "inplace", + "label": "struct DisputeKitClassic.Vote", + "members": [ + { + "astId": 5612, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "account", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 5614, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "commit", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + }, + { + "astId": 5616, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "choice", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 5618, + "contract": "src/arbitration/dispute-kits/DisputeKitClassic.sol:DisputeKitClassic", + "label": "voted", + "offset": 0, + "slot": "3", + "type": "t_bool" + } + ], + "numberOfBytes": "128" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepolia/DisputeKitClassic_Proxy.json b/contracts/deployments/arbitrumSepolia/DisputeKitClassic_Proxy.json new file mode 100644 index 000000000..011232bf4 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/DisputeKitClassic_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0x8078C2A3bf93f6f69BDD4D38233E7e219eA1914e", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x8c2fc255b80094a5e3c06421c7d686512871b10f7923623008a4c1b662a56151", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x8078C2A3bf93f6f69BDD4D38233E7e219eA1914e", + "transactionIndex": 1, + "gasUsed": "1856905", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080800000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x0b9827ecf499650f1b62c557bbc62c407f3aaf0028c5155f190292a3e40c026b", + "transactionHash": "0x8c2fc255b80094a5e3c06421c7d686512871b10f7923623008a4c1b662a56151", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842823, + "transactionHash": "0x8c2fc255b80094a5e3c06421c7d686512871b10f7923623008a4c1b662a56151", + "address": "0x8078C2A3bf93f6f69BDD4D38233E7e219eA1914e", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x0b9827ecf499650f1b62c557bbc62c407f3aaf0028c5155f190292a3e40c026b" + } + ], + "blockNumber": 3842823, + "cumulativeGasUsed": "1856905", + "status": 1, + "byzantium": true + }, + "args": [ + "0x2507018D785CE92115CfebE0d92CC496C42e99b7", + "0x485cc955000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c590000000000000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepolia/DisputeResolver.json b/contracts/deployments/arbitrumSepolia/DisputeResolver.json new file mode 100644 index 000000000..1423c4c17 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/DisputeResolver.json @@ -0,0 +1,522 @@ +{ + "address": "0x48e052B4A6dC4F30e90930F1CeaAFd83b3981EB3", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "_templateRegistry", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_arbitrableDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_templateId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateUri", + "type": "string" + } + ], + "name": "DisputeRequest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "arbitratorDisputeIDToLocalID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + } + ], + "name": "changeArbitrator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "_templateRegistry", + "type": "address" + } + ], + "name": "changeTemplateRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "string", + "name": "_disputeTemplate", + "type": "string" + }, + { + "internalType": "string", + "name": "_disputeTemplateDataMappings", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_numberOfRulingOptions", + "type": "uint256" + } + ], + "name": "createDisputeForTemplate", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "string", + "name": "_disputeTemplateUri", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_numberOfRulingOptions", + "type": "uint256" + } + ], + "name": "createDisputeForTemplateUri", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "bytes", + "name": "arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "isRuled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numberOfRulingOptions", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "rule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "templateRegistry", + "outputs": [ + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xf79a6965dfd667d6de2ada1a6cf3726a9fa43f47cc96b1b37e6ccd298d00875e", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x48e052B4A6dC4F30e90930F1CeaAFd83b3981EB3", + "transactionIndex": 1, + "gasUsed": "5973778", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x131ceb74d45d3044f40e28fa3785d17f1b04723f82bb41669d083f06f5e2ca5a", + "transactionHash": "0xf79a6965dfd667d6de2ada1a6cf3726a9fa43f47cc96b1b37e6ccd298d00875e", + "logs": [], + "blockNumber": 3842882, + "cumulativeGasUsed": "5973778", + "status": 1, + "byzantium": true + }, + "args": [ + "0x33d0b8879368acD8ca868e656Ade97bB97b90468", + "0x553dcbF6aB3aE06a1064b5200Df1B5A9fB403d3c" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_arbitrableDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateUri\",\"type\":\"string\"}],\"name\":\"DisputeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"arbitratorDisputeIDToLocalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"name\":\"changeArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"}],\"name\":\"changeTemplateRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplate\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplateDataMappings\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"}],\"name\":\"createDisputeForTemplate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_disputeTemplateUri\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfRulingOptions\",\"type\":\"uint256\"}],\"name\":\"createDisputeForTemplateUri\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"isRuled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numberOfRulingOptions\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templateRegistry\",\"outputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"DisputeRequest(address,uint256,uint256,uint256,string)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrableDisputeID\":\"The identifier of the dispute in the Arbitrable contract.\",\"_arbitrator\":\"The arbitrator of the contract.\",\"_externalDisputeID\":\"An identifier created outside Kleros by the protocol requesting arbitration.\",\"_templateId\":\"The identifier of the dispute template. Should not be used with _templateUri.\",\"_templateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrator\":\"The arbitrator giving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}}},\"kind\":\"dev\",\"methods\":{\"changeGovernor(address)\":{\"details\":\"Changes the governor.\",\"params\":{\"_governor\":\"The address of the new governor.\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"_arbitrator\":\"Target global arbitrator for any disputes.\"}},\"createDisputeForTemplate(bytes,string,string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator of the dispute.\",\"_disputeTemplate\":\"Dispute template.\",\"_disputeTemplateDataMappings\":\"The data mappings.\",\"_numberOfRulingOptions\":\"Number of ruling options.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the created dispute.\"}},\"createDisputeForTemplateUri(bytes,string,uint256)\":{\"details\":\"Calls createDispute function of the specified arbitrator to create a dispute. Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\",\"params\":{\"_arbitratorExtraData\":\"Extra data for the arbitrator of the dispute.\",\"_disputeTemplateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.\",\"_numberOfRulingOptions\":\"Number of ruling options.\"},\"returns\":{\"disputeID\":\"Dispute id (on arbitrator side) of the created dispute.\"}},\"rule(uint256,uint256)\":{\"details\":\"To be called by the arbitrator of the dispute, to declare the winning ruling.\",\"params\":{\"_externalDisputeID\":\"ID of the dispute in arbitrator contract.\",\"_ruling\":\"The ruling choice of the arbitration.\"}}},\"title\":\"DisputeResolver DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/arbitrables/DisputeResolver.sol\":\"DisputeResolver\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/arbitrables/DisputeResolver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@ferittuncer, @unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"../interfaces/IArbitrableV2.sol\\\";\\nimport \\\"../interfaces/IDisputeTemplateRegistry.sol\\\";\\n\\npragma solidity 0.8.18;\\n\\n/// @title DisputeResolver\\n/// DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.\\ncontract DisputeResolver is IArbitrableV2 {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n struct DisputeStruct {\\n bytes arbitratorExtraData; // Extra data for the dispute.\\n bool isRuled; // True if the dispute has been ruled.\\n uint256 ruling; // Ruling given to the dispute.\\n uint256 numberOfRulingOptions; // The number of choices the arbitrator can give.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The governor.\\n IArbitratorV2 public arbitrator; // The arbitrator.\\n IDisputeTemplateRegistry public templateRegistry; // The dispute template registry.\\n DisputeStruct[] public disputes; // Local disputes.\\n mapping(uint256 => uint256) public arbitratorDisputeIDToLocalID; // Maps arbitrator-side dispute IDs to local dispute IDs.\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor\\n /// @param _arbitrator Target global arbitrator for any disputes.\\n constructor(IArbitratorV2 _arbitrator, IDisputeTemplateRegistry _templateRegistry) {\\n governor = msg.sender;\\n arbitrator = _arbitrator;\\n templateRegistry = _templateRegistry;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Changes the governor.\\n /// @param _governor The address of the new governor.\\n function changeGovernor(address _governor) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n governor = _governor;\\n }\\n\\n function changeArbitrator(IArbitratorV2 _arbitrator) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n arbitrator = _arbitrator;\\n }\\n\\n function changeTemplateRegistry(IDisputeTemplateRegistry _templateRegistry) external {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n templateRegistry = _templateRegistry;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.\\n /// @param _disputeTemplate Dispute template.\\n /// @param _disputeTemplateDataMappings The data mappings.\\n /// @param _numberOfRulingOptions Number of ruling options.\\n /// @return disputeID Dispute id (on arbitrator side) of the created dispute.\\n function createDisputeForTemplate(\\n bytes calldata _arbitratorExtraData,\\n string calldata _disputeTemplate,\\n string memory _disputeTemplateDataMappings,\\n uint256 _numberOfRulingOptions\\n ) external payable returns (uint256 disputeID) {\\n return\\n _createDispute(\\n _arbitratorExtraData,\\n _disputeTemplate,\\n _disputeTemplateDataMappings,\\n \\\"\\\",\\n _numberOfRulingOptions\\n );\\n }\\n\\n /// @dev Calls createDispute function of the specified arbitrator to create a dispute.\\n /// Note that we don\\u2019t need to check that msg.value is enough to pay arbitration fees as it\\u2019s the responsibility of the arbitrator contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.\\n /// @param _disputeTemplateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.\\n /// @param _numberOfRulingOptions Number of ruling options.\\n /// @return disputeID Dispute id (on arbitrator side) of the created dispute.\\n function createDisputeForTemplateUri(\\n bytes calldata _arbitratorExtraData,\\n string calldata _disputeTemplateUri,\\n uint256 _numberOfRulingOptions\\n ) external payable returns (uint256 disputeID) {\\n return _createDispute(_arbitratorExtraData, \\\"\\\", \\\"\\\", _disputeTemplateUri, _numberOfRulingOptions);\\n }\\n\\n /// @dev To be called by the arbitrator of the dispute, to declare the winning ruling.\\n /// @param _externalDisputeID ID of the dispute in arbitrator contract.\\n /// @param _ruling The ruling choice of the arbitration.\\n function rule(uint256 _externalDisputeID, uint256 _ruling) external override {\\n uint256 localDisputeID = arbitratorDisputeIDToLocalID[_externalDisputeID];\\n DisputeStruct storage dispute = disputes[localDisputeID];\\n require(msg.sender == address(arbitrator), \\\"Only the arbitrator can execute this.\\\");\\n require(_ruling <= dispute.numberOfRulingOptions, \\\"Invalid ruling.\\\");\\n require(!dispute.isRuled, \\\"This dispute has been ruled already.\\\");\\n\\n dispute.isRuled = true;\\n dispute.ruling = _ruling;\\n\\n emit Ruling(IArbitratorV2(msg.sender), _externalDisputeID, dispute.ruling);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n function _createDispute(\\n bytes calldata _arbitratorExtraData,\\n string memory _disputeTemplate,\\n string memory _disputeTemplateDataMappings,\\n string memory _disputeTemplateUri,\\n uint256 _numberOfRulingOptions\\n ) internal returns (uint256 disputeID) {\\n require(_numberOfRulingOptions > 1, \\\"Should be at least 2 ruling options.\\\");\\n\\n disputeID = arbitrator.createDispute{value: msg.value}(_numberOfRulingOptions, _arbitratorExtraData);\\n uint256 localDisputeID = disputes.length;\\n disputes.push(\\n DisputeStruct({\\n arbitratorExtraData: _arbitratorExtraData,\\n isRuled: false,\\n ruling: 0,\\n numberOfRulingOptions: _numberOfRulingOptions\\n })\\n );\\n arbitratorDisputeIDToLocalID[disputeID] = localDisputeID;\\n uint256 templateId = templateRegistry.setDisputeTemplate(\\\"\\\", _disputeTemplate, _disputeTemplateDataMappings);\\n emit DisputeRequest(arbitrator, disputeID, localDisputeID, templateId, _disputeTemplateUri);\\n }\\n}\\n\",\"keccak256\":\"0x6a73611696ae6b6f128c1c3d6f355f691f93b374243f41e6a9b0795bbfb8fb13\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeTemplateRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n/// @title IDisputeTemplate\\n/// @notice Dispute Template interface.\\ninterface IDisputeTemplateRegistry {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n /// @param _templateDataMappings The data mappings.\\n event DisputeTemplate(\\n uint256 indexed _templateId,\\n string indexed _templateTag,\\n string _templateData,\\n string _templateDataMappings\\n );\\n\\n function setDisputeTemplate(\\n string memory _templateTag,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external returns (uint256 templateId);\\n}\\n\",\"keccak256\":\"0x88b0038d226532e6cf862a485d162f7bca61ac3d361d6801146b55a240f091ac\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50604051610ed5380380610ed583398101604081905261002f91610083565b600080546001600160a01b03199081163317909155600180546001600160a01b03948516908316179055600280549290931691161790556100bd565b6001600160a01b038116811461008057600080fd5b50565b6000806040838503121561009657600080fd5b82516100a18161006b565b60208401519092506100b28161006b565b809150509250929050565b610e09806100cc6000396000f3fe60806040526004361061009c5760003560e01c8063908bb29511610064578063908bb29514610170578063a0af81f014610191578063dc653511146101b1578063e09997d9146101c4578063e4c0aaf4146101f1578063fc548f081461021157600080fd5b80630c340a24146100a1578063311a6c56146100de5780634660ebbe14610100578063564a565d146101205780636cc6cde114610150575b600080fd5b3480156100ad57600080fd5b506000546100c1906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ea57600080fd5b506100fe6100f93660046108bb565b610231565b005b34801561010c57600080fd5b506100fe61011b3660046108f5565b6103d1565b34801561012c57600080fd5b5061014061013b366004610919565b61041d565b6040516100d59493929190610978565b34801561015c57600080fd5b506001546100c1906001600160a01b031681565b61018361017e3660046109f0565b6104eb565b6040519081526020016100d5565b34801561019d57600080fd5b506002546100c1906001600160a01b031681565b6101836101bf366004610a7a565b61055a565b3480156101d057600080fd5b506101836101df366004610919565b60046020526000908152604090205481565b3480156101fd57600080fd5b506100fe61020c3660046108f5565b6105b9565b34801561021d57600080fd5b506100fe61022c3660046108f5565b610605565b600082815260046020526040812054600380549192918390811061025757610257610b88565b6000918252602090912060015460049092020191506001600160a01b031633146102d65760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b806003015483111561031c5760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102cd565b600181015460ff161561037d5760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102cd565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b6000546001600160a01b031633146103fb5760405162461bcd60e51b81526004016102cd90610b9e565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6003818154811061042d57600080fd5b906000526020600020906004020160009150905080600001805461045090610be0565b80601f016020809104026020016040519081016040528092919081815260200182805461047c90610be0565b80156104c95780601f1061049e576101008083540402835291602001916104c9565b820191906000526020600020905b8154815290600101906020018083116104ac57829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b60006105508686604051806020016040528060008152506040518060200160405280600081525088888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250610651915050565b9695505050505050565b60006105ae878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525060408051602081019091529081528a93509150889050610651565b979650505050505050565b6000546001600160a01b031633146105e35760405162461bcd60e51b81526004016102cd90610b9e565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461062f5760405162461bcd60e51b81526004016102cd90610b9e565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000600182116106af5760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b60648201526084016102cd565b60015460405163c13517e160e01b81526001600160a01b039091169063c13517e19034906106e59086908c908c90600401610c1a565b60206040518083038185885af1158015610703573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107289190610c50565b600380546040805160a06020601f8d018190040282018101909252608081018b8152949550919382918c908c90819085018382808284376000920182905250938552505050602080830182905260408301829052606090920187905283546001810185559381522081519192600402019081906107a59082610cb8565b5060208281015160018301805460ff19169115159190911790556040808401516002808501919091556060909401516003909301929092556000858152600491829052828120859055925491516312a6505d60e21b81526001600160a01b0390921691634a9941749161081c918b918b9101610d78565b6020604051808303816000875af115801561083b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085f9190610c50565b60015460405191925084916001600160a01b03909116907f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186906108a790869086908b90610db4565b60405180910390a350509695505050505050565b600080604083850312156108ce57600080fd5b50508035926020909101359150565b6001600160a01b03811681146108f257600080fd5b50565b60006020828403121561090757600080fd5b8135610912816108dd565b9392505050565b60006020828403121561092b57600080fd5b5035919050565b6000815180845260005b818110156109585760208185018101518683018201520161093c565b506000602082860101526020601f19601f83011685010191505092915050565b60808152600061098b6080830187610932565b9415156020830152506040810192909252606090910152919050565b60008083601f8401126109b957600080fd5b50813567ffffffffffffffff8111156109d157600080fd5b6020830191508360208285010111156109e957600080fd5b9250929050565b600080600080600060608688031215610a0857600080fd5b853567ffffffffffffffff80821115610a2057600080fd5b610a2c89838a016109a7565b90975095506020880135915080821115610a4557600080fd5b50610a52888289016109a7565b96999598509660400135949350505050565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060808789031215610a9357600080fd5b863567ffffffffffffffff80821115610aab57600080fd5b610ab78a838b016109a7565b90985096506020890135915080821115610ad057600080fd5b610adc8a838b016109a7565b90965094506040890135915080821115610af557600080fd5b818901915089601f830112610b0957600080fd5b813581811115610b1b57610b1b610a64565b604051601f8201601f19908116603f01168101908382118183101715610b4357610b43610a64565b816040528281528c6020848701011115610b5c57600080fd5b826020860160208301376000602084830101528096505050505050606087013590509295509295509295565b634e487b7160e01b600052603260045260246000fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600181811c90821680610bf457607f821691505b602082108103610c1457634e487b7160e01b600052602260045260246000fd5b50919050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610c6257600080fd5b5051919050565b601f821115610cb357600081815260208120601f850160051c81016020861015610c905750805b601f850160051c820191505b81811015610caf57828155600101610c9c565b5050505b505050565b815167ffffffffffffffff811115610cd257610cd2610a64565b610ce681610ce08454610be0565b84610c69565b602080601f831160018114610d1b5760008415610d035750858301515b600019600386901b1c1916600185901b178555610caf565b600085815260208120601f198616915b82811015610d4a57888601518255948401946001909101908401610d2b565b5085821015610d685787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006060820152608060208201526000610d996080830185610932565b8281036040840152610dab8185610932565b95945050505050565b838152826020820152606060408201526000610dab606083018461093256fea2646970667358221220877ae0e909997117f80796c7abc2192eb434ddbaf0b29b8c6a7ca73e306f53b964736f6c63430008120033", + "deployedBytecode": "0x60806040526004361061009c5760003560e01c8063908bb29511610064578063908bb29514610170578063a0af81f014610191578063dc653511146101b1578063e09997d9146101c4578063e4c0aaf4146101f1578063fc548f081461021157600080fd5b80630c340a24146100a1578063311a6c56146100de5780634660ebbe14610100578063564a565d146101205780636cc6cde114610150575b600080fd5b3480156100ad57600080fd5b506000546100c1906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ea57600080fd5b506100fe6100f93660046108bb565b610231565b005b34801561010c57600080fd5b506100fe61011b3660046108f5565b6103d1565b34801561012c57600080fd5b5061014061013b366004610919565b61041d565b6040516100d59493929190610978565b34801561015c57600080fd5b506001546100c1906001600160a01b031681565b61018361017e3660046109f0565b6104eb565b6040519081526020016100d5565b34801561019d57600080fd5b506002546100c1906001600160a01b031681565b6101836101bf366004610a7a565b61055a565b3480156101d057600080fd5b506101836101df366004610919565b60046020526000908152604090205481565b3480156101fd57600080fd5b506100fe61020c3660046108f5565b6105b9565b34801561021d57600080fd5b506100fe61022c3660046108f5565b610605565b600082815260046020526040812054600380549192918390811061025757610257610b88565b6000918252602090912060015460049092020191506001600160a01b031633146102d65760405162461bcd60e51b815260206004820152602560248201527f4f6e6c79207468652061726269747261746f722063616e2065786563757465206044820152643a3434b99760d91b60648201526084015b60405180910390fd5b806003015483111561031c5760405162461bcd60e51b815260206004820152600f60248201526e24b73b30b634b210393ab634b7339760891b60448201526064016102cd565b600181015460ff161561037d5760405162461bcd60e51b8152602060048201526024808201527f54686973206469737075746520686173206265656e2072756c656420616c726560448201526330b23c9760e11b60648201526084016102cd565b6001818101805460ff1916909117905560028101839055604051838152849033907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a350505050565b6000546001600160a01b031633146103fb5760405162461bcd60e51b81526004016102cd90610b9e565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6003818154811061042d57600080fd5b906000526020600020906004020160009150905080600001805461045090610be0565b80601f016020809104026020016040519081016040528092919081815260200182805461047c90610be0565b80156104c95780601f1061049e576101008083540402835291602001916104c9565b820191906000526020600020905b8154815290600101906020018083116104ac57829003601f168201915b5050505060018301546002840154600390940154929360ff9091169290915084565b60006105508686604051806020016040528060008152506040518060200160405280600081525088888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250610651915050565b9695505050505050565b60006105ae878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525060408051602081019091529081528a93509150889050610651565b979650505050505050565b6000546001600160a01b031633146105e35760405162461bcd60e51b81526004016102cd90610b9e565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461062f5760405162461bcd60e51b81526004016102cd90610b9e565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000600182116106af5760405162461bcd60e51b8152602060048201526024808201527f53686f756c64206265206174206c6561737420322072756c696e67206f70746960448201526337b7399760e11b60648201526084016102cd565b60015460405163c13517e160e01b81526001600160a01b039091169063c13517e19034906106e59086908c908c90600401610c1a565b60206040518083038185885af1158015610703573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107289190610c50565b600380546040805160a06020601f8d018190040282018101909252608081018b8152949550919382918c908c90819085018382808284376000920182905250938552505050602080830182905260408301829052606090920187905283546001810185559381522081519192600402019081906107a59082610cb8565b5060208281015160018301805460ff19169115159190911790556040808401516002808501919091556060909401516003909301929092556000858152600491829052828120859055925491516312a6505d60e21b81526001600160a01b0390921691634a9941749161081c918b918b9101610d78565b6020604051808303816000875af115801561083b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085f9190610c50565b60015460405191925084916001600160a01b03909116907f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186906108a790869086908b90610db4565b60405180910390a350509695505050505050565b600080604083850312156108ce57600080fd5b50508035926020909101359150565b6001600160a01b03811681146108f257600080fd5b50565b60006020828403121561090757600080fd5b8135610912816108dd565b9392505050565b60006020828403121561092b57600080fd5b5035919050565b6000815180845260005b818110156109585760208185018101518683018201520161093c565b506000602082860101526020601f19601f83011685010191505092915050565b60808152600061098b6080830187610932565b9415156020830152506040810192909252606090910152919050565b60008083601f8401126109b957600080fd5b50813567ffffffffffffffff8111156109d157600080fd5b6020830191508360208285010111156109e957600080fd5b9250929050565b600080600080600060608688031215610a0857600080fd5b853567ffffffffffffffff80821115610a2057600080fd5b610a2c89838a016109a7565b90975095506020880135915080821115610a4557600080fd5b50610a52888289016109a7565b96999598509660400135949350505050565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060808789031215610a9357600080fd5b863567ffffffffffffffff80821115610aab57600080fd5b610ab78a838b016109a7565b90985096506020890135915080821115610ad057600080fd5b610adc8a838b016109a7565b90965094506040890135915080821115610af557600080fd5b818901915089601f830112610b0957600080fd5b813581811115610b1b57610b1b610a64565b604051601f8201601f19908116603f01168101908382118183101715610b4357610b43610a64565b816040528281528c6020848701011115610b5c57600080fd5b826020860160208301376000602084830101528096505050505050606087013590509295509295509295565b634e487b7160e01b600052603260045260246000fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b600181811c90821680610bf457607f821691505b602082108103610c1457634e487b7160e01b600052602260045260246000fd5b50919050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215610c6257600080fd5b5051919050565b601f821115610cb357600081815260208120601f850160051c81016020861015610c905750805b601f850160051c820191505b81811015610caf57828155600101610c9c565b5050505b505050565b815167ffffffffffffffff811115610cd257610cd2610a64565b610ce681610ce08454610be0565b84610c69565b602080601f831160018114610d1b5760008415610d035750858301515b600019600386901b1c1916600185901b178555610caf565b600085815260208120601f198616915b82811015610d4a57888601518255948401946001909101908401610d2b565b5085821015610d685787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006060820152608060208201526000610d996080830185610932565b8281036040840152610dab8185610932565b95945050505050565b838152826020820152606060408201526000610dab606083018461093256fea2646970667358221220877ae0e909997117f80796c7abc2192eb434ddbaf0b29b8c6a7ca73e306f53b964736f6c63430008120033", + "devdoc": { + "events": { + "DisputeRequest(address,uint256,uint256,uint256,string)": { + "details": "To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.", + "params": { + "_arbitrableDisputeID": "The identifier of the dispute in the Arbitrable contract.", + "_arbitrator": "The arbitrator of the contract.", + "_externalDisputeID": "An identifier created outside Kleros by the protocol requesting arbitration.", + "_templateId": "The identifier of the dispute template. Should not be used with _templateUri.", + "_templateUri": "The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId." + } + }, + "Ruling(address,uint256,uint256)": { + "details": "To be raised when a ruling is given.", + "params": { + "_arbitrator": "The arbitrator giving the ruling.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract.", + "_ruling": "The ruling which was given." + } + } + }, + "kind": "dev", + "methods": { + "changeGovernor(address)": { + "details": "Changes the governor.", + "params": { + "_governor": "The address of the new governor." + } + }, + "constructor": { + "details": "Constructor", + "params": { + "_arbitrator": "Target global arbitrator for any disputes." + } + }, + "createDisputeForTemplate(bytes,string,string,uint256)": { + "details": "Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "params": { + "_arbitratorExtraData": "Extra data for the arbitrator of the dispute.", + "_disputeTemplate": "Dispute template.", + "_disputeTemplateDataMappings": "The data mappings.", + "_numberOfRulingOptions": "Number of ruling options." + }, + "returns": { + "disputeID": "Dispute id (on arbitrator side) of the created dispute." + } + }, + "createDisputeForTemplateUri(bytes,string,uint256)": { + "details": "Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.", + "params": { + "_arbitratorExtraData": "Extra data for the arbitrator of the dispute.", + "_disputeTemplateUri": "The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.", + "_numberOfRulingOptions": "Number of ruling options." + }, + "returns": { + "disputeID": "Dispute id (on arbitrator side) of the created dispute." + } + }, + "rule(uint256,uint256)": { + "details": "To be called by the arbitrator of the dispute, to declare the winning ruling.", + "params": { + "_externalDisputeID": "ID of the dispute in arbitrator contract.", + "_ruling": "The ruling choice of the arbitration." + } + } + }, + "title": "DisputeResolver DisputeResolver contract adapted for V2 from https://github.com/kleros/arbitrable-proxy-contracts/blob/master/contracts/ArbitrableProxy.sol.", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 10260, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 10263, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "arbitrator", + "offset": 0, + "slot": "1", + "type": "t_contract(IArbitratorV2)17049" + }, + { + "astId": 10266, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "templateRegistry", + "offset": 0, + "slot": "2", + "type": "t_contract(IDisputeTemplateRegistry)17216" + }, + { + "astId": 10270, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "disputes", + "offset": 0, + "slot": "3", + "type": "t_array(t_struct(DisputeStruct)10258_storage)dyn_storage" + }, + { + "astId": 10274, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "arbitratorDisputeIDToLocalID", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_uint256)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(DisputeStruct)10258_storage)dyn_storage": { + "base": "t_struct(DisputeStruct)10258_storage", + "encoding": "dynamic_array", + "label": "struct DisputeResolver.DisputeStruct[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(IArbitratorV2)17049": { + "encoding": "inplace", + "label": "contract IArbitratorV2", + "numberOfBytes": "20" + }, + "t_contract(IDisputeTemplateRegistry)17216": { + "encoding": "inplace", + "label": "contract IDisputeTemplateRegistry", + "numberOfBytes": "20" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(DisputeStruct)10258_storage": { + "encoding": "inplace", + "label": "struct DisputeResolver.DisputeStruct", + "members": [ + { + "astId": 10251, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "arbitratorExtraData", + "offset": 0, + "slot": "0", + "type": "t_bytes_storage" + }, + { + "astId": 10253, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "isRuled", + "offset": 0, + "slot": "1", + "type": "t_bool" + }, + { + "astId": 10255, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "ruling", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 10257, + "contract": "src/arbitration/arbitrables/DisputeResolver.sol:DisputeResolver", + "label": "numberOfRulingOptions", + "offset": 0, + "slot": "3", + "type": "t_uint256" + } + ], + "numberOfBytes": "128" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepolia/DisputeTemplateRegistry.json b/contracts/deployments/arbitrumSepolia/DisputeTemplateRegistry.json new file mode 100644 index 000000000..d4b42ec97 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/DisputeTemplateRegistry.json @@ -0,0 +1,311 @@ +{ + "address": "0x553dcbF6aB3aE06a1064b5200Df1B5A9fB403d3c", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_templateId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "string", + "name": "_templateTag", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + } + ], + "name": "DisputeTemplate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_templateTag", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + } + ], + "name": "setDisputeTemplate", + "outputs": [ + { + "internalType": "uint256", + "name": "templateId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "templates", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0x1db4f2bcbada1766ee5a72651c2166b5627aef9d06a1db36fc0fadb5d4e2cf0d", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x553dcbF6aB3aE06a1064b5200Df1B5A9fB403d3c", + "transactionIndex": 1, + "gasUsed": "1839109", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000088000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000008000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x746147ea465cbeea73173f04a9c6932a69564d741882d02426ef94703565ce7f", + "transactionHash": "0x1db4f2bcbada1766ee5a72651c2166b5627aef9d06a1db36fc0fadb5d4e2cf0d", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842873, + "transactionHash": "0x1db4f2bcbada1766ee5a72651c2166b5627aef9d06a1db36fc0fadb5d4e2cf0d", + "address": "0x553dcbF6aB3aE06a1064b5200Df1B5A9fB403d3c", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x746147ea465cbeea73173f04a9c6932a69564d741882d02426ef94703565ce7f" + } + ], + "blockNumber": 3842873, + "cumulativeGasUsed": "1839109", + "status": 1, + "byzantium": true + }, + "args": [ + "0x15E5964C7751dF8563eA4bC000301582C79BC454", + "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59" + ] + }, + "implementation": "0x15E5964C7751dF8563eA4bC000301582C79BC454", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepolia/DisputeTemplateRegistry_Implementation.json b/contracts/deployments/arbitrumSepolia/DisputeTemplateRegistry_Implementation.json new file mode 100644 index 000000000..ea98c30f5 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/DisputeTemplateRegistry_Implementation.json @@ -0,0 +1,392 @@ +{ + "address": "0x15E5964C7751dF8563eA4bC000301582C79BC454", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_templateId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "string", + "name": "_templateTag", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + } + ], + "name": "DisputeTemplate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_templateTag", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + } + ], + "name": "setDisputeTemplate", + "outputs": [ + { + "internalType": "uint256", + "name": "templateId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "templates", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x66f3a1e7440888fd5cea51fcade2682f6015feb5d076354b885a826c39239583", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x15E5964C7751dF8563eA4bC000301582C79BC454", + "transactionIndex": 1, + "gasUsed": "3968781", + "logsBloom": "0x00000000000000000000000000040000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x2fadc52cf21e41ce95ab6b06d914aa7a9f7dfb96611df2f290598d8984fe5dd3", + "transactionHash": "0x66f3a1e7440888fd5cea51fcade2682f6015feb5d076354b885a826c39239583", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842868, + "transactionHash": "0x66f3a1e7440888fd5cea51fcade2682f6015feb5d076354b885a826c39239583", + "address": "0x15E5964C7751dF8563eA4bC000301582C79BC454", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 0, + "blockHash": "0x2fadc52cf21e41ce95ab6b06d914aa7a9f7dfb96611df2f290598d8984fe5dd3" + } + ], + "blockNumber": 3842868, + "cumulativeGasUsed": "3968781", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"_templateTag\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"}],\"name\":\"DisputeTemplate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_templateTag\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"}],\"name\":\"setDisputeTemplate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"templateId\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templates\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"A contract to maintain a registry of dispute templates.\",\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"DisputeTemplate(uint256,string,string,string)\":{\"details\":\"To be emitted when a new dispute template is created.\",\"params\":{\"_templateData\":\"The template data.\",\"_templateDataMappings\":\"The data mappings.\",\"_templateId\":\"The identifier of the dispute template.\",\"_templateTag\":\"An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"changeGovernor(address)\":{\"details\":\"Changes the governor of the contract.\",\"params\":{\"_governor\":\"The new governor.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"initialize(address)\":{\"details\":\"Initializer\",\"params\":{\"_governor\":\"Governor of the contract.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"setDisputeTemplate(string,string,string)\":{\"details\":\"Registers a new dispute template.\",\"params\":{\"_templateData\":\"The data of the template.\",\"_templateDataMappings\":\"The data mappings of the template.\",\"_templateTag\":\"The tag of the template (optional).\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"Dispute Template Registry\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/DisputeTemplateRegistry.sol\":\"DisputeTemplateRegistry\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/arbitration/DisputeTemplateRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\nimport \\\"../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../proxy/Initializable.sol\\\";\\nimport \\\"./interfaces/IDisputeTemplateRegistry.sol\\\";\\n\\n/// @title Dispute Template Registry\\n/// @dev A contract to maintain a registry of dispute templates.\\ncontract DisputeTemplateRegistry is IDisputeTemplateRegistry, UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The address that can withdraw funds.\\n uint256 public templates; // The number of templates.\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Governor only\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer\\n /// @param _governor Governor of the contract.\\n function initialize(address _governor) external reinitializer(1) {\\n governor = _governor;\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /**\\n * @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Changes the governor of the contract.\\n /// @param _governor The new governor.\\n function changeGovernor(address _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Registers a new dispute template.\\n /// @param _templateTag The tag of the template (optional).\\n /// @param _templateData The data of the template.\\n /// @param _templateDataMappings The data mappings of the template.\\n function setDisputeTemplate(\\n string memory _templateTag,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external returns (uint256 templateId) {\\n templateId = templates++;\\n emit DisputeTemplate(templateId, _templateTag, _templateData, _templateDataMappings);\\n }\\n}\\n\",\"keccak256\":\"0x230526c8cffcfc580fa1c802cd497a944ae92bd97b37d750ca2f811edb32ff93\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeTemplateRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n/// @title IDisputeTemplate\\n/// @notice Dispute Template interface.\\ninterface IDisputeTemplateRegistry {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n /// @param _templateDataMappings The data mappings.\\n event DisputeTemplate(\\n uint256 indexed _templateId,\\n string indexed _templateTag,\\n string _templateData,\\n string _templateDataMappings\\n );\\n\\n function setDisputeTemplate(\\n string memory _templateTag,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external returns (uint256 templateId);\\n}\\n\",\"keccak256\":\"0x88b0038d226532e6cf862a485d162f7bca61ac3d361d6801146b55a240f091ac\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060805234801561001457600080fd5b5061001d610022565b6100d3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff16156100715760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b03908116146100d05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6080516108d66100fc600039600081816101d1015281816101fa01526103f701526108d66000f3fe6080604052600436106100605760003560e01c80630c340a24146100655780633a283d7d146100a25780634a994174146100c65780634f1ef286146100e657806352d1902d146100fb578063c4d66de814610110578063e4c0aaf414610130575b600080fd5b34801561007157600080fd5b50600054610085906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ae57600080fd5b506100b860015481565b604051908152602001610099565b3480156100d257600080fd5b506100b86100e136600461065e565b610150565b6100f96100f4366004610702565b6101bd565b005b34801561010757600080fd5b506100b86103ea565b34801561011c57600080fd5b506100f961012b366004610764565b610448565b34801561013c57600080fd5b506100f961014b366004610764565b610532565b60018054600091826101618361077f565b9190505590508360405161017591906107ca565b6040518091039020817ef7cd7255d1073b4e136dd477c38ea0020c051ab17110cc5bfab0c840ff992485856040516101ae929190610812565b60405180910390a39392505050565b6101c68261057e565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061024457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166102386000805160206108818339815191525490565b6001600160a01b031614155b156102625760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156102bc575060408051601f3d908101601f191682019092526102b991810190610840565b60015b6102e957604051630c76093760e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610881833981519152811461031a57604051632a87526960e21b8152600481018290526024016102e0565b6000805160206108818339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28151156103e5576000836001600160a01b03168360405161038191906107ca565b600060405180830381855af49150503d80600081146103bc576040519150601f19603f3d011682016040523d82523d6000602084013e6103c1565b606091505b50509050806103e3576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104355760405163703e46dd60e11b815260040160405180910390fd5b5060008051602061088183398151915290565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806104925750805467ffffffffffffffff808416911610155b156104af5760405162dc149f60e41b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6000546001600160a01b0316331461055c5760405162461bcd60e51b81526004016102e090610859565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146105a85760405162461bcd60e51b81526004016102e090610859565b50565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156105dc576105dc6105ab565b604051601f8501601f19908116603f01168101908282118183101715610604576106046105ab565b8160405280935085815286868601111561061d57600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261064857600080fd5b610657838335602085016105c1565b9392505050565b60008060006060848603121561067357600080fd5b833567ffffffffffffffff8082111561068b57600080fd5b61069787838801610637565b945060208601359150808211156106ad57600080fd5b6106b987838801610637565b935060408601359150808211156106cf57600080fd5b506106dc86828701610637565b9150509250925092565b80356001600160a01b03811681146106fd57600080fd5b919050565b6000806040838503121561071557600080fd5b61071e836106e6565b9150602083013567ffffffffffffffff81111561073a57600080fd5b8301601f8101851361074b57600080fd5b61075a858235602084016105c1565b9150509250929050565b60006020828403121561077657600080fd5b610657826106e6565b60006001820161079f57634e487b7160e01b600052601160045260246000fd5b5060010190565b60005b838110156107c15781810151838201526020016107a9565b50506000910152565b600082516107dc8184602087016107a6565b9190910192915050565b600081518084526107fe8160208601602086016107a6565b601f01601f19169290920160200192915050565b60408152600061082560408301856107e6565b828103602084015261083781856107e6565b95945050505050565b60006020828403121561085257600080fd5b5051919050565b6020808252600d908201526c476f7665726e6f72206f6e6c7960981b60408201526060019056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212200004ee6006386c26ab6ccd4a63aa3601a23b64b04172511e9dbcdf70e85f6e7c64736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106100605760003560e01c80630c340a24146100655780633a283d7d146100a25780634a994174146100c65780634f1ef286146100e657806352d1902d146100fb578063c4d66de814610110578063e4c0aaf414610130575b600080fd5b34801561007157600080fd5b50600054610085906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ae57600080fd5b506100b860015481565b604051908152602001610099565b3480156100d257600080fd5b506100b86100e136600461065e565b610150565b6100f96100f4366004610702565b6101bd565b005b34801561010757600080fd5b506100b86103ea565b34801561011c57600080fd5b506100f961012b366004610764565b610448565b34801561013c57600080fd5b506100f961014b366004610764565b610532565b60018054600091826101618361077f565b9190505590508360405161017591906107ca565b6040518091039020817ef7cd7255d1073b4e136dd477c38ea0020c051ab17110cc5bfab0c840ff992485856040516101ae929190610812565b60405180910390a39392505050565b6101c68261057e565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061024457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166102386000805160206108818339815191525490565b6001600160a01b031614155b156102625760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156102bc575060408051601f3d908101601f191682019092526102b991810190610840565b60015b6102e957604051630c76093760e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610881833981519152811461031a57604051632a87526960e21b8152600481018290526024016102e0565b6000805160206108818339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28151156103e5576000836001600160a01b03168360405161038191906107ca565b600060405180830381855af49150503d80600081146103bc576040519150601f19603f3d011682016040523d82523d6000602084013e6103c1565b606091505b50509050806103e3576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104355760405163703e46dd60e11b815260040160405180910390fd5b5060008051602061088183398151915290565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806104925750805467ffffffffffffffff808416911610155b156104af5760405162dc149f60e41b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6000546001600160a01b0316331461055c5760405162461bcd60e51b81526004016102e090610859565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146105a85760405162461bcd60e51b81526004016102e090610859565b50565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156105dc576105dc6105ab565b604051601f8501601f19908116603f01168101908282118183101715610604576106046105ab565b8160405280935085815286868601111561061d57600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261064857600080fd5b610657838335602085016105c1565b9392505050565b60008060006060848603121561067357600080fd5b833567ffffffffffffffff8082111561068b57600080fd5b61069787838801610637565b945060208601359150808211156106ad57600080fd5b6106b987838801610637565b935060408601359150808211156106cf57600080fd5b506106dc86828701610637565b9150509250925092565b80356001600160a01b03811681146106fd57600080fd5b919050565b6000806040838503121561071557600080fd5b61071e836106e6565b9150602083013567ffffffffffffffff81111561073a57600080fd5b8301601f8101851361074b57600080fd5b61075a858235602084016105c1565b9150509250929050565b60006020828403121561077657600080fd5b610657826106e6565b60006001820161079f57634e487b7160e01b600052601160045260246000fd5b5060010190565b60005b838110156107c15781810151838201526020016107a9565b50506000910152565b600082516107dc8184602087016107a6565b9190910192915050565b600081518084526107fe8160208601602086016107a6565b601f01601f19169290920160200192915050565b60408152600061082560408301856107e6565b828103602084015261083781856107e6565b95945050505050565b60006020828403121561085257600080fd5b5051919050565b6020808252600d908201526c476f7665726e6f72206f6e6c7960981b60408201526060019056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212200004ee6006386c26ab6ccd4a63aa3601a23b64b04172511e9dbcdf70e85f6e7c64736f6c63430008120033", + "devdoc": { + "details": "A contract to maintain a registry of dispute templates.", + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "DisputeTemplate(uint256,string,string,string)": { + "details": "To be emitted when a new dispute template is created.", + "params": { + "_templateData": "The template data.", + "_templateDataMappings": "The data mappings.", + "_templateId": "The identifier of the dispute template.", + "_templateTag": "An optional tag for the dispute template, such as \"registration\" or \"removal\"." + } + }, + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "changeGovernor(address)": { + "details": "Changes the governor of the contract.", + "params": { + "_governor": "The new governor." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "initialize(address)": { + "details": "Initializer", + "params": { + "_governor": "Governor of the contract." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "setDisputeTemplate(string,string,string)": { + "details": "Registers a new dispute template.", + "params": { + "_templateData": "The data of the template.", + "_templateDataMappings": "The data mappings of the template.", + "_templateTag": "The tag of the template (optional)." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "title": "Dispute Template Registry", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 2856, + "contract": "src/arbitration/DisputeTemplateRegistry.sol:DisputeTemplateRegistry", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 2858, + "contract": "src/arbitration/DisputeTemplateRegistry.sol:DisputeTemplateRegistry", + "label": "templates", + "offset": 0, + "slot": "1", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepolia/DisputeTemplateRegistry_Proxy.json b/contracts/deployments/arbitrumSepolia/DisputeTemplateRegistry_Proxy.json new file mode 100644 index 000000000..e300db3cc --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/DisputeTemplateRegistry_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0x553dcbF6aB3aE06a1064b5200Df1B5A9fB403d3c", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x1db4f2bcbada1766ee5a72651c2166b5627aef9d06a1db36fc0fadb5d4e2cf0d", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x553dcbF6aB3aE06a1064b5200Df1B5A9fB403d3c", + "transactionIndex": 1, + "gasUsed": "1839109", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000088000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000008000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x746147ea465cbeea73173f04a9c6932a69564d741882d02426ef94703565ce7f", + "transactionHash": "0x1db4f2bcbada1766ee5a72651c2166b5627aef9d06a1db36fc0fadb5d4e2cf0d", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842873, + "transactionHash": "0x1db4f2bcbada1766ee5a72651c2166b5627aef9d06a1db36fc0fadb5d4e2cf0d", + "address": "0x553dcbF6aB3aE06a1064b5200Df1B5A9fB403d3c", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x746147ea465cbeea73173f04a9c6932a69564d741882d02426ef94703565ce7f" + } + ], + "blockNumber": 3842873, + "cumulativeGasUsed": "1839109", + "status": 1, + "byzantium": true + }, + "args": [ + "0x15E5964C7751dF8563eA4bC000301582C79BC454", + "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepolia/Escrow.json b/contracts/deployments/arbitrumSepolia/Escrow.json new file mode 100644 index 000000000..94d78183c --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/Escrow.json @@ -0,0 +1,1081 @@ +{ + "address": "0xF1a7Cd3115F5852966430f8E3877D2221F074A2e", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + }, + { + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + }, + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "_templateRegistry", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_feeTimeout", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ArbitratorOnly", + "type": "error" + }, + { + "inputs": [], + "name": "BuyerFeeNotCoverArbitrationCosts", + "type": "error" + }, + { + "inputs": [], + "name": "BuyerOnly", + "type": "error" + }, + { + "inputs": [], + "name": "DeadlineNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeAlreadyCreatedOrTransactionAlreadyExecuted", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeAlreadyResolved", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorOnly", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidRuling", + "type": "error" + }, + { + "inputs": [], + "name": "MaximumPaymentAmountExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "NotWaitingForBuyerFees", + "type": "error" + }, + { + "inputs": [], + "name": "NotWaitingForSellerFees", + "type": "error" + }, + { + "inputs": [], + "name": "SellerFeeNotCoverArbitrationCosts", + "type": "error" + }, + { + "inputs": [], + "name": "SellerOnly", + "type": "error" + }, + { + "inputs": [], + "name": "TimeoutNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "TransactionDisputed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_arbitrableDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_templateId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_templateUri", + "type": "string" + } + ], + "name": "DisputeRequest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum Escrow.Party", + "name": "_party", + "type": "uint8" + } + ], + "name": "HasToPayFee", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "_party", + "type": "address" + } + ], + "name": "Payment", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_buyer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_seller", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "TransactionCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "enum Escrow.Resolution", + "name": "_resolution", + "type": "uint8" + } + ], + "name": "TransactionResolved", + "type": "event" + }, + { + "inputs": [], + "name": "AMOUNT_OF_CHOICES", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "arbitrator", + "outputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "arbitratorExtraData", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IArbitratorV2", + "name": "_arbitrator", + "type": "address" + } + ], + "name": "changeArbitrator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_arbitratorExtraData", + "type": "bytes" + } + ], + "name": "changeArbitratorExtraData", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + } + ], + "name": "changeDisputeTemplate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "_templateRegistry", + "type": "address" + } + ], + "name": "changeTemplateRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_timeoutPayment", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "_seller", + "type": "address" + }, + { + "internalType": "string", + "name": "_templateData", + "type": "string" + }, + { + "internalType": "string", + "name": "_templateDataMappings", + "type": "string" + } + ], + "name": "createTransaction", + "outputs": [ + { + "internalType": "uint256", + "name": "transactionID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputeIDtoTransactionID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + } + ], + "name": "executeTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "feeTimeout", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCountTransactions", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "pay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + } + ], + "name": "payArbitrationFeeByBuyer", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + } + ], + "name": "payArbitrationFeeBySeller", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_amountReimbursed", + "type": "uint256" + } + ], + "name": "reimburse", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "rule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "templateId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "templateRegistry", + "outputs": [ + { + "internalType": "contract IDisputeTemplateRegistry", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + } + ], + "name": "timeOutByBuyer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_transactionID", + "type": "uint256" + } + ], + "name": "timeOutBySeller", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "transactions", + "outputs": [ + { + "internalType": "address payable", + "name": "buyer", + "type": "address" + }, + { + "internalType": "address payable", + "name": "seller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyerFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sellerFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastFeePaymentTime", + "type": "uint256" + }, + { + "internalType": "string", + "name": "templateData", + "type": "string" + }, + { + "internalType": "string", + "name": "templateDataMappings", + "type": "string" + }, + { + "internalType": "enum Escrow.Status", + "name": "status", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xaeede717c82c01252761f793c66f39b13876aa14e9070388a1109263c50dbdb3", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xF1a7Cd3115F5852966430f8E3877D2221F074A2e", + "transactionIndex": 1, + "gasUsed": "11319899", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000080000000000000000000000000000000000080000000000000000000000000000000000000008000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008040000000002000000400000000000100000000000000000000000000000000000000", + "blockHash": "0x5d82cf40bed0d7b146e24a8d5a4d4d25f9ba570fbb5f65ce46b979433a9a25cb", + "transactionHash": "0xaeede717c82c01252761f793c66f39b13876aa14e9070388a1109263c50dbdb3", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842884, + "transactionHash": "0xaeede717c82c01252761f793c66f39b13876aa14e9070388a1109263c50dbdb3", + "address": "0x553dcbF6aB3aE06a1064b5200Df1B5A9fB403d3c", + "topics": [ + "0x00f7cd7255d1073b4e136dd477c38ea0020c051ab17110cc5bfab0c840ff9924", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c6469737075746554656d706c6174654d617070696e673a20544f444f00000000", + "logIndex": 0, + "blockHash": "0x5d82cf40bed0d7b146e24a8d5a4d4d25f9ba570fbb5f65ce46b979433a9a25cb" + } + ], + "blockNumber": 3842884, + "cumulativeGasUsed": "11319899", + "status": 1, + "byzantium": true + }, + "args": [ + "0x33d0b8879368acD8ca868e656Ade97bB97b90468", + "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003", + { + "$schema": "../NewDisputeTemplate.schema.json", + "title": "Let's do this", + "description": "We want to do this: %s", + "question": "Does it comply with the policy?", + "answers": [ + { + "title": "Yes", + "description": "Select this if you agree that it must be done." + }, + { + "title": "No", + "description": "Select this if you do not agree that it must be done." + } + ], + "policyURI": "/ipfs/Qmdvk...rSD6cE/policy.pdf", + "frontendUrl": "https://kleros-v2.netlify.app/#/cases/%s/overview", + "arbitratorChainID": "421614", + "arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b", + "category": "Others", + "specification": "KIP001", + "lang": "en_US" + }, + "disputeTemplateMapping: TODO", + "0x553dcbF6aB3aE06a1064b5200Df1B5A9fB403d3c", + 600 + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"},{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_feeTimeout\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ArbitratorOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BuyerFeeNotCoverArbitrationCosts\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BuyerOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeadlineNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeAlreadyCreatedOrTransactionAlreadyExecuted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeAlreadyResolved\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRuling\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaximumPaymentAmountExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotWaitingForBuyerFees\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotWaitingForSellerFees\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SellerFeeNotCoverArbitrationCosts\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SellerOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TimeoutNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransactionDisputed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_arbitrableDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateUri\",\"type\":\"string\"}],\"name\":\"DisputeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum Escrow.Party\",\"name\":\"_party\",\"type\":\"uint8\"}],\"name\":\"HasToPayFee\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_party\",\"type\":\"address\"}],\"name\":\"Payment\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_buyer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_seller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"TransactionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"enum Escrow.Resolution\",\"name\":\"_resolution\",\"type\":\"uint8\"}],\"name\":\"TransactionResolved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AMOUNT_OF_CHOICES\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"arbitratorExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"name\":\"changeArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"}],\"name\":\"changeArbitratorExtraData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"}],\"name\":\"changeDisputeTemplate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"}],\"name\":\"changeTemplateRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_timeoutPayment\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"_seller\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"}],\"name\":\"createTransaction\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"transactionID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputeIDtoTransactionID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"executeTransaction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeTimeout\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCountTransactions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"pay\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"payArbitrationFeeByBuyer\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"payArbitrationFeeBySeller\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_amountReimbursed\",\"type\":\"uint256\"}],\"name\":\"reimburse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templateId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templateRegistry\",\"outputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"timeOutByBuyer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"timeOutBySeller\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"transactions\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"buyer\",\"type\":\"address\"},{\"internalType\":\"address payable\",\"name\":\"seller\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"buyerFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sellerFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastFeePaymentTime\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"templateDataMappings\",\"type\":\"string\"},{\"internalType\":\"enum Escrow.Status\",\"name\":\"status\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"MultipleArbitrableTransaction contract that is compatible with V2. Adapted from https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTransaction.sol\",\"events\":{\"DisputeRequest(address,uint256,uint256,uint256,string)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrableDisputeID\":\"The identifier of the dispute in the Arbitrable contract.\",\"_arbitrator\":\"The arbitrator of the contract.\",\"_externalDisputeID\":\"An identifier created outside Kleros by the protocol requesting arbitration.\",\"_templateId\":\"The identifier of the dispute template. Should not be used with _templateUri.\",\"_templateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\"}},\"HasToPayFee(uint256,uint8)\":{\"details\":\"Indicate that a party has to pay a fee or would otherwise be considered as losing.\",\"params\":{\"_party\":\"The party who has to pay.\",\"_transactionID\":\"The index of the transaction.\"}},\"Payment(uint256,uint256,address)\":{\"details\":\"To be emitted when a party pays or reimburses the other.\",\"params\":{\"_amount\":\"The amount paid.\",\"_party\":\"The party that paid.\",\"_transactionID\":\"The index of the transaction.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrator\":\"The arbitrator giving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}},\"TransactionCreated(uint256,address,address,uint256)\":{\"details\":\"Emitted when a transaction is created.\",\"params\":{\"_amount\":\"The initial amount in the transaction.\",\"_buyer\":\"The address of the buyer.\",\"_seller\":\"The address of the seller.\",\"_transactionID\":\"The index of the transaction.\"}},\"TransactionResolved(uint256,uint8)\":{\"details\":\"To be emitted when a transaction is resolved, either by its execution, a timeout or because a ruling was enforced.\",\"params\":{\"_resolution\":\"Short description of what caused the transaction to be solved.\",\"_transactionID\":\"The ID of the respective transaction.\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"_arbitrator\":\"The arbitrator of the contract.\",\"_arbitratorExtraData\":\"Extra data for the arbitrator.\",\"_feeTimeout\":\"Arbitration fee timeout for the parties.\",\"_templateData\":\"The dispute template data.\",\"_templateDataMappings\":\"The dispute template data mappings.\",\"_templateRegistry\":\"The dispute template registry.\"}},\"createTransaction(uint256,address,string,string)\":{\"details\":\"Create a transaction.\",\"params\":{\"_seller\":\"The recipient of the transaction.\",\"_templateData\":\"The dispute template data.\",\"_templateDataMappings\":\"The dispute template data mappings.\",\"_timeoutPayment\":\"Time after which a party can automatically execute the arbitrable transaction.\"},\"returns\":{\"transactionID\":\"The index of the transaction.\"}},\"executeTransaction(uint256)\":{\"details\":\"Transfer the transaction's amount to the seller if the timeout has passed.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}},\"getCountTransactions()\":{\"details\":\"Getter to know the count of transactions.\",\"returns\":{\"_0\":\"The count of transactions.\"}},\"pay(uint256,uint256)\":{\"details\":\"Pay seller. To be called if the good or service is provided.\",\"params\":{\"_amount\":\"Amount to pay in wei.\",\"_transactionID\":\"The index of the transaction.\"}},\"payArbitrationFeeByBuyer(uint256)\":{\"details\":\"Pay the arbitration fee to raise a dispute. To be called by the buyer. Note that the arbitrator can have createDispute throw, which will make this function throw and therefore lead to a party being timed-out. This is not a vulnerability as the arbitrator can rule in favor of one party anyway.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}},\"payArbitrationFeeBySeller(uint256)\":{\"details\":\"Pay the arbitration fee to raise a dispute. To be called by the seller. Note that this function mirrors payArbitrationFeeByBuyer.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}},\"reimburse(uint256,uint256)\":{\"details\":\"Reimburse buyer. To be called if the good or service can't be fully provided.\",\"params\":{\"_amountReimbursed\":\"Amount to reimburse in wei.\",\"_transactionID\":\"The index of the transaction.\"}},\"rule(uint256,uint256)\":{\"details\":\"Give a ruling for a dispute. Must be called by the arbitrator to enforce the final ruling. The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\",\"params\":{\"_disputeID\":\"ID of the dispute in the Arbitrator contract.\",\"_ruling\":\"Ruling given by the arbitrator. Note that 0 is reserved for \\\"Refuse to arbitrate\\\".\"}},\"timeOutByBuyer(uint256)\":{\"details\":\"Reimburse buyer if seller fails to pay the fee.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}},\"timeOutBySeller(uint256)\":{\"details\":\"Pay seller if buyer fails to pay the fee.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}}},\"title\":\"Escrow for a sale paid in ETH and no fees.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/arbitrables/Escrow.sol\":\"Escrow\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/arbitrables/Escrow.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @authors: [@unknownunknown1, @fnanni-0, @shalzz, @jaybuidl]\\n/// @reviewers: []\\n/// @auditors: []\\n/// @bounties: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"../interfaces/IArbitrableV2.sol\\\";\\nimport \\\"../interfaces/IDisputeTemplateRegistry.sol\\\";\\n\\n/// @title Escrow for a sale paid in ETH and no fees.\\n/// @dev MultipleArbitrableTransaction contract that is compatible with V2.\\n/// Adapted from https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTransaction.sol\\ncontract Escrow is IArbitrableV2 {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Party {\\n None,\\n Buyer, // Makes a purchase in ETH.\\n Seller // Provides a good or service in exchange for ETH.\\n }\\n\\n enum Status {\\n NoDispute,\\n WaitingBuyer,\\n WaitingSeller,\\n DisputeCreated,\\n TransactionResolved\\n }\\n\\n enum Resolution {\\n TransactionExecuted,\\n TimeoutByBuyer,\\n TimeoutBySeller,\\n RulingEnforced\\n }\\n\\n struct Transaction {\\n address payable buyer;\\n address payable seller;\\n uint256 amount;\\n uint256 deadline; // Timestamp at which the transaction can be automatically executed if not disputed.\\n uint256 disputeID; // If dispute exists, the ID of the dispute.\\n uint256 buyerFee; // Total fees paid by the buyer.\\n uint256 sellerFee; // Total fees paid by the seller.\\n uint256 lastFeePaymentTime; // Last time the dispute fees were paid by either party.\\n string templateData;\\n string templateDataMappings;\\n Status status;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant AMOUNT_OF_CHOICES = 2;\\n address public immutable governor;\\n IArbitratorV2 public arbitrator; // Address of the arbitrator contract.\\n bytes public arbitratorExtraData; // Extra data to set up the arbitration.\\n IDisputeTemplateRegistry public templateRegistry; // The dispute template registry.\\n uint256 public templateId; // The current dispute template identifier.\\n uint256 public immutable feeTimeout; // Time in seconds a party can take to pay arbitration fees before being considered unresponsive and lose the dispute.\\n Transaction[] public transactions; // List of all created transactions.\\n mapping(uint256 => uint256) public disputeIDtoTransactionID; // Naps dispute ID to tx ID.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n /// @dev To be emitted when a party pays or reimburses the other.\\n /// @param _transactionID The index of the transaction.\\n /// @param _amount The amount paid.\\n /// @param _party The party that paid.\\n event Payment(uint256 indexed _transactionID, uint256 _amount, address _party);\\n\\n /// @dev Indicate that a party has to pay a fee or would otherwise be considered as losing.\\n /// @param _transactionID The index of the transaction.\\n /// @param _party The party who has to pay.\\n event HasToPayFee(uint256 indexed _transactionID, Party _party);\\n\\n /// @dev Emitted when a transaction is created.\\n /// @param _transactionID The index of the transaction.\\n /// @param _buyer The address of the buyer.\\n /// @param _seller The address of the seller.\\n /// @param _amount The initial amount in the transaction.\\n event TransactionCreated(\\n uint256 indexed _transactionID,\\n address indexed _buyer,\\n address indexed _seller,\\n uint256 _amount\\n );\\n\\n /// @dev To be emitted when a transaction is resolved, either by its\\n /// execution, a timeout or because a ruling was enforced.\\n /// @param _transactionID The ID of the respective transaction.\\n /// @param _resolution Short description of what caused the transaction to be solved.\\n event TransactionResolved(uint256 indexed _transactionID, Resolution indexed _resolution);\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator.\\n /// @param _templateData The dispute template data.\\n /// @param _templateDataMappings The dispute template data mappings.\\n /// @param _templateRegistry The dispute template registry.\\n /// @param _feeTimeout Arbitration fee timeout for the parties.\\n constructor(\\n IArbitratorV2 _arbitrator,\\n bytes memory _arbitratorExtraData,\\n string memory _templateData,\\n string memory _templateDataMappings,\\n IDisputeTemplateRegistry _templateRegistry,\\n uint256 _feeTimeout\\n ) {\\n governor = msg.sender;\\n arbitrator = _arbitrator;\\n arbitratorExtraData = _arbitratorExtraData;\\n templateRegistry = _templateRegistry;\\n feeTimeout = _feeTimeout;\\n\\n templateId = templateRegistry.setDisputeTemplate(\\\"\\\", _templateData, _templateDataMappings);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n function changeArbitrator(IArbitratorV2 _arbitrator) external onlyByGovernor {\\n arbitrator = _arbitrator;\\n }\\n\\n function changeArbitratorExtraData(bytes calldata _arbitratorExtraData) external onlyByGovernor {\\n arbitratorExtraData = _arbitratorExtraData;\\n }\\n\\n function changeTemplateRegistry(IDisputeTemplateRegistry _templateRegistry) external onlyByGovernor {\\n templateRegistry = _templateRegistry;\\n }\\n\\n function changeDisputeTemplate(\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external onlyByGovernor {\\n templateId = templateRegistry.setDisputeTemplate(\\\"\\\", _templateData, _templateDataMappings);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Create a transaction.\\n /// @param _timeoutPayment Time after which a party can automatically execute the arbitrable transaction.\\n /// @param _seller The recipient of the transaction.\\n /// @param _templateData The dispute template data.\\n /// @param _templateDataMappings The dispute template data mappings.\\n /// @return transactionID The index of the transaction.\\n function createTransaction(\\n uint256 _timeoutPayment,\\n address payable _seller,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external payable returns (uint256 transactionID) {\\n Transaction storage transaction = transactions.push();\\n transaction.buyer = payable(msg.sender);\\n transaction.seller = _seller;\\n transaction.amount = msg.value;\\n transaction.deadline = block.timestamp + _timeoutPayment;\\n transaction.templateData = _templateData;\\n transaction.templateDataMappings = _templateDataMappings;\\n\\n transactionID = transactions.length - 1;\\n\\n emit TransactionCreated(transactionID, msg.sender, _seller, msg.value);\\n }\\n\\n /// @dev Pay seller. To be called if the good or service is provided.\\n /// @param _transactionID The index of the transaction.\\n /// @param _amount Amount to pay in wei.\\n function pay(uint256 _transactionID, uint256 _amount) external {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.buyer != msg.sender) revert BuyerOnly();\\n if (transaction.status != Status.NoDispute) revert TransactionDisputed();\\n if (_amount > transaction.amount) revert MaximumPaymentAmountExceeded();\\n\\n transaction.seller.send(_amount); // It is the user responsibility to accept ETH.\\n transaction.amount -= _amount;\\n\\n emit Payment(_transactionID, _amount, msg.sender);\\n }\\n\\n /// @dev Reimburse buyer. To be called if the good or service can't be fully provided.\\n /// @param _transactionID The index of the transaction.\\n /// @param _amountReimbursed Amount to reimburse in wei.\\n function reimburse(uint256 _transactionID, uint256 _amountReimbursed) external {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.seller != msg.sender) revert SellerOnly();\\n if (transaction.status != Status.NoDispute) revert TransactionDisputed();\\n if (_amountReimbursed > transaction.amount) revert MaximumPaymentAmountExceeded();\\n\\n transaction.buyer.send(_amountReimbursed); // It is the user responsibility to accept ETH.\\n transaction.amount -= _amountReimbursed;\\n\\n emit Payment(_transactionID, _amountReimbursed, msg.sender);\\n }\\n\\n /// @dev Transfer the transaction's amount to the seller if the timeout has passed.\\n /// @param _transactionID The index of the transaction.\\n function executeTransaction(uint256 _transactionID) external {\\n Transaction storage transaction = transactions[_transactionID];\\n if (block.timestamp < transaction.deadline) revert DeadlineNotPassed();\\n if (transaction.status != Status.NoDispute) revert TransactionDisputed();\\n\\n transaction.seller.send(transaction.amount); // It is the user responsibility to accept ETH.\\n transaction.amount = 0;\\n transaction.status = Status.TransactionResolved;\\n\\n emit TransactionResolved(_transactionID, Resolution.TransactionExecuted);\\n }\\n\\n /// @dev Pay the arbitration fee to raise a dispute. To be called by the buyer.\\n /// Note that the arbitrator can have createDispute throw, which will make\\n /// this function throw and therefore lead to a party being timed-out.\\n /// This is not a vulnerability as the arbitrator can rule in favor of one party anyway.\\n /// @param _transactionID The index of the transaction.\\n function payArbitrationFeeByBuyer(uint256 _transactionID) external payable {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.status >= Status.DisputeCreated) revert DisputeAlreadyCreatedOrTransactionAlreadyExecuted();\\n if (msg.sender != transaction.buyer) revert BuyerOnly();\\n\\n transaction.buyerFee += msg.value;\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);\\n if (transaction.buyerFee < arbitrationCost) revert BuyerFeeNotCoverArbitrationCosts();\\n\\n transaction.lastFeePaymentTime = block.timestamp;\\n\\n if (transaction.sellerFee < arbitrationCost) {\\n // The seller still has to pay. This can also happen if he has paid, but arbitrationCost has increased.\\n transaction.status = Status.WaitingSeller;\\n emit HasToPayFee(_transactionID, Party.Seller);\\n } else {\\n // The seller has also paid the fee. We create the dispute.\\n raiseDispute(_transactionID, arbitrationCost);\\n }\\n }\\n\\n /// @dev Pay the arbitration fee to raise a dispute. To be called by the seller.\\n /// Note that this function mirrors payArbitrationFeeByBuyer.\\n /// @param _transactionID The index of the transaction.\\n function payArbitrationFeeBySeller(uint256 _transactionID) external payable {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.status >= Status.DisputeCreated) revert DisputeAlreadyCreatedOrTransactionAlreadyExecuted();\\n if (msg.sender != transaction.seller) revert SellerOnly();\\n\\n transaction.sellerFee += msg.value;\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);\\n if (transaction.sellerFee < arbitrationCost) revert SellerFeeNotCoverArbitrationCosts();\\n\\n transaction.lastFeePaymentTime = block.timestamp;\\n\\n if (transaction.buyerFee < arbitrationCost) {\\n // The buyer still has to pay. This can also happen if he has paid, but arbitrationCost has increased.\\n transaction.status = Status.WaitingBuyer;\\n emit HasToPayFee(_transactionID, Party.Buyer);\\n } else {\\n // The buyer has also paid the fee. We create the dispute.\\n raiseDispute(_transactionID, arbitrationCost);\\n }\\n }\\n\\n /// @dev Reimburse buyer if seller fails to pay the fee.\\n /// @param _transactionID The index of the transaction.\\n function timeOutByBuyer(uint256 _transactionID) external {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.status != Status.WaitingSeller) revert NotWaitingForSellerFees();\\n if (block.timestamp - transaction.lastFeePaymentTime < feeTimeout) revert TimeoutNotPassed();\\n\\n if (transaction.sellerFee != 0) {\\n transaction.seller.send(transaction.sellerFee); // It is the user responsibility to accept ETH.\\n transaction.sellerFee = 0;\\n }\\n executeRuling(_transactionID, uint256(Party.Buyer));\\n emit TransactionResolved(_transactionID, Resolution.TimeoutByBuyer);\\n }\\n\\n /// @dev Pay seller if buyer fails to pay the fee.\\n /// @param _transactionID The index of the transaction.\\n function timeOutBySeller(uint256 _transactionID) external {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.status != Status.WaitingBuyer) revert NotWaitingForBuyerFees();\\n if (block.timestamp - transaction.lastFeePaymentTime < feeTimeout) revert TimeoutNotPassed();\\n\\n if (transaction.buyerFee != 0) {\\n transaction.buyer.send(transaction.buyerFee); // It is the user responsibility to accept ETH.\\n transaction.buyerFee = 0;\\n }\\n\\n executeRuling(_transactionID, uint256(Party.Seller));\\n emit TransactionResolved(_transactionID, Resolution.TimeoutBySeller);\\n }\\n\\n /// @dev Give a ruling for a dispute. Must be called by the arbitrator to enforce the final ruling.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID ID of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator. Note that 0 is reserved\\n /// for \\\"Refuse to arbitrate\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external override {\\n if (msg.sender != address(arbitrator)) revert ArbitratorOnly();\\n if (_ruling > AMOUNT_OF_CHOICES) revert InvalidRuling();\\n\\n uint256 transactionID = disputeIDtoTransactionID[_disputeID];\\n Transaction storage transaction = transactions[transactionID];\\n if (transaction.status != Status.DisputeCreated) revert DisputeAlreadyResolved();\\n\\n emit Ruling(arbitrator, _disputeID, _ruling);\\n executeRuling(transactionID, _ruling);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Create a dispute.\\n /// @param _transactionID The index of the transaction.\\n /// @param _arbitrationCost Amount to pay the arbitrator.\\n function raiseDispute(uint256 _transactionID, uint256 _arbitrationCost) internal {\\n Transaction storage transaction = transactions[_transactionID];\\n transaction.status = Status.DisputeCreated;\\n transaction.disputeID = arbitrator.createDispute{value: _arbitrationCost}(\\n AMOUNT_OF_CHOICES,\\n arbitratorExtraData\\n );\\n disputeIDtoTransactionID[transaction.disputeID] = _transactionID;\\n emit DisputeRequest(arbitrator, transaction.disputeID, _transactionID, templateId, \\\"\\\");\\n\\n // Refund buyer if he overpaid.\\n if (transaction.buyerFee > _arbitrationCost) {\\n uint256 extraFeeBuyer = transaction.buyerFee - _arbitrationCost;\\n transaction.buyerFee = _arbitrationCost;\\n transaction.buyer.send(extraFeeBuyer); // It is the user responsibility to accept ETH.\\n }\\n\\n // Refund seller if he overpaid.\\n if (transaction.sellerFee > _arbitrationCost) {\\n uint256 extraFeeSeller = transaction.sellerFee - _arbitrationCost;\\n transaction.sellerFee = _arbitrationCost;\\n transaction.seller.send(extraFeeSeller); // It is the user responsibility to accept ETH.\\n }\\n }\\n\\n /// @dev Execute a ruling of a dispute. It reimburses the fee to the winning party.\\n /// @param _transactionID The index of the transaction.\\n /// @param _ruling Ruling given by the arbitrator. 1 : Reimburse the seller. 2 : Pay the buyer.\\n function executeRuling(uint256 _transactionID, uint256 _ruling) internal {\\n Transaction storage transaction = transactions[_transactionID];\\n // Give the arbitration fee back.\\n // Note that we use send to prevent a party from blocking the execution.\\n if (_ruling == uint256(Party.Buyer)) {\\n transaction.buyer.send(transaction.buyerFee + transaction.amount);\\n } else if (_ruling == uint256(Party.Seller)) {\\n transaction.seller.send(transaction.sellerFee + transaction.amount);\\n } else {\\n uint256 splitAmount = (transaction.buyerFee + transaction.amount) / 2;\\n transaction.buyer.send(splitAmount);\\n transaction.seller.send(splitAmount);\\n }\\n\\n transaction.amount = 0;\\n transaction.buyerFee = 0;\\n transaction.sellerFee = 0;\\n transaction.status = Status.TransactionResolved;\\n\\n emit TransactionResolved(_transactionID, Resolution.RulingEnforced);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Getter to know the count of transactions.\\n /// @return The count of transactions.\\n function getCountTransactions() external view returns (uint256) {\\n return transactions.length;\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error BuyerOnly();\\n error SellerOnly();\\n error ArbitratorOnly();\\n error TransactionDisputed();\\n error MaximumPaymentAmountExceeded();\\n error DisputeAlreadyCreatedOrTransactionAlreadyExecuted();\\n error DeadlineNotPassed();\\n error BuyerFeeNotCoverArbitrationCosts();\\n error SellerFeeNotCoverArbitrationCosts();\\n error NotWaitingForSellerFees();\\n error NotWaitingForBuyerFees();\\n error TimeoutNotPassed();\\n error InvalidRuling();\\n error DisputeAlreadyResolved();\\n}\\n\",\"keccak256\":\"0x9fa34c5dca0b60c55a0ab61601f78a38c599b95bb04652cc11aab399431367fe\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeTemplateRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n/// @title IDisputeTemplate\\n/// @notice Dispute Template interface.\\ninterface IDisputeTemplateRegistry {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n /// @param _templateDataMappings The data mappings.\\n event DisputeTemplate(\\n uint256 indexed _templateId,\\n string indexed _templateTag,\\n string _templateData,\\n string _templateDataMappings\\n );\\n\\n function setDisputeTemplate(\\n string memory _templateTag,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external returns (uint256 templateId);\\n}\\n\",\"keccak256\":\"0x88b0038d226532e6cf862a485d162f7bca61ac3d361d6801146b55a240f091ac\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60c06040523480156200001157600080fd5b50604051620022c0380380620022c083398101604081905262000034916200020d565b33608052600080546001600160a01b0319166001600160a01b038816179055600162000061868262000376565b50600280546001600160a01b0319166001600160a01b03841690811790915560a08290526040516312a6505d60e21b8152634a99417490620000aa908790879060040162000470565b6020604051808303816000875af1158015620000ca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000f09190620004b0565b60035550620004ca945050505050565b6001600160a01b03811681146200011657600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200014c57818101518382015260200162000132565b50506000910152565b60006001600160401b038084111562000172576200017262000119565b604051601f8501601f19908116603f011681019082821181831017156200019d576200019d62000119565b81604052809350858152868686011115620001b757600080fd5b620001c78660208301876200012f565b5050509392505050565b600082601f830112620001e357600080fd5b620001f48383516020850162000155565b9392505050565b8051620002088162000100565b919050565b60008060008060008060c087890312156200022757600080fd5b8651620002348162000100565b60208801519096506001600160401b03808211156200025257600080fd5b818901915089601f8301126200026757600080fd5b620002788a83516020850162000155565b965060408901519150808211156200028f57600080fd5b6200029d8a838b01620001d1565b95506060890151915080821115620002b457600080fd5b50620002c389828a01620001d1565b935050620002d460808801620001fb565b915060a087015190509295509295509295565b600181811c90821680620002fc57607f821691505b6020821081036200031d57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200037157600081815260208120601f850160051c810160208610156200034c5750805b601f850160051c820191505b818110156200036d5782815560010162000358565b5050505b505050565b81516001600160401b0381111562000392576200039262000119565b620003aa81620003a38454620002e7565b8462000323565b602080601f831160018114620003e25760008415620003c95750858301515b600019600386901b1c1916600185901b1785556200036d565b600085815260208120601f198616915b828110156200041357888601518255948401946001909101908401620003f2565b5085821015620004325787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600081518084526200045c8160208601602086016200012f565b601f01601f19169290920160200192915050565b606081526000606082015260806020820152600062000493608083018562000442565b8281036040840152620004a7818562000442565b95945050505050565b600060208284031215620004c357600080fd5b5051919050565b60805160a051611da66200051a60003960008181610364015281816105490152610f16015260008181610157015281816108d201528181610abd01528181610cb501526111be0152611da66000f3fe6080604052600436106101405760003560e01c80637aa77f29116100b6578063d1e41b5d1161006f578063d1e41b5d146103a6578063e77d0bd3146103b9578063ee22610b146103d9578063ef48eee6146103f9578063fc548f0814610419578063fe43a9921461043957600080fd5b80637aa77f29146102d05780639ace38c2146102e6578063a0af81f01461031d578063a527aa6a1461033d578063b329036b14610352578063c5d552881461038657600080fd5b80632fbe3b03116101085780632fbe3b0314610210578063311a6c561461023d57806334e2672d1461025d5780633bf547241461027d5780634660ebbe146102905780636cc6cde1146102b057600080fd5b80630c340a24146101455780630c7ac7b6146101965780631bd1823a146101b85780632be6d005146101da5780632e0b6422146101ed575b600080fd5b34801561015157600080fd5b506101797f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101a257600080fd5b506101ab610459565b60405161018d919061169b565b3480156101c457600080fd5b506101d86101d33660046116b5565b6104e7565b005b6101d86101e83660046116b5565b610612565b3480156101f957600080fd5b50610202600281565b60405190815260200161018d565b34801561021c57600080fd5b5061020261022b3660046116b5565b60056020526000908152604090205481565b34801561024957600080fd5b506101d86102583660046116ce565b6107c0565b34801561026957600080fd5b506101d86102783660046116f0565b6108d0565b6101d861028b3660046116b5565b610926565b34801561029c57600080fd5b506101d86102ab36600461177a565b610abb565b3480156102bc57600080fd5b50600054610179906001600160a01b031681565b3480156102dc57600080fd5b5061020260035481565b3480156102f257600080fd5b506103066103013660046116b5565b610b26565b60405161018d9b9a999897969594939291906117ad565b34801561032957600080fd5b50600254610179906001600160a01b031681565b34801561034957600080fd5b50600454610202565b34801561035e57600080fd5b506102027f000000000000000000000000000000000000000000000000000000000000000081565b34801561039257600080fd5b506101d86103a13660046118e0565b610cb3565b6102026103b4366004611944565b610d78565b3480156103c557600080fd5b506101d86103d43660046116b5565b610eb4565b3480156103e557600080fd5b506101d86103f43660046116b5565b610fb7565b34801561040557600080fd5b506101d86104143660046116ce565b611088565b34801561042557600080fd5b506101d861043436600461177a565b6111bc565b34801561044557600080fd5b506101d86104543660046116ce565b611227565b60018054610466906119c4565b80601f0160208091040260200160405190810160405280929190818152602001828054610492906119c4565b80156104df5780601f106104b4576101008083540402835291602001916104df565b820191906000526020600020905b8154815290600101906020018083116104c257829003601f168201915b505050505081565b6000600482815481106104fc576104fc6119fe565b60009182526020909120600b9091020190506001600a82015460ff16600481111561052957610529611797565b1461054757604051635ed7670b60e11b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000008160070154426105789190611a2a565b101561059757604051634799187b60e01b815260040160405180910390fd5b6005810154156105d557805460058201546040516001600160a01b039092169181156108fc0291906000818181858888f15050600060058501555050505b6105e0826002611318565b60025b60405183907f89e6168584e1de3ec704ff46376271b5481b0d9b2b0ef0ae102f0d001093e00090600090a35050565b600060048281548110610627576106276119fe565b60009182526020909120600b9091020190506003600a82015460ff16600481111561065457610654611797565b106106725760405163df44e9d960e01b815260040160405180910390fd5b80546001600160a01b0316331461069c5760405163e2bc376b60e01b815260040160405180910390fd5b348160050160008282546106b09190611a43565b90915550506000805460405163f7434ea960e01b81526001600160a01b039091169063f7434ea9906106e790600190600401611ad3565b602060405180830381865afa158015610704573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107289190611ae6565b9050808260050154101561074f57604051631a48f3db60e11b815260040160405180910390fd5b42600783015560068201548111156107b157600a8201805460ff1916600290811790915560405184917fc74b9f7dedf2887cd3c113b6d8da9cea19e55c1116e25f1f0e1b72d7543179b5916107a49190611aff565b60405180910390a2505050565b6107bb8382611488565b505050565b6000546001600160a01b031633146107eb57604051630955f84760e31b815260040160405180910390fd5b600281111561080d576040516309efd47960e41b815260040160405180910390fd5b6000828152600560205260408120546004805491929183908110610833576108336119fe565b60009182526020909120600b9091020190506003600a82015460ff16600481111561086057610860611797565b1461087e5760405163f10068b560e01b815260040160405180910390fd5b60005460405184815285916001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a36108ca8284611318565b50505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633146109195760405163c383977560e01b815260040160405180910390fd5b60016107bb828483611b7c565b60006004828154811061093b5761093b6119fe565b60009182526020909120600b9091020190506003600a82015460ff16600481111561096857610968611797565b106109865760405163df44e9d960e01b815260040160405180910390fd5b60018101546001600160a01b031633146109b357604051635800797f60e11b815260040160405180910390fd5b348160060160008282546109c79190611a43565b90915550506000805460405163f7434ea960e01b81526001600160a01b039091169063f7434ea9906109fe90600190600401611ad3565b602060405180830381865afa158015610a1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3f9190611ae6565b90508082600601541015610a665760405163818d938f60e01b815260040160405180910390fd5b42600783015560058201548111156107b157600a8201805460ff1916600190811790915560405184917fc74b9f7dedf2887cd3c113b6d8da9cea19e55c1116e25f1f0e1b72d7543179b5916107a49190611aff565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163314610b045760405163c383977560e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60048181548110610b3657600080fd5b60009182526020909120600b90910201805460018201546002830154600384015460048501546005860154600687015460078801546008890180546001600160a01b03998a169b50989097169895979496939592949193909291610b99906119c4565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc5906119c4565b8015610c125780601f10610be757610100808354040283529160200191610c12565b820191906000526020600020905b815481529060010190602001808311610bf557829003601f168201915b505050505090806009018054610c27906119c4565b80601f0160208091040260200160405190810160405280929190818152602001828054610c53906119c4565b8015610ca05780601f10610c7557610100808354040283529160200191610ca0565b820191906000526020600020905b815481529060010190602001808311610c8357829003601f168201915b505050600a909301549192505060ff168b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163314610cfc5760405163c383977560e01b815260040160405180910390fd5b6002546040516312a6505d60e21b81526001600160a01b0390911690634a99417490610d2e9085908590600401611c37565b6020604051808303816000875af1158015610d4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d719190611ae6565b6003555050565b600480546001810182556000918252600b027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b810180546001600160a01b0319908116331782557f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c830180546001600160a01b0389169216919091179055347f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d90920191909155610e298642611a43565b600382015560088101610e3c8582611c73565b5060098101610e4b8482611c73565b50600454610e5b90600190611a2a565b9150846001600160a01b0316336001600160a01b0316837fe9097a4f4eddc0e5906640fcd9e1193c9db52771536ca4c8b06ab4c40aa045d234604051610ea391815260200190565b60405180910390a450949350505050565b600060048281548110610ec957610ec96119fe565b60009182526020909120600b9091020190506002600a82015460ff166004811115610ef657610ef6611797565b14610f1457604051638225aba560e01b815260040160405180910390fd5b7f0000000000000000000000000000000000000000000000000000000000000000816007015442610f459190611a2a565b1015610f6457604051634799187b60e01b815260040160405180910390fd5b600681015415610fa557600181015460068201546040516001600160a01b039092169181156108fc0291906000818181858888f15050600060068501555050505b610fb0826001611318565b60016105e3565b600060048281548110610fcc57610fcc6119fe565b90600052602060002090600b020190508060030154421015611001576040516302eb354360e41b815260040160405180910390fd5b6000600a82015460ff16600481111561101c5761101c611797565b1461103a57604051634e22597f60e11b815260040160405180910390fd5b600181015460028201546040516001600160a01b039092169181156108fc0291906000818181858888f15050600060028501819055600a8501805460ff1916600417905592506105e3915050565b60006004838154811061109d5761109d6119fe565b60009182526020909120600b9091020180549091506001600160a01b031633146110da5760405163e2bc376b60e01b815260040160405180910390fd5b6000600a82015460ff1660048111156110f5576110f5611797565b1461111357604051634e22597f60e11b815260040160405180910390fd5b8060020154821115611138576040516305aafecf60e01b815260040160405180910390fd5b60018101546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050818160020160008282546111789190611a2a565b90915550506040805183815233602082015284917fd1432ca9a38d944f01b256a411861b109bc4bfe200c40d7144e919a16b86a8a8910160405180910390a2505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633146112055760405163c383977560e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006004838154811061123c5761123c6119fe565b600091825260209091206001600b90920201908101549091506001600160a01b0316331461127d57604051635800797f60e11b815260040160405180910390fd5b6000600a82015460ff16600481111561129857611298611797565b146112b657604051634e22597f60e11b815260040160405180910390fd5b80600201548211156112db576040516305aafecf60e01b815260040160405180910390fd5b80546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050818160020160008282546111789190611a2a565b60006004838154811061132d5761132d6119fe565b60009182526020909120600b90910201905060018203611389578054600282015460058301546001600160a01b03909216916108fc9161136c91611a43565b6040518115909202916000818181858888f1935050505050611431565b600282036113b9576001810154600282015460068301546001600160a01b03909216916108fc9161136c91611a43565b60006002826002015483600501546113d19190611a43565b6113db9190611d2d565b82546040519192506001600160a01b03169082156108fc029083906000818181858888f150505060018401546040516001600160a01b03909116925083156108fc02915083906000818181858888f15050505050505b6000600282018190556005820181905560068201819055600a8201805460ff1916600417905560405160039185917f89e6168584e1de3ec704ff46376271b5481b0d9b2b0ef0ae102f0d001093e0009190a3505050565b60006004838154811061149d5761149d6119fe565b600091825260208220600a600b90920201908101805460ff19166003179055905460405163c13517e160e01b81529192506001600160a01b03169063c13517e19084906114f290600290600190600401611d4f565b60206040518083038185885af1158015611510573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115359190611ae6565b600482018181556000918252600560205260408083208690559054915460035491516001600160a01b03909116917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186916115a691888252602082015260606040820181905260009082015260800190565b60405180910390a381816005015411156115fe5760008282600501546115cc9190611a2a565b6005830184905582546040519192506001600160a01b03169082156108fc029083906000818181858888f15050505050505b81816006015411156107bb57600082826006015461161c9190611a2a565b6006830184905560018301546040519192506001600160a01b03169082156108fc029083906000818181858888f1505050505050505050565b6000815180845260005b8181101561167b5760208185018101518683018201520161165f565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006116ae6020830184611655565b9392505050565b6000602082840312156116c757600080fd5b5035919050565b600080604083850312156116e157600080fd5b50508035926020909101359150565b6000806020838503121561170357600080fd5b823567ffffffffffffffff8082111561171b57600080fd5b818501915085601f83011261172f57600080fd5b81358181111561173e57600080fd5b86602082850101111561175057600080fd5b60209290920196919550909350505050565b6001600160a01b038116811461177757600080fd5b50565b60006020828403121561178c57600080fd5b81356116ae81611762565b634e487b7160e01b600052602160045260246000fd5b600061016060018060a01b03808f168452808e166020850152508b60408401528a60608401528960808401528860a08401528760c08401528660e0840152806101008401526117fe81840187611655565b90508281036101208401526118138186611655565b9150506005831061182657611826611797565b826101408301529c9b505050505050505050505050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261186457600080fd5b813567ffffffffffffffff8082111561187f5761187f61183d565b604051601f8301601f19908116603f011681019082821181831017156118a7576118a761183d565b816040528381528660208588010111156118c057600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080604083850312156118f357600080fd5b823567ffffffffffffffff8082111561190b57600080fd5b61191786838701611853565b9350602085013591508082111561192d57600080fd5b5061193a85828601611853565b9150509250929050565b6000806000806080858703121561195a57600080fd5b84359350602085013561196c81611762565b9250604085013567ffffffffffffffff8082111561198957600080fd5b61199588838901611853565b935060608701359150808211156119ab57600080fd5b506119b887828801611853565b91505092959194509250565b600181811c908216806119d857607f821691505b6020821081036119f857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115611a3d57611a3d611a14565b92915050565b80820180821115611a3d57611a3d611a14565b60008154611a63816119c4565b808552602060018381168015611a805760018114611a9a57611ac8565b60ff1985168884015283151560051b880183019550611ac8565b866000528260002060005b85811015611ac05781548a8201860152908301908401611aa5565b890184019650505b505050505092915050565b6020815260006116ae6020830184611a56565b600060208284031215611af857600080fd5b5051919050565b6020810160038310611b1357611b13611797565b91905290565b601f8211156107bb57600081815260208120601f850160051c81016020861015611b405750805b601f850160051c820191505b81811015611b5f57828155600101611b4c565b505050505050565b600019600383901b1c191660019190911b1790565b67ffffffffffffffff831115611b9457611b9461183d565b611ba883611ba283546119c4565b83611b19565b6000601f841160018114611bd65760008515611bc45750838201355b611bce8682611b67565b845550611c30565b600083815260209020601f19861690835b82811015611c075786850135825560209485019460019092019101611be7565b5086821015611c245760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b6060815260006060820152608060208201526000611c586080830185611655565b8281036040840152611c6a8185611655565b95945050505050565b815167ffffffffffffffff811115611c8d57611c8d61183d565b611ca181611c9b84546119c4565b84611b19565b602080601f831160018114611cd05760008415611cbe5750858301515b611cc88582611b67565b865550611b5f565b600085815260208120601f198616915b82811015611cff57888601518255948401946001909101908401611ce0565b5085821015611d1d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082611d4a57634e487b7160e01b600052601260045260246000fd5b500490565b828152604060208201526000611d686040830184611a56565b94935050505056fea264697066735822122005b0699f8f6e4a5a2b7331292d34d72ef79a72fae2d7ed4c1c12fe8da221be2b64736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106101405760003560e01c80637aa77f29116100b6578063d1e41b5d1161006f578063d1e41b5d146103a6578063e77d0bd3146103b9578063ee22610b146103d9578063ef48eee6146103f9578063fc548f0814610419578063fe43a9921461043957600080fd5b80637aa77f29146102d05780639ace38c2146102e6578063a0af81f01461031d578063a527aa6a1461033d578063b329036b14610352578063c5d552881461038657600080fd5b80632fbe3b03116101085780632fbe3b0314610210578063311a6c561461023d57806334e2672d1461025d5780633bf547241461027d5780634660ebbe146102905780636cc6cde1146102b057600080fd5b80630c340a24146101455780630c7ac7b6146101965780631bd1823a146101b85780632be6d005146101da5780632e0b6422146101ed575b600080fd5b34801561015157600080fd5b506101797f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101a257600080fd5b506101ab610459565b60405161018d919061169b565b3480156101c457600080fd5b506101d86101d33660046116b5565b6104e7565b005b6101d86101e83660046116b5565b610612565b3480156101f957600080fd5b50610202600281565b60405190815260200161018d565b34801561021c57600080fd5b5061020261022b3660046116b5565b60056020526000908152604090205481565b34801561024957600080fd5b506101d86102583660046116ce565b6107c0565b34801561026957600080fd5b506101d86102783660046116f0565b6108d0565b6101d861028b3660046116b5565b610926565b34801561029c57600080fd5b506101d86102ab36600461177a565b610abb565b3480156102bc57600080fd5b50600054610179906001600160a01b031681565b3480156102dc57600080fd5b5061020260035481565b3480156102f257600080fd5b506103066103013660046116b5565b610b26565b60405161018d9b9a999897969594939291906117ad565b34801561032957600080fd5b50600254610179906001600160a01b031681565b34801561034957600080fd5b50600454610202565b34801561035e57600080fd5b506102027f000000000000000000000000000000000000000000000000000000000000000081565b34801561039257600080fd5b506101d86103a13660046118e0565b610cb3565b6102026103b4366004611944565b610d78565b3480156103c557600080fd5b506101d86103d43660046116b5565b610eb4565b3480156103e557600080fd5b506101d86103f43660046116b5565b610fb7565b34801561040557600080fd5b506101d86104143660046116ce565b611088565b34801561042557600080fd5b506101d861043436600461177a565b6111bc565b34801561044557600080fd5b506101d86104543660046116ce565b611227565b60018054610466906119c4565b80601f0160208091040260200160405190810160405280929190818152602001828054610492906119c4565b80156104df5780601f106104b4576101008083540402835291602001916104df565b820191906000526020600020905b8154815290600101906020018083116104c257829003601f168201915b505050505081565b6000600482815481106104fc576104fc6119fe565b60009182526020909120600b9091020190506001600a82015460ff16600481111561052957610529611797565b1461054757604051635ed7670b60e11b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000008160070154426105789190611a2a565b101561059757604051634799187b60e01b815260040160405180910390fd5b6005810154156105d557805460058201546040516001600160a01b039092169181156108fc0291906000818181858888f15050600060058501555050505b6105e0826002611318565b60025b60405183907f89e6168584e1de3ec704ff46376271b5481b0d9b2b0ef0ae102f0d001093e00090600090a35050565b600060048281548110610627576106276119fe565b60009182526020909120600b9091020190506003600a82015460ff16600481111561065457610654611797565b106106725760405163df44e9d960e01b815260040160405180910390fd5b80546001600160a01b0316331461069c5760405163e2bc376b60e01b815260040160405180910390fd5b348160050160008282546106b09190611a43565b90915550506000805460405163f7434ea960e01b81526001600160a01b039091169063f7434ea9906106e790600190600401611ad3565b602060405180830381865afa158015610704573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107289190611ae6565b9050808260050154101561074f57604051631a48f3db60e11b815260040160405180910390fd5b42600783015560068201548111156107b157600a8201805460ff1916600290811790915560405184917fc74b9f7dedf2887cd3c113b6d8da9cea19e55c1116e25f1f0e1b72d7543179b5916107a49190611aff565b60405180910390a2505050565b6107bb8382611488565b505050565b6000546001600160a01b031633146107eb57604051630955f84760e31b815260040160405180910390fd5b600281111561080d576040516309efd47960e41b815260040160405180910390fd5b6000828152600560205260408120546004805491929183908110610833576108336119fe565b60009182526020909120600b9091020190506003600a82015460ff16600481111561086057610860611797565b1461087e5760405163f10068b560e01b815260040160405180910390fd5b60005460405184815285916001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a36108ca8284611318565b50505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633146109195760405163c383977560e01b815260040160405180910390fd5b60016107bb828483611b7c565b60006004828154811061093b5761093b6119fe565b60009182526020909120600b9091020190506003600a82015460ff16600481111561096857610968611797565b106109865760405163df44e9d960e01b815260040160405180910390fd5b60018101546001600160a01b031633146109b357604051635800797f60e11b815260040160405180910390fd5b348160060160008282546109c79190611a43565b90915550506000805460405163f7434ea960e01b81526001600160a01b039091169063f7434ea9906109fe90600190600401611ad3565b602060405180830381865afa158015610a1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3f9190611ae6565b90508082600601541015610a665760405163818d938f60e01b815260040160405180910390fd5b42600783015560058201548111156107b157600a8201805460ff1916600190811790915560405184917fc74b9f7dedf2887cd3c113b6d8da9cea19e55c1116e25f1f0e1b72d7543179b5916107a49190611aff565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163314610b045760405163c383977560e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60048181548110610b3657600080fd5b60009182526020909120600b90910201805460018201546002830154600384015460048501546005860154600687015460078801546008890180546001600160a01b03998a169b50989097169895979496939592949193909291610b99906119c4565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc5906119c4565b8015610c125780601f10610be757610100808354040283529160200191610c12565b820191906000526020600020905b815481529060010190602001808311610bf557829003601f168201915b505050505090806009018054610c27906119c4565b80601f0160208091040260200160405190810160405280929190818152602001828054610c53906119c4565b8015610ca05780601f10610c7557610100808354040283529160200191610ca0565b820191906000526020600020905b815481529060010190602001808311610c8357829003601f168201915b505050600a909301549192505060ff168b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163314610cfc5760405163c383977560e01b815260040160405180910390fd5b6002546040516312a6505d60e21b81526001600160a01b0390911690634a99417490610d2e9085908590600401611c37565b6020604051808303816000875af1158015610d4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d719190611ae6565b6003555050565b600480546001810182556000918252600b027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b810180546001600160a01b0319908116331782557f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c830180546001600160a01b0389169216919091179055347f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d90920191909155610e298642611a43565b600382015560088101610e3c8582611c73565b5060098101610e4b8482611c73565b50600454610e5b90600190611a2a565b9150846001600160a01b0316336001600160a01b0316837fe9097a4f4eddc0e5906640fcd9e1193c9db52771536ca4c8b06ab4c40aa045d234604051610ea391815260200190565b60405180910390a450949350505050565b600060048281548110610ec957610ec96119fe565b60009182526020909120600b9091020190506002600a82015460ff166004811115610ef657610ef6611797565b14610f1457604051638225aba560e01b815260040160405180910390fd5b7f0000000000000000000000000000000000000000000000000000000000000000816007015442610f459190611a2a565b1015610f6457604051634799187b60e01b815260040160405180910390fd5b600681015415610fa557600181015460068201546040516001600160a01b039092169181156108fc0291906000818181858888f15050600060068501555050505b610fb0826001611318565b60016105e3565b600060048281548110610fcc57610fcc6119fe565b90600052602060002090600b020190508060030154421015611001576040516302eb354360e41b815260040160405180910390fd5b6000600a82015460ff16600481111561101c5761101c611797565b1461103a57604051634e22597f60e11b815260040160405180910390fd5b600181015460028201546040516001600160a01b039092169181156108fc0291906000818181858888f15050600060028501819055600a8501805460ff1916600417905592506105e3915050565b60006004838154811061109d5761109d6119fe565b60009182526020909120600b9091020180549091506001600160a01b031633146110da5760405163e2bc376b60e01b815260040160405180910390fd5b6000600a82015460ff1660048111156110f5576110f5611797565b1461111357604051634e22597f60e11b815260040160405180910390fd5b8060020154821115611138576040516305aafecf60e01b815260040160405180910390fd5b60018101546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050818160020160008282546111789190611a2a565b90915550506040805183815233602082015284917fd1432ca9a38d944f01b256a411861b109bc4bfe200c40d7144e919a16b86a8a8910160405180910390a2505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633146112055760405163c383977560e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006004838154811061123c5761123c6119fe565b600091825260209091206001600b90920201908101549091506001600160a01b0316331461127d57604051635800797f60e11b815260040160405180910390fd5b6000600a82015460ff16600481111561129857611298611797565b146112b657604051634e22597f60e11b815260040160405180910390fd5b80600201548211156112db576040516305aafecf60e01b815260040160405180910390fd5b80546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050818160020160008282546111789190611a2a565b60006004838154811061132d5761132d6119fe565b60009182526020909120600b90910201905060018203611389578054600282015460058301546001600160a01b03909216916108fc9161136c91611a43565b6040518115909202916000818181858888f1935050505050611431565b600282036113b9576001810154600282015460068301546001600160a01b03909216916108fc9161136c91611a43565b60006002826002015483600501546113d19190611a43565b6113db9190611d2d565b82546040519192506001600160a01b03169082156108fc029083906000818181858888f150505060018401546040516001600160a01b03909116925083156108fc02915083906000818181858888f15050505050505b6000600282018190556005820181905560068201819055600a8201805460ff1916600417905560405160039185917f89e6168584e1de3ec704ff46376271b5481b0d9b2b0ef0ae102f0d001093e0009190a3505050565b60006004838154811061149d5761149d6119fe565b600091825260208220600a600b90920201908101805460ff19166003179055905460405163c13517e160e01b81529192506001600160a01b03169063c13517e19084906114f290600290600190600401611d4f565b60206040518083038185885af1158015611510573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115359190611ae6565b600482018181556000918252600560205260408083208690559054915460035491516001600160a01b03909116917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e27186916115a691888252602082015260606040820181905260009082015260800190565b60405180910390a381816005015411156115fe5760008282600501546115cc9190611a2a565b6005830184905582546040519192506001600160a01b03169082156108fc029083906000818181858888f15050505050505b81816006015411156107bb57600082826006015461161c9190611a2a565b6006830184905560018301546040519192506001600160a01b03169082156108fc029083906000818181858888f1505050505050505050565b6000815180845260005b8181101561167b5760208185018101518683018201520161165f565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006116ae6020830184611655565b9392505050565b6000602082840312156116c757600080fd5b5035919050565b600080604083850312156116e157600080fd5b50508035926020909101359150565b6000806020838503121561170357600080fd5b823567ffffffffffffffff8082111561171b57600080fd5b818501915085601f83011261172f57600080fd5b81358181111561173e57600080fd5b86602082850101111561175057600080fd5b60209290920196919550909350505050565b6001600160a01b038116811461177757600080fd5b50565b60006020828403121561178c57600080fd5b81356116ae81611762565b634e487b7160e01b600052602160045260246000fd5b600061016060018060a01b03808f168452808e166020850152508b60408401528a60608401528960808401528860a08401528760c08401528660e0840152806101008401526117fe81840187611655565b90508281036101208401526118138186611655565b9150506005831061182657611826611797565b826101408301529c9b505050505050505050505050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261186457600080fd5b813567ffffffffffffffff8082111561187f5761187f61183d565b604051601f8301601f19908116603f011681019082821181831017156118a7576118a761183d565b816040528381528660208588010111156118c057600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080604083850312156118f357600080fd5b823567ffffffffffffffff8082111561190b57600080fd5b61191786838701611853565b9350602085013591508082111561192d57600080fd5b5061193a85828601611853565b9150509250929050565b6000806000806080858703121561195a57600080fd5b84359350602085013561196c81611762565b9250604085013567ffffffffffffffff8082111561198957600080fd5b61199588838901611853565b935060608701359150808211156119ab57600080fd5b506119b887828801611853565b91505092959194509250565b600181811c908216806119d857607f821691505b6020821081036119f857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115611a3d57611a3d611a14565b92915050565b80820180821115611a3d57611a3d611a14565b60008154611a63816119c4565b808552602060018381168015611a805760018114611a9a57611ac8565b60ff1985168884015283151560051b880183019550611ac8565b866000528260002060005b85811015611ac05781548a8201860152908301908401611aa5565b890184019650505b505050505092915050565b6020815260006116ae6020830184611a56565b600060208284031215611af857600080fd5b5051919050565b6020810160038310611b1357611b13611797565b91905290565b601f8211156107bb57600081815260208120601f850160051c81016020861015611b405750805b601f850160051c820191505b81811015611b5f57828155600101611b4c565b505050505050565b600019600383901b1c191660019190911b1790565b67ffffffffffffffff831115611b9457611b9461183d565b611ba883611ba283546119c4565b83611b19565b6000601f841160018114611bd65760008515611bc45750838201355b611bce8682611b67565b845550611c30565b600083815260209020601f19861690835b82811015611c075786850135825560209485019460019092019101611be7565b5086821015611c245760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b6060815260006060820152608060208201526000611c586080830185611655565b8281036040840152611c6a8185611655565b95945050505050565b815167ffffffffffffffff811115611c8d57611c8d61183d565b611ca181611c9b84546119c4565b84611b19565b602080601f831160018114611cd05760008415611cbe5750858301515b611cc88582611b67565b865550611b5f565b600085815260208120601f198616915b82811015611cff57888601518255948401946001909101908401611ce0565b5085821015611d1d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082611d4a57634e487b7160e01b600052601260045260246000fd5b500490565b828152604060208201526000611d686040830184611a56565b94935050505056fea264697066735822122005b0699f8f6e4a5a2b7331292d34d72ef79a72fae2d7ed4c1c12fe8da221be2b64736f6c63430008120033", + "devdoc": { + "details": "MultipleArbitrableTransaction contract that is compatible with V2. Adapted from https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTransaction.sol", + "events": { + "DisputeRequest(address,uint256,uint256,uint256,string)": { + "details": "To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.", + "params": { + "_arbitrableDisputeID": "The identifier of the dispute in the Arbitrable contract.", + "_arbitrator": "The arbitrator of the contract.", + "_externalDisputeID": "An identifier created outside Kleros by the protocol requesting arbitration.", + "_templateId": "The identifier of the dispute template. Should not be used with _templateUri.", + "_templateUri": "The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId." + } + }, + "HasToPayFee(uint256,uint8)": { + "details": "Indicate that a party has to pay a fee or would otherwise be considered as losing.", + "params": { + "_party": "The party who has to pay.", + "_transactionID": "The index of the transaction." + } + }, + "Payment(uint256,uint256,address)": { + "details": "To be emitted when a party pays or reimburses the other.", + "params": { + "_amount": "The amount paid.", + "_party": "The party that paid.", + "_transactionID": "The index of the transaction." + } + }, + "Ruling(address,uint256,uint256)": { + "details": "To be raised when a ruling is given.", + "params": { + "_arbitrator": "The arbitrator giving the ruling.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract.", + "_ruling": "The ruling which was given." + } + }, + "TransactionCreated(uint256,address,address,uint256)": { + "details": "Emitted when a transaction is created.", + "params": { + "_amount": "The initial amount in the transaction.", + "_buyer": "The address of the buyer.", + "_seller": "The address of the seller.", + "_transactionID": "The index of the transaction." + } + }, + "TransactionResolved(uint256,uint8)": { + "details": "To be emitted when a transaction is resolved, either by its execution, a timeout or because a ruling was enforced.", + "params": { + "_resolution": "Short description of what caused the transaction to be solved.", + "_transactionID": "The ID of the respective transaction." + } + } + }, + "kind": "dev", + "methods": { + "constructor": { + "details": "Constructor.", + "params": { + "_arbitrator": "The arbitrator of the contract.", + "_arbitratorExtraData": "Extra data for the arbitrator.", + "_feeTimeout": "Arbitration fee timeout for the parties.", + "_templateData": "The dispute template data.", + "_templateDataMappings": "The dispute template data mappings.", + "_templateRegistry": "The dispute template registry." + } + }, + "createTransaction(uint256,address,string,string)": { + "details": "Create a transaction.", + "params": { + "_seller": "The recipient of the transaction.", + "_templateData": "The dispute template data.", + "_templateDataMappings": "The dispute template data mappings.", + "_timeoutPayment": "Time after which a party can automatically execute the arbitrable transaction." + }, + "returns": { + "transactionID": "The index of the transaction." + } + }, + "executeTransaction(uint256)": { + "details": "Transfer the transaction's amount to the seller if the timeout has passed.", + "params": { + "_transactionID": "The index of the transaction." + } + }, + "getCountTransactions()": { + "details": "Getter to know the count of transactions.", + "returns": { + "_0": "The count of transactions." + } + }, + "pay(uint256,uint256)": { + "details": "Pay seller. To be called if the good or service is provided.", + "params": { + "_amount": "Amount to pay in wei.", + "_transactionID": "The index of the transaction." + } + }, + "payArbitrationFeeByBuyer(uint256)": { + "details": "Pay the arbitration fee to raise a dispute. To be called by the buyer. Note that the arbitrator can have createDispute throw, which will make this function throw and therefore lead to a party being timed-out. This is not a vulnerability as the arbitrator can rule in favor of one party anyway.", + "params": { + "_transactionID": "The index of the transaction." + } + }, + "payArbitrationFeeBySeller(uint256)": { + "details": "Pay the arbitration fee to raise a dispute. To be called by the seller. Note that this function mirrors payArbitrationFeeByBuyer.", + "params": { + "_transactionID": "The index of the transaction." + } + }, + "reimburse(uint256,uint256)": { + "details": "Reimburse buyer. To be called if the good or service can't be fully provided.", + "params": { + "_amountReimbursed": "Amount to reimburse in wei.", + "_transactionID": "The index of the transaction." + } + }, + "rule(uint256,uint256)": { + "details": "Give a ruling for a dispute. Must be called by the arbitrator to enforce the final ruling. The purpose of this function is to ensure that the address calling it has the right to rule on the contract.", + "params": { + "_disputeID": "ID of the dispute in the Arbitrator contract.", + "_ruling": "Ruling given by the arbitrator. Note that 0 is reserved for \"Refuse to arbitrate\"." + } + }, + "timeOutByBuyer(uint256)": { + "details": "Reimburse buyer if seller fails to pay the fee.", + "params": { + "_transactionID": "The index of the transaction." + } + }, + "timeOutBySeller(uint256)": { + "details": "Pay seller if buyer fails to pay the fee.", + "params": { + "_transactionID": "The index of the transaction." + } + } + }, + "title": "Escrow for a sale paid in ETH and no fees.", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 10600, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "arbitrator", + "offset": 0, + "slot": "0", + "type": "t_contract(IArbitratorV2)17049" + }, + { + "astId": 10602, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "arbitratorExtraData", + "offset": 0, + "slot": "1", + "type": "t_bytes_storage" + }, + { + "astId": 10605, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "templateRegistry", + "offset": 0, + "slot": "2", + "type": "t_contract(IDisputeTemplateRegistry)17216" + }, + { + "astId": 10607, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "templateId", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 10613, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "transactions", + "offset": 0, + "slot": "4", + "type": "t_array(t_struct(Transaction)10592_storage)dyn_storage" + }, + { + "astId": 10617, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "disputeIDtoTransactionID", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_uint256,t_uint256)" + } + ], + "types": { + "t_address_payable": { + "encoding": "inplace", + "label": "address payable", + "numberOfBytes": "20" + }, + "t_array(t_struct(Transaction)10592_storage)dyn_storage": { + "base": "t_struct(Transaction)10592_storage", + "encoding": "dynamic_array", + "label": "struct Escrow.Transaction[]", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(IArbitratorV2)17049": { + "encoding": "inplace", + "label": "contract IArbitratorV2", + "numberOfBytes": "20" + }, + "t_contract(IDisputeTemplateRegistry)17216": { + "encoding": "inplace", + "label": "contract IDisputeTemplateRegistry", + "numberOfBytes": "20" + }, + "t_enum(Status)10563": { + "encoding": "inplace", + "label": "enum Escrow.Status", + "numberOfBytes": "1" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Transaction)10592_storage": { + "encoding": "inplace", + "label": "struct Escrow.Transaction", + "members": [ + { + "astId": 10570, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "buyer", + "offset": 0, + "slot": "0", + "type": "t_address_payable" + }, + { + "astId": 10572, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "seller", + "offset": 0, + "slot": "1", + "type": "t_address_payable" + }, + { + "astId": 10574, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "amount", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 10576, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "deadline", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 10578, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "disputeID", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 10580, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "buyerFee", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 10582, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "sellerFee", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 10584, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "lastFeePaymentTime", + "offset": 0, + "slot": "7", + "type": "t_uint256" + }, + { + "astId": 10586, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "templateData", + "offset": 0, + "slot": "8", + "type": "t_string_storage" + }, + { + "astId": 10588, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "templateDataMappings", + "offset": 0, + "slot": "9", + "type": "t_string_storage" + }, + { + "astId": 10591, + "contract": "src/arbitration/arbitrables/Escrow.sol:Escrow", + "label": "status", + "offset": 0, + "slot": "10", + "type": "t_enum(Status)10563" + } + ], + "numberOfBytes": "352" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepolia/EvidenceModule.json b/contracts/deployments/arbitrumSepolia/EvidenceModule.json new file mode 100644 index 000000000..f81d1c2e9 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/EvidenceModule.json @@ -0,0 +1,268 @@ +{ + "address": "0xE4066AE16685F66e30fb22e932B67E49220095c0", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_party", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "Evidence", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "submitEvidence", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0xc0dc9ddb6305e5faf69723d411b02d67c7b2d641939ab09f7e5d991043a8e1a5", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xE4066AE16685F66e30fb22e932B67E49220095c0", + "transactionIndex": 1, + "gasUsed": "1846645", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x4295263357d24cb6387f113474c3facac7c919c2d0f83cffda4a68f4c6dfe72a", + "transactionHash": "0xc0dc9ddb6305e5faf69723d411b02d67c7b2d641939ab09f7e5d991043a8e1a5", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842810, + "transactionHash": "0xc0dc9ddb6305e5faf69723d411b02d67c7b2d641939ab09f7e5d991043a8e1a5", + "address": "0xE4066AE16685F66e30fb22e932B67E49220095c0", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x4295263357d24cb6387f113474c3facac7c919c2d0f83cffda4a68f4c6dfe72a" + } + ], + "blockNumber": 3842810, + "cumulativeGasUsed": "1846645", + "status": 1, + "byzantium": true + }, + "args": [ + "0xD8609345DEe222051337b3A8335581Cc630Df2E9", + "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59" + ] + }, + "implementation": "0xD8609345DEe222051337b3A8335581Cc630Df2E9", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepolia/EvidenceModule_Implementation.json b/contracts/deployments/arbitrumSepolia/EvidenceModule_Implementation.json new file mode 100644 index 000000000..8376e086c --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/EvidenceModule_Implementation.json @@ -0,0 +1,327 @@ +{ + "address": "0xD8609345DEe222051337b3A8335581Cc630Df2E9", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_party", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "Evidence", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_externalDisputeID", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_evidence", + "type": "string" + } + ], + "name": "submitEvidence", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x0fba45750c6620609060f6b657b04651dcdc727d19a21816f5273af6cae08d6d", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xD8609345DEe222051337b3A8335581Cc630Df2E9", + "transactionIndex": 1, + "gasUsed": "3591307", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000004000000001000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xe3b5e8d14614c7989abf188ab0d2b9b38f5a75592c1398024a80a5787a3ad177", + "transactionHash": "0x0fba45750c6620609060f6b657b04651dcdc727d19a21816f5273af6cae08d6d", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842806, + "transactionHash": "0x0fba45750c6620609060f6b657b04651dcdc727d19a21816f5273af6cae08d6d", + "address": "0xD8609345DEe222051337b3A8335581Cc630Df2E9", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 0, + "blockHash": "0xe3b5e8d14614c7989abf188ab0d2b9b38f5a75592c1398024a80a5787a3ad177" + } + ], + "blockNumber": 3842806, + "cumulativeGasUsed": "3591307", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_party\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"Evidence\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_evidence\",\"type\":\"string\"}],\"name\":\"submitEvidence\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"Evidence(uint256,address,string)\":{\"details\":\"To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\",\"params\":{\"_evidence\":\"IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'\",\"_externalDisputeID\":\"Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right external dispute ID.\",\"_party\":\"The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"initialize(address)\":{\"details\":\"Initializer.\",\"params\":{\"_governor\":\"The governor's address.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"submitEvidence(uint256,string)\":{\"details\":\"Submits evidence for a dispute.\",\"params\":{\"_evidence\":\"IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.\",\"_externalDisputeID\":\"Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID.\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"Evidence Module\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/evidence/EvidenceModule.sol\":\"EvidenceModule\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/evidence/EvidenceModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@jaybuidl, @fnanni-0]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n/// @custom:tools: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"../interfaces/IArbitratorV2.sol\\\";\\nimport \\\"../interfaces/IEvidence.sol\\\";\\nimport \\\"../../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../../proxy/Initializable.sol\\\";\\n\\n/// @title Evidence Module\\ncontract EvidenceModule is IEvidence, Initializable, UUPSProxiable {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The governor of the contract.\\n\\n // ************************************* //\\n // * Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer.\\n /// @param _governor The governor's address.\\n function initialize(address _governor) external reinitializer(1) {\\n governor = _governor;\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /**\\n * @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n /// @dev Submits evidence for a dispute.\\n /// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID.\\n /// @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.\\n function submitEvidence(uint256 _externalDisputeID, string calldata _evidence) external {\\n emit Evidence(_externalDisputeID, msg.sender, _evidence);\\n }\\n}\\n\",\"keccak256\":\"0x32d2c14255a266083094597f009f557e2db62727fb8a8fa9cf3f1760be58300c\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IEvidence.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n/// @title IEvidence\\ninterface IEvidence {\\n /// @dev To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).\\n /// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right external dispute ID.\\n /// @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.\\n /// @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'\\n event Evidence(uint256 indexed _externalDisputeID, address indexed _party, string _evidence);\\n}\\n\",\"keccak256\":\"0x3350da62267a5dad4616dafd9916fe3bfa4cdabfce124709ac3b7d087361e8c4\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060805234801561001457600080fd5b5061001d610022565b6100d3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff16156100715760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b03908116146100d05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6080516107896100fc6000396000818161011801528181610141015261033e01526107896000f3fe60806040526004361061004a5760003560e01c80630c340a241461004f5780634f1ef2861461008c57806352d1902d146100a1578063a6a7f0eb146100c4578063c4d66de8146100e4575b600080fd5b34801561005b57600080fd5b5060005461006f906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61009f61009a36600461055c565b610104565b005b3480156100ad57600080fd5b506100b6610331565b604051908152602001610083565b3480156100d057600080fd5b5061009f6100df36600461061e565b61038f565b3480156100f057600080fd5b5061009f6100ff36600461069a565b6103d8565b61010d826104c2565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061018b57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661017f6000805160206107348339815191525490565b6001600160a01b031614155b156101a95760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610203575060408051601f3d908101601f19168201909252610200918101906106bc565b60015b61023057604051630c76093760e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610734833981519152811461026157604051632a87526960e21b815260048101829052602401610227565b6000805160206107348339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a281511561032c576000836001600160a01b0316836040516102c891906106d5565b600060405180830381855af49150503d8060008114610303576040519150601f19603f3d011682016040523d82523d6000602084013e610308565b606091505b505090508061032a576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461037c5760405163703e46dd60e11b815260040160405180910390fd5b5060008051602061073483398151915290565b336001600160a01b0316837f39935cf45244bc296a03d6aef1cf17779033ee27090ce9c68d432367ce10699684846040516103cb929190610704565b60405180910390a3505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806104225750805467ffffffffffffffff808416911610155b1561043f5760405162dc149f60e41b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6000546001600160a01b031633146105275760405162461bcd60e51b815260206004820152602260248201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6044820152613c9760f11b6064820152608401610227565b50565b80356001600160a01b038116811461054157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561056f57600080fd5b6105788361052a565b9150602083013567ffffffffffffffff8082111561059557600080fd5b818501915085601f8301126105a957600080fd5b8135818111156105bb576105bb610546565b604051601f8201601f19908116603f011681019083821181831017156105e3576105e3610546565b816040528281528860208487010111156105fc57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008060006040848603121561063357600080fd5b83359250602084013567ffffffffffffffff8082111561065257600080fd5b818601915086601f83011261066657600080fd5b81358181111561067557600080fd5b87602082850101111561068757600080fd5b6020830194508093505050509250925092565b6000602082840312156106ac57600080fd5b6106b58261052a565b9392505050565b6000602082840312156106ce57600080fd5b5051919050565b6000825160005b818110156106f657602081860181015185830152016106dc565b506000920191825250919050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f1916010191905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220ca354c10b2e92a7809e892ebe3420a0270fe6b7b1718bfcaea15c6aba0a706ae64736f6c63430008120033", + "deployedBytecode": "0x60806040526004361061004a5760003560e01c80630c340a241461004f5780634f1ef2861461008c57806352d1902d146100a1578063a6a7f0eb146100c4578063c4d66de8146100e4575b600080fd5b34801561005b57600080fd5b5060005461006f906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61009f61009a36600461055c565b610104565b005b3480156100ad57600080fd5b506100b6610331565b604051908152602001610083565b3480156100d057600080fd5b5061009f6100df36600461061e565b61038f565b3480156100f057600080fd5b5061009f6100ff36600461069a565b6103d8565b61010d826104c2565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061018b57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661017f6000805160206107348339815191525490565b6001600160a01b031614155b156101a95760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610203575060408051601f3d908101601f19168201909252610200918101906106bc565b60015b61023057604051630c76093760e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610734833981519152811461026157604051632a87526960e21b815260048101829052602401610227565b6000805160206107348339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a281511561032c576000836001600160a01b0316836040516102c891906106d5565b600060405180830381855af49150503d8060008114610303576040519150601f19603f3d011682016040523d82523d6000602084013e610308565b606091505b505090508061032a576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461037c5760405163703e46dd60e11b815260040160405180910390fd5b5060008051602061073483398151915290565b336001600160a01b0316837f39935cf45244bc296a03d6aef1cf17779033ee27090ce9c68d432367ce10699684846040516103cb929190610704565b60405180910390a3505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806104225750805467ffffffffffffffff808416911610155b1561043f5760405162dc149f60e41b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6000546001600160a01b031633146105275760405162461bcd60e51b815260206004820152602260248201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6044820152613c9760f11b6064820152608401610227565b50565b80356001600160a01b038116811461054157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561056f57600080fd5b6105788361052a565b9150602083013567ffffffffffffffff8082111561059557600080fd5b818501915085601f8301126105a957600080fd5b8135818111156105bb576105bb610546565b604051601f8201601f19908116603f011681019083821181831017156105e3576105e3610546565b816040528281528860208487010111156105fc57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008060006040848603121561063357600080fd5b83359250602084013567ffffffffffffffff8082111561065257600080fd5b818601915086601f83011261066657600080fd5b81358181111561067557600080fd5b87602082850101111561068757600080fd5b6020830194508093505050509250925092565b6000602082840312156106ac57600080fd5b6106b58261052a565b9392505050565b6000602082840312156106ce57600080fd5b5051919050565b6000825160005b818110156106f657602081860181015185830152016106dc565b506000920191825250919050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f1916010191905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220ca354c10b2e92a7809e892ebe3420a0270fe6b7b1718bfcaea15c6aba0a706ae64736f6c63430008120033", + "devdoc": { + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "Evidence(uint256,address,string)": { + "details": "To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).", + "params": { + "_evidence": "IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'", + "_externalDisputeID": "Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right external dispute ID.", + "_party": "The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party." + } + }, + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "initialize(address)": { + "details": "Initializer.", + "params": { + "_governor": "The governor's address." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "submitEvidence(uint256,string)": { + "details": "Submits evidence for a dispute.", + "params": { + "_evidence": "IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.", + "_externalDisputeID": "Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "title": "Evidence Module", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 15567, + "contract": "src/arbitration/evidence/EvidenceModule.sol:EvidenceModule", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepolia/EvidenceModule_Proxy.json b/contracts/deployments/arbitrumSepolia/EvidenceModule_Proxy.json new file mode 100644 index 000000000..8a9a84793 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/EvidenceModule_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0xE4066AE16685F66e30fb22e932B67E49220095c0", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xc0dc9ddb6305e5faf69723d411b02d67c7b2d641939ab09f7e5d991043a8e1a5", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xE4066AE16685F66e30fb22e932B67E49220095c0", + "transactionIndex": 1, + "gasUsed": "1846645", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x4295263357d24cb6387f113474c3facac7c919c2d0f83cffda4a68f4c6dfe72a", + "transactionHash": "0xc0dc9ddb6305e5faf69723d411b02d67c7b2d641939ab09f7e5d991043a8e1a5", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842810, + "transactionHash": "0xc0dc9ddb6305e5faf69723d411b02d67c7b2d641939ab09f7e5d991043a8e1a5", + "address": "0xE4066AE16685F66e30fb22e932B67E49220095c0", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x4295263357d24cb6387f113474c3facac7c919c2d0f83cffda4a68f4c6dfe72a" + } + ], + "blockNumber": 3842810, + "cumulativeGasUsed": "1846645", + "status": 1, + "byzantium": true + }, + "args": [ + "0xD8609345DEe222051337b3A8335581Cc630Df2E9", + "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepolia/KlerosCore.json b/contracts/deployments/arbitrumSepolia/KlerosCore.json new file mode 100644 index 000000000..db32e8141 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/KlerosCore.json @@ -0,0 +1,1905 @@ +{ + "address": "0x33d0b8879368acD8ca868e656Ade97bB97b90468", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "AppealFeesNotEnough", + "type": "error" + }, + { + "inputs": [], + "name": "AppealPeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "ArbitrationFeesNotEnough", + "type": "error" + }, + { + "inputs": [], + "name": "ArraysLengthMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "CannotDisableClassicDK", + "type": "error" + }, + { + "inputs": [], + "name": "CommitPeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "DepthLevelMax", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeKitNotSupportedByCourt", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeKitOnly", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeNotAppealable", + "type": "error" + }, + { + "inputs": [], + "name": "DisputePeriodIsFinal", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeStillDrawing", + "type": "error" + }, + { + "inputs": [], + "name": "EvidenceNotPassedAndNotAppeal", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorOnly", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDisputKitParent", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidForkingCourtAsParent", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "MinStakeLowerThanParentCourt", + "type": "error" + }, + { + "inputs": [], + "name": "MustSupportDisputeKitClassic", + "type": "error" + }, + { + "inputs": [], + "name": "NotEvidencePeriod", + "type": "error" + }, + { + "inputs": [], + "name": "NotExecutionPeriod", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "RulingAlreadyExecuted", + "type": "error" + }, + { + "inputs": [], + "name": "SortitionModuleOnly", + "type": "error" + }, + { + "inputs": [], + "name": "StakingFailed", + "type": "error" + }, + { + "inputs": [], + "name": "TokenNotAccepted", + "type": "error" + }, + { + "inputs": [], + "name": "TransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "inputs": [], + "name": "UnsuccessfulCall", + "type": "error" + }, + { + "inputs": [], + "name": "UnsupportedDisputeKit", + "type": "error" + }, + { + "inputs": [], + "name": "VotePeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "WrongDisputeKitIndex", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "_accepted", + "type": "bool" + } + ], + "name": "AcceptedFeeToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "AppealDecision", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "AppealPossible", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_parent", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_supportedDisputeKits", + "type": "uint256[]" + } + ], + "name": "CourtCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_fromCourtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "_toCourtID", + "type": "uint96" + } + ], + "name": "CourtJump", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + } + ], + "name": "CourtModified", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IDisputeKit", + "name": "_disputeKitAddress", + "type": "address" + } + ], + "name": "DisputeKitCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bool", + "name": "_enable", + "type": "bool" + } + ], + "name": "DisputeKitEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_fromDisputeKitID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_toDisputeKitID", + "type": "uint256" + } + ], + "name": "DisputeKitJump", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "Draw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_pnkAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "LeftoverRewardSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "_rateInEth", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "_rateDecimals", + "type": "uint8" + } + ], + "name": "NewCurrencyRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum KlerosCore.Period", + "name": "_period", + "type": "uint8" + } + ], + "name": "NewPeriod", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_degreeOfCoherency", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "_pnkAmount", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "_feeAmount", + "type": "int256" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "TokenAndETHShift", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract IDisputeKit", + "name": "_disputeKitAddress", + "type": "address" + } + ], + "name": "addNewDisputeKit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "appeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "appealCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "appealPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_accepted", + "type": "bool" + } + ], + "name": "changeAcceptedFeeTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + } + ], + "name": "changeCourtParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "uint64", + "name": "_rateInEth", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "_rateDecimals", + "type": "uint8" + } + ], + "name": "changeCurrencyRates", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_jurorProsecutionModule", + "type": "address" + } + ], + "name": "changeJurorProsecutionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_pinakion", + "type": "address" + } + ], + "name": "changePinakion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISortitionModule", + "name": "_sortitionModule", + "type": "address" + } + ], + "name": "changeSortitionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_toToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountInEth", + "type": "uint256" + } + ], + "name": "convertEthToTokenAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "courts", + "outputs": [ + { + "internalType": "uint96", + "name": "parent", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_parent", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "internalType": "bytes", + "name": "_sortitionExtraData", + "type": "bytes" + }, + { + "internalType": "uint256[]", + "name": "_supportedDisputeKits", + "type": "uint256[]" + } + ], + "name": "createCourt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_feeAmount", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "currencyRates", + "outputs": [ + { + "internalType": "bool", + "name": "feePaymentAccepted", + "type": "bool" + }, + { + "internalType": "uint64", + "name": "rateInEth", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "rateDecimals", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "currentRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "bool", + "name": "overridden", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputeKits", + "outputs": [ + { + "internalType": "contract IDisputeKit", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "uint96", + "name": "courtID", + "type": "uint96" + }, + { + "internalType": "contract IArbitrableV2", + "name": "arbitrated", + "type": "address" + }, + { + "internalType": "enum KlerosCore.Period", + "name": "period", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "ruled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "lastPeriodChange", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256[]", + "name": "_disputeKitIDs", + "type": "uint256[]" + }, + { + "internalType": "bool", + "name": "_enable", + "type": "bool" + } + ], + "name": "enableDisputeKits", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "execute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeGovernorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "executeRuling", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getDisputeKitsLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "getNumberOfRounds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "getNumberOfVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_round", + "type": "uint256" + } + ], + "name": "getRoundInfo", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "disputeKitID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkAtStakePerJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalFeesForJurors", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "repartitions", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkPenalties", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "drawnJurors", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "sumFeeRewardPaid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sumPnkRewardPaid", + "type": "uint256" + }, + { + "internalType": "contract IERC20", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "drawIterations", + "type": "uint256" + } + ], + "internalType": "struct KlerosCore.Round", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "getTimesPerPeriod", + "outputs": [ + { + "internalType": "uint256[4]", + "name": "timesPerPeriod", + "type": "uint256[4]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_pinakion", + "type": "address" + }, + { + "internalType": "address", + "name": "_jurorProsecutionModule", + "type": "address" + }, + { + "internalType": "contract IDisputeKit", + "name": "_disputeKit", + "type": "address" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256[4]", + "name": "_courtParameters", + "type": "uint256[4]" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "internalType": "bytes", + "name": "_sortitionExtraData", + "type": "bytes" + }, + { + "internalType": "contract ISortitionModule", + "name": "_sortitionModuleAddress", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "isDisputeKitJumping", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + } + ], + "name": "isSupported", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "jurorProsecutionModule", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "passPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pinakion", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + } + ], + "name": "setStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_alreadyTransferred", + "type": "bool" + } + ], + "name": "setStakeBySortitionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sortitionModule", + "outputs": [ + { + "internalType": "contract ISortitionModule", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0xdddc8358282ebf57d1b6c4773e2625c66f633c4d7778898497aac375e08cf208", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x33d0b8879368acD8ca868e656Ade97bB97b90468", + "transactionIndex": 1, + "gasUsed": "2521724", + "logsBloom": "0x00000000000000000000000020000000000000000000000000000000020000000000000000000000000000000000000000000000800000000000000000040000000000000000000000000000000000000000000000040000000000000000000000000000020000000000000010000800402000000000000008000200000000000000000000000000000800000040000000000000000080000000000000100040000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000060000000001001000000000000000000000000000000000000000000000000000020", + "blockHash": "0x33061a26b14f447927e333d5cfb0fe66f5fc46977083a62edbc0a7a5d554a1fd", + "transactionHash": "0xdddc8358282ebf57d1b6c4773e2625c66f633c4d7778898497aac375e08cf208", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842840, + "transactionHash": "0xdddc8358282ebf57d1b6c4773e2625c66f633c4d7778898497aac375e08cf208", + "address": "0x33d0b8879368acD8ca868e656Ade97bB97b90468", + "topics": [ + "0x44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb2", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000008078c2a3bf93f6f69bdd4d38233e7e219ea1914e" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x33061a26b14f447927e333d5cfb0fe66f5fc46977083a62edbc0a7a5d554a1fd" + }, + { + "transactionIndex": 1, + "blockNumber": 3842840, + "transactionHash": "0xdddc8358282ebf57d1b6c4773e2625c66f633c4d7778898497aac375e08cf208", + "address": "0x33d0b8879368acD8ca868e656Ade97bB97b90468", + "topics": [ + "0x3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000", + "logIndex": 1, + "blockHash": "0x33061a26b14f447927e333d5cfb0fe66f5fc46977083a62edbc0a7a5d554a1fd" + }, + { + "transactionIndex": 1, + "blockNumber": 3842840, + "transactionHash": "0xdddc8358282ebf57d1b6c4773e2625c66f633c4d7778898497aac375e08cf208", + "address": "0x33d0b8879368acD8ca868e656Ade97bB97b90468", + "topics": [ + "0xb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc79", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000001" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0x33061a26b14f447927e333d5cfb0fe66f5fc46977083a62edbc0a7a5d554a1fd" + }, + { + "transactionIndex": 1, + "blockNumber": 3842840, + "transactionHash": "0xdddc8358282ebf57d1b6c4773e2625c66f633c4d7778898497aac375e08cf208", + "address": "0x33d0b8879368acD8ca868e656Ade97bB97b90468", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 3, + "blockHash": "0x33061a26b14f447927e333d5cfb0fe66f5fc46977083a62edbc0a7a5d554a1fd" + } + ], + "blockNumber": 3842840, + "cumulativeGasUsed": "2521724", + "status": 1, + "byzantium": true + }, + "args": [ + "0x6FDc191b55a03e840b36793e433A932EeCEa40BE", + "0x994b27af000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c5900000000000000000000000034b944d42cacfc8266955d07a80181d2054aa22500000000000000000000000000000000000000000000000000000000000000000000000000000000000000008078c2a3bf93f6f69bdd4d38233e7e219ea1914e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001e00000000000000000000000003645f9e08d80e47c82ad9e33fcb4ea703822c83100000000000000000000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "0x34B944D42cAcfC8266955D07A80181D2054aa225", + "0x0000000000000000000000000000000000000000", + "0x8078C2A3bf93f6f69BDD4D38233E7e219eA1914e", + false, + [ + { + "type": "BigNumber", + "hex": "0x0ad78ebc5ac6200000" + }, + 10000, + { + "type": "BigNumber", + "hex": "0x016345785d8a0000" + }, + 256 + ], + [ + 0, + 0, + 0, + 10 + ], + "0x05", + "0x3645F9e08D80E47c82aD9E33fCB4EA703822C831" + ] + }, + "implementation": "0x6FDc191b55a03e840b36793e433A932EeCEa40BE", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepolia/KlerosCore_Implementation.json b/contracts/deployments/arbitrumSepolia/KlerosCore_Implementation.json new file mode 100644 index 000000000..8dc47c9ab --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/KlerosCore_Implementation.json @@ -0,0 +1,2571 @@ +{ + "address": "0x6FDc191b55a03e840b36793e433A932EeCEa40BE", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "AppealFeesNotEnough", + "type": "error" + }, + { + "inputs": [], + "name": "AppealPeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "ArbitrationFeesNotEnough", + "type": "error" + }, + { + "inputs": [], + "name": "ArraysLengthMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "CannotDisableClassicDK", + "type": "error" + }, + { + "inputs": [], + "name": "CommitPeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "DepthLevelMax", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeKitNotSupportedByCourt", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeKitOnly", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeNotAppealable", + "type": "error" + }, + { + "inputs": [], + "name": "DisputePeriodIsFinal", + "type": "error" + }, + { + "inputs": [], + "name": "DisputeStillDrawing", + "type": "error" + }, + { + "inputs": [], + "name": "EvidenceNotPassedAndNotAppeal", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorOnly", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDisputKitParent", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidForkingCourtAsParent", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "MinStakeLowerThanParentCourt", + "type": "error" + }, + { + "inputs": [], + "name": "MustSupportDisputeKitClassic", + "type": "error" + }, + { + "inputs": [], + "name": "NotEvidencePeriod", + "type": "error" + }, + { + "inputs": [], + "name": "NotExecutionPeriod", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "RulingAlreadyExecuted", + "type": "error" + }, + { + "inputs": [], + "name": "SortitionModuleOnly", + "type": "error" + }, + { + "inputs": [], + "name": "StakingFailed", + "type": "error" + }, + { + "inputs": [], + "name": "TokenNotAccepted", + "type": "error" + }, + { + "inputs": [], + "name": "TransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "inputs": [], + "name": "UnsuccessfulCall", + "type": "error" + }, + { + "inputs": [], + "name": "UnsupportedDisputeKit", + "type": "error" + }, + { + "inputs": [], + "name": "VotePeriodNotPassed", + "type": "error" + }, + { + "inputs": [], + "name": "WrongDisputeKitIndex", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "_accepted", + "type": "bool" + } + ], + "name": "AcceptedFeeToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "AppealDecision", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "AppealPossible", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_parent", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "_supportedDisputeKits", + "type": "uint256[]" + } + ], + "name": "CourtCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_fromCourtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "_toCourtID", + "type": "uint96" + } + ], + "name": "CourtJump", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + } + ], + "name": "CourtModified", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + } + ], + "name": "DisputeCreation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IDisputeKit", + "name": "_disputeKitAddress", + "type": "address" + } + ], + "name": "DisputeKitCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bool", + "name": "_enable", + "type": "bool" + } + ], + "name": "DisputeKitEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_fromDisputeKitID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_toDisputeKitID", + "type": "uint256" + } + ], + "name": "DisputeKitJump", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_voteID", + "type": "uint256" + } + ], + "name": "Draw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_pnkAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_feeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "LeftoverRewardSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "_rateInEth", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "_rateDecimals", + "type": "uint8" + } + ], + "name": "NewCurrencyRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum KlerosCore.Period", + "name": "_period", + "type": "uint8" + } + ], + "name": "NewPeriod", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IArbitrableV2", + "name": "_arbitrable", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_ruling", + "type": "uint256" + } + ], + "name": "Ruling", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_roundID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_degreeOfCoherency", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "_pnkAmount", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "_feeAmount", + "type": "int256" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "TokenAndETHShift", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract IDisputeKit", + "name": "_disputeKitAddress", + "type": "address" + } + ], + "name": "addNewDisputeKit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "appeal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "appealCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "appealPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "arbitrationCost", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "_accepted", + "type": "bool" + } + ], + "name": "changeAcceptedFeeTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + } + ], + "name": "changeCourtParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "uint64", + "name": "_rateInEth", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "_rateDecimals", + "type": "uint8" + } + ], + "name": "changeCurrencyRates", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_jurorProsecutionModule", + "type": "address" + } + ], + "name": "changeJurorProsecutionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_pinakion", + "type": "address" + } + ], + "name": "changePinakion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISortitionModule", + "name": "_sortitionModule", + "type": "address" + } + ], + "name": "changeSortitionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_toToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountInEth", + "type": "uint256" + } + ], + "name": "convertEthToTokenAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "courts", + "outputs": [ + { + "internalType": "uint96", + "name": "parent", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "disabled", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_parent", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "_minStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_alpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_feeForJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_jurorsForCourtJump", + "type": "uint256" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "internalType": "bytes", + "name": "_sortitionExtraData", + "type": "bytes" + }, + { + "internalType": "uint256[]", + "name": "_supportedDisputeKits", + "type": "uint256[]" + } + ], + "name": "createCourt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numberOfChoices", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "contract IERC20", + "name": "_feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_feeAmount", + "type": "uint256" + } + ], + "name": "createDispute", + "outputs": [ + { + "internalType": "uint256", + "name": "disputeID", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "currencyRates", + "outputs": [ + { + "internalType": "bool", + "name": "feePaymentAccepted", + "type": "bool" + }, + { + "internalType": "uint64", + "name": "rateInEth", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "rateDecimals", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "currentRuling", + "outputs": [ + { + "internalType": "uint256", + "name": "ruling", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "tied", + "type": "bool" + }, + { + "internalType": "bool", + "name": "overridden", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputeKits", + "outputs": [ + { + "internalType": "contract IDisputeKit", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "disputes", + "outputs": [ + { + "internalType": "uint96", + "name": "courtID", + "type": "uint96" + }, + { + "internalType": "contract IArbitrableV2", + "name": "arbitrated", + "type": "address" + }, + { + "internalType": "enum KlerosCore.Period", + "name": "period", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "ruled", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "lastPeriodChange", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256[]", + "name": "_disputeKitIDs", + "type": "uint256[]" + }, + { + "internalType": "bool", + "name": "_enable", + "type": "bool" + } + ], + "name": "enableDisputeKits", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_round", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "execute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeGovernorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "executeRuling", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getDisputeKitsLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "getNumberOfRounds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "getNumberOfVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_round", + "type": "uint256" + } + ], + "name": "getRoundInfo", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "disputeKitID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkAtStakePerJuror", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalFeesForJurors", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "repartitions", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkPenalties", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "drawnJurors", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "sumFeeRewardPaid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sumPnkRewardPaid", + "type": "uint256" + }, + { + "internalType": "contract IERC20", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "drawIterations", + "type": "uint256" + } + ], + "internalType": "struct KlerosCore.Round", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "getTimesPerPeriod", + "outputs": [ + { + "internalType": "uint256[4]", + "name": "timesPerPeriod", + "type": "uint256[4]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_pinakion", + "type": "address" + }, + { + "internalType": "address", + "name": "_jurorProsecutionModule", + "type": "address" + }, + { + "internalType": "contract IDisputeKit", + "name": "_disputeKit", + "type": "address" + }, + { + "internalType": "bool", + "name": "_hiddenVotes", + "type": "bool" + }, + { + "internalType": "uint256[4]", + "name": "_courtParameters", + "type": "uint256[4]" + }, + { + "internalType": "uint256[4]", + "name": "_timesPerPeriod", + "type": "uint256[4]" + }, + { + "internalType": "bytes", + "name": "_sortitionExtraData", + "type": "bytes" + }, + { + "internalType": "contract ISortitionModule", + "name": "_sortitionModuleAddress", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "isDisputeKitJumping", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_disputeKitID", + "type": "uint256" + } + ], + "name": "isSupported", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "jurorProsecutionModule", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_disputeID", + "type": "uint256" + } + ], + "name": "passPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pinakion", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + } + ], + "name": "setStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_alreadyTransferred", + "type": "bool" + } + ], + "name": "setStakeBySortitionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sortitionModule", + "outputs": [ + { + "internalType": "contract ISortitionModule", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0xa88b6d1298fbab07692628798c10df1bc5d7168c2e181e08181d415736d983e5", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x6FDc191b55a03e840b36793e433A932EeCEa40BE", + "transactionIndex": 1, + "gasUsed": "26879050", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xcacbad42a73d1a07a55293c367068bee65b91117e38b672aa4c56752aa7f3413", + "transactionHash": "0xa88b6d1298fbab07692628798c10df1bc5d7168c2e181e08181d415736d983e5", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842836, + "transactionHash": "0xa88b6d1298fbab07692628798c10df1bc5d7168c2e181e08181d415736d983e5", + "address": "0x6FDc191b55a03e840b36793e433A932EeCEa40BE", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 0, + "blockHash": "0xcacbad42a73d1a07a55293c367068bee65b91117e38b672aa4c56752aa7f3413" + } + ], + "blockNumber": 3842836, + "cumulativeGasUsed": "26879050", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "e9fdf269c6fad89c4e78ca88d7e75f64", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AppealFeesNotEnough\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AppealPeriodNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ArbitrationFeesNotEnough\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ArraysLengthMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotDisableClassicDK\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CommitPeriodNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DepthLevelMax\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeKitNotSupportedByCourt\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeKitOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeNotAppealable\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputePeriodIsFinal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeStillDrawing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EvidenceNotPassedAndNotAppeal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDisputKitParent\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidForkingCourtAsParent\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MinStakeLowerThanParentCourt\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustSupportDisputeKitClassic\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotEvidencePeriod\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotExecutionPeriod\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RulingAlreadyExecuted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SortitionModuleOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StakingFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenNotAccepted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnsuccessfulCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnsupportedDisputeKit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VotePeriodNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongDisputeKitIndex\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"_accepted\",\"type\":\"bool\"}],\"name\":\"AcceptedFeeToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"AppealDecision\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"AppealPossible\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_parent\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"_supportedDisputeKits\",\"type\":\"uint256[]\"}],\"name\":\"CourtCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_fromCourtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"_toCourtID\",\"type\":\"uint96\"}],\"name\":\"CourtJump\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"}],\"name\":\"CourtModified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"}],\"name\":\"DisputeCreation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"contract IDisputeKit\",\"name\":\"_disputeKitAddress\",\"type\":\"address\"}],\"name\":\"DisputeKitCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"_enable\",\"type\":\"bool\"}],\"name\":\"DisputeKitEnabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_fromDisputeKitID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_toDisputeKitID\",\"type\":\"uint256\"}],\"name\":\"DisputeKitJump\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_voteID\",\"type\":\"uint256\"}],\"name\":\"Draw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_pnkAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"}],\"name\":\"LeftoverRewardSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"_rateInEth\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"_rateDecimals\",\"type\":\"uint8\"}],\"name\":\"NewCurrencyRate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum KlerosCore.Period\",\"name\":\"_period\",\"type\":\"uint8\"}],\"name\":\"NewPeriod\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitrableV2\",\"name\":\"_arbitrable\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_roundID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_degreeOfCoherency\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"_pnkAmount\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"_feeAmount\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"}],\"name\":\"TokenAndETHShift\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"contract IDisputeKit\",\"name\":\"_disputeKitAddress\",\"type\":\"address\"}],\"name\":\"addNewDisputeKit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"appeal\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"appealCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"appealPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"start\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"}],\"name\":\"arbitrationCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"arbitrationCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cost\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"_accepted\",\"type\":\"bool\"}],\"name\":\"changeAcceptedFeeTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"}],\"name\":\"changeCourtParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_rateInEth\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"_rateDecimals\",\"type\":\"uint8\"}],\"name\":\"changeCurrencyRates\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_jurorProsecutionModule\",\"type\":\"address\"}],\"name\":\"changeJurorProsecutionModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_pinakion\",\"type\":\"address\"}],\"name\":\"changePinakion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISortitionModule\",\"name\":\"_sortitionModule\",\"type\":\"address\"}],\"name\":\"changeSortitionModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_toToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amountInEth\",\"type\":\"uint256\"}],\"name\":\"convertEthToTokenAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"courts\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"parent\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"minStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"alpha\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeForJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"jurorsForCourtJump\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"disabled\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_parent\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"_minStake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_alpha\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_feeForJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_jurorsForCourtJump\",\"type\":\"uint256\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"internalType\":\"bytes\",\"name\":\"_sortitionExtraData\",\"type\":\"bytes\"},{\"internalType\":\"uint256[]\",\"name\":\"_supportedDisputeKits\",\"type\":\"uint256[]\"}],\"name\":\"createCourt\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_numberOfChoices\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"},{\"internalType\":\"contract IERC20\",\"name\":\"_feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_feeAmount\",\"type\":\"uint256\"}],\"name\":\"createDispute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"currencyRates\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"feePaymentAccepted\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"rateInEth\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"rateDecimals\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"currentRuling\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ruling\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"tied\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"overridden\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputeKits\",\"outputs\":[{\"internalType\":\"contract IDisputeKit\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputes\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"courtID\",\"type\":\"uint96\"},{\"internalType\":\"contract IArbitrableV2\",\"name\":\"arbitrated\",\"type\":\"address\"},{\"internalType\":\"enum KlerosCore.Period\",\"name\":\"period\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"ruled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"lastPeriodChange\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256[]\",\"name\":\"_disputeKitIDs\",\"type\":\"uint256[]\"},{\"internalType\":\"bool\",\"name\":\"_enable\",\"type\":\"bool\"}],\"name\":\"enableDisputeKits\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"execute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_destination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"executeGovernorProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"executeRuling\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDisputeKitsLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"getNumberOfRounds\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"getNumberOfVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_round\",\"type\":\"uint256\"}],\"name\":\"getRoundInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"disputeKitID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pnkAtStakePerJuror\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalFeesForJurors\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"repartitions\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pnkPenalties\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"drawnJurors\",\"type\":\"address[]\"},{\"internalType\":\"uint256\",\"name\":\"sumFeeRewardPaid\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sumPnkRewardPaid\",\"type\":\"uint256\"},{\"internalType\":\"contract IERC20\",\"name\":\"feeToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"drawIterations\",\"type\":\"uint256\"}],\"internalType\":\"struct KlerosCore.Round\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"getTimesPerPeriod\",\"outputs\":[{\"internalType\":\"uint256[4]\",\"name\":\"timesPerPeriod\",\"type\":\"uint256[4]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"_pinakion\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_jurorProsecutionModule\",\"type\":\"address\"},{\"internalType\":\"contract IDisputeKit\",\"name\":\"_disputeKit\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"_hiddenVotes\",\"type\":\"bool\"},{\"internalType\":\"uint256[4]\",\"name\":\"_courtParameters\",\"type\":\"uint256[4]\"},{\"internalType\":\"uint256[4]\",\"name\":\"_timesPerPeriod\",\"type\":\"uint256[4]\"},{\"internalType\":\"bytes\",\"name\":\"_sortitionExtraData\",\"type\":\"bytes\"},{\"internalType\":\"contract ISortitionModule\",\"name\":\"_sortitionModuleAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"isDisputeKitJumping\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_disputeKitID\",\"type\":\"uint256\"}],\"name\":\"isSupported\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"jurorProsecutionModule\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"}],\"name\":\"passPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pinakion\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_newStake\",\"type\":\"uint256\"}],\"name\":\"setStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_newStake\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"_alreadyTransferred\",\"type\":\"bool\"}],\"name\":\"setStakeBySortitionModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sortitionModule\",\"outputs\":[{\"internalType\":\"contract ISortitionModule\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"AcceptedFeeToken(address,bool)\":{\"details\":\"To be emitted when an ERC20 token is added or removed as a method to pay fees.\",\"params\":{\"_accepted\":\"Whether the token is accepted or not.\",\"_token\":\"The ERC20 token.\"}},\"DisputeCreation(uint256,address)\":{\"details\":\"To be emitted when a dispute is created.\",\"params\":{\"_arbitrable\":\"The contract which created the dispute.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\"}},\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"NewCurrencyRate(address,uint64,uint8)\":{\"details\":\"To be emitted when the fee for a particular ERC20 token is updated.\",\"params\":{\"_feeToken\":\"The ERC20 token.\",\"_rateDecimals\":\"The new decimals of the fee token rate.\",\"_rateInEth\":\"The new rate of the fee token in ETH.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrable\":\"The arbitrable receiving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"addNewDisputeKit(address)\":{\"details\":\"Add a new supported dispute kit module to the court.\",\"params\":{\"_disputeKitAddress\":\"The address of the dispute kit contract.\"}},\"appeal(uint256,uint256,bytes)\":{\"details\":\"Appeals the ruling of a specified dispute. Note: Access restricted to the Dispute Kit for this `disputeID`.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_extraData\":\"Extradata for the dispute. Can be required during court jump.\",\"_numberOfChoices\":\"Number of choices for the dispute. Can be required during court jump.\"}},\"appealCost(uint256)\":{\"details\":\"Gets the cost of appealing a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"cost\":\"The appeal cost.\"}},\"appealPeriod(uint256)\":{\"details\":\"Gets the start and the end of a specified dispute's current appeal period.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"end\":\"The end of the appeal period.\",\"start\":\"The start of the appeal period.\"}},\"arbitrationCost(bytes)\":{\"details\":\"Compute the cost of arbitration denominated in ETH. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\"},\"returns\":{\"cost\":\"The arbitration cost in ETH.\"}},\"arbitrationCost(bytes,address)\":{\"details\":\"Compute the cost of arbitration denominated in `_feeToken`. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\",\"_feeToken\":\"The ERC20 token used to pay fees.\"},\"returns\":{\"cost\":\"The arbitration cost in `_feeToken`.\"}},\"changeAcceptedFeeTokens(address,bool)\":{\"details\":\"Changes the supported fee tokens.\",\"params\":{\"_accepted\":\"Whether the token is supported or not as a method of fee payment.\",\"_feeToken\":\"The fee token.\"}},\"changeCurrencyRates(address,uint64,uint8)\":{\"details\":\"Changes the currency rate of a fee token.\",\"params\":{\"_feeToken\":\"The fee token.\",\"_rateDecimals\":\"The new decimals of the fee token rate.\",\"_rateInEth\":\"The new rate of the fee token in ETH.\"}},\"changeGovernor(address)\":{\"details\":\"Changes the `governor` storage variable.\",\"params\":{\"_governor\":\"The new value for the `governor` storage variable.\"}},\"changeJurorProsecutionModule(address)\":{\"details\":\"Changes the `jurorProsecutionModule` storage variable.\",\"params\":{\"_jurorProsecutionModule\":\"The new value for the `jurorProsecutionModule` storage variable.\"}},\"changePinakion(address)\":{\"details\":\"Changes the `pinakion` storage variable.\",\"params\":{\"_pinakion\":\"The new value for the `pinakion` storage variable.\"}},\"changeSortitionModule(address)\":{\"details\":\"Changes the `_sortitionModule` storage variable. Note that the new module should be initialized for all courts.\",\"params\":{\"_sortitionModule\":\"The new value for the `sortitionModule` storage variable.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"createCourt(uint96,bool,uint256,uint256,uint256,uint256,uint256[4],bytes,uint256[])\":{\"details\":\"Creates a court under a specified parent court.\",\"params\":{\"_alpha\":\"The `alpha` property value of the court.\",\"_feeForJuror\":\"The `feeForJuror` property value of the court.\",\"_hiddenVotes\":\"The `hiddenVotes` property value of the court.\",\"_jurorsForCourtJump\":\"The `jurorsForCourtJump` property value of the court.\",\"_minStake\":\"The `minStake` property value of the court.\",\"_parent\":\"The `parent` property value of the court.\",\"_sortitionExtraData\":\"Extra data for sortition module.\",\"_supportedDisputeKits\":\"Indexes of dispute kits that this court will support.\",\"_timesPerPeriod\":\"The `timesPerPeriod` property value of the court.\"}},\"createDispute(uint256,bytes)\":{\"details\":\"Create a dispute and pay for the fees in the native currency, typically ETH. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\",\"_numberOfChoices\":\"The number of choices the arbitrator can choose from in this dispute.\"},\"returns\":{\"disputeID\":\"The identifier of the dispute created.\"}},\"createDispute(uint256,bytes,address,uint256)\":{\"details\":\"Create a dispute and pay for the fees in a supported ERC20 token. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).\",\"params\":{\"_extraData\":\"Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\",\"_feeAmount\":\"Amount of the ERC20 token used to pay fees.\",\"_feeToken\":\"The ERC20 token used to pay fees.\",\"_numberOfChoices\":\"The number of choices the arbitrator can choose from in this dispute.\"},\"returns\":{\"disputeID\":\"The identifier of the dispute created.\"}},\"currentRuling(uint256)\":{\"details\":\"Gets the current ruling of a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"overridden\":\"Whether the ruling was overridden by appeal funding or not.\",\"ruling\":\"The current ruling.\",\"tied\":\"Whether it's a tie or not.\"}},\"draw(uint256,uint256)\":{\"details\":\"Draws jurors for the dispute. Can be called in parts.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_iterations\":\"The number of iterations to run.\"}},\"enableDisputeKits(uint96,uint256[],bool)\":{\"details\":\"Adds/removes court's support for specified dispute kits.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_disputeKitIDs\":\"The IDs of dispute kits which support should be added/removed.\",\"_enable\":\"Whether add or remove the dispute kits from the court.\"}},\"execute(uint256,uint256,uint256)\":{\"details\":\"Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\",\"_iterations\":\"The number of iterations to run.\",\"_round\":\"The appeal round.\"}},\"executeGovernorProposal(address,uint256,bytes)\":{\"details\":\"Allows the governor to call anything on behalf of the contract.\",\"params\":{\"_amount\":\"The value sent with the call.\",\"_data\":\"The data sent with the call.\",\"_destination\":\"The destination of the call.\"}},\"executeRuling(uint256)\":{\"details\":\"Executes a specified dispute's ruling.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"getNumberOfVotes(uint256)\":{\"details\":\"Gets the number of votes permitted for the specified dispute in the latest round.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"getTimesPerPeriod(uint96)\":{\"details\":\"Gets the timesPerPeriod array for a given court.\",\"params\":{\"_courtID\":\"The ID of the court to get the times from.\"},\"returns\":{\"timesPerPeriod\":\"The timesPerPeriod array for the given court.\"}},\"initialize(address,address,address,address,bool,uint256[4],uint256[4],bytes,address)\":{\"details\":\"Initializer (constructor equivalent for upgradable contracts).\",\"params\":{\"_courtParameters\":\"Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\",\"_disputeKit\":\"The address of the default dispute kit.\",\"_governor\":\"The governor's address.\",\"_hiddenVotes\":\"The `hiddenVotes` property value of the general court.\",\"_jurorProsecutionModule\":\"The address of the juror prosecution module.\",\"_pinakion\":\"The address of the token contract.\",\"_sortitionExtraData\":\"The extra data for sortition module.\",\"_sortitionModuleAddress\":\"The sortition module responsible for sortition of the jurors.\",\"_timesPerPeriod\":\"The `timesPerPeriod` property value of the general court.\"}},\"isDisputeKitJumping(uint256)\":{\"details\":\"Returns true if the dispute kit will be switched to a parent DK.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"},\"returns\":{\"_0\":\"Whether DK will be switched or not.\"}},\"passPeriod(uint256)\":{\"details\":\"Passes the period of a specified dispute.\",\"params\":{\"_disputeID\":\"The ID of the dispute.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"setStake(uint96,uint256)\":{\"details\":\"Sets the caller's stake in a court.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_newStake\":\"The new stake. Note that the existing delayed stake will be nullified as non-relevant.\"}},\"setStakeBySortitionModule(address,uint96,uint256,bool)\":{\"details\":\"Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.\",\"params\":{\"_account\":\"The account whose stake is being set.\",\"_alreadyTransferred\":\"Whether the PNKs have already been transferred to the contract.\",\"_courtID\":\"The ID of the court.\",\"_newStake\":\"The new stake.\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"KlerosCore Core arbitrator contract for Kleros v2. Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/KlerosCore.sol\":\"KlerosCore\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/KlerosCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"./interfaces/IArbitratorV2.sol\\\";\\nimport {IDisputeKit} from \\\"./interfaces/IDisputeKit.sol\\\";\\nimport {ISortitionModule} from \\\"./interfaces/ISortitionModule.sol\\\";\\nimport {SafeERC20, IERC20} from \\\"../libraries/SafeERC20.sol\\\";\\nimport {Constants} from \\\"../libraries/Constants.sol\\\";\\nimport {OnError} from \\\"../libraries/Types.sol\\\";\\nimport {UUPSProxiable} from \\\"../proxy/UUPSProxiable.sol\\\";\\nimport {Initializable} from \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title KlerosCore\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\ncontract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum PNKs needed to stake in the court.\\n uint256 alpha; // Basis point of PNKs that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court. Note that each court must support classic dispute kit.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrableV2 arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 pnkAtStakePerJuror; // The amount of PNKs at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 pnkPenalties; // The amount of PNKs collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumFeeRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumPnkRewardPaid; // Total sum of PNK paid to coherent jurors as a reward in this round.\\n IERC20 feeToken; // The token used for paying fees in this round.\\n uint256 drawIterations; // The number of iterations passed drawing the jurors for this round.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 pnkPenaltiesInRound; // The amount of PNKs collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n struct CurrencyRate {\\n bool feePaymentAccepted;\\n uint64 rateInEth;\\n uint8 rateDecimals;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 private constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 private constant NON_PAYABLE_AMOUNT = (2 ** 256 - 2) / 2; // An amount higher than the supply of ETH.\\n\\n address public governor; // The governor of the contract.\\n IERC20 public pinakion; // The Pinakion token contract.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n Court[] public courts; // The courts.\\n IDisputeKit[] public disputeKits; // Array of dispute kits.\\n Dispute[] public disputes; // The disputes.\\n mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(\\n uint96 indexed _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod\\n );\\n event DisputeKitCreated(uint256 indexed _disputeKitID, IDisputeKit indexed _disputeKitAddress);\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _pnkAmount,\\n int256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _pnkAmount,\\n uint256 _feeAmount,\\n IERC20 _feeToken\\n );\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _governor The governor's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n function initialize(\\n address _governor,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) external reinitializer(1) {\\n governor = _governor;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a dispute kit is not supported.\\n disputeKits.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKits.push(_disputeKit);\\n\\n emit DisputeKitCreated(Constants.DISPUTE_KIT_CLASSIC, _disputeKit);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(Constants.FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = Constants.FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(Constants.GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(Constants.GENERAL_COURT, Constants.DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /* @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n if (!success) revert UnsuccessfulCall();\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress) external onlyByGovernor {\\n uint256 disputeKitID = disputeKits.length;\\n disputeKits.push(_disputeKitAddress);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress);\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt();\\n if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit();\\n if (_parent == Constants.FORKING_COURT) revert InvalidForkingCourtAsParent();\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n // Check that Classic DK support was added.\\n if (!court.supportedDisputeKits[Constants.DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic();\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n function changeCourtParameters(\\n uint96 _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod\\n ) external onlyByGovernor {\\n Court storage court = courts[_courtID];\\n if (_courtID != Constants.GENERAL_COURT && courts[court.parent].minStake > _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n for (uint256 i = 0; i < court.children.length; i++) {\\n if (courts[court.children[i]].minStake < _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n }\\n court.minStake = _minStake;\\n court.hiddenVotes = _hiddenVotes;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(\\n _courtID,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod\\n );\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n // Classic dispute kit must be supported by all courts.\\n if (_disputeKitIDs[i] == Constants.DISPUTE_KIT_CLASSIC) {\\n revert CannotDisableClassicDK();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n /// @dev Changes the supported fee tokens.\\n /// @param _feeToken The fee token.\\n /// @param _accepted Whether the token is supported or not as a method of fee payment.\\n function changeAcceptedFeeTokens(IERC20 _feeToken, bool _accepted) external onlyByGovernor {\\n currencyRates[_feeToken].feePaymentAccepted = _accepted;\\n emit AcceptedFeeToken(_feeToken, _accepted);\\n }\\n\\n /// @dev Changes the currency rate of a fee token.\\n /// @param _feeToken The fee token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n function changeCurrencyRates(IERC20 _feeToken, uint64 _rateInEth, uint8 _rateDecimals) external onlyByGovernor {\\n currencyRates[_feeToken].rateInEth = _rateInEth;\\n currencyRates[_feeToken].rateDecimals = _rateDecimals;\\n emit NewCurrencyRate(_feeToken, _rateInEth, _rateDecimals);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// Note that the existing delayed stake will be nullified as non-relevant.\\n function setStake(uint96 _courtID, uint256 _newStake) external {\\n _setStake(msg.sender, _courtID, _newStake, false, OnError.Revert);\\n }\\n\\n /// @dev Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.\\n /// @param _account The account whose stake is being set.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs have already been transferred to the contract.\\n function setStakeBySortitionModule(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external {\\n if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly();\\n _setStake(_account, _courtID, _newStake, _alreadyTransferred, OnError.Return);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough();\\n\\n return _createDispute(_numberOfChoices, _extraData, Constants.NATIVE_CURRENCY, msg.value);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external override returns (uint256 disputeID) {\\n if (!currencyRates[_feeToken].feePaymentAccepted) revert TokenNotAccepted();\\n if (_feeAmount < arbitrationCost(_extraData, _feeToken)) revert ArbitrationFeesNotEnough();\\n\\n if (!_feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount)) revert TransferFailed();\\n return _createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount);\\n }\\n\\n function _createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) internal returns (uint256 disputeID) {\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n if (!courts[courtID].supportedDisputeKits[disputeKitID]) revert DisputeKitNotSupportedByCourt();\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrableV2(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKits[disputeKitID];\\n Court storage court = courts[dispute.courtID];\\n Round storage round = dispute.rounds.push();\\n\\n // Obtain the feeForJuror in the same currency as the _feeAmount\\n uint256 feeForJuror = (_feeToken == Constants.NATIVE_CURRENCY)\\n ? court.feeForJuror\\n : convertEthToTokenAmount(_feeToken, court.feeForJuror);\\n round.nbVotes = _feeAmount / feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = _feeAmount;\\n round.feeToken = IERC20(_feeToken);\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrableV2(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n if (\\n currentRound == 0 &&\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]\\n ) {\\n revert EvidenceNotPassedAndNotAppeal();\\n }\\n if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing();\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areCommitsAllCast(_disputeID)\\n ) {\\n revert CommitPeriodNotPassed();\\n }\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areVotesAllCast(_disputeID)\\n ) {\\n revert VotePeriodNotPassed();\\n }\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) {\\n revert AppealPeriodNotPassed();\\n }\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert DisputePeriodIsFinal();\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period != Period.evidence) revert NotEvidencePeriod();\\n\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 startIndex = round.drawIterations; // for gas: less storage reads\\n uint256 i;\\n while (i < _iterations && round.drawnJurors.length < round.nbVotes) {\\n address drawnAddress = disputeKit.draw(_disputeID, startIndex + i++);\\n if (drawnAddress == address(0)) {\\n continue;\\n }\\n sortitionModule.lockStake(drawnAddress, round.pnkAtStakePerJuror);\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n round.drawIterations += i;\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n if (msg.value < appealCost(_disputeID)) revert AppealFeesNotEnough();\\n\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.appeal) revert DisputeNotAppealable();\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n if (msg.sender != address(disputeKits[round.disputeKitID])) revert DisputeKitOnly();\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n // Switch to classic dispute kit if parent court doesn't support the current one.\\n newDisputeKitID = Constants.DISPUTE_KIT_CLASSIC;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKits[extraRound.disputeKitID].createDispute(\\n _disputeID,\\n _numberOfChoices,\\n _extraData,\\n extraRound.nbVotes\\n );\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n\\n Round storage round = dispute.rounds[_round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 pnkPenaltiesInRoundCache = round.pnkPenalties; // For saving gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect the PNK penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n pnkPenaltiesInRoundCache = _executePenalties(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n }\\n }\\n if (round.pnkPenalties != pnkPenaltiesInRoundCache) {\\n round.pnkPenalties = pnkPenaltiesInRoundCache; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return pnkPenaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.pnkAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.pnkPenaltiesInRound += penalty;\\n\\n // Unlock the PNKs affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n sortitionModule.unlockStake(account, penalty);\\n\\n // Apply the penalty to the staked PNKs.\\n sortitionModule.penalizeStake(account, penalty);\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n -int256(penalty),\\n 0,\\n round.feeToken\\n );\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(round.totalFeesForJurors);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, round.totalFeesForJurors);\\n }\\n pinakion.safeTransfer(governor, _params.pnkPenaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.pnkPenaltiesInRound,\\n round.totalFeesForJurors,\\n round.feeToken\\n );\\n }\\n return _params.pnkPenaltiesInRound;\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the PNKs of the juror for this round.\\n sortitionModule.unlockStake(account, pnkLocked);\\n\\n // Give back the locked PNKs in case the juror fully unstaked earlier.\\n if (!sortitionModule.isJurorStaked(account)) {\\n pinakion.safeTransfer(account, pnkLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumPnkRewardPaid += pnkReward;\\n uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumFeeRewardPaid += feeReward;\\n pinakion.safeTransfer(account, pnkReward);\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(account).send(feeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(account, feeReward);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(pnkReward),\\n int256(feeReward),\\n round.feeToken\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverPnkReward = _params.pnkPenaltiesInRound - round.sumPnkRewardPaid;\\n uint256 leftoverFeeReward = round.totalFeesForJurors - round.sumFeeRewardPaid;\\n if (leftoverPnkReward != 0 || leftoverFeeReward != 0) {\\n if (leftoverPnkReward != 0) {\\n pinakion.safeTransfer(governor, leftoverPnkReward);\\n }\\n if (leftoverFeeReward != 0) {\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(leftoverFeeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, leftoverFeeReward);\\n }\\n }\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n leftoverPnkReward,\\n leftoverFeeReward,\\n round.feeToken\\n );\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n if (dispute.ruled) revert RulingAlreadyExecuted();\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Compute the cost of arbitration denominated in ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) public view override returns (uint256 cost) {\\n cost = convertEthToTokenAmount(_feeToken, arbitrationCost(_extraData));\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == Constants.GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(uint256 _disputeID, uint256 _round) external view returns (Round memory) {\\n return disputes[_disputeID].rounds[_round];\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n timesPerPeriod = courts[_courtID].timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitsLength() external view returns (uint256) {\\n return disputeKits.length;\\n }\\n\\n function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) {\\n return (_amountInEth * 10 ** currencyRates[_toToken].rateDecimals) / currencyRates[_toToken].rateInEth;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support. Note that classic dispute kit should always be enabled.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev If called only once then set _onError to Revert, otherwise set it to Return\\n /// @param _account The account to set the stake for.\\n /// @param _courtID The ID of the court to set the stake for.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs were already transferred to/from the staking contract.\\n /// @param _onError Whether to revert or return false on error.\\n /// @return Whether the stake was successfully set or not.\\n function _setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred,\\n OnError _onError\\n ) internal returns (bool) {\\n if (_courtID == Constants.FORKING_COURT || _courtID > courts.length) {\\n _stakingFailed(_onError); // Staking directly into the forking court is not allowed.\\n return false;\\n }\\n if (_newStake != 0 && _newStake < courts[_courtID].minStake) {\\n _stakingFailed(_onError); // Staking less than the minimum stake is not allowed.\\n return false;\\n }\\n (uint256 pnkDeposit, uint256 pnkWithdrawal, bool sortitionSuccess) = sortitionModule.setStake(\\n _account,\\n _courtID,\\n _newStake,\\n _alreadyTransferred\\n );\\n if (!sortitionSuccess) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n if (pnkDeposit > 0) {\\n if (!pinakion.safeTransferFrom(_account, address(this), pnkDeposit)) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n }\\n if (pnkWithdrawal > 0) {\\n if (!pinakion.safeTransfer(_account, pnkWithdrawal)) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @dev It may revert depending on the _onError parameter.\\n function _stakingFailed(OnError _onError) internal pure {\\n if (_onError == OnError.Return) return;\\n revert StakingFailed();\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == Constants.FORKING_COURT || courtID >= courts.length) {\\n courtID = Constants.GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = Constants.DEFAULT_NB_OF_JURORS;\\n }\\n if (disputeKitID == Constants.NULL_DISPUTE_KIT || disputeKitID >= disputeKits.length) {\\n disputeKitID = Constants.DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = Constants.GENERAL_COURT;\\n minJurors = Constants.DEFAULT_NB_OF_JURORS;\\n disputeKitID = Constants.DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error DisputeKitOnly();\\n error SortitionModuleOnly();\\n error UnsuccessfulCall();\\n error InvalidDisputKitParent();\\n error DepthLevelMax();\\n error MinStakeLowerThanParentCourt();\\n error UnsupportedDisputeKit();\\n error InvalidForkingCourtAsParent();\\n error WrongDisputeKitIndex();\\n error CannotDisableClassicDK();\\n error ArraysLengthMismatch();\\n error StakingFailed();\\n error ArbitrationFeesNotEnough();\\n error DisputeKitNotSupportedByCourt();\\n error MustSupportDisputeKitClassic();\\n error TokenNotAccepted();\\n error EvidenceNotPassedAndNotAppeal();\\n error DisputeStillDrawing();\\n error CommitPeriodNotPassed();\\n error VotePeriodNotPassed();\\n error AppealPeriodNotPassed();\\n error NotEvidencePeriod();\\n error AppealFeesNotEnough();\\n error DisputeNotAppealable();\\n error NotExecutionPeriod();\\n error RulingAlreadyExecuted();\\n error DisputePeriodIsFinal();\\n error TransferFailed();\\n}\\n\",\"keccak256\":\"0x43205bc90f6965b5c1380effd2c29994f6dfea074696e39d5df037343a768d6b\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _juror Address of the juror.\\n /// @param _voteIDs The identifiers of the votes in the dispute.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event VoteCast(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256[] _voteIDs,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _nonce Nonce.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID, uint256 _nonce) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0x7fe6b1d9b991cc327cc5895f34208a7b1e3b6ebf8efb20fcb9f3ff0f40d2d209\",\"license\":\"MIT\"},\"src/arbitration/interfaces/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external returns (uint256 pnkDeposit, uint256 pnkWithdrawal, bool succeeded);\\n\\n function setJurorInactive(address _account) external;\\n\\n function lockStake(address _account, uint256 _relativeAmount) external;\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external;\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _nonce) external view returns (address);\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts);\\n\\n function getJurorCourtIDs(address _juror) external view returns (uint96[] memory);\\n\\n function isJurorStaked(address _juror) external view returns (bool);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0xa6d79053edfe04f7d3c8ad9b9ce3f182e45f2f74be40a77a304a93168549c474\",\"license\":\"MIT\"},\"src/libraries/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title Constants\\nlibrary Constants {\\n // Courts\\n uint96 internal constant FORKING_COURT = 0; // Index of the forking court.\\n uint96 internal constant GENERAL_COURT = 1; // Index of the default (general) court.\\n\\n // Dispute Kits\\n uint256 internal constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\n uint256 internal constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n\\n // Defaults\\n uint256 internal constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute.\\n IERC20 internal constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1.\\n}\\n\",\"keccak256\":\"0xc1dc3005bd8de9e68b6c8723db40e98c4c9d5e0c4ca444aa8f314866ebd9e73b\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"},\"src/libraries/Types.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nenum OnError {\\n Revert,\\n Return\\n}\\n\",\"keccak256\":\"0xc7deebd8227dfaa46a36ae8d2c24fe1b5d5c776ab963b44943829ab4058b5701\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000d9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff1615620000765760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b0390811614620000d65780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6080516154fb62000103600039600081816115020152818161152b015261172101526154fb6000f3fe6080604052600436106102665760003560e01c80638bb0487511610144578063d07368bd116100b6578063f6506db41161007a578063f6506db414610811578063f7434ea914610831578063fbb519e714610851578063fbf405b014610871578063fc6f8f1614610891578063fe524c39146108b157600080fd5b8063d07368bd1461077c578063d2b8035a1461079c578063d4d1d76a146107bc578063d98493f6146107d1578063e4c0aaf4146107f157600080fd5b8063b004963711610108578063b0049637146106d6578063c13517e1146106f6578063c258bb1914610709578063c356990214610729578063c71f42531461073c578063cf0c38f81461075c57600080fd5b80638bb0487514610621578063994b27af14610641578063a072b86c14610661578063acdbf51d14610681578063afe15cfb146106a157600080fd5b80633cfd1184116101dd578063751accd0116101a1578063751accd0146105545780637717a6e8146105745780637934c0be1461059457806382d02237146105b457806386541b24146105d45780638a9bb02a146105f457600080fd5b80633cfd1184146104ae5780634f1ef286146104db57806352d1902d146104ee578063564a565d1461050357806359ec827e1461053457600080fd5b80631860592b1161022f5780631860592b1461037257806319b81529146103a05780631c3db16d146103d05780631f5a0dd21461040d5780632d29a47b1461046e5780632e1daf2f1461048e57600080fd5b8062f5822c1461026b5780630219da791461028d5780630b7414bc146103055780630c340a2414610325578063115d537614610352575b600080fd5b34801561027757600080fd5b5061028b61028636600461467f565b6108d1565b005b34801561029957600080fd5b506102d86102a836600461467f565b60076020526000908152604090205460ff808216916001600160401b0361010082041691600160481b9091041683565b6040805193151584526001600160401b03909216602084015260ff16908201526060015b60405180910390f35b34801561031157600080fd5b5061028b610320366004614787565b61091e565b34801561033157600080fd5b50600054610345906001600160a01b031681565b6040516102fc91906147e8565b34801561035e57600080fd5b5061028b61036d3660046147fc565b610a5f565b34801561037e57600080fd5b5061039261038d366004614815565b610f91565b6040519081526020016102fc565b3480156103ac57600080fd5b506103c06103bb3660046147fc565b610feb565b60405190151581526020016102fc565b3480156103dc57600080fd5b506103f06103eb3660046147fc565b6110e4565b6040805193845291151560208401521515908201526060016102fc565b34801561041957600080fd5b5061042d6104283660046147fc565b6111e5565b604080516001600160601b0390981688529515156020880152948601939093526060850191909152608084015260a0830152151560c082015260e0016102fc565b34801561047a57600080fd5b5061028b610489366004614841565b611244565b34801561049a57600080fd5b50600354610345906001600160a01b031681565b3480156104ba57600080fd5b506104ce6104c936600461486d565b611484565b6040516102fc91906148ab565b61028b6104e9366004614928565b6114ee565b3480156104fa57600080fd5b50610392611714565b34801561050f57600080fd5b5061052361051e3660046147fc565b611772565b6040516102fc9594939291906149af565b34801561054057600080fd5b5061039261054f3660046147fc565b6117ce565b34801561056057600080fd5b5061028b61056f3660046149ee565b611923565b34801561058057600080fd5b5061028b61058f366004614a46565b6119cd565b3480156105a057600080fd5b5061028b6105af366004614a62565b6119db565b3480156105c057600080fd5b5061028b6105cf366004614a9b565b611a5a565b3480156105e057600080fd5b5061028b6105ef366004614b5a565b611b17565b34801561060057600080fd5b5061061461060f366004614bc8565b611cfe565b6040516102fc9190614c2e565b34801561062d57600080fd5b5061028b61063c3660046147fc565b611e8a565b34801561064d57600080fd5b5061028b61065c366004614cd3565b611fee565b34801561066d57600080fd5b5061028b61067c366004614da7565b6123a8565b34801561068d57600080fd5b5061034561069c3660046147fc565b61271a565b3480156106ad57600080fd5b506106c16106bc3660046147fc565b612744565b604080519283526020830191909152016102fc565b3480156106e257600080fd5b5061028b6106f136600461467f565b6127f0565b610392610704366004614e67565b61283d565b34801561071557600080fd5b5061028b61072436600461467f565b612875565b61028b610737366004614e97565b6128c2565b34801561074857600080fd5b506103926107573660046147fc565b612d96565b34801561076857600080fd5b50600254610345906001600160a01b031681565b34801561078857600080fd5b5061028b61079736600461467f565b612dfe565b3480156107a857600080fd5b5061028b6107b7366004614bc8565b612ea7565b3480156107c857600080fd5b50600554610392565b3480156107dd57600080fd5b506103926107ec366004614f18565b6131be565b3480156107fd57600080fd5b5061028b61080c36600461467f565b61320b565b34801561081d57600080fd5b5061039261082c366004614f63565b613258565b34801561083d57600080fd5b5061039261084c366004614fc9565b61333e565b34801561085d57600080fd5b5061028b61086c366004614ffd565b61338a565b34801561087d57600080fd5b50600154610345906001600160a01b031681565b34801561089d57600080fd5b506103926108ac3660046147fc565b6133ca565b3480156108bd57600080fd5b506103c06108cc366004614a46565b6133f9565b6000546001600160a01b031633146108fc5760405163c383977560e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146109495760405163c383977560e01b815260040160405180910390fd5b60005b8251811015610a595781156109e85782818151811061096d5761096d61504e565b6020026020010151600014806109a0575060055483518490839081106109955761099561504e565b602002602001015110155b156109be57604051633d58a98960e11b815260040160405180910390fd5b6109e3848483815181106109d4576109d461504e565b60200260200101516001613441565b610a47565b60018382815181106109fc576109fc61504e565b602002602001015103610a22576040516356d111fd60e11b815260040160405180910390fd5b610a4784848381518110610a3857610a3861504e565b60200260200101516000613441565b80610a518161507a565b91505061094c565b50505050565b600060068281548110610a7457610a7461504e565b600091825260208220600491820201805482549194506001600160601b0316908110610aa257610aa261504e565b6000918252602082206003850154600c909202019250610ac490600190615093565b90506000836003018281548110610add57610add61504e565b600091825260208220600b909102019150600185015460ff166004811115610b0757610b07614977565b03610be25781158015610b5657506001840154600684019060ff166004811115610b3357610b33614977565b60048110610b4357610b4361504e565b01546002850154610b549042615093565b105b15610b7457604051633e9727df60e01b815260040160405180910390fd5b6003810154600682015414610b9c576040516309e4486b60e41b815260040160405180910390fd5b8254600160601b900460ff16610bb3576002610bb6565b60015b60018086018054909160ff1990911690836004811115610bd857610bd8614977565b0217905550610f43565b60018085015460ff166004811115610bfc57610bfc614977565b03610d0c576001840154600684019060ff166004811115610c1f57610c1f614977565b60048110610c2f57610c2f61504e565b01546002850154610c409042615093565b108015610cd757506005816000015481548110610c5f57610c5f61504e565b600091825260209091200154604051630baa64d160e01b8152600481018790526001600160a01b0390911690630baa64d190602401602060405180830381865afa158015610cb1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd591906150a6565b155b15610cf557604051634dfa578560e11b815260040160405180910390fd5b6001808501805460029260ff199091169083610bd8565b6002600185015460ff166004811115610d2757610d27614977565b03610e75576001840154600684019060ff166004811115610d4a57610d4a614977565b60048110610d5a57610d5a61504e565b01546002850154610d6b9042615093565b108015610e0257506005816000015481548110610d8a57610d8a61504e565b6000918252602090912001546040516336a66c7560e11b8152600481018790526001600160a01b0390911690636d4cd8ea90602401602060405180830381865afa158015610ddc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0091906150a6565b155b15610e2057604051631988dead60e31b815260040160405180910390fd5b600184018054600360ff199091161790558354604051600160601b9091046001600160a01b03169086907fa5d41b970d849372be1da1481ffd78d162bfe57a7aa2fe4e5fb73481fa5ac24f90600090a3610f43565b6003600185015460ff166004811115610e9057610e90614977565b03610f0a576001840154600684019060ff166004811115610eb357610eb3614977565b60048110610ec357610ec361504e565b01546002850154610ed49042615093565b1015610ef357604051632f4dfd8760e01b815260040160405180910390fd5b6001808501805460049260ff199091169083610bd8565b6004600185015460ff166004811115610f2557610f25614977565b03610f43576040516307f38c8f60e11b815260040160405180910390fd5b426002850155600184015460405186917f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b9191610f829160ff16906150c3565b60405180910390a25050505050565b6001600160a01b03821660009081526007602052604081205461010081046001600160401b031690610fce90600160481b900460ff16600a6151b5565b610fd890846151c4565b610fe291906151f1565b90505b92915050565b600080600683815481106110015761100161504e565b600091825260208220600360049092020190810180549193509061102790600190615093565b815481106110375761103761504e565b600091825260208220845460048054600b909402909201945090916001600160601b0390911690811061106c5761106c61504e565b90600052602060002090600c0201905080600501548260030154101561109757506000949350505050565b80546004805490916001600160601b03169081106110b7576110b761504e565b6000918252602080832094548352600a600c9092029094010190925250604090205460ff16159392505050565b600080600080600685815481106110fd576110fd61504e565b600091825260208220600360049092020190810180549193509061112390600190615093565b815481106111335761113361504e565b90600052602060002090600b020190506000600582600001548154811061115c5761115c61504e565b600091825260209091200154604051631c3db16d60e01b8152600481018990526001600160a01b0390911691508190631c3db16d90602401606060405180830381865afa1580156111b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d59190615205565b9199909850909650945050505050565b600481815481106111f557600080fd5b60009182526020909120600c9091020180546002820154600383015460048401546005850154600b909501546001600160601b038516965060ff600160601b9095048516959394929391921687565b6000600684815481106112595761125961504e565b600091825260209091206004918202019150600182015460ff16600481111561128457611284614977565b146112a257604051638794ce4b60e01b815260040160405180910390fd5b60008160030184815481106112b9576112b961504e565b90600052602060002090600b02019050600060058260000154815481106112e2576112e261504e565b600091825260208220015460048401546001600160a01b0390911692509061130a868361523d565b6005850154600686015460405163368efae360e21b8152600481018c9052602481018b905292935090916000906001600160a01b0387169063da3beb8c90604401602060405180830381865afa158015611368573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138c9190615250565b9050806000036113a757818411156113a2578193505b6113c7565b6113b28260026151c4565b8411156113c7576113c48260026151c4565b93505b60048701849055845b84811015611463578281101561141c576114156040518060c001604052808e81526020018d8152602001848152602001858152602001868152602001838152506134c9565b9350611451565b6114516040518060c001604052808e81526020018d815260200184815260200185815260200186815260200183815250613986565b8061145b8161507a565b9150506113d0565b508287600501541461147757600587018390555b5050505050505050505050565b61148c6145bf565b6004826001600160601b0316815481106114a8576114a861504e565b6000918252602090912060408051608081019182905292600c029091016006019060049082845b8154815260200190600101908083116114cf5750505050509050919050565b6114f782613ea9565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061157557507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166115696000805160206154a68339815191525490565b6001600160a01b031614155b156115935760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156115ed575060408051601f3d908101601f191682019092526115ea91810190615250565b60015b6116155781604051630c76093760e01b815260040161160c91906147e8565b60405180910390fd5b6000805160206154a6833981519152811461164657604051632a87526960e21b81526004810182905260240161160c565b6000805160206154a68339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a281511561170f576000836001600160a01b0316836040516116ad919061528d565b600060405180830381855af49150503d80600081146116e8576040519150601f19603f3d011682016040523d82523d6000602084013e6116ed565b606091505b5050905080610a59576040516339b21b5d60e11b815260040160405180910390fd5b505050565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461175f5760405163703e46dd60e11b815260040160405180910390fd5b506000805160206154a683398151915290565b6006818154811061178257600080fd5b60009182526020909120600490910201805460018201546002909201546001600160601b0382169350600160601b9091046001600160a01b03169160ff80821692610100909204169085565b600080600683815481106117e4576117e461504e565b600091825260208220600360049092020190810180549193509061180a90600190615093565b8154811061181a5761181a61504e565b600091825260208220845460048054600b909402909201945090916001600160601b0390911690811061184f5761184f61504e565b90600052602060002090600c0201905080600501548260030154106118ee5782546001600160601b031660001901611890576001600160ff1b03935061191b565b60038201546118a09060026151c4565b6118ab90600161523d565b81546004805490916001600160601b03169081106118cb576118cb61504e565b90600052602060002090600c0201600401546118e791906151c4565b935061191b565b60038201546118fe9060026151c4565b61190990600161523d565b816004015461191891906151c4565b93505b505050919050565b6000546001600160a01b0316331461194e5760405163c383977560e01b815260040160405180910390fd5b6000836001600160a01b03168383604051611969919061528d565b60006040518083038185875af1925050503d80600081146119a6576040519150601f19603f3d011682016040523d82523d6000602084013e6119ab565b606091505b5050905080610a59576040516322092f2f60e11b815260040160405180910390fd5b61170f338383600080613ed7565b6000546001600160a01b03163314611a065760405163c383977560e01b815260040160405180910390fd5b6001600160a01b038216600081815260076020526040808220805460ff191685151590811790915590519092917f541615e167511d757a7067a700eb54431b256bb458dfdce0ac58bf2ed0aefd4491a35050565b6000546001600160a01b03163314611a855760405163c383977560e01b815260040160405180910390fd5b6001600160a01b038316600081815260076020908152604091829020805469ffffffffffffffffff0019166101006001600160401b03881690810260ff60481b191691909117600160481b60ff8816908102919091179092558351908152918201527fe6996b7f03e9bd02228b99d3d946932e3197f505f60542c4cfbc919441d8a4e6910160405180910390a2505050565b6000546001600160a01b03163314611b425760405163c383977560e01b815260040160405180910390fd5b60006004886001600160601b031681548110611b6057611b6061504e565b90600052602060002090600c0201905060016001600160601b0316886001600160601b031614158015611bc2575080546004805488926001600160601b0316908110611bae57611bae61504e565b90600052602060002090600c020160020154115b15611be057604051639717078960e01b815260040160405180910390fd5b60005b6001820154811015611c6557866004836001018381548110611c0757611c0761504e565b906000526020600020015481548110611c2257611c2261504e565b90600052602060002090600c0201600201541015611c5357604051639717078960e01b815260040160405180910390fd5b80611c5d8161507a565b915050611be3565b5060028101869055805460ff60601b1916600160601b8815150217815560038101859055600480820185905560058201849055611ca890600683019084906145dd565b50876001600160601b03167f709b1f5fda58af9a4f52dacd1ec404840a8148455700cce155a2bd8cf127ef1a888888888888604051611cec969594939291906152a9565b60405180910390a25050505050505050565b611d6460405180610160016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160608152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b60068381548110611d7757611d7761504e565b90600052602060002090600402016003018281548110611d9957611d9961504e565b90600052602060002090600b02016040518061016001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482015481526020016005820154815260200160068201805480602002602001604051908101604052809291908181526020018280548015611e4857602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611e2a575b5050509183525050600782015460208201526008820154604082015260098201546001600160a01b03166060820152600a909101546080909101529392505050565b600060068281548110611e9f57611e9f61504e565b600091825260209091206004918202019150600182015460ff166004811115611eca57611eca614977565b14611ee857604051638794ce4b60e01b815260040160405180910390fd5b6001810154610100900460ff1615611f135760405163c977f8d360e01b815260040160405180910390fd5b6000611f1e836110e4565b505060018301805461010061ff001990911617905582546040518281529192508491600160601b9091046001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a3815460405163188d362b60e11b81526004810185905260248101839052600160601b9091046001600160a01b03169063311a6c5690604401600060405180830381600087803b158015611fd157600080fd5b505af1158015611fe5573d6000803e3d6000fd5b50505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff1680612037575080546001600160401b03808416911610155b156120545760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b03831617600160401b178155600080546001600160a01b03808e166001600160a01b0319928316178355600180548e8316908416178155600280548e8416908516178155600380548985169086161790556005805481875291820190557f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db1018054928d1692909316821790925560405190927f44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb291a360048054600101815560008181526003546040516311de995760e21b81526001600160a01b039091169263477a655c9261215c929091899101615308565b600060405180830381600087803b15801561217657600080fd5b505af115801561218a573d6000803e3d6000fd5b5050600480546001810182556000918252600c027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160601b0319168155604080518381526020810190915290935091505080516121f891600184019160209091019061461b565b50805460ff60601b1916600160601b89151502178155865160028201556020870151600382015560408701516004808301919091556060880151600583015561224790600683019088906145dd565b506003546040516311de995760e21b81526001600160a01b039091169063477a655c9061227b906001908990600401615308565b600060405180830381600087803b15801561229557600080fd5b505af11580156122a9573d6000803e3d6000fd5b505082546001600160601b03169150600190507f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d8a8a600060200201518b600160200201518c600260200201518d600360200201518d600060405190808252806020026020018201604052801561232a578160200160208202803683370190505b5060405161233e9796959493929190615321565b60405180910390a36123536001806001613441565b50805460ff60401b191681556040516001600160401b03831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050505050505050565b6000546001600160a01b031633146123d35760405163c383977560e01b815260040160405180910390fd5b8660048a6001600160601b0316815481106123f0576123f061504e565b90600052602060002090600c020160020154111561242157604051639717078960e01b815260040160405180910390fd5b80516000036124435760405163402585f560e01b815260040160405180910390fd5b6001600160601b03891661246a57604051631ef4f64960e01b815260040160405180910390fd5b60048054600181018255600091825290600c82027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01905b8351811015612568578381815181106124bd576124bd61504e565b6020026020010151600014806124f0575060055484518590839081106124e5576124e561504e565b602002602001015110155b1561250e57604051633d58a98960e11b815260040160405180910390fd5b600182600a0160008684815181106125285761252861504e565b6020026020010151815260200190815260200160002060006101000a81548160ff02191690831515021790555080806125609061507a565b9150506124a2565b5060016000908152600a8201602052604090205460ff1661259c576040516306351b3d60e31b815260040160405180910390fd5b80546001600160601b0319166001600160601b038c1617815560408051600081526020810191829052516125d491600184019161461b565b50805460ff60601b1916600160601b8b151502178155600281018990556003810188905560048082018890556005820187905561261790600683019087906145dd565b506003546040516311de995760e21b81526001600160a01b039091169063477a655c9061264a9085908890600401615308565b600060405180830381600087803b15801561266457600080fd5b505af1158015612678573d6000803e3d6000fd5b5050505060048b6001600160601b0316815481106126985761269861504e565b600091825260208083206001600c909302018201805492830181558352909120018290556040516001600160601b038c169083907f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d90612705908e908e908e908e908e908e908d90615321565b60405180910390a35050505050505050505050565b6005818154811061272a57600080fd5b6000918252602090912001546001600160a01b0316905081565b60008060006006848154811061275c5761275c61504e565b6000918252602090912060049091020190506003600182015460ff16600481111561278957612789614977565b036127e1576002810154815460048054929550916001600160601b039091169081106127b7576127b761504e565b600091825260209091206009600c90920201015460028201546127da919061523d565b91506127ea565b60009250600091505b50915091565b6000546001600160a01b0316331461281b5760405163c383977560e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b60006128488261333e565b34101561286857604051630e3360f160e21b815260040160405180910390fd5b610fe28383600034614071565b6000546001600160a01b031633146128a05760405163c383977560e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6128cb836117ce565b3410156128eb57604051633191f8f160e01b815260040160405180910390fd5b6000600684815481106129005761290061504e565b6000918252602090912060049091020190506003600182015460ff16600481111561292d5761292d614977565b1461294b576040516337cdefcb60e21b815260040160405180910390fd5b6003810180546000919061296190600190615093565b815481106129715761297161504e565b90600052602060002090600b0201905060058160000154815481106129985761299861504e565b6000918252602090912001546001600160a01b031633146129cc5760405163065f245f60e01b815260040160405180910390fd5b8154815460038401805460018101825560009182526020909120600480546001600160601b0390951694600b9093029091019184908110612a0f57612a0f61504e565b90600052602060002090600c020160050154846003015410612b18576004836001600160601b031681548110612a4757612a4761504e565b60009182526020909120600c9091020154600480546001600160601b0390921694509084908110612a7a57612a7a61504e565b60009182526020808320858452600a600c90930201919091019052604090205460ff16612aa657600191505b84546001600160601b03848116911614612b1857845460038601546001600160601b0390911690612ad990600190615093565b6040516001600160601b03861681528a907f736e3f52761298c8c0823e1ebf482ed3c5ecb304f743d2d91a7c006e8e8d7a1f9060200160405180910390a45b84546001600160601b0319166001600160601b038416908117865560018601805460ff1916905542600287015560048054600092908110612b5b57612b5b61504e565b90600052602060002090600c02019050806004015434612b7b91906151f1565b826003018190555061271081600301548260020154612b9a91906151c4565b612ba491906151f1565b60018084019190915534600284015583835560038054908801546001600160a01b039091169163d09f392d918c91612bdb91615093565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381600087803b158015612c1957600080fd5b505af1158015612c2d573d6000803e3d6000fd5b505086548454149150612d1390505784546003870154612c4f90600190615093565b83546040519081528b907fcbe7939a71f0b369c7471d760a0a99b60b7bb010ee0406cba8a46679d1ea77569060200160405180910390a46005826000015481548110612c9d57612c9d61504e565b60009182526020909120015460038301546040516302dbb79560e61b81526001600160a01b039092169163b6ede54091612ce0918d918d918d919060040161539e565b600060405180830381600087803b158015612cfa57600080fd5b505af1158015612d0e573d6000803e3d6000fd5b505050505b8554604051600160601b9091046001600160a01b0316908a907f9c9b64db9e130f48381bf697abf638e73117dbfbfd7a4484f2da3ba188f4187d90600090a3887f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b916000604051612d8391906150c3565b60405180910390a2505050505050505050565b60008060068381548110612dac57612dac61504e565b906000526020600020906004020190508060030160018260030180549050612dd49190615093565b81548110612de457612de461504e565b90600052602060002090600b020160030154915050919050565b6000546001600160a01b03163314612e295760405163c383977560e01b815260040160405180910390fd5b6005805460018101825560009182527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0810180546001600160a01b0319166001600160a01b0385169081179091556040519192909183917f44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb291a35050565b600060068381548110612ebc57612ebc61504e565b90600052602060002090600402019050600060018260030180549050612ee29190615093565b90506000826003018281548110612efb57612efb61504e565b600091825260208220600b909102019150600184015460ff166004811115612f2557612f25614977565b14612f4357604051638285c4ef60e01b815260040160405180910390fd5b60006005826000015481548110612f5c57612f5c61504e565b6000918252602082200154600a8401546001600160a01b039091169250905b8681108015612f91575060038401546006850154105b1561319b5760006001600160a01b03841663d2b8035a8a84612fb28161507a565b9550612fbe908761523d565b6040516001600160e01b031960e085901b168152600481019290925260248201526044016020604051808303816000875af1158015613001573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061302591906153ce565b90506001600160a01b03811661303b5750612f7b565b60035460018601546040516310f0b12f60e11b81526001600160a01b03909216916321e1625e91613071918591906004016153eb565b600060405180830381600087803b15801561308b57600080fd5b505af115801561309f573d6000803e3d6000fd5b50505060068601546040518b92506001600160a01b038416917f6119cf536152c11e0a9a6c22f3953ce4ecc93ee54fa72ffa326ffabded21509b916130ec918b8252602082015260400190565b60405180910390a36006850180546001810182556000828152602090200180546001600160a01b0319166001600160a01b038416179055600386015490540361319557600354604051632e96bc2360e11b8152600481018b9052602481018890526001600160a01b0390911690635d2d784690604401600060405180830381600087803b15801561317c57600080fd5b505af1158015613190573d6000803e3d6000fd5b505050505b50612f7b565b8084600a0160008282546131af919061523d565b90915550505050505050505050565b60006132038261038d86868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061333e92505050565b949350505050565b6000546001600160a01b031633146132365760405163c383977560e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03821660009081526007602052604081205460ff166132915760405163e51cf7bf60e01b815260040160405180910390fd5b61329c8585856131be565b8210156132bc57604051630e3360f160e21b815260040160405180910390fd5b6132d16001600160a01b03841633308561435a565b6132ee576040516312171d8360e31b815260040160405180910390fd5b6133328686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508892508791506140719050565b90505b95945050505050565b600080600061334c84614436565b5091509150806004836001600160601b03168154811061336e5761336e61504e565b90600052602060002090600c02016004015461320391906151c4565b6003546001600160a01b031633146133b557604051639d6cab9960e01b815260040160405180910390fd5b6133c3848484846001613ed7565b5050505050565b6000600682815481106133df576133df61504e565b600091825260209091206003600490920201015492915050565b60006004836001600160601b0316815481106134175761341761504e565b60009182526020808320948352600c91909102909301600a0190925250604090205460ff16919050565b806004846001600160601b03168154811061345e5761345e61504e565b60009182526020808320868452600c92909202909101600a0190526040808220805460ff19169315159390931790925590518215159184916001600160601b038716917fb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc7991a4505050565b60008060068360000151815481106134e3576134e361504e565b9060005260206000209060040201905060008160030184602001518154811061350e5761350e61504e565b90600052602060002090600b02019050600060058260000154815481106135375761353761504e565b60009182526020808320919091015487519188015160a0890151604051634fe264fb60e01b81526004810194909452602484019190915260448301526001600160a01b031692508290634fe264fb90606401602060405180830381865afa1580156135a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135ca9190615250565b90506127108111156135db57506127105b60006127106135ea8382615093565b85600101546135f991906151c4565b61360391906151f1565b90508087608001818151613617919061523d565b90525060a08701516006850180546000929081106136375761363761504e565b60009182526020909120015460035460405163965af6c760e01b81526001600160a01b03928316935091169063965af6c79061367990849086906004016153eb565b600060405180830381600087803b15801561369357600080fd5b505af11580156136a7573d6000803e3d6000fd5b5050600354604051633c85b79360e21b81526001600160a01b03909116925063f216de4c91506136dd90849086906004016153eb565b600060405180830381600087803b1580156136f757600080fd5b505af115801561370b573d6000803e3d6000fd5b50505050602088015188516001600160a01b0383167f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e78661374b87615404565b60098b015460405161376d9392916000916001600160a01b0390911690615420565b60405180910390a48751602089015160a08a015160405163ba66fde760e01b81526004810193909352602483019190915260448201526001600160a01b0385169063ba66fde790606401602060405180830381865afa1580156137d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137f891906150a6565b61385f5760035460405163b5d69e9960e01b81526001600160a01b039091169063b5d69e999061382c9084906004016147e8565b600060405180830381600087803b15801561384657600080fd5b505af115801561385a573d6000803e3d6000fd5b505050505b600188606001516138709190615093565b8860a0015114801561388457506040880151155b156139755760098501546001600160a01b03166138cd576000805460028701546040516001600160a01b039092169281156108fc029290818181858888f19350505050506138f4565b600054600286015460098701546138f2926001600160a01b03918216929116906144bd565b505b6000546080890151600154613917926001600160a01b03918216929116906144bd565b506020880151885160808a0151600288015460098901546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf49361396c93909290916001600160a01b0390911690615444565b60405180910390a35b505050608090940151949350505050565b6000600682600001518154811061399f5761399f61504e565b906000526020600020906004020190506000816003018360200151815481106139ca576139ca61504e565b90600052602060002090600b02019050600060058260000154815481106139f3576139f361504e565b6000918252602080832090910154865191870151606088015160a08901516001600160a01b0390931695508593634fe264fb93909291613a3291615463565b6040516001600160e01b031960e086901b168152600481019390935260248301919091526044820152606401602060405180830381865afa158015613a7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a9f9190615250565b9050612710811115613ab057506127105b60008360060186606001518760a00151613aca9190615463565b81548110613ada57613ada61504e565b600091825260208220015460018601546001600160a01b03909116925061271090613b069085906151c4565b613b1091906151f1565b60035460405163965af6c760e01b81529192506001600160a01b03169063965af6c790613b4390859085906004016153eb565b600060405180830381600087803b158015613b5d57600080fd5b505af1158015613b71573d6000803e3d6000fd5b5050600354604051636624192f60e01b81526001600160a01b039091169250636624192f9150613ba59085906004016147e8565b602060405180830381865afa158015613bc2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613be691906150a6565b613c0357600154613c01906001600160a01b031683836144bd565b505b60006127108489604001518a60800151613c1d91906151f1565b613c2791906151c4565b613c3191906151f1565b905080866008016000828254613c47919061523d565b925050819055506000612710858a604001518960020154613c6891906151f1565b613c7291906151c4565b613c7c91906151f1565b905080876007016000828254613c92919061523d565b9091555050600154613cae906001600160a01b031685846144bd565b5060098701546001600160a01b0316613cec576040516001600160a01b0385169082156108fc029083906000818181858888f1935050505050613d07565b6009870154613d05906001600160a01b031685836144bd565b505b6020890151895160098901546040516001600160a01b03888116927f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e792613d57928c928a928a9290911690615420565b60405180910390a4600189606001516002613d7291906151c4565b613d7c9190615093565b8960a0015103613e9e57600087600801548a60800151613d9c9190615093565b9050600088600701548960020154613db49190615093565b905081151580613dc357508015155b15611477578115613ded57600054600154613deb916001600160a01b039182169116846144bd565b505b8015613e545760098901546001600160a01b0316613e3357600080546040516001600160a01b039091169183156108fc02918491818181858888f1935050505050613e54565b60005460098a0154613e52916001600160a01b039182169116836144bd565b505b60208b01518b5160098b01546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf49161270591879187916001600160a01b0390911690615444565b505050505050505050565b6000546001600160a01b03163314613ed45760405163c383977560e01b815260040160405180910390fd5b50565b60006001600160601b0385161580613ef957506004546001600160601b038616115b15613f0f57613f078261458a565b506000613335565b8315801590613f4a57506004856001600160601b031681548110613f3557613f3561504e565b90600052602060002090600c02016002015484105b15613f5857613f078261458a565b600354604051630a5861b960e41b81526001600160a01b0388811660048301526001600160601b0388166024830152604482018790528515156064830152600092839283929091169063a5861b90906084016060604051808303816000875af1158015613fc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fed9190615477565b9250925092508061400d576140018561458a565b60009350505050613335565b82156140385760015461402b906001600160a01b03168a308661435a565b614038576140018561458a565b811561406257600154614055906001600160a01b03168a846144bd565b614062576140018561458a565b50600198975050505050505050565b600080600061407f86614436565b92505091506004826001600160601b0316815481106140a0576140a061504e565b60009182526020808320848452600a600c90930201919091019052604090205460ff166140e05760405163b34eb75d60e01b815260040160405180910390fd5b600680546001810182556000918252600160601b33026001600160601b03851617600482027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f8101918255427ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d4190910155600580549296509092918490811061416b5761416b61504e565b60009182526020822001548354600480546001600160a01b039093169450916001600160601b039091169081106141a4576141a461504e565b60009182526020808320600387018054600181018255908552918420600c909302019350600b0201906001600160a01b038a16156141ef576141ea8a8460040154610f91565b6141f5565b82600401545b9050614201818a6151f1565b600380840191909155868355830154600284015461271091614222916151c4565b61422c91906151f1565b6001830155600282018990556009820180546001600160a01b0319166001600160a01b038c81169190911790915560035460405163d09f392d60e01b8152600481018b90526000602482015291169063d09f392d90604401600060405180830381600087803b15801561429e57600080fd5b505af11580156142b2573d6000803e3d6000fd5b50505050836001600160a01b031663b6ede540898e8e86600301546040518563ffffffff1660e01b81526004016142ec949392919061539e565b600060405180830381600087803b15801561430657600080fd5b505af115801561431a573d6000803e3d6000fd5b50506040513392508a91507f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a350505050505050949350505050565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b179052516143bf919061528d565b6000604051808303816000865af19150503d80600081146143fc576040519150601f19603f3d011682016040523d82523d6000602084013e614401565b606091505b509150915081801561442b57508051158061442b57508080602001905181019061442b91906150a6565b979650505050505050565b600080600060408451106144ab575050506020810151604082015160608301516001600160601b038316158061447757506004546001600160601b03841610155b1561448157600192505b8160000361448e57600391505b80158061449d57506005548110155b156144a6575060015b6144b6565b506001915060039050815b9193909250565b6000806000856001600160a01b031685856040516024016144df9291906153eb565b60408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b17905251614514919061528d565b6000604051808303816000865af19150503d8060008114614551576040519150601f19603f3d011682016040523d82523d6000602084013e614556565b606091505b509150915081801561458057508051158061458057508080602001905181019061458091906150a6565b9695505050505050565b600181600181111561459e5761459e614977565b036145a65750565b60405163a437293760e01b815260040160405180910390fd5b60405180608001604052806004906020820280368337509192915050565b826004810192821561460b579160200282015b8281111561460b5782518255916020019190600101906145f0565b50614617929150614655565b5090565b82805482825590600052602060002090810192821561460b579160200282018281111561460b5782518255916020019190600101906145f0565b5b808211156146175760008155600101614656565b6001600160a01b0381168114613ed457600080fd5b60006020828403121561469157600080fd5b813561469c8161466a565b9392505050565b80356001600160601b03811681146146ba57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156146fd576146fd6146bf565b604052919050565b600082601f83011261471657600080fd5b813560206001600160401b03821115614731576147316146bf565b8160051b6147408282016146d5565b928352848101820192828101908785111561475a57600080fd5b83870192505b8483101561442b57823582529183019190830190614760565b8015158114613ed457600080fd5b60008060006060848603121561479c57600080fd5b6147a5846146a3565b925060208401356001600160401b038111156147c057600080fd5b6147cc86828701614705565b92505060408401356147dd81614779565b809150509250925092565b6001600160a01b0391909116815260200190565b60006020828403121561480e57600080fd5b5035919050565b6000806040838503121561482857600080fd5b82356148338161466a565b946020939093013593505050565b60008060006060848603121561485657600080fd5b505081359360208301359350604090920135919050565b60006020828403121561487f57600080fd5b610fe2826146a3565b8060005b6004811015610a5957815184526020938401939091019060010161488c565b60808101610fe58284614888565b600082601f8301126148ca57600080fd5b81356001600160401b038111156148e3576148e36146bf565b6148f6601f8201601f19166020016146d5565b81815284602083860101111561490b57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561493b57600080fd5b82356149468161466a565b915060208301356001600160401b0381111561496157600080fd5b61496d858286016148b9565b9150509250929050565b634e487b7160e01b600052602160045260246000fd5b600581106149ab57634e487b7160e01b600052602160045260246000fd5b9052565b6001600160601b03861681526001600160a01b038516602082015260a081016149db604083018661498d565b9215156060820152608001529392505050565b600080600060608486031215614a0357600080fd5b8335614a0e8161466a565b92506020840135915060408401356001600160401b03811115614a3057600080fd5b614a3c868287016148b9565b9150509250925092565b60008060408385031215614a5957600080fd5b614833836146a3565b60008060408385031215614a7557600080fd5b8235614a808161466a565b91506020830135614a9081614779565b809150509250929050565b600080600060608486031215614ab057600080fd5b8335614abb8161466a565b925060208401356001600160401b0381168114614ad757600080fd5b9150604084013560ff811681146147dd57600080fd5b600082601f830112614afe57600080fd5b604051608081018181106001600160401b0382111715614b2057614b206146bf565b604052806080840185811115614b3557600080fd5b845b81811015614b4f578035835260209283019201614b37565b509195945050505050565b6000806000806000806000610140888a031215614b7657600080fd5b614b7f886146a3565b96506020880135614b8f81614779565b955060408801359450606088013593506080880135925060a08801359150614bba8960c08a01614aed565b905092959891949750929550565b60008060408385031215614bdb57600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b83811015614c235781516001600160a01b031687529582019590820190600101614bfe565b509495945050505050565b6020815281516020820152602082015160408201526040820151606082015260608201516080820152608082015160a082015260a082015160c0820152600060c08301516101608060e0850152614c89610180850183614bea565b60e08601516101008681019190915286015161012080870191909152860151909250610140614cc2818701836001600160a01b03169052565b959095015193019290925250919050565b60008060008060008060008060006101e08a8c031215614cf257600080fd5b8935614cfd8161466a565b985060208a0135614d0d8161466a565b975060408a0135614d1d8161466a565b965060608a0135614d2d8161466a565b955060808a0135614d3d81614779565b9450614d4c8b60a08c01614aed565b9350614d5c8b6101208c01614aed565b92506101a08a01356001600160401b03811115614d7857600080fd5b614d848c828d016148b9565b9250506101c08a0135614d968161466a565b809150509295985092959850929598565b60008060008060008060008060006101808a8c031215614dc657600080fd5b614dcf8a6146a3565b985060208a0135614ddf81614779565b975060408a0135965060608a0135955060808a0135945060a08a01359350614e0a8b60c08c01614aed565b92506101408a01356001600160401b0380821115614e2757600080fd5b614e338d838e016148b9565b93506101608c0135915080821115614e4a57600080fd5b50614e578c828d01614705565b9150509295985092959850929598565b60008060408385031215614e7a57600080fd5b8235915060208301356001600160401b0381111561496157600080fd5b600080600060608486031215614eac57600080fd5b833592506020840135915060408401356001600160401b03811115614a3057600080fd5b60008083601f840112614ee257600080fd5b5081356001600160401b03811115614ef957600080fd5b602083019150836020828501011115614f1157600080fd5b9250929050565b600080600060408486031215614f2d57600080fd5b83356001600160401b03811115614f4357600080fd5b614f4f86828701614ed0565b90945092505060208401356147dd8161466a565b600080600080600060808688031215614f7b57600080fd5b8535945060208601356001600160401b03811115614f9857600080fd5b614fa488828901614ed0565b9095509350506040860135614fb88161466a565b949793965091946060013592915050565b600060208284031215614fdb57600080fd5b81356001600160401b03811115614ff157600080fd5b613203848285016148b9565b6000806000806080858703121561501357600080fd5b843561501e8161466a565b935061502c602086016146a3565b925060408501359150606085013561504381614779565b939692955090935050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161508c5761508c615064565b5060010190565b81810381811115610fe557610fe5615064565b6000602082840312156150b857600080fd5b815161469c81614779565b60208101610fe5828461498d565b600181815b8085111561510c5781600019048211156150f2576150f2615064565b808516156150ff57918102915b93841c93908002906150d6565b509250929050565b60008261512357506001610fe5565b8161513057506000610fe5565b816001811461514657600281146151505761516c565b6001915050610fe5565b60ff84111561516157615161615064565b50506001821b610fe5565b5060208310610133831016604e8410600b841016171561518f575081810a610fe5565b61519983836150d1565b80600019048211156151ad576151ad615064565b029392505050565b6000610fe260ff841683615114565b8082028115828204841417610fe557610fe5615064565b634e487b7160e01b600052601260045260246000fd5b600082615200576152006151db565b500490565b60008060006060848603121561521a57600080fd5b83519250602084015161522c81614779565b60408501519092506147dd81614779565b80820180821115610fe557610fe5615064565b60006020828403121561526257600080fd5b5051919050565b60005b8381101561528457818101518382015260200161526c565b50506000910152565b6000825161529f818460208701615269565b9190910192915050565b600061012082019050871515825286602083015285604083015284606083015283608083015261442b60a0830184614888565b600081518084526152f4816020860160208601615269565b601f01601f19169290920160200192915050565b82815260406020820152600061320360408301846152dc565b60006101408083018a1515845260208a8186015289604086015288606086015287608086015261535460a0860188614888565b6101208501929092528451908190526101608401918086019160005b8181101561538c57835185529382019392820192600101615370565b50929c9b505050505050505050505050565b8481528360208201526080604082015260006153bd60808301856152dc565b905082606083015295945050505050565b6000602082840312156153e057600080fd5b815161469c8161466a565b6001600160a01b03929092168252602082015260400190565b6000600160ff1b820161541957615419615064565b5060000390565b938452602084019290925260408301526001600160a01b0316606082015260800190565b92835260208301919091526001600160a01b0316604082015260600190565b600082615472576154726151db565b500690565b60008060006060848603121561548c57600080fd5b835192506020840151915060408401516147dd8161477956fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220431441c28ca8378da3d4299e6d70f877d23c3d059d9775a1575f25515c19247964736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106102665760003560e01c80638bb0487511610144578063d07368bd116100b6578063f6506db41161007a578063f6506db414610811578063f7434ea914610831578063fbb519e714610851578063fbf405b014610871578063fc6f8f1614610891578063fe524c39146108b157600080fd5b8063d07368bd1461077c578063d2b8035a1461079c578063d4d1d76a146107bc578063d98493f6146107d1578063e4c0aaf4146107f157600080fd5b8063b004963711610108578063b0049637146106d6578063c13517e1146106f6578063c258bb1914610709578063c356990214610729578063c71f42531461073c578063cf0c38f81461075c57600080fd5b80638bb0487514610621578063994b27af14610641578063a072b86c14610661578063acdbf51d14610681578063afe15cfb146106a157600080fd5b80633cfd1184116101dd578063751accd0116101a1578063751accd0146105545780637717a6e8146105745780637934c0be1461059457806382d02237146105b457806386541b24146105d45780638a9bb02a146105f457600080fd5b80633cfd1184146104ae5780634f1ef286146104db57806352d1902d146104ee578063564a565d1461050357806359ec827e1461053457600080fd5b80631860592b1161022f5780631860592b1461037257806319b81529146103a05780631c3db16d146103d05780631f5a0dd21461040d5780632d29a47b1461046e5780632e1daf2f1461048e57600080fd5b8062f5822c1461026b5780630219da791461028d5780630b7414bc146103055780630c340a2414610325578063115d537614610352575b600080fd5b34801561027757600080fd5b5061028b61028636600461467f565b6108d1565b005b34801561029957600080fd5b506102d86102a836600461467f565b60076020526000908152604090205460ff808216916001600160401b0361010082041691600160481b9091041683565b6040805193151584526001600160401b03909216602084015260ff16908201526060015b60405180910390f35b34801561031157600080fd5b5061028b610320366004614787565b61091e565b34801561033157600080fd5b50600054610345906001600160a01b031681565b6040516102fc91906147e8565b34801561035e57600080fd5b5061028b61036d3660046147fc565b610a5f565b34801561037e57600080fd5b5061039261038d366004614815565b610f91565b6040519081526020016102fc565b3480156103ac57600080fd5b506103c06103bb3660046147fc565b610feb565b60405190151581526020016102fc565b3480156103dc57600080fd5b506103f06103eb3660046147fc565b6110e4565b6040805193845291151560208401521515908201526060016102fc565b34801561041957600080fd5b5061042d6104283660046147fc565b6111e5565b604080516001600160601b0390981688529515156020880152948601939093526060850191909152608084015260a0830152151560c082015260e0016102fc565b34801561047a57600080fd5b5061028b610489366004614841565b611244565b34801561049a57600080fd5b50600354610345906001600160a01b031681565b3480156104ba57600080fd5b506104ce6104c936600461486d565b611484565b6040516102fc91906148ab565b61028b6104e9366004614928565b6114ee565b3480156104fa57600080fd5b50610392611714565b34801561050f57600080fd5b5061052361051e3660046147fc565b611772565b6040516102fc9594939291906149af565b34801561054057600080fd5b5061039261054f3660046147fc565b6117ce565b34801561056057600080fd5b5061028b61056f3660046149ee565b611923565b34801561058057600080fd5b5061028b61058f366004614a46565b6119cd565b3480156105a057600080fd5b5061028b6105af366004614a62565b6119db565b3480156105c057600080fd5b5061028b6105cf366004614a9b565b611a5a565b3480156105e057600080fd5b5061028b6105ef366004614b5a565b611b17565b34801561060057600080fd5b5061061461060f366004614bc8565b611cfe565b6040516102fc9190614c2e565b34801561062d57600080fd5b5061028b61063c3660046147fc565b611e8a565b34801561064d57600080fd5b5061028b61065c366004614cd3565b611fee565b34801561066d57600080fd5b5061028b61067c366004614da7565b6123a8565b34801561068d57600080fd5b5061034561069c3660046147fc565b61271a565b3480156106ad57600080fd5b506106c16106bc3660046147fc565b612744565b604080519283526020830191909152016102fc565b3480156106e257600080fd5b5061028b6106f136600461467f565b6127f0565b610392610704366004614e67565b61283d565b34801561071557600080fd5b5061028b61072436600461467f565b612875565b61028b610737366004614e97565b6128c2565b34801561074857600080fd5b506103926107573660046147fc565b612d96565b34801561076857600080fd5b50600254610345906001600160a01b031681565b34801561078857600080fd5b5061028b61079736600461467f565b612dfe565b3480156107a857600080fd5b5061028b6107b7366004614bc8565b612ea7565b3480156107c857600080fd5b50600554610392565b3480156107dd57600080fd5b506103926107ec366004614f18565b6131be565b3480156107fd57600080fd5b5061028b61080c36600461467f565b61320b565b34801561081d57600080fd5b5061039261082c366004614f63565b613258565b34801561083d57600080fd5b5061039261084c366004614fc9565b61333e565b34801561085d57600080fd5b5061028b61086c366004614ffd565b61338a565b34801561087d57600080fd5b50600154610345906001600160a01b031681565b34801561089d57600080fd5b506103926108ac3660046147fc565b6133ca565b3480156108bd57600080fd5b506103c06108cc366004614a46565b6133f9565b6000546001600160a01b031633146108fc5760405163c383977560e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146109495760405163c383977560e01b815260040160405180910390fd5b60005b8251811015610a595781156109e85782818151811061096d5761096d61504e565b6020026020010151600014806109a0575060055483518490839081106109955761099561504e565b602002602001015110155b156109be57604051633d58a98960e11b815260040160405180910390fd5b6109e3848483815181106109d4576109d461504e565b60200260200101516001613441565b610a47565b60018382815181106109fc576109fc61504e565b602002602001015103610a22576040516356d111fd60e11b815260040160405180910390fd5b610a4784848381518110610a3857610a3861504e565b60200260200101516000613441565b80610a518161507a565b91505061094c565b50505050565b600060068281548110610a7457610a7461504e565b600091825260208220600491820201805482549194506001600160601b0316908110610aa257610aa261504e565b6000918252602082206003850154600c909202019250610ac490600190615093565b90506000836003018281548110610add57610add61504e565b600091825260208220600b909102019150600185015460ff166004811115610b0757610b07614977565b03610be25781158015610b5657506001840154600684019060ff166004811115610b3357610b33614977565b60048110610b4357610b4361504e565b01546002850154610b549042615093565b105b15610b7457604051633e9727df60e01b815260040160405180910390fd5b6003810154600682015414610b9c576040516309e4486b60e41b815260040160405180910390fd5b8254600160601b900460ff16610bb3576002610bb6565b60015b60018086018054909160ff1990911690836004811115610bd857610bd8614977565b0217905550610f43565b60018085015460ff166004811115610bfc57610bfc614977565b03610d0c576001840154600684019060ff166004811115610c1f57610c1f614977565b60048110610c2f57610c2f61504e565b01546002850154610c409042615093565b108015610cd757506005816000015481548110610c5f57610c5f61504e565b600091825260209091200154604051630baa64d160e01b8152600481018790526001600160a01b0390911690630baa64d190602401602060405180830381865afa158015610cb1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd591906150a6565b155b15610cf557604051634dfa578560e11b815260040160405180910390fd5b6001808501805460029260ff199091169083610bd8565b6002600185015460ff166004811115610d2757610d27614977565b03610e75576001840154600684019060ff166004811115610d4a57610d4a614977565b60048110610d5a57610d5a61504e565b01546002850154610d6b9042615093565b108015610e0257506005816000015481548110610d8a57610d8a61504e565b6000918252602090912001546040516336a66c7560e11b8152600481018790526001600160a01b0390911690636d4cd8ea90602401602060405180830381865afa158015610ddc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0091906150a6565b155b15610e2057604051631988dead60e31b815260040160405180910390fd5b600184018054600360ff199091161790558354604051600160601b9091046001600160a01b03169086907fa5d41b970d849372be1da1481ffd78d162bfe57a7aa2fe4e5fb73481fa5ac24f90600090a3610f43565b6003600185015460ff166004811115610e9057610e90614977565b03610f0a576001840154600684019060ff166004811115610eb357610eb3614977565b60048110610ec357610ec361504e565b01546002850154610ed49042615093565b1015610ef357604051632f4dfd8760e01b815260040160405180910390fd5b6001808501805460049260ff199091169083610bd8565b6004600185015460ff166004811115610f2557610f25614977565b03610f43576040516307f38c8f60e11b815260040160405180910390fd5b426002850155600184015460405186917f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b9191610f829160ff16906150c3565b60405180910390a25050505050565b6001600160a01b03821660009081526007602052604081205461010081046001600160401b031690610fce90600160481b900460ff16600a6151b5565b610fd890846151c4565b610fe291906151f1565b90505b92915050565b600080600683815481106110015761100161504e565b600091825260208220600360049092020190810180549193509061102790600190615093565b815481106110375761103761504e565b600091825260208220845460048054600b909402909201945090916001600160601b0390911690811061106c5761106c61504e565b90600052602060002090600c0201905080600501548260030154101561109757506000949350505050565b80546004805490916001600160601b03169081106110b7576110b761504e565b6000918252602080832094548352600a600c9092029094010190925250604090205460ff16159392505050565b600080600080600685815481106110fd576110fd61504e565b600091825260208220600360049092020190810180549193509061112390600190615093565b815481106111335761113361504e565b90600052602060002090600b020190506000600582600001548154811061115c5761115c61504e565b600091825260209091200154604051631c3db16d60e01b8152600481018990526001600160a01b0390911691508190631c3db16d90602401606060405180830381865afa1580156111b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d59190615205565b9199909850909650945050505050565b600481815481106111f557600080fd5b60009182526020909120600c9091020180546002820154600383015460048401546005850154600b909501546001600160601b038516965060ff600160601b9095048516959394929391921687565b6000600684815481106112595761125961504e565b600091825260209091206004918202019150600182015460ff16600481111561128457611284614977565b146112a257604051638794ce4b60e01b815260040160405180910390fd5b60008160030184815481106112b9576112b961504e565b90600052602060002090600b02019050600060058260000154815481106112e2576112e261504e565b600091825260208220015460048401546001600160a01b0390911692509061130a868361523d565b6005850154600686015460405163368efae360e21b8152600481018c9052602481018b905292935090916000906001600160a01b0387169063da3beb8c90604401602060405180830381865afa158015611368573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138c9190615250565b9050806000036113a757818411156113a2578193505b6113c7565b6113b28260026151c4565b8411156113c7576113c48260026151c4565b93505b60048701849055845b84811015611463578281101561141c576114156040518060c001604052808e81526020018d8152602001848152602001858152602001868152602001838152506134c9565b9350611451565b6114516040518060c001604052808e81526020018d815260200184815260200185815260200186815260200183815250613986565b8061145b8161507a565b9150506113d0565b508287600501541461147757600587018390555b5050505050505050505050565b61148c6145bf565b6004826001600160601b0316815481106114a8576114a861504e565b6000918252602090912060408051608081019182905292600c029091016006019060049082845b8154815260200190600101908083116114cf5750505050509050919050565b6114f782613ea9565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061157557507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166115696000805160206154a68339815191525490565b6001600160a01b031614155b156115935760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156115ed575060408051601f3d908101601f191682019092526115ea91810190615250565b60015b6116155781604051630c76093760e01b815260040161160c91906147e8565b60405180910390fd5b6000805160206154a6833981519152811461164657604051632a87526960e21b81526004810182905260240161160c565b6000805160206154a68339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a281511561170f576000836001600160a01b0316836040516116ad919061528d565b600060405180830381855af49150503d80600081146116e8576040519150601f19603f3d011682016040523d82523d6000602084013e6116ed565b606091505b5050905080610a59576040516339b21b5d60e11b815260040160405180910390fd5b505050565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461175f5760405163703e46dd60e11b815260040160405180910390fd5b506000805160206154a683398151915290565b6006818154811061178257600080fd5b60009182526020909120600490910201805460018201546002909201546001600160601b0382169350600160601b9091046001600160a01b03169160ff80821692610100909204169085565b600080600683815481106117e4576117e461504e565b600091825260208220600360049092020190810180549193509061180a90600190615093565b8154811061181a5761181a61504e565b600091825260208220845460048054600b909402909201945090916001600160601b0390911690811061184f5761184f61504e565b90600052602060002090600c0201905080600501548260030154106118ee5782546001600160601b031660001901611890576001600160ff1b03935061191b565b60038201546118a09060026151c4565b6118ab90600161523d565b81546004805490916001600160601b03169081106118cb576118cb61504e565b90600052602060002090600c0201600401546118e791906151c4565b935061191b565b60038201546118fe9060026151c4565b61190990600161523d565b816004015461191891906151c4565b93505b505050919050565b6000546001600160a01b0316331461194e5760405163c383977560e01b815260040160405180910390fd5b6000836001600160a01b03168383604051611969919061528d565b60006040518083038185875af1925050503d80600081146119a6576040519150601f19603f3d011682016040523d82523d6000602084013e6119ab565b606091505b5050905080610a59576040516322092f2f60e11b815260040160405180910390fd5b61170f338383600080613ed7565b6000546001600160a01b03163314611a065760405163c383977560e01b815260040160405180910390fd5b6001600160a01b038216600081815260076020526040808220805460ff191685151590811790915590519092917f541615e167511d757a7067a700eb54431b256bb458dfdce0ac58bf2ed0aefd4491a35050565b6000546001600160a01b03163314611a855760405163c383977560e01b815260040160405180910390fd5b6001600160a01b038316600081815260076020908152604091829020805469ffffffffffffffffff0019166101006001600160401b03881690810260ff60481b191691909117600160481b60ff8816908102919091179092558351908152918201527fe6996b7f03e9bd02228b99d3d946932e3197f505f60542c4cfbc919441d8a4e6910160405180910390a2505050565b6000546001600160a01b03163314611b425760405163c383977560e01b815260040160405180910390fd5b60006004886001600160601b031681548110611b6057611b6061504e565b90600052602060002090600c0201905060016001600160601b0316886001600160601b031614158015611bc2575080546004805488926001600160601b0316908110611bae57611bae61504e565b90600052602060002090600c020160020154115b15611be057604051639717078960e01b815260040160405180910390fd5b60005b6001820154811015611c6557866004836001018381548110611c0757611c0761504e565b906000526020600020015481548110611c2257611c2261504e565b90600052602060002090600c0201600201541015611c5357604051639717078960e01b815260040160405180910390fd5b80611c5d8161507a565b915050611be3565b5060028101869055805460ff60601b1916600160601b8815150217815560038101859055600480820185905560058201849055611ca890600683019084906145dd565b50876001600160601b03167f709b1f5fda58af9a4f52dacd1ec404840a8148455700cce155a2bd8cf127ef1a888888888888604051611cec969594939291906152a9565b60405180910390a25050505050505050565b611d6460405180610160016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160608152602001600081526020016000815260200160006001600160a01b03168152602001600081525090565b60068381548110611d7757611d7761504e565b90600052602060002090600402016003018281548110611d9957611d9961504e565b90600052602060002090600b02016040518061016001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482015481526020016005820154815260200160068201805480602002602001604051908101604052809291908181526020018280548015611e4857602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611e2a575b5050509183525050600782015460208201526008820154604082015260098201546001600160a01b03166060820152600a909101546080909101529392505050565b600060068281548110611e9f57611e9f61504e565b600091825260209091206004918202019150600182015460ff166004811115611eca57611eca614977565b14611ee857604051638794ce4b60e01b815260040160405180910390fd5b6001810154610100900460ff1615611f135760405163c977f8d360e01b815260040160405180910390fd5b6000611f1e836110e4565b505060018301805461010061ff001990911617905582546040518281529192508491600160601b9091046001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a3815460405163188d362b60e11b81526004810185905260248101839052600160601b9091046001600160a01b03169063311a6c5690604401600060405180830381600087803b158015611fd157600080fd5b505af1158015611fe5573d6000803e3d6000fd5b50505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff1680612037575080546001600160401b03808416911610155b156120545760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b03831617600160401b178155600080546001600160a01b03808e166001600160a01b0319928316178355600180548e8316908416178155600280548e8416908516178155600380548985169086161790556005805481875291820190557f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db1018054928d1692909316821790925560405190927f44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb291a360048054600101815560008181526003546040516311de995760e21b81526001600160a01b039091169263477a655c9261215c929091899101615308565b600060405180830381600087803b15801561217657600080fd5b505af115801561218a573d6000803e3d6000fd5b5050600480546001810182556000918252600c027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160601b0319168155604080518381526020810190915290935091505080516121f891600184019160209091019061461b565b50805460ff60601b1916600160601b89151502178155865160028201556020870151600382015560408701516004808301919091556060880151600583015561224790600683019088906145dd565b506003546040516311de995760e21b81526001600160a01b039091169063477a655c9061227b906001908990600401615308565b600060405180830381600087803b15801561229557600080fd5b505af11580156122a9573d6000803e3d6000fd5b505082546001600160601b03169150600190507f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d8a8a600060200201518b600160200201518c600260200201518d600360200201518d600060405190808252806020026020018201604052801561232a578160200160208202803683370190505b5060405161233e9796959493929190615321565b60405180910390a36123536001806001613441565b50805460ff60401b191681556040516001600160401b03831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050505050505050565b6000546001600160a01b031633146123d35760405163c383977560e01b815260040160405180910390fd5b8660048a6001600160601b0316815481106123f0576123f061504e565b90600052602060002090600c020160020154111561242157604051639717078960e01b815260040160405180910390fd5b80516000036124435760405163402585f560e01b815260040160405180910390fd5b6001600160601b03891661246a57604051631ef4f64960e01b815260040160405180910390fd5b60048054600181018255600091825290600c82027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01905b8351811015612568578381815181106124bd576124bd61504e565b6020026020010151600014806124f0575060055484518590839081106124e5576124e561504e565b602002602001015110155b1561250e57604051633d58a98960e11b815260040160405180910390fd5b600182600a0160008684815181106125285761252861504e565b6020026020010151815260200190815260200160002060006101000a81548160ff02191690831515021790555080806125609061507a565b9150506124a2565b5060016000908152600a8201602052604090205460ff1661259c576040516306351b3d60e31b815260040160405180910390fd5b80546001600160601b0319166001600160601b038c1617815560408051600081526020810191829052516125d491600184019161461b565b50805460ff60601b1916600160601b8b151502178155600281018990556003810188905560048082018890556005820187905561261790600683019087906145dd565b506003546040516311de995760e21b81526001600160a01b039091169063477a655c9061264a9085908890600401615308565b600060405180830381600087803b15801561266457600080fd5b505af1158015612678573d6000803e3d6000fd5b5050505060048b6001600160601b0316815481106126985761269861504e565b600091825260208083206001600c909302018201805492830181558352909120018290556040516001600160601b038c169083907f3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d90612705908e908e908e908e908e908e908d90615321565b60405180910390a35050505050505050505050565b6005818154811061272a57600080fd5b6000918252602090912001546001600160a01b0316905081565b60008060006006848154811061275c5761275c61504e565b6000918252602090912060049091020190506003600182015460ff16600481111561278957612789614977565b036127e1576002810154815460048054929550916001600160601b039091169081106127b7576127b761504e565b600091825260209091206009600c90920201015460028201546127da919061523d565b91506127ea565b60009250600091505b50915091565b6000546001600160a01b0316331461281b5760405163c383977560e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b60006128488261333e565b34101561286857604051630e3360f160e21b815260040160405180910390fd5b610fe28383600034614071565b6000546001600160a01b031633146128a05760405163c383977560e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6128cb836117ce565b3410156128eb57604051633191f8f160e01b815260040160405180910390fd5b6000600684815481106129005761290061504e565b6000918252602090912060049091020190506003600182015460ff16600481111561292d5761292d614977565b1461294b576040516337cdefcb60e21b815260040160405180910390fd5b6003810180546000919061296190600190615093565b815481106129715761297161504e565b90600052602060002090600b0201905060058160000154815481106129985761299861504e565b6000918252602090912001546001600160a01b031633146129cc5760405163065f245f60e01b815260040160405180910390fd5b8154815460038401805460018101825560009182526020909120600480546001600160601b0390951694600b9093029091019184908110612a0f57612a0f61504e565b90600052602060002090600c020160050154846003015410612b18576004836001600160601b031681548110612a4757612a4761504e565b60009182526020909120600c9091020154600480546001600160601b0390921694509084908110612a7a57612a7a61504e565b60009182526020808320858452600a600c90930201919091019052604090205460ff16612aa657600191505b84546001600160601b03848116911614612b1857845460038601546001600160601b0390911690612ad990600190615093565b6040516001600160601b03861681528a907f736e3f52761298c8c0823e1ebf482ed3c5ecb304f743d2d91a7c006e8e8d7a1f9060200160405180910390a45b84546001600160601b0319166001600160601b038416908117865560018601805460ff1916905542600287015560048054600092908110612b5b57612b5b61504e565b90600052602060002090600c02019050806004015434612b7b91906151f1565b826003018190555061271081600301548260020154612b9a91906151c4565b612ba491906151f1565b60018084019190915534600284015583835560038054908801546001600160a01b039091169163d09f392d918c91612bdb91615093565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381600087803b158015612c1957600080fd5b505af1158015612c2d573d6000803e3d6000fd5b505086548454149150612d1390505784546003870154612c4f90600190615093565b83546040519081528b907fcbe7939a71f0b369c7471d760a0a99b60b7bb010ee0406cba8a46679d1ea77569060200160405180910390a46005826000015481548110612c9d57612c9d61504e565b60009182526020909120015460038301546040516302dbb79560e61b81526001600160a01b039092169163b6ede54091612ce0918d918d918d919060040161539e565b600060405180830381600087803b158015612cfa57600080fd5b505af1158015612d0e573d6000803e3d6000fd5b505050505b8554604051600160601b9091046001600160a01b0316908a907f9c9b64db9e130f48381bf697abf638e73117dbfbfd7a4484f2da3ba188f4187d90600090a3887f4e6f5cf43b95303e86aee81683df63992061723a829ee012db21dad388756b916000604051612d8391906150c3565b60405180910390a2505050505050505050565b60008060068381548110612dac57612dac61504e565b906000526020600020906004020190508060030160018260030180549050612dd49190615093565b81548110612de457612de461504e565b90600052602060002090600b020160030154915050919050565b6000546001600160a01b03163314612e295760405163c383977560e01b815260040160405180910390fd5b6005805460018101825560009182527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0810180546001600160a01b0319166001600160a01b0385169081179091556040519192909183917f44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb291a35050565b600060068381548110612ebc57612ebc61504e565b90600052602060002090600402019050600060018260030180549050612ee29190615093565b90506000826003018281548110612efb57612efb61504e565b600091825260208220600b909102019150600184015460ff166004811115612f2557612f25614977565b14612f4357604051638285c4ef60e01b815260040160405180910390fd5b60006005826000015481548110612f5c57612f5c61504e565b6000918252602082200154600a8401546001600160a01b039091169250905b8681108015612f91575060038401546006850154105b1561319b5760006001600160a01b03841663d2b8035a8a84612fb28161507a565b9550612fbe908761523d565b6040516001600160e01b031960e085901b168152600481019290925260248201526044016020604051808303816000875af1158015613001573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061302591906153ce565b90506001600160a01b03811661303b5750612f7b565b60035460018601546040516310f0b12f60e11b81526001600160a01b03909216916321e1625e91613071918591906004016153eb565b600060405180830381600087803b15801561308b57600080fd5b505af115801561309f573d6000803e3d6000fd5b50505060068601546040518b92506001600160a01b038416917f6119cf536152c11e0a9a6c22f3953ce4ecc93ee54fa72ffa326ffabded21509b916130ec918b8252602082015260400190565b60405180910390a36006850180546001810182556000828152602090200180546001600160a01b0319166001600160a01b038416179055600386015490540361319557600354604051632e96bc2360e11b8152600481018b9052602481018890526001600160a01b0390911690635d2d784690604401600060405180830381600087803b15801561317c57600080fd5b505af1158015613190573d6000803e3d6000fd5b505050505b50612f7b565b8084600a0160008282546131af919061523d565b90915550505050505050505050565b60006132038261038d86868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061333e92505050565b949350505050565b6000546001600160a01b031633146132365760405163c383977560e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03821660009081526007602052604081205460ff166132915760405163e51cf7bf60e01b815260040160405180910390fd5b61329c8585856131be565b8210156132bc57604051630e3360f160e21b815260040160405180910390fd5b6132d16001600160a01b03841633308561435a565b6132ee576040516312171d8360e31b815260040160405180910390fd5b6133328686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508892508791506140719050565b90505b95945050505050565b600080600061334c84614436565b5091509150806004836001600160601b03168154811061336e5761336e61504e565b90600052602060002090600c02016004015461320391906151c4565b6003546001600160a01b031633146133b557604051639d6cab9960e01b815260040160405180910390fd5b6133c3848484846001613ed7565b5050505050565b6000600682815481106133df576133df61504e565b600091825260209091206003600490920201015492915050565b60006004836001600160601b0316815481106134175761341761504e565b60009182526020808320948352600c91909102909301600a0190925250604090205460ff16919050565b806004846001600160601b03168154811061345e5761345e61504e565b60009182526020808320868452600c92909202909101600a0190526040808220805460ff19169315159390931790925590518215159184916001600160601b038716917fb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc7991a4505050565b60008060068360000151815481106134e3576134e361504e565b9060005260206000209060040201905060008160030184602001518154811061350e5761350e61504e565b90600052602060002090600b02019050600060058260000154815481106135375761353761504e565b60009182526020808320919091015487519188015160a0890151604051634fe264fb60e01b81526004810194909452602484019190915260448301526001600160a01b031692508290634fe264fb90606401602060405180830381865afa1580156135a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135ca9190615250565b90506127108111156135db57506127105b60006127106135ea8382615093565b85600101546135f991906151c4565b61360391906151f1565b90508087608001818151613617919061523d565b90525060a08701516006850180546000929081106136375761363761504e565b60009182526020909120015460035460405163965af6c760e01b81526001600160a01b03928316935091169063965af6c79061367990849086906004016153eb565b600060405180830381600087803b15801561369357600080fd5b505af11580156136a7573d6000803e3d6000fd5b5050600354604051633c85b79360e21b81526001600160a01b03909116925063f216de4c91506136dd90849086906004016153eb565b600060405180830381600087803b1580156136f757600080fd5b505af115801561370b573d6000803e3d6000fd5b50505050602088015188516001600160a01b0383167f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e78661374b87615404565b60098b015460405161376d9392916000916001600160a01b0390911690615420565b60405180910390a48751602089015160a08a015160405163ba66fde760e01b81526004810193909352602483019190915260448201526001600160a01b0385169063ba66fde790606401602060405180830381865afa1580156137d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137f891906150a6565b61385f5760035460405163b5d69e9960e01b81526001600160a01b039091169063b5d69e999061382c9084906004016147e8565b600060405180830381600087803b15801561384657600080fd5b505af115801561385a573d6000803e3d6000fd5b505050505b600188606001516138709190615093565b8860a0015114801561388457506040880151155b156139755760098501546001600160a01b03166138cd576000805460028701546040516001600160a01b039092169281156108fc029290818181858888f19350505050506138f4565b600054600286015460098701546138f2926001600160a01b03918216929116906144bd565b505b6000546080890151600154613917926001600160a01b03918216929116906144bd565b506020880151885160808a0151600288015460098901546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf49361396c93909290916001600160a01b0390911690615444565b60405180910390a35b505050608090940151949350505050565b6000600682600001518154811061399f5761399f61504e565b906000526020600020906004020190506000816003018360200151815481106139ca576139ca61504e565b90600052602060002090600b02019050600060058260000154815481106139f3576139f361504e565b6000918252602080832090910154865191870151606088015160a08901516001600160a01b0390931695508593634fe264fb93909291613a3291615463565b6040516001600160e01b031960e086901b168152600481019390935260248301919091526044820152606401602060405180830381865afa158015613a7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a9f9190615250565b9050612710811115613ab057506127105b60008360060186606001518760a00151613aca9190615463565b81548110613ada57613ada61504e565b600091825260208220015460018601546001600160a01b03909116925061271090613b069085906151c4565b613b1091906151f1565b60035460405163965af6c760e01b81529192506001600160a01b03169063965af6c790613b4390859085906004016153eb565b600060405180830381600087803b158015613b5d57600080fd5b505af1158015613b71573d6000803e3d6000fd5b5050600354604051636624192f60e01b81526001600160a01b039091169250636624192f9150613ba59085906004016147e8565b602060405180830381865afa158015613bc2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613be691906150a6565b613c0357600154613c01906001600160a01b031683836144bd565b505b60006127108489604001518a60800151613c1d91906151f1565b613c2791906151c4565b613c3191906151f1565b905080866008016000828254613c47919061523d565b925050819055506000612710858a604001518960020154613c6891906151f1565b613c7291906151c4565b613c7c91906151f1565b905080876007016000828254613c92919061523d565b9091555050600154613cae906001600160a01b031685846144bd565b5060098701546001600160a01b0316613cec576040516001600160a01b0385169082156108fc029083906000818181858888f1935050505050613d07565b6009870154613d05906001600160a01b031685836144bd565b505b6020890151895160098901546040516001600160a01b03888116927f8975b837fe0d18616c65abb8b843726a32b552ee4feca009944fa658bbb282e792613d57928c928a928a9290911690615420565b60405180910390a4600189606001516002613d7291906151c4565b613d7c9190615093565b8960a0015103613e9e57600087600801548a60800151613d9c9190615093565b9050600088600701548960020154613db49190615093565b905081151580613dc357508015155b15611477578115613ded57600054600154613deb916001600160a01b039182169116846144bd565b505b8015613e545760098901546001600160a01b0316613e3357600080546040516001600160a01b039091169183156108fc02918491818181858888f1935050505050613e54565b60005460098a0154613e52916001600160a01b039182169116836144bd565b505b60208b01518b5160098b01546040517f6cecfd3ec56289ccb16e30eb194f9a87dfdc12630b9abbc31fc69af5a0b0eaf49161270591879187916001600160a01b0390911690615444565b505050505050505050565b6000546001600160a01b03163314613ed45760405163c383977560e01b815260040160405180910390fd5b50565b60006001600160601b0385161580613ef957506004546001600160601b038616115b15613f0f57613f078261458a565b506000613335565b8315801590613f4a57506004856001600160601b031681548110613f3557613f3561504e565b90600052602060002090600c02016002015484105b15613f5857613f078261458a565b600354604051630a5861b960e41b81526001600160a01b0388811660048301526001600160601b0388166024830152604482018790528515156064830152600092839283929091169063a5861b90906084016060604051808303816000875af1158015613fc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fed9190615477565b9250925092508061400d576140018561458a565b60009350505050613335565b82156140385760015461402b906001600160a01b03168a308661435a565b614038576140018561458a565b811561406257600154614055906001600160a01b03168a846144bd565b614062576140018561458a565b50600198975050505050505050565b600080600061407f86614436565b92505091506004826001600160601b0316815481106140a0576140a061504e565b60009182526020808320848452600a600c90930201919091019052604090205460ff166140e05760405163b34eb75d60e01b815260040160405180910390fd5b600680546001810182556000918252600160601b33026001600160601b03851617600482027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f8101918255427ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d4190910155600580549296509092918490811061416b5761416b61504e565b60009182526020822001548354600480546001600160a01b039093169450916001600160601b039091169081106141a4576141a461504e565b60009182526020808320600387018054600181018255908552918420600c909302019350600b0201906001600160a01b038a16156141ef576141ea8a8460040154610f91565b6141f5565b82600401545b9050614201818a6151f1565b600380840191909155868355830154600284015461271091614222916151c4565b61422c91906151f1565b6001830155600282018990556009820180546001600160a01b0319166001600160a01b038c81169190911790915560035460405163d09f392d60e01b8152600481018b90526000602482015291169063d09f392d90604401600060405180830381600087803b15801561429e57600080fd5b505af11580156142b2573d6000803e3d6000fd5b50505050836001600160a01b031663b6ede540898e8e86600301546040518563ffffffff1660e01b81526004016142ec949392919061539e565b600060405180830381600087803b15801561430657600080fd5b505af115801561431a573d6000803e3d6000fd5b50506040513392508a91507f141dfc18aa6a56fc816f44f0e9e2f1ebc92b15ab167770e17db5b084c10ed99590600090a350505050505050949350505050565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b179052516143bf919061528d565b6000604051808303816000865af19150503d80600081146143fc576040519150601f19603f3d011682016040523d82523d6000602084013e614401565b606091505b509150915081801561442b57508051158061442b57508080602001905181019061442b91906150a6565b979650505050505050565b600080600060408451106144ab575050506020810151604082015160608301516001600160601b038316158061447757506004546001600160601b03841610155b1561448157600192505b8160000361448e57600391505b80158061449d57506005548110155b156144a6575060015b6144b6565b506001915060039050815b9193909250565b6000806000856001600160a01b031685856040516024016144df9291906153eb565b60408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b17905251614514919061528d565b6000604051808303816000865af19150503d8060008114614551576040519150601f19603f3d011682016040523d82523d6000602084013e614556565b606091505b509150915081801561458057508051158061458057508080602001905181019061458091906150a6565b9695505050505050565b600181600181111561459e5761459e614977565b036145a65750565b60405163a437293760e01b815260040160405180910390fd5b60405180608001604052806004906020820280368337509192915050565b826004810192821561460b579160200282015b8281111561460b5782518255916020019190600101906145f0565b50614617929150614655565b5090565b82805482825590600052602060002090810192821561460b579160200282018281111561460b5782518255916020019190600101906145f0565b5b808211156146175760008155600101614656565b6001600160a01b0381168114613ed457600080fd5b60006020828403121561469157600080fd5b813561469c8161466a565b9392505050565b80356001600160601b03811681146146ba57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156146fd576146fd6146bf565b604052919050565b600082601f83011261471657600080fd5b813560206001600160401b03821115614731576147316146bf565b8160051b6147408282016146d5565b928352848101820192828101908785111561475a57600080fd5b83870192505b8483101561442b57823582529183019190830190614760565b8015158114613ed457600080fd5b60008060006060848603121561479c57600080fd5b6147a5846146a3565b925060208401356001600160401b038111156147c057600080fd5b6147cc86828701614705565b92505060408401356147dd81614779565b809150509250925092565b6001600160a01b0391909116815260200190565b60006020828403121561480e57600080fd5b5035919050565b6000806040838503121561482857600080fd5b82356148338161466a565b946020939093013593505050565b60008060006060848603121561485657600080fd5b505081359360208301359350604090920135919050565b60006020828403121561487f57600080fd5b610fe2826146a3565b8060005b6004811015610a5957815184526020938401939091019060010161488c565b60808101610fe58284614888565b600082601f8301126148ca57600080fd5b81356001600160401b038111156148e3576148e36146bf565b6148f6601f8201601f19166020016146d5565b81815284602083860101111561490b57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561493b57600080fd5b82356149468161466a565b915060208301356001600160401b0381111561496157600080fd5b61496d858286016148b9565b9150509250929050565b634e487b7160e01b600052602160045260246000fd5b600581106149ab57634e487b7160e01b600052602160045260246000fd5b9052565b6001600160601b03861681526001600160a01b038516602082015260a081016149db604083018661498d565b9215156060820152608001529392505050565b600080600060608486031215614a0357600080fd5b8335614a0e8161466a565b92506020840135915060408401356001600160401b03811115614a3057600080fd5b614a3c868287016148b9565b9150509250925092565b60008060408385031215614a5957600080fd5b614833836146a3565b60008060408385031215614a7557600080fd5b8235614a808161466a565b91506020830135614a9081614779565b809150509250929050565b600080600060608486031215614ab057600080fd5b8335614abb8161466a565b925060208401356001600160401b0381168114614ad757600080fd5b9150604084013560ff811681146147dd57600080fd5b600082601f830112614afe57600080fd5b604051608081018181106001600160401b0382111715614b2057614b206146bf565b604052806080840185811115614b3557600080fd5b845b81811015614b4f578035835260209283019201614b37565b509195945050505050565b6000806000806000806000610140888a031215614b7657600080fd5b614b7f886146a3565b96506020880135614b8f81614779565b955060408801359450606088013593506080880135925060a08801359150614bba8960c08a01614aed565b905092959891949750929550565b60008060408385031215614bdb57600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b83811015614c235781516001600160a01b031687529582019590820190600101614bfe565b509495945050505050565b6020815281516020820152602082015160408201526040820151606082015260608201516080820152608082015160a082015260a082015160c0820152600060c08301516101608060e0850152614c89610180850183614bea565b60e08601516101008681019190915286015161012080870191909152860151909250610140614cc2818701836001600160a01b03169052565b959095015193019290925250919050565b60008060008060008060008060006101e08a8c031215614cf257600080fd5b8935614cfd8161466a565b985060208a0135614d0d8161466a565b975060408a0135614d1d8161466a565b965060608a0135614d2d8161466a565b955060808a0135614d3d81614779565b9450614d4c8b60a08c01614aed565b9350614d5c8b6101208c01614aed565b92506101a08a01356001600160401b03811115614d7857600080fd5b614d848c828d016148b9565b9250506101c08a0135614d968161466a565b809150509295985092959850929598565b60008060008060008060008060006101808a8c031215614dc657600080fd5b614dcf8a6146a3565b985060208a0135614ddf81614779565b975060408a0135965060608a0135955060808a0135945060a08a01359350614e0a8b60c08c01614aed565b92506101408a01356001600160401b0380821115614e2757600080fd5b614e338d838e016148b9565b93506101608c0135915080821115614e4a57600080fd5b50614e578c828d01614705565b9150509295985092959850929598565b60008060408385031215614e7a57600080fd5b8235915060208301356001600160401b0381111561496157600080fd5b600080600060608486031215614eac57600080fd5b833592506020840135915060408401356001600160401b03811115614a3057600080fd5b60008083601f840112614ee257600080fd5b5081356001600160401b03811115614ef957600080fd5b602083019150836020828501011115614f1157600080fd5b9250929050565b600080600060408486031215614f2d57600080fd5b83356001600160401b03811115614f4357600080fd5b614f4f86828701614ed0565b90945092505060208401356147dd8161466a565b600080600080600060808688031215614f7b57600080fd5b8535945060208601356001600160401b03811115614f9857600080fd5b614fa488828901614ed0565b9095509350506040860135614fb88161466a565b949793965091946060013592915050565b600060208284031215614fdb57600080fd5b81356001600160401b03811115614ff157600080fd5b613203848285016148b9565b6000806000806080858703121561501357600080fd5b843561501e8161466a565b935061502c602086016146a3565b925060408501359150606085013561504381614779565b939692955090935050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161508c5761508c615064565b5060010190565b81810381811115610fe557610fe5615064565b6000602082840312156150b857600080fd5b815161469c81614779565b60208101610fe5828461498d565b600181815b8085111561510c5781600019048211156150f2576150f2615064565b808516156150ff57918102915b93841c93908002906150d6565b509250929050565b60008261512357506001610fe5565b8161513057506000610fe5565b816001811461514657600281146151505761516c565b6001915050610fe5565b60ff84111561516157615161615064565b50506001821b610fe5565b5060208310610133831016604e8410600b841016171561518f575081810a610fe5565b61519983836150d1565b80600019048211156151ad576151ad615064565b029392505050565b6000610fe260ff841683615114565b8082028115828204841417610fe557610fe5615064565b634e487b7160e01b600052601260045260246000fd5b600082615200576152006151db565b500490565b60008060006060848603121561521a57600080fd5b83519250602084015161522c81614779565b60408501519092506147dd81614779565b80820180821115610fe557610fe5615064565b60006020828403121561526257600080fd5b5051919050565b60005b8381101561528457818101518382015260200161526c565b50506000910152565b6000825161529f818460208701615269565b9190910192915050565b600061012082019050871515825286602083015285604083015284606083015283608083015261442b60a0830184614888565b600081518084526152f4816020860160208601615269565b601f01601f19169290920160200192915050565b82815260406020820152600061320360408301846152dc565b60006101408083018a1515845260208a8186015289604086015288606086015287608086015261535460a0860188614888565b6101208501929092528451908190526101608401918086019160005b8181101561538c57835185529382019392820192600101615370565b50929c9b505050505050505050505050565b8481528360208201526080604082015260006153bd60808301856152dc565b905082606083015295945050505050565b6000602082840312156153e057600080fd5b815161469c8161466a565b6001600160a01b03929092168252602082015260400190565b6000600160ff1b820161541957615419615064565b5060000390565b938452602084019290925260408301526001600160a01b0316606082015260800190565b92835260208301919091526001600160a01b0316604082015260600190565b600082615472576154726151db565b500690565b60008060006060848603121561548c57600080fd5b835192506020840151915060408401516147dd8161477956fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220431441c28ca8378da3d4299e6d70f877d23c3d059d9775a1575f25515c19247964736f6c63430008120033", + "devdoc": { + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "AcceptedFeeToken(address,bool)": { + "details": "To be emitted when an ERC20 token is added or removed as a method to pay fees.", + "params": { + "_accepted": "Whether the token is accepted or not.", + "_token": "The ERC20 token." + } + }, + "DisputeCreation(uint256,address)": { + "details": "To be emitted when a dispute is created.", + "params": { + "_arbitrable": "The contract which created the dispute.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract." + } + }, + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "NewCurrencyRate(address,uint64,uint8)": { + "details": "To be emitted when the fee for a particular ERC20 token is updated.", + "params": { + "_feeToken": "The ERC20 token.", + "_rateDecimals": "The new decimals of the fee token rate.", + "_rateInEth": "The new rate of the fee token in ETH." + } + }, + "Ruling(address,uint256,uint256)": { + "details": "To be raised when a ruling is given.", + "params": { + "_arbitrable": "The arbitrable receiving the ruling.", + "_disputeID": "The identifier of the dispute in the Arbitrator contract.", + "_ruling": "The ruling which was given." + } + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "addNewDisputeKit(address)": { + "details": "Add a new supported dispute kit module to the court.", + "params": { + "_disputeKitAddress": "The address of the dispute kit contract." + } + }, + "appeal(uint256,uint256,bytes)": { + "details": "Appeals the ruling of a specified dispute. Note: Access restricted to the Dispute Kit for this `disputeID`.", + "params": { + "_disputeID": "The ID of the dispute.", + "_extraData": "Extradata for the dispute. Can be required during court jump.", + "_numberOfChoices": "Number of choices for the dispute. Can be required during court jump." + } + }, + "appealCost(uint256)": { + "details": "Gets the cost of appealing a specified dispute.", + "params": { + "_disputeID": "The ID of the dispute." + }, + "returns": { + "cost": "The appeal cost." + } + }, + "appealPeriod(uint256)": { + "details": "Gets the start and the end of a specified dispute's current appeal period.", + "params": { + "_disputeID": "The ID of the dispute." + }, + "returns": { + "end": "The end of the appeal period.", + "start": "The start of the appeal period." + } + }, + "arbitrationCost(bytes)": { + "details": "Compute the cost of arbitration denominated in ETH. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes)." + }, + "returns": { + "cost": "The arbitration cost in ETH." + } + }, + "arbitrationCost(bytes,address)": { + "details": "Compute the cost of arbitration denominated in `_feeToken`. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).", + "_feeToken": "The ERC20 token used to pay fees." + }, + "returns": { + "cost": "The arbitration cost in `_feeToken`." + } + }, + "changeAcceptedFeeTokens(address,bool)": { + "details": "Changes the supported fee tokens.", + "params": { + "_accepted": "Whether the token is supported or not as a method of fee payment.", + "_feeToken": "The fee token." + } + }, + "changeCurrencyRates(address,uint64,uint8)": { + "details": "Changes the currency rate of a fee token.", + "params": { + "_feeToken": "The fee token.", + "_rateDecimals": "The new decimals of the fee token rate.", + "_rateInEth": "The new rate of the fee token in ETH." + } + }, + "changeGovernor(address)": { + "details": "Changes the `governor` storage variable.", + "params": { + "_governor": "The new value for the `governor` storage variable." + } + }, + "changeJurorProsecutionModule(address)": { + "details": "Changes the `jurorProsecutionModule` storage variable.", + "params": { + "_jurorProsecutionModule": "The new value for the `jurorProsecutionModule` storage variable." + } + }, + "changePinakion(address)": { + "details": "Changes the `pinakion` storage variable.", + "params": { + "_pinakion": "The new value for the `pinakion` storage variable." + } + }, + "changeSortitionModule(address)": { + "details": "Changes the `_sortitionModule` storage variable. Note that the new module should be initialized for all courts.", + "params": { + "_sortitionModule": "The new value for the `sortitionModule` storage variable." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "createCourt(uint96,bool,uint256,uint256,uint256,uint256,uint256[4],bytes,uint256[])": { + "details": "Creates a court under a specified parent court.", + "params": { + "_alpha": "The `alpha` property value of the court.", + "_feeForJuror": "The `feeForJuror` property value of the court.", + "_hiddenVotes": "The `hiddenVotes` property value of the court.", + "_jurorsForCourtJump": "The `jurorsForCourtJump` property value of the court.", + "_minStake": "The `minStake` property value of the court.", + "_parent": "The `parent` property value of the court.", + "_sortitionExtraData": "Extra data for sortition module.", + "_supportedDisputeKits": "Indexes of dispute kits that this court will support.", + "_timesPerPeriod": "The `timesPerPeriod` property value of the court." + } + }, + "createDispute(uint256,bytes)": { + "details": "Create a dispute and pay for the fees in the native currency, typically ETH. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).", + "_numberOfChoices": "The number of choices the arbitrator can choose from in this dispute." + }, + "returns": { + "disputeID": "The identifier of the dispute created." + } + }, + "createDispute(uint256,bytes,address,uint256)": { + "details": "Create a dispute and pay for the fees in a supported ERC20 token. Must be called by the arbitrable contract. Must pay at least arbitrationCost(_extraData).", + "params": { + "_extraData": "Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).", + "_feeAmount": "Amount of the ERC20 token used to pay fees.", + "_feeToken": "The ERC20 token used to pay fees.", + "_numberOfChoices": "The number of choices the arbitrator can choose from in this dispute." + }, + "returns": { + "disputeID": "The identifier of the dispute created." + } + }, + "currentRuling(uint256)": { + "details": "Gets the current ruling of a specified dispute.", + "params": { + "_disputeID": "The ID of the dispute." + }, + "returns": { + "overridden": "Whether the ruling was overridden by appeal funding or not.", + "ruling": "The current ruling.", + "tied": "Whether it's a tie or not." + } + }, + "draw(uint256,uint256)": { + "details": "Draws jurors for the dispute. Can be called in parts.", + "params": { + "_disputeID": "The ID of the dispute.", + "_iterations": "The number of iterations to run." + } + }, + "enableDisputeKits(uint96,uint256[],bool)": { + "details": "Adds/removes court's support for specified dispute kits.", + "params": { + "_courtID": "The ID of the court.", + "_disputeKitIDs": "The IDs of dispute kits which support should be added/removed.", + "_enable": "Whether add or remove the dispute kits from the court." + } + }, + "execute(uint256,uint256,uint256)": { + "details": "Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.", + "params": { + "_disputeID": "The ID of the dispute.", + "_iterations": "The number of iterations to run.", + "_round": "The appeal round." + } + }, + "executeGovernorProposal(address,uint256,bytes)": { + "details": "Allows the governor to call anything on behalf of the contract.", + "params": { + "_amount": "The value sent with the call.", + "_data": "The data sent with the call.", + "_destination": "The destination of the call." + } + }, + "executeRuling(uint256)": { + "details": "Executes a specified dispute's ruling.", + "params": { + "_disputeID": "The ID of the dispute." + } + }, + "getNumberOfVotes(uint256)": { + "details": "Gets the number of votes permitted for the specified dispute in the latest round.", + "params": { + "_disputeID": "The ID of the dispute." + } + }, + "getTimesPerPeriod(uint96)": { + "details": "Gets the timesPerPeriod array for a given court.", + "params": { + "_courtID": "The ID of the court to get the times from." + }, + "returns": { + "timesPerPeriod": "The timesPerPeriod array for the given court." + } + }, + "initialize(address,address,address,address,bool,uint256[4],uint256[4],bytes,address)": { + "details": "Initializer (constructor equivalent for upgradable contracts).", + "params": { + "_courtParameters": "Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).", + "_disputeKit": "The address of the default dispute kit.", + "_governor": "The governor's address.", + "_hiddenVotes": "The `hiddenVotes` property value of the general court.", + "_jurorProsecutionModule": "The address of the juror prosecution module.", + "_pinakion": "The address of the token contract.", + "_sortitionExtraData": "The extra data for sortition module.", + "_sortitionModuleAddress": "The sortition module responsible for sortition of the jurors.", + "_timesPerPeriod": "The `timesPerPeriod` property value of the general court." + } + }, + "isDisputeKitJumping(uint256)": { + "details": "Returns true if the dispute kit will be switched to a parent DK.", + "params": { + "_disputeID": "The ID of the dispute." + }, + "returns": { + "_0": "Whether DK will be switched or not." + } + }, + "passPeriod(uint256)": { + "details": "Passes the period of a specified dispute.", + "params": { + "_disputeID": "The ID of the dispute." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "setStake(uint96,uint256)": { + "details": "Sets the caller's stake in a court.", + "params": { + "_courtID": "The ID of the court.", + "_newStake": "The new stake. Note that the existing delayed stake will be nullified as non-relevant." + } + }, + "setStakeBySortitionModule(address,uint96,uint256,bool)": { + "details": "Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.", + "params": { + "_account": "The account whose stake is being set.", + "_alreadyTransferred": "Whether the PNKs have already been transferred to the contract.", + "_courtID": "The ID of the court.", + "_newStake": "The new stake." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "title": "KlerosCore Core arbitrator contract for Kleros v2. Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 264, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 267, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "pinakion", + "offset": 0, + "slot": "1", + "type": "t_contract(IERC20)124" + }, + { + "astId": 269, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "jurorProsecutionModule", + "offset": 0, + "slot": "2", + "type": "t_address" + }, + { + "astId": 272, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "sortitionModule", + "offset": 0, + "slot": "3", + "type": "t_contract(ISortitionModule)9818" + }, + { + "astId": 276, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "courts", + "offset": 0, + "slot": "4", + "type": "t_array(t_struct(Court)187_storage)dyn_storage" + }, + { + "astId": 280, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "disputeKits", + "offset": 0, + "slot": "5", + "type": "t_array(t_contract(IDisputeKit)9696)dyn_storage" + }, + { + "astId": 284, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "disputes", + "offset": 0, + "slot": "6", + "type": "t_array(t_struct(Dispute)204_storage)dyn_storage" + }, + { + "astId": 290, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "currencyRates", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_contract(IERC20)124,t_struct(CurrencyRate)249_storage)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_address)dyn_storage": { + "base": "t_address", + "encoding": "dynamic_array", + "label": "address[]", + "numberOfBytes": "32" + }, + "t_array(t_contract(IDisputeKit)9696)dyn_storage": { + "base": "t_contract(IDisputeKit)9696", + "encoding": "dynamic_array", + "label": "contract IDisputeKit[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Court)187_storage)dyn_storage": { + "base": "t_struct(Court)187_storage", + "encoding": "dynamic_array", + "label": "struct KlerosCore.Court[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Dispute)204_storage)dyn_storage": { + "base": "t_struct(Dispute)204_storage", + "encoding": "dynamic_array", + "label": "struct KlerosCore.Dispute[]", + "numberOfBytes": "32" + }, + "t_array(t_struct(Round)229_storage)dyn_storage": { + "base": "t_struct(Round)229_storage", + "encoding": "dynamic_array", + "label": "struct KlerosCore.Round[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)4_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[4]", + "numberOfBytes": "128" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IArbitrableV2)9457": { + "encoding": "inplace", + "label": "contract IArbitrableV2", + "numberOfBytes": "20" + }, + "t_contract(IDisputeKit)9696": { + "encoding": "inplace", + "label": "contract IDisputeKit", + "numberOfBytes": "20" + }, + "t_contract(IERC20)124": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(ISortitionModule)9818": { + "encoding": "inplace", + "label": "contract ISortitionModule", + "numberOfBytes": "20" + }, + "t_enum(Period)161": { + "encoding": "inplace", + "label": "enum KlerosCore.Period", + "numberOfBytes": "1" + }, + "t_mapping(t_contract(IERC20)124,t_struct(CurrencyRate)249_storage)": { + "encoding": "mapping", + "key": "t_contract(IERC20)124", + "label": "mapping(contract IERC20 => struct KlerosCore.CurrencyRate)", + "numberOfBytes": "32", + "value": "t_struct(CurrencyRate)249_storage" + }, + "t_mapping(t_uint256,t_bool)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_struct(Court)187_storage": { + "encoding": "inplace", + "label": "struct KlerosCore.Court", + "members": [ + { + "astId": 163, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "parent", + "offset": 0, + "slot": "0", + "type": "t_uint96" + }, + { + "astId": 165, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "hiddenVotes", + "offset": 12, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 168, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "children", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 170, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "minStake", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 172, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "alpha", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 174, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "feeForJuror", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 176, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "jurorsForCourtJump", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 180, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "timesPerPeriod", + "offset": 0, + "slot": "6", + "type": "t_array(t_uint256)4_storage" + }, + { + "astId": 184, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "supportedDisputeKits", + "offset": 0, + "slot": "10", + "type": "t_mapping(t_uint256,t_bool)" + }, + { + "astId": 186, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "disabled", + "offset": 0, + "slot": "11", + "type": "t_bool" + } + ], + "numberOfBytes": "384" + }, + "t_struct(CurrencyRate)249_storage": { + "encoding": "inplace", + "label": "struct KlerosCore.CurrencyRate", + "members": [ + { + "astId": 244, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "feePaymentAccepted", + "offset": 0, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 246, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "rateInEth", + "offset": 1, + "slot": "0", + "type": "t_uint64" + }, + { + "astId": 248, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "rateDecimals", + "offset": 9, + "slot": "0", + "type": "t_uint8" + } + ], + "numberOfBytes": "32" + }, + "t_struct(Dispute)204_storage": { + "encoding": "inplace", + "label": "struct KlerosCore.Dispute", + "members": [ + { + "astId": 189, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "courtID", + "offset": 0, + "slot": "0", + "type": "t_uint96" + }, + { + "astId": 192, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "arbitrated", + "offset": 12, + "slot": "0", + "type": "t_contract(IArbitrableV2)9457" + }, + { + "astId": 195, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "period", + "offset": 0, + "slot": "1", + "type": "t_enum(Period)161" + }, + { + "astId": 197, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "ruled", + "offset": 1, + "slot": "1", + "type": "t_bool" + }, + { + "astId": 199, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "lastPeriodChange", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 203, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "rounds", + "offset": 0, + "slot": "3", + "type": "t_array(t_struct(Round)229_storage)dyn_storage" + } + ], + "numberOfBytes": "128" + }, + "t_struct(Round)229_storage": { + "encoding": "inplace", + "label": "struct KlerosCore.Round", + "members": [ + { + "astId": 206, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "disputeKitID", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 208, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "pnkAtStakePerJuror", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 210, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "totalFeesForJurors", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 212, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "nbVotes", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 214, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "repartitions", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 216, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "pnkPenalties", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 219, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "drawnJurors", + "offset": 0, + "slot": "6", + "type": "t_array(t_address)dyn_storage" + }, + { + "astId": 221, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "sumFeeRewardPaid", + "offset": 0, + "slot": "7", + "type": "t_uint256" + }, + { + "astId": 223, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "sumPnkRewardPaid", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 226, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "feeToken", + "offset": 0, + "slot": "9", + "type": "t_contract(IERC20)124" + }, + { + "astId": 228, + "contract": "src/arbitration/KlerosCore.sol:KlerosCore", + "label": "drawIterations", + "offset": 0, + "slot": "10", + "type": "t_uint256" + } + ], + "numberOfBytes": "352" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + }, + "t_uint96": { + "encoding": "inplace", + "label": "uint96", + "numberOfBytes": "12" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepolia/KlerosCore_Proxy.json b/contracts/deployments/arbitrumSepolia/KlerosCore_Proxy.json new file mode 100644 index 000000000..087fffd62 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/KlerosCore_Proxy.json @@ -0,0 +1,136 @@ +{ + "address": "0x33d0b8879368acD8ca868e656Ade97bB97b90468", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xdddc8358282ebf57d1b6c4773e2625c66f633c4d7778898497aac375e08cf208", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x33d0b8879368acD8ca868e656Ade97bB97b90468", + "transactionIndex": 1, + "gasUsed": "2521724", + "logsBloom": "0x00000000000000000000000020000000000000000000000000000000020000000000000000000000000000000000000000000000800000000000000000040000000000000000000000000000000000000000000000040000000000000000000000000000020000000000000010000800402000000000000008000200000000000000000000000000000800000040000000000000000080000000000000100040000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000060000000001001000000000000000000000000000000000000000000000000000020", + "blockHash": "0x33061a26b14f447927e333d5cfb0fe66f5fc46977083a62edbc0a7a5d554a1fd", + "transactionHash": "0xdddc8358282ebf57d1b6c4773e2625c66f633c4d7778898497aac375e08cf208", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842840, + "transactionHash": "0xdddc8358282ebf57d1b6c4773e2625c66f633c4d7778898497aac375e08cf208", + "address": "0x33d0b8879368acD8ca868e656Ade97bB97b90468", + "topics": [ + "0x44063d258760b98116d53815adbc906a56b3563e540148cc0fc2457f83b5eeb2", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000008078c2a3bf93f6f69bdd4d38233e7e219ea1914e" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x33061a26b14f447927e333d5cfb0fe66f5fc46977083a62edbc0a7a5d554a1fd" + }, + { + "transactionIndex": 1, + "blockNumber": 3842840, + "transactionHash": "0xdddc8358282ebf57d1b6c4773e2625c66f633c4d7778898497aac375e08cf208", + "address": "0x33d0b8879368acD8ca868e656Ade97bB97b90468", + "topics": [ + "0x3475f0ed7216dd7d453db663a1c3024e4f36cc925521d54edb9d13e022cbee3d", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000", + "logIndex": 1, + "blockHash": "0x33061a26b14f447927e333d5cfb0fe66f5fc46977083a62edbc0a7a5d554a1fd" + }, + { + "transactionIndex": 1, + "blockNumber": 3842840, + "transactionHash": "0xdddc8358282ebf57d1b6c4773e2625c66f633c4d7778898497aac375e08cf208", + "address": "0x33d0b8879368acD8ca868e656Ade97bB97b90468", + "topics": [ + "0xb47629acdf64971062d40984f77d3dee212d735b11e3e8c7a4222d9f0572cc79", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000001" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0x33061a26b14f447927e333d5cfb0fe66f5fc46977083a62edbc0a7a5d554a1fd" + }, + { + "transactionIndex": 1, + "blockNumber": 3842840, + "transactionHash": "0xdddc8358282ebf57d1b6c4773e2625c66f633c4d7778898497aac375e08cf208", + "address": "0x33d0b8879368acD8ca868e656Ade97bB97b90468", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 3, + "blockHash": "0x33061a26b14f447927e333d5cfb0fe66f5fc46977083a62edbc0a7a5d554a1fd" + } + ], + "blockNumber": 3842840, + "cumulativeGasUsed": "2521724", + "status": 1, + "byzantium": true + }, + "args": [ + "0x6FDc191b55a03e840b36793e433A932EeCEa40BE", + "0x994b27af000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c5900000000000000000000000034b944d42cacfc8266955d07a80181d2054aa22500000000000000000000000000000000000000000000000000000000000000000000000000000000000000008078c2a3bf93f6f69bdd4d38233e7e219ea1914e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad78ebc5ac62000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000001e00000000000000000000000003645f9e08d80e47c82ad9e33fcb4ea703822c83100000000000000000000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepolia/PNKFaucet.json b/contracts/deployments/arbitrumSepolia/PNKFaucet.json new file mode 100644 index 000000000..d28f29e24 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/PNKFaucet.json @@ -0,0 +1,226 @@ +{ + "address": "0x0273512759B5E80031725332da12E91E9F8Bf667", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "amount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "balance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "changeAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "request", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "withdrewAlready", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x122f0df01af8e5f5f1aaf1496bd4319f5f237c42d59313735a1f02c8405fc7f3", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x0273512759B5E80031725332da12E91E9F8Bf667", + "transactionIndex": 1, + "gasUsed": "7817067", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xbbd32a62b7284fdac223da811dd2ca4ea598d5faf247b65531f912c06f7edf95", + "transactionHash": "0x122f0df01af8e5f5f1aaf1496bd4319f5f237c42d59313735a1f02c8405fc7f3", + "logs": [], + "blockNumber": 3845283, + "cumulativeGasUsed": "7817067", + "status": 1, + "byzantium": true + }, + "args": [ + "0x34B944D42cAcfC8266955D07A80181D2054aa225" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"amount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"balance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"changeAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"request\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"withdrewAlready\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/token/Faucet.sol\":\"Faucet\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/token/Faucet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ncontract Faucet {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n IERC20 public token;\\n address public governor;\\n mapping(address => bool) public withdrewAlready;\\n uint256 public amount = 10_000 ether;\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(address(governor) == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n constructor(IERC20 _token) {\\n token = _token;\\n governor = msg.sender;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n function changeGovernor(address _governor) public onlyByGovernor {\\n governor = _governor;\\n }\\n\\n function changeAmount(uint256 _amount) public onlyByGovernor {\\n amount = _amount;\\n }\\n\\n function withdraw() public onlyByGovernor {\\n token.transfer(governor, token.balanceOf(address(this)));\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function request() public {\\n require(\\n !withdrewAlready[msg.sender],\\n \\\"You have used this faucet already. If you need more tokens, please use another address.\\\"\\n );\\n token.transfer(msg.sender, amount);\\n withdrewAlready[msg.sender] = true;\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n function balance() public view returns (uint) {\\n return token.balanceOf(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x3a54681cc304ccbfdb42215104b63809919a432ac5d3986d3021a11fcc7a1cc3\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405269021e19e0c9bab240000060035534801561001e57600080fd5b5060405161065538038061065583398101604081905261003d9161006b565b600080546001600160a01b039092166001600160a01b0319928316179055600180549091163317905561009b565b60006020828403121561007d57600080fd5b81516001600160a01b038116811461009457600080fd5b9392505050565b6105ab806100aa6000396000f3fe608060405234801561001057600080fd5b50600436106100835760003560e01c80630c340a2414610088578063338cdca1146100b15780633ccfd60b146100bb5780635c320516146100c3578063aa8c217c146100d6578063b69ef8a8146100ed578063d61c40dc146100f5578063e4c0aaf414610128578063fc0c546a1461013b575b600080fd5b60015461009b906001600160a01b031681565b6040516100a8919061049b565b60405180910390f35b6100b961014e565b005b6100b961028f565b6100b96100d13660046104af565b6103a9565b6100df60035481565b6040519081526020016100a8565b6100df6103d8565b6101186101033660046104c8565b60026020526000908152604090205460ff1681565b60405190151581526020016100a8565b6100b96101363660046104c8565b61044f565b60005461009b906001600160a01b031681565b3360009081526002602052604090205460ff16156101f95760405162461bcd60e51b815260206004820152605760248201527f596f752068617665207573656420746869732066617563657420616c7265616460448201527f792e20496620796f75206e656564206d6f726520746f6b656e732c20706c656160648201527639b2903ab9b29030b737ba3432b91030b2323932b9b99760491b608482015260a4015b60405180910390fd5b60005460035460405163a9059cbb60e01b815233600482015260248101919091526001600160a01b039091169063a9059cbb906044016020604051808303816000875af115801561024e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027291906104f8565b50336000908152600260205260409020805460ff19166001179055565b6001546001600160a01b031633146102b95760405162461bcd60e51b81526004016101f09061051a565b6000546001546040516370a0823160e01b81526001600160a01b039283169263a9059cbb92169083906370a08231906102f690309060040161049b565b602060405180830381865afa158015610313573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610337919061055c565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a691906104f8565b50565b6001546001600160a01b031633146103d35760405162461bcd60e51b81526004016101f09061051a565b600355565b600080546040516370a0823160e01b81526001600160a01b03909116906370a082319061040990309060040161049b565b602060405180830381865afa158015610426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a919061055c565b905090565b6001546001600160a01b031633146104795760405162461bcd60e51b81526004016101f09061051a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0391909116815260200190565b6000602082840312156104c157600080fd5b5035919050565b6000602082840312156104da57600080fd5b81356001600160a01b03811681146104f157600080fd5b9392505050565b60006020828403121561050a57600080fd5b815180151581146104f157600080fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60006020828403121561056e57600080fd5b505191905056fea26469706673582212204f7fd812260eacd88f23b436eb40b4943480e914005f0a0f2738f0d3c9696a5964736f6c63430008120033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100835760003560e01c80630c340a2414610088578063338cdca1146100b15780633ccfd60b146100bb5780635c320516146100c3578063aa8c217c146100d6578063b69ef8a8146100ed578063d61c40dc146100f5578063e4c0aaf414610128578063fc0c546a1461013b575b600080fd5b60015461009b906001600160a01b031681565b6040516100a8919061049b565b60405180910390f35b6100b961014e565b005b6100b961028f565b6100b96100d13660046104af565b6103a9565b6100df60035481565b6040519081526020016100a8565b6100df6103d8565b6101186101033660046104c8565b60026020526000908152604090205460ff1681565b60405190151581526020016100a8565b6100b96101363660046104c8565b61044f565b60005461009b906001600160a01b031681565b3360009081526002602052604090205460ff16156101f95760405162461bcd60e51b815260206004820152605760248201527f596f752068617665207573656420746869732066617563657420616c7265616460448201527f792e20496620796f75206e656564206d6f726520746f6b656e732c20706c656160648201527639b2903ab9b29030b737ba3432b91030b2323932b9b99760491b608482015260a4015b60405180910390fd5b60005460035460405163a9059cbb60e01b815233600482015260248101919091526001600160a01b039091169063a9059cbb906044016020604051808303816000875af115801561024e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027291906104f8565b50336000908152600260205260409020805460ff19166001179055565b6001546001600160a01b031633146102b95760405162461bcd60e51b81526004016101f09061051a565b6000546001546040516370a0823160e01b81526001600160a01b039283169263a9059cbb92169083906370a08231906102f690309060040161049b565b602060405180830381865afa158015610313573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610337919061055c565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a691906104f8565b50565b6001546001600160a01b031633146103d35760405162461bcd60e51b81526004016101f09061051a565b600355565b600080546040516370a0823160e01b81526001600160a01b03909116906370a082319061040990309060040161049b565b602060405180830381865afa158015610426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a919061055c565b905090565b6001546001600160a01b031633146104795760405162461bcd60e51b81526004016101f09061051a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0391909116815260200190565b6000602082840312156104c157600080fd5b5035919050565b6000602082840312156104da57600080fd5b81356001600160a01b03811681146104f157600080fd5b9392505050565b60006020828403121561050a57600080fd5b815180151581146104f157600080fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60006020828403121561056e57600080fd5b505191905056fea26469706673582212204f7fd812260eacd88f23b436eb40b4943480e914005f0a0f2738f0d3c9696a5964736f6c63430008120033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 24559, + "contract": "src/token/Faucet.sol:Faucet", + "label": "token", + "offset": 0, + "slot": "0", + "type": "t_contract(IERC20)1042" + }, + { + "astId": 24561, + "contract": "src/token/Faucet.sol:Faucet", + "label": "governor", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 24565, + "contract": "src/token/Faucet.sol:Faucet", + "label": "withdrewAlready", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 24568, + "contract": "src/token/Faucet.sol:Faucet", + "label": "amount", + "offset": 0, + "slot": "3", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)1042": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepolia/PolicyRegistry.json b/contracts/deployments/arbitrumSepolia/PolicyRegistry.json new file mode 100644 index 000000000..4e47a2ad6 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/PolicyRegistry.json @@ -0,0 +1,305 @@ +{ + "address": "0xb177AC8827146AC74C412688c6b10676ca170096", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_courtName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "_policy", + "type": "string" + } + ], + "name": "PolicyUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "policies", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_courtName", + "type": "string" + }, + { + "internalType": "string", + "name": "_policy", + "type": "string" + } + ], + "name": "setPolicy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0xce1cad69ac742ad0a50a35f2a0da0868d6003910e48abfde28d3ee8aef256434", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xb177AC8827146AC74C412688c6b10676ca170096", + "transactionIndex": 1, + "gasUsed": "1844759", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000004000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x308ecaf89b4a4f4159d28730415a66167959d1ea06d678926735d5415d9487e1", + "transactionHash": "0xce1cad69ac742ad0a50a35f2a0da0868d6003910e48abfde28d3ee8aef256434", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842803, + "transactionHash": "0xce1cad69ac742ad0a50a35f2a0da0868d6003910e48abfde28d3ee8aef256434", + "address": "0xb177AC8827146AC74C412688c6b10676ca170096", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x308ecaf89b4a4f4159d28730415a66167959d1ea06d678926735d5415d9487e1" + } + ], + "blockNumber": 3842803, + "cumulativeGasUsed": "1844759", + "status": 1, + "byzantium": true + }, + "args": [ + "0xd543D50dcba2c3E067296210D64c8F91206Df908", + "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59" + ] + }, + "implementation": "0xd543D50dcba2c3E067296210D64c8F91206Df908", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepolia/PolicyRegistry_Implementation.json b/contracts/deployments/arbitrumSepolia/PolicyRegistry_Implementation.json new file mode 100644 index 000000000..164a9c90b --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/PolicyRegistry_Implementation.json @@ -0,0 +1,397 @@ +{ + "address": "0xd543D50dcba2c3E067296210D64c8F91206Df908", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_courtName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "_policy", + "type": "string" + } + ], + "name": "PolicyUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "policies", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "internalType": "string", + "name": "_courtName", + "type": "string" + }, + { + "internalType": "string", + "name": "_policy", + "type": "string" + } + ], + "name": "setPolicy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x2ad28178412a686ad0b21d17a3fb40cbd7c354192ddfadd1ebf724d73b3901ff", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xd543D50dcba2c3E067296210D64c8F91206Df908", + "transactionIndex": 1, + "gasUsed": "5015977", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x78a7dd8160e6abd5f1ab8f9d80f49932ccba3d9873177259a1c46a5ee7f68089", + "transactionHash": "0x2ad28178412a686ad0b21d17a3fb40cbd7c354192ddfadd1ebf724d73b3901ff", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842801, + "transactionHash": "0x2ad28178412a686ad0b21d17a3fb40cbd7c354192ddfadd1ebf724d73b3901ff", + "address": "0xd543D50dcba2c3E067296210D64c8F91206Df908", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 0, + "blockHash": "0x78a7dd8160e6abd5f1ab8f9d80f49932ccba3d9873177259a1c46a5ee7f68089" + } + ], + "blockNumber": 3842801, + "cumulativeGasUsed": "5015977", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_courtName\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_policy\",\"type\":\"string\"}],\"name\":\"PolicyUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"policies\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_courtName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_policy\",\"type\":\"string\"}],\"name\":\"setPolicy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"A contract to maintain a policy for each court.\",\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"PolicyUpdate(uint256,string,string)\":{\"details\":\"Emitted when a policy is updated.\",\"params\":{\"_courtID\":\"The ID of the policy's court.\",\"_courtName\":\"The name of the policy's court.\",\"_policy\":\"The URI of the policy JSON.\"}},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"changeGovernor(address)\":{\"details\":\"Changes the `governor` storage variable.\",\"params\":{\"_governor\":\"The new value for the `governor` storage variable.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"initialize(address)\":{\"details\":\"Constructs the `PolicyRegistry` contract.\",\"params\":{\"_governor\":\"The governor's address.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"setPolicy(uint256,string,string)\":{\"details\":\"Sets the policy for the specified court.\",\"params\":{\"_courtID\":\"The ID of the specified court.\",\"_courtName\":\"The name of the specified court.\",\"_policy\":\"The URI of the policy JSON.\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"PolicyRegistry\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/PolicyRegistry.sol\":\"PolicyRegistry\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/arbitration/PolicyRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\nimport \\\"../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title PolicyRegistry\\n/// @dev A contract to maintain a policy for each court.\\ncontract PolicyRegistry is UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n /// @dev Emitted when a policy is updated.\\n /// @param _courtID The ID of the policy's court.\\n /// @param _courtName The name of the policy's court.\\n /// @param _policy The URI of the policy JSON.\\n event PolicyUpdate(uint256 indexed _courtID, string _courtName, string _policy);\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor;\\n mapping(uint256 => string) public policies;\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n /// @dev Requires that the sender is the governor.\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"No allowed: governor only\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Constructs the `PolicyRegistry` contract.\\n /// @param _governor The governor's address.\\n function initialize(address _governor) external reinitializer(1) {\\n governor = _governor;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the policy for the specified court.\\n /// @param _courtID The ID of the specified court.\\n /// @param _courtName The name of the specified court.\\n /// @param _policy The URI of the policy JSON.\\n function setPolicy(uint256 _courtID, string calldata _courtName, string calldata _policy) external onlyByGovernor {\\n policies[_courtID] = _policy;\\n emit PolicyUpdate(_courtID, _courtName, policies[_courtID]);\\n }\\n}\\n\",\"keccak256\":\"0x24154360b94aa45b0699b65d31087e475f9d43b42771c62440f3d5741f7419a4\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060805234801561001457600080fd5b5061001d610022565b6100d3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff16156100715760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b03908116146100d05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051610b926100fc6000396000818161017b015281816101a401526103a10152610b926000f3fe6080604052600436106100605760003560e01c80630c340a24146100655780634f1ef286146100a257806352d1902d146100b7578063bdf73780146100da578063c4d66de8146100fa578063d3e894831461011a578063e4c0aaf414610147575b600080fd5b34801561007157600080fd5b50600054610085906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100b56100b03660046106ba565b610167565b005b3480156100c357600080fd5b506100cc610394565b604051908152602001610099565b3480156100e657600080fd5b506100b56100f53660046107c5565b6103f2565b34801561010657600080fd5b506100b561011536600461083f565b61048b565b34801561012657600080fd5b5061013a610135366004610861565b610575565b604051610099919061089e565b34801561015357600080fd5b506100b561016236600461083f565b61060f565b6101708261065b565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806101ee57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166101e2600080516020610b3d8339815191525490565b6001600160a01b031614155b1561020c5760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610266575060408051601f3d908101601f19168201909252610263918101906108d1565b60015b61029357604051630c76093760e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610b3d83398151915281146102c457604051632a87526960e21b81526004810182905260240161028a565b600080516020610b3d8339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a281511561038f576000836001600160a01b03168360405161032b91906108ea565b600060405180830381855af49150503d8060008114610366576040519150601f19603f3d011682016040523d82523d6000602084013e61036b565b606091505b505090508061038d576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103df5760405163703e46dd60e11b815260040160405180910390fd5b50600080516020610b3d83398151915290565b6000546001600160a01b0316331461041c5760405162461bcd60e51b815260040161028a90610906565b60008581526001602052604090206104358284836109c1565b50847f61f7110245e82eddd3b134d1e1607420d4a4dcdab30f5abdbbc9c3485b5dd2a48585600160008a815260200190815260200160002060405161047c93929190610a82565b60405180910390a25050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806104d55750805467ffffffffffffffff808416911610155b156104f25760405162dc149f60e41b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6001602052600090815260409020805461058e90610939565b80601f01602080910402602001604051908101604052809291908181526020018280546105ba90610939565b80156106075780601f106105dc57610100808354040283529160200191610607565b820191906000526020600020905b8154815290600101906020018083116105ea57829003601f168201915b505050505081565b6000546001600160a01b031633146106395760405162461bcd60e51b815260040161028a90610906565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146106855760405162461bcd60e51b815260040161028a90610906565b50565b80356001600160a01b038116811461069f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156106cd57600080fd5b6106d683610688565b9150602083013567ffffffffffffffff808211156106f357600080fd5b818501915085601f83011261070757600080fd5b813581811115610719576107196106a4565b604051601f8201601f19908116603f01168101908382118183101715610741576107416106a4565b8160405282815288602084870101111561075a57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008083601f84011261078e57600080fd5b50813567ffffffffffffffff8111156107a657600080fd5b6020830191508360208285010111156107be57600080fd5b9250929050565b6000806000806000606086880312156107dd57600080fd5b85359450602086013567ffffffffffffffff808211156107fc57600080fd5b61080889838a0161077c565b9096509450604088013591508082111561082157600080fd5b5061082e8882890161077c565b969995985093965092949392505050565b60006020828403121561085157600080fd5b61085a82610688565b9392505050565b60006020828403121561087357600080fd5b5035919050565b60005b8381101561089557818101518382015260200161087d565b50506000910152565b60208152600082518060208401526108bd81604085016020870161087a565b601f01601f19169190910160400192915050565b6000602082840312156108e357600080fd5b5051919050565b600082516108fc81846020870161087a565b9190910192915050565b6020808252601990820152784e6f20616c6c6f7765643a20676f7665726e6f72206f6e6c7960381b604082015260600190565b600181811c9082168061094d57607f821691505b60208210810361096d57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561038f57600081815260208120601f850160051c8101602086101561099a5750805b601f850160051c820191505b818110156109b9578281556001016109a6565b505050505050565b67ffffffffffffffff8311156109d9576109d96106a4565b6109ed836109e78354610939565b83610973565b6000601f841160018114610a215760008515610a095750838201355b600019600387901b1c1916600186901b178355610a7b565b600083815260209020601f19861690835b82811015610a525786850135825560209485019460019092019101610a32565b5086821015610a6f5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b60408152826040820152828460608301376000606084830101526000601f19601f850116820160206060848303018185015260008554610ac181610939565b8060608601526080600180841660008114610ae35760018114610afd57610b2b565b60ff1985168884015283151560051b880183019550610b2b565b8a6000528660002060005b85811015610b235781548a8201860152908301908801610b08565b890184019650505b50939b9a505050505050505050505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122013474a11eb4f083f97a82a4223662ae3b08f8ebecfcac55156e710f84b21048b64736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106100605760003560e01c80630c340a24146100655780634f1ef286146100a257806352d1902d146100b7578063bdf73780146100da578063c4d66de8146100fa578063d3e894831461011a578063e4c0aaf414610147575b600080fd5b34801561007157600080fd5b50600054610085906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100b56100b03660046106ba565b610167565b005b3480156100c357600080fd5b506100cc610394565b604051908152602001610099565b3480156100e657600080fd5b506100b56100f53660046107c5565b6103f2565b34801561010657600080fd5b506100b561011536600461083f565b61048b565b34801561012657600080fd5b5061013a610135366004610861565b610575565b604051610099919061089e565b34801561015357600080fd5b506100b561016236600461083f565b61060f565b6101708261065b565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806101ee57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166101e2600080516020610b3d8339815191525490565b6001600160a01b031614155b1561020c5760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610266575060408051601f3d908101601f19168201909252610263918101906108d1565b60015b61029357604051630c76093760e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610b3d83398151915281146102c457604051632a87526960e21b81526004810182905260240161028a565b600080516020610b3d8339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a281511561038f576000836001600160a01b03168360405161032b91906108ea565b600060405180830381855af49150503d8060008114610366576040519150601f19603f3d011682016040523d82523d6000602084013e61036b565b606091505b505090508061038d576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103df5760405163703e46dd60e11b815260040160405180910390fd5b50600080516020610b3d83398151915290565b6000546001600160a01b0316331461041c5760405162461bcd60e51b815260040161028a90610906565b60008581526001602052604090206104358284836109c1565b50847f61f7110245e82eddd3b134d1e1607420d4a4dcdab30f5abdbbc9c3485b5dd2a48585600160008a815260200190815260200160002060405161047c93929190610a82565b60405180910390a25050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806104d55750805467ffffffffffffffff808416911610155b156104f25760405162dc149f60e41b815260040160405180910390fd5b8054600160401b67ffffffffffffffff841668ffffffffffffffffff199092168217178255600080546001600160a01b0319166001600160a01b038616179055815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6001602052600090815260409020805461058e90610939565b80601f01602080910402602001604051908101604052809291908181526020018280546105ba90610939565b80156106075780601f106105dc57610100808354040283529160200191610607565b820191906000526020600020905b8154815290600101906020018083116105ea57829003601f168201915b505050505081565b6000546001600160a01b031633146106395760405162461bcd60e51b815260040161028a90610906565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146106855760405162461bcd60e51b815260040161028a90610906565b50565b80356001600160a01b038116811461069f57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156106cd57600080fd5b6106d683610688565b9150602083013567ffffffffffffffff808211156106f357600080fd5b818501915085601f83011261070757600080fd5b813581811115610719576107196106a4565b604051601f8201601f19908116603f01168101908382118183101715610741576107416106a4565b8160405282815288602084870101111561075a57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008083601f84011261078e57600080fd5b50813567ffffffffffffffff8111156107a657600080fd5b6020830191508360208285010111156107be57600080fd5b9250929050565b6000806000806000606086880312156107dd57600080fd5b85359450602086013567ffffffffffffffff808211156107fc57600080fd5b61080889838a0161077c565b9096509450604088013591508082111561082157600080fd5b5061082e8882890161077c565b969995985093965092949392505050565b60006020828403121561085157600080fd5b61085a82610688565b9392505050565b60006020828403121561087357600080fd5b5035919050565b60005b8381101561089557818101518382015260200161087d565b50506000910152565b60208152600082518060208401526108bd81604085016020870161087a565b601f01601f19169190910160400192915050565b6000602082840312156108e357600080fd5b5051919050565b600082516108fc81846020870161087a565b9190910192915050565b6020808252601990820152784e6f20616c6c6f7765643a20676f7665726e6f72206f6e6c7960381b604082015260600190565b600181811c9082168061094d57607f821691505b60208210810361096d57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561038f57600081815260208120601f850160051c8101602086101561099a5750805b601f850160051c820191505b818110156109b9578281556001016109a6565b505050505050565b67ffffffffffffffff8311156109d9576109d96106a4565b6109ed836109e78354610939565b83610973565b6000601f841160018114610a215760008515610a095750838201355b600019600387901b1c1916600186901b178355610a7b565b600083815260209020601f19861690835b82811015610a525786850135825560209485019460019092019101610a32565b5086821015610a6f5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b60408152826040820152828460608301376000606084830101526000601f19601f850116820160206060848303018185015260008554610ac181610939565b8060608601526080600180841660008114610ae35760018114610afd57610b2b565b60ff1985168884015283151560051b880183019550610b2b565b8a6000528660002060005b85811015610b235781548a8201860152908301908801610b08565b890184019650505b50939b9a505050505050505050505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122013474a11eb4f083f97a82a4223662ae3b08f8ebecfcac55156e710f84b21048b64736f6c63430008120033", + "devdoc": { + "details": "A contract to maintain a policy for each court.", + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "PolicyUpdate(uint256,string,string)": { + "details": "Emitted when a policy is updated.", + "params": { + "_courtID": "The ID of the policy's court.", + "_courtName": "The name of the policy's court.", + "_policy": "The URI of the policy JSON." + } + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "changeGovernor(address)": { + "details": "Changes the `governor` storage variable.", + "params": { + "_governor": "The new value for the `governor` storage variable." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "initialize(address)": { + "details": "Constructs the `PolicyRegistry` contract.", + "params": { + "_governor": "The governor's address." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "setPolicy(uint256,string,string)": { + "details": "Sets the policy for the specified court.", + "params": { + "_courtID": "The ID of the specified court.", + "_courtName": "The name of the specified court.", + "_policy": "The URI of the policy JSON." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "title": "PolicyRegistry", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 7764, + "contract": "src/arbitration/PolicyRegistry.sol:PolicyRegistry", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 7768, + "contract": "src/arbitration/PolicyRegistry.sol:PolicyRegistry", + "label": "policies", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint256,t_string_storage)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_mapping(t_uint256,t_string_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => string)", + "numberOfBytes": "32", + "value": "t_string_storage" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepolia/PolicyRegistry_Proxy.json b/contracts/deployments/arbitrumSepolia/PolicyRegistry_Proxy.json new file mode 100644 index 000000000..eb59fcd1c --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/PolicyRegistry_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0xb177AC8827146AC74C412688c6b10676ca170096", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xce1cad69ac742ad0a50a35f2a0da0868d6003910e48abfde28d3ee8aef256434", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xb177AC8827146AC74C412688c6b10676ca170096", + "transactionIndex": 1, + "gasUsed": "1844759", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000004000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x308ecaf89b4a4f4159d28730415a66167959d1ea06d678926735d5415d9487e1", + "transactionHash": "0xce1cad69ac742ad0a50a35f2a0da0868d6003910e48abfde28d3ee8aef256434", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842803, + "transactionHash": "0xce1cad69ac742ad0a50a35f2a0da0868d6003910e48abfde28d3ee8aef256434", + "address": "0xb177AC8827146AC74C412688c6b10676ca170096", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x308ecaf89b4a4f4159d28730415a66167959d1ea06d678926735d5415d9487e1" + } + ], + "blockNumber": 3842803, + "cumulativeGasUsed": "1844759", + "status": 1, + "byzantium": true + }, + "args": [ + "0xd543D50dcba2c3E067296210D64c8F91206Df908", + "0xc4d66de8000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepolia/RandomizerRNG.json b/contracts/deployments/arbitrumSepolia/RandomizerRNG.json new file mode 100644 index 000000000..9952e01b9 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/RandomizerRNG.json @@ -0,0 +1,397 @@ +{ + "address": "0xaE7F3AcA5c1E40D5E51eE61e20929bbDA0CAf4DC", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "callbackGasLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IRandomizer", + "name": "_randomizer", + "type": "address" + }, + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "randomNumbers", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomizer", + "outputs": [ + { + "internalType": "contract IRandomizer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_id", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_value", + "type": "bytes32" + } + ], + "name": "randomizerCallback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "randomizerWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "receiveRandomness", + "outputs": [ + { + "internalType": "uint256", + "name": "randomNumber", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "requestRandomness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "requesterToID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_callbackGasLimit", + "type": "uint256" + } + ], + "name": "setCallbackGasLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_randomizer", + "type": "address" + } + ], + "name": "setRandomizer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0x58cf386fd52b9c1de0387c3fabb3f8a1c99513b9169a348557a61f903c692a72", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xaE7F3AcA5c1E40D5E51eE61e20929bbDA0CAf4DC", + "transactionIndex": 1, + "gasUsed": "1948110", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000004000000000000000000000000000000000000000000001000000000000000000000000000000000000000", + "blockHash": "0xfc0459102ab7158db096bbd6609f10e1804e895ef713f52f833617d07a21e404", + "transactionHash": "0x58cf386fd52b9c1de0387c3fabb3f8a1c99513b9169a348557a61f903c692a72", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842817, + "transactionHash": "0x58cf386fd52b9c1de0387c3fabb3f8a1c99513b9169a348557a61f903c692a72", + "address": "0xaE7F3AcA5c1E40D5E51eE61e20929bbDA0CAf4DC", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0xfc0459102ab7158db096bbd6609f10e1804e895ef713f52f833617d07a21e404" + } + ], + "blockNumber": 3842817, + "cumulativeGasUsed": "1948110", + "status": 1, + "byzantium": true + }, + "args": [ + "0x121F321f8F803fb88A895b969D6E26C672121149", + "0x485cc955000000000000000000000000e775d7fde1d0d09ae627c0131040012ccbcc4b9b000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xE775D7fde1d0D09ae627C0131040012ccBcC4b9b", + "0xf1C7c037891525E360C59f708739Ac09A7670c59" + ] + }, + "implementation": "0x121F321f8F803fb88A895b969D6E26C672121149", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepolia/RandomizerRNG_Implementation.json b/contracts/deployments/arbitrumSepolia/RandomizerRNG_Implementation.json new file mode 100644 index 000000000..7ce4a5da0 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/RandomizerRNG_Implementation.json @@ -0,0 +1,533 @@ +{ + "address": "0x121F321f8F803fb88A895b969D6E26C672121149", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "callbackGasLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IRandomizer", + "name": "_randomizer", + "type": "address" + }, + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "randomNumbers", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomizer", + "outputs": [ + { + "internalType": "contract IRandomizer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_id", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_value", + "type": "bytes32" + } + ], + "name": "randomizerCallback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "randomizerWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "receiveRandomness", + "outputs": [ + { + "internalType": "uint256", + "name": "randomNumber", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "requestRandomness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "requesterToID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_callbackGasLimit", + "type": "uint256" + } + ], + "name": "setCallbackGasLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_randomizer", + "type": "address" + } + ], + "name": "setRandomizer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0xdf59e00d64131fdf37001ccb0b28f4aa9099bebf1602eda7632bf1d85beeb113", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x121F321f8F803fb88A895b969D6E26C672121149", + "transactionIndex": 1, + "gasUsed": "4512091", + "logsBloom": "0x00000004000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x4688d2a492358a6d6ad31993fd00cbc0efe66dea10647e02c4712a716a339456", + "transactionHash": "0xdf59e00d64131fdf37001ccb0b28f4aa9099bebf1602eda7632bf1d85beeb113", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842812, + "transactionHash": "0xdf59e00d64131fdf37001ccb0b28f4aa9099bebf1602eda7632bf1d85beeb113", + "address": "0x121F321f8F803fb88A895b969D6E26C672121149", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 0, + "blockHash": "0x4688d2a492358a6d6ad31993fd00cbc0efe66dea10647e02c4712a716a339456" + } + ], + "blockNumber": 3842812, + "cumulativeGasUsed": "4512091", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"callbackGasLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IRandomizer\",\"name\":\"_randomizer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"randomNumbers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomizer\",\"outputs\":[{\"internalType\":\"contract IRandomizer\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_value\",\"type\":\"bytes32\"}],\"name\":\"randomizerCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"randomizerWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"receiveRandomness\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"randomNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"requestRandomness\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"requesterToID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_callbackGasLimit\",\"type\":\"uint256\"}],\"name\":\"setCallbackGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_randomizer\",\"type\":\"address\"}],\"name\":\"setRandomizer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"changeGovernor(address)\":{\"details\":\"Changes the governor of the contract.\",\"params\":{\"_governor\":\"The new governor.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"initialize(address,address)\":{\"details\":\"Initializer\",\"params\":{\"_governor\":\"Governor of the contract.\",\"_randomizer\":\"Randomizer contract.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"randomizerCallback(uint256,bytes32)\":{\"details\":\"Callback function called by the randomizer contract when the random value is generated.\"},\"randomizerWithdraw(uint256)\":{\"details\":\"Allows the governor to withdraw randomizer funds.\",\"params\":{\"_amount\":\"Amount to withdraw in wei.\"}},\"receiveRandomness(uint256)\":{\"details\":\"Return the random number.\",\"returns\":{\"randomNumber\":\"The random number or 0 if it is not ready or has not been requested.\"}},\"requestRandomness(uint256)\":{\"details\":\"Request a random number. The id of the request is tied to the sender.\"},\"setCallbackGasLimit(uint256)\":{\"details\":\"Change the Randomizer callback gas limit.\",\"params\":{\"_callbackGasLimit\":\"the new limit.\"}},\"setRandomizer(address)\":{\"details\":\"Change the Randomizer address.\",\"params\":{\"_randomizer\":\"the new Randomizer address.\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"Random Number Generator that uses Randomizer.ai https://randomizer.ai/\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/rng/RandomizerRNG.sol\":\"RandomizerRNG\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"},\"src/rng/IRandomizer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n// Randomizer protocol interface\\ninterface IRandomizer {\\n function request(uint256 callbackGasLimit) external returns (uint256);\\n\\n function clientWithdrawTo(address _to, uint256 _amount) external;\\n}\\n\",\"keccak256\":\"0xe71bbdd9470eeb89f5d10aee07fda95b6ccc13aa845c0d8c0bc7a9ec20b6356e\",\"license\":\"MIT\"},\"src/rng/RNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\ninterface RNG {\\n /// @dev Request a random number.\\n /// @param _block Block linked to the request.\\n function requestRandomness(uint256 _block) external;\\n\\n /// @dev Receive the random number.\\n /// @param _block Block the random number is linked to.\\n /// @return randomNumber Random Number. If the number is not ready or has not been required 0 instead.\\n function receiveRandomness(uint256 _block) external returns (uint256 randomNumber);\\n}\\n\",\"keccak256\":\"0x5afe7121f49aebe72218df356bd91b66c2171b9ad15e7945a15a091784291a43\",\"license\":\"MIT\"},\"src/rng/RandomizerRNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./RNG.sol\\\";\\nimport \\\"./IRandomizer.sol\\\";\\nimport \\\"../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title Random Number Generator that uses Randomizer.ai\\n/// https://randomizer.ai/\\ncontract RandomizerRNG is RNG, UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The address that can withdraw funds.\\n uint256 public callbackGasLimit; // Gas limit for the randomizer callback\\n IRandomizer public randomizer; // Randomizer address.\\n mapping(uint256 => uint256) public randomNumbers; // randomNumbers[requestID] is the random number for this request id, 0 otherwise.\\n mapping(address => uint256) public requesterToID; // Maps the requester to his latest request ID.\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Governor only\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer\\n /// @param _randomizer Randomizer contract.\\n /// @param _governor Governor of the contract.\\n function initialize(IRandomizer _randomizer, address _governor) external reinitializer(1) {\\n randomizer = _randomizer;\\n governor = _governor;\\n callbackGasLimit = 50000;\\n }\\n\\n // ************************ //\\n // * Governance * //\\n // ************************ //\\n\\n /**\\n * @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Changes the governor of the contract.\\n /// @param _governor The new governor.\\n function changeGovernor(address _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Change the Randomizer callback gas limit.\\n /// @param _callbackGasLimit the new limit.\\n function setCallbackGasLimit(uint256 _callbackGasLimit) external onlyByGovernor {\\n callbackGasLimit = _callbackGasLimit;\\n }\\n\\n /// @dev Change the Randomizer address.\\n /// @param _randomizer the new Randomizer address.\\n function setRandomizer(address _randomizer) external onlyByGovernor {\\n randomizer = IRandomizer(_randomizer);\\n }\\n\\n /// @dev Allows the governor to withdraw randomizer funds.\\n /// @param _amount Amount to withdraw in wei.\\n function randomizerWithdraw(uint256 _amount) external onlyByGovernor {\\n randomizer.clientWithdrawTo(msg.sender, _amount);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Request a random number. The id of the request is tied to the sender.\\n function requestRandomness(uint256 /*_block*/) external override {\\n uint256 id = randomizer.request(callbackGasLimit);\\n requesterToID[msg.sender] = id;\\n }\\n\\n /// @dev Callback function called by the randomizer contract when the random value is generated.\\n function randomizerCallback(uint256 _id, bytes32 _value) external {\\n require(msg.sender == address(randomizer), \\\"Randomizer only\\\");\\n randomNumbers[_id] = uint256(_value);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Return the random number.\\n /// @return randomNumber The random number or 0 if it is not ready or has not been requested.\\n function receiveRandomness(uint256 /*_block*/) external view override returns (uint256 randomNumber) {\\n // Get the latest request ID for this requester.\\n uint256 id = requesterToID[msg.sender];\\n randomNumber = randomNumbers[id];\\n }\\n}\\n\",\"keccak256\":\"0x4285391be2975df0c7d1fa2fcdcd8abe8458e3228961ba32dec1e97325598df0\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060805234801561001457600080fd5b5061001d610022565b6100d3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff16156100715760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b03908116146100d05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051610b396100fc600039600081816104a1015281816104ca01526106c20152610b396000f3fe6080604052600436106100c85760003560e01c806352d1902d1161007a57806352d1902d146101ec57806371d4b00b146102015780637363ae1f1461022e578063767bcab51461024e5780638a54942f1461026e578063e4c0aaf41461028e578063ebe93caf146102ae578063f10fb584146102ce57600080fd5b80630c340a24146100cd57806313cf90541461010a57806324f7469714610154578063485cc9551461016a5780634e07c9391461018c5780634f1ef286146101ac5780635257cd90146101bf575b600080fd5b3480156100d957600080fd5b506000546100ed906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011657600080fd5b506101466101253660046108ed565b50336000908152600460209081526040808320548352600390915290205490565b604051908152602001610101565b34801561016057600080fd5b5061014660015481565b34801561017657600080fd5b5061018a61018536600461091b565b6102ee565b005b34801561019857600080fd5b5061018a6101a73660046108ed565b6103f3565b61018a6101ba36600461096a565b61048d565b3480156101cb57600080fd5b506101466101da3660046108ed565b60036020526000908152604090205481565b3480156101f857600080fd5b506101466106b5565b34801561020d57600080fd5b5061014661021c366004610a2e565b60046020526000908152604090205481565b34801561023a57600080fd5b5061018a6102493660046108ed565b610713565b34801561025a57600080fd5b5061018a610269366004610a2e565b61079b565b34801561027a57600080fd5b5061018a6102893660046108ed565b6107e7565b34801561029a57600080fd5b5061018a6102a9366004610a2e565b610816565b3480156102ba57600080fd5b5061018a6102c9366004610a52565b610862565b3480156102da57600080fd5b506002546100ed906001600160a01b031681565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806103385750805467ffffffffffffffff808416911610155b156103555760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff8316908117600160401b178255600280546001600160a01b038781166001600160a01b031992831617909255600080549287169290911691909117905561c350600155815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b6000546001600160a01b031633146104265760405162461bcd60e51b815260040161041d90610a74565b60405180910390fd5b600254604051632465f8f560e01b8152336004820152602481018390526001600160a01b0390911690632465f8f590604401600060405180830381600087803b15801561047257600080fd5b505af1158015610486573d6000803e3d6000fd5b5050505050565b610496826108c0565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061051457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610508600080516020610ae48339815191525490565b6001600160a01b031614155b156105325760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561058c575060408051601f3d908101601f1916820190925261058991810190610a9b565b60015b6105b457604051630c76093760e01b81526001600160a01b038316600482015260240161041d565b600080516020610ae483398151915281146105e557604051632a87526960e21b81526004810182905260240161041d565b600080516020610ae48339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28151156106b0576000836001600160a01b03168360405161064c9190610ab4565b600060405180830381855af49150503d8060008114610687576040519150601f19603f3d011682016040523d82523d6000602084013e61068c565b606091505b50509050806106ae576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146107005760405163703e46dd60e11b815260040160405180910390fd5b50600080516020610ae483398151915290565b60025460015460405163d845a4b360e01b815260048101919091526000916001600160a01b03169063d845a4b3906024016020604051808303816000875af1158015610763573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107879190610a9b565b336000908152600460205260409020555050565b6000546001600160a01b031633146107c55760405162461bcd60e51b815260040161041d90610a74565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146108115760405162461bcd60e51b815260040161041d90610a74565b600155565b6000546001600160a01b031633146108405760405162461bcd60e51b815260040161041d90610a74565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031633146108ae5760405162461bcd60e51b815260206004820152600f60248201526e52616e646f6d697a6572206f6e6c7960881b604482015260640161041d565b60009182526003602052604090912055565b6000546001600160a01b031633146108ea5760405162461bcd60e51b815260040161041d90610a74565b50565b6000602082840312156108ff57600080fd5b5035919050565b6001600160a01b03811681146108ea57600080fd5b6000806040838503121561092e57600080fd5b823561093981610906565b9150602083013561094981610906565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561097d57600080fd5b823561098881610906565b9150602083013567ffffffffffffffff808211156109a557600080fd5b818501915085601f8301126109b957600080fd5b8135818111156109cb576109cb610954565b604051601f8201601f19908116603f011681019083821181831017156109f3576109f3610954565b81604052828152886020848701011115610a0c57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600060208284031215610a4057600080fd5b8135610a4b81610906565b9392505050565b60008060408385031215610a6557600080fd5b50508035926020909101359150565b6020808252600d908201526c476f7665726e6f72206f6e6c7960981b604082015260600190565b600060208284031215610aad57600080fd5b5051919050565b6000825160005b81811015610ad55760208186018101518583015201610abb565b50600092019182525091905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220aec03dad51a46b09534bed3ffa73b065bf3cda8ee37f8b3126efdc48f7db06ed64736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106100c85760003560e01c806352d1902d1161007a57806352d1902d146101ec57806371d4b00b146102015780637363ae1f1461022e578063767bcab51461024e5780638a54942f1461026e578063e4c0aaf41461028e578063ebe93caf146102ae578063f10fb584146102ce57600080fd5b80630c340a24146100cd57806313cf90541461010a57806324f7469714610154578063485cc9551461016a5780634e07c9391461018c5780634f1ef286146101ac5780635257cd90146101bf575b600080fd5b3480156100d957600080fd5b506000546100ed906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011657600080fd5b506101466101253660046108ed565b50336000908152600460209081526040808320548352600390915290205490565b604051908152602001610101565b34801561016057600080fd5b5061014660015481565b34801561017657600080fd5b5061018a61018536600461091b565b6102ee565b005b34801561019857600080fd5b5061018a6101a73660046108ed565b6103f3565b61018a6101ba36600461096a565b61048d565b3480156101cb57600080fd5b506101466101da3660046108ed565b60036020526000908152604090205481565b3480156101f857600080fd5b506101466106b5565b34801561020d57600080fd5b5061014661021c366004610a2e565b60046020526000908152604090205481565b34801561023a57600080fd5b5061018a6102493660046108ed565b610713565b34801561025a57600080fd5b5061018a610269366004610a2e565b61079b565b34801561027a57600080fd5b5061018a6102893660046108ed565b6107e7565b34801561029a57600080fd5b5061018a6102a9366004610a2e565b610816565b3480156102ba57600080fd5b5061018a6102c9366004610a52565b610862565b3480156102da57600080fd5b506002546100ed906001600160a01b031681565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806103385750805467ffffffffffffffff808416911610155b156103555760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff8316908117600160401b178255600280546001600160a01b038781166001600160a01b031992831617909255600080549287169290911691909117905561c350600155815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b6000546001600160a01b031633146104265760405162461bcd60e51b815260040161041d90610a74565b60405180910390fd5b600254604051632465f8f560e01b8152336004820152602481018390526001600160a01b0390911690632465f8f590604401600060405180830381600087803b15801561047257600080fd5b505af1158015610486573d6000803e3d6000fd5b5050505050565b610496826108c0565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061051457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610508600080516020610ae48339815191525490565b6001600160a01b031614155b156105325760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561058c575060408051601f3d908101601f1916820190925261058991810190610a9b565b60015b6105b457604051630c76093760e01b81526001600160a01b038316600482015260240161041d565b600080516020610ae483398151915281146105e557604051632a87526960e21b81526004810182905260240161041d565b600080516020610ae48339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28151156106b0576000836001600160a01b03168360405161064c9190610ab4565b600060405180830381855af49150503d8060008114610687576040519150601f19603f3d011682016040523d82523d6000602084013e61068c565b606091505b50509050806106ae576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146107005760405163703e46dd60e11b815260040160405180910390fd5b50600080516020610ae483398151915290565b60025460015460405163d845a4b360e01b815260048101919091526000916001600160a01b03169063d845a4b3906024016020604051808303816000875af1158015610763573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107879190610a9b565b336000908152600460205260409020555050565b6000546001600160a01b031633146107c55760405162461bcd60e51b815260040161041d90610a74565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146108115760405162461bcd60e51b815260040161041d90610a74565b600155565b6000546001600160a01b031633146108405760405162461bcd60e51b815260040161041d90610a74565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031633146108ae5760405162461bcd60e51b815260206004820152600f60248201526e52616e646f6d697a6572206f6e6c7960881b604482015260640161041d565b60009182526003602052604090912055565b6000546001600160a01b031633146108ea5760405162461bcd60e51b815260040161041d90610a74565b50565b6000602082840312156108ff57600080fd5b5035919050565b6001600160a01b03811681146108ea57600080fd5b6000806040838503121561092e57600080fd5b823561093981610906565b9150602083013561094981610906565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561097d57600080fd5b823561098881610906565b9150602083013567ffffffffffffffff808211156109a557600080fd5b818501915085601f8301126109b957600080fd5b8135818111156109cb576109cb610954565b604051601f8201601f19908116603f011681019083821181831017156109f3576109f3610954565b81604052828152886020848701011115610a0c57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600060208284031215610a4057600080fd5b8135610a4b81610906565b9392505050565b60008060408385031215610a6557600080fd5b50508035926020909101359150565b6020808252600d908201526c476f7665726e6f72206f6e6c7960981b604082015260600190565b600060208284031215610aad57600080fd5b5051919050565b6000825160005b81811015610ad55760208186018101518583015201610abb565b50600092019182525091905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220aec03dad51a46b09534bed3ffa73b065bf3cda8ee37f8b3126efdc48f7db06ed64736f6c63430008120033", + "devdoc": { + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "changeGovernor(address)": { + "details": "Changes the governor of the contract.", + "params": { + "_governor": "The new governor." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "initialize(address,address)": { + "details": "Initializer", + "params": { + "_governor": "Governor of the contract.", + "_randomizer": "Randomizer contract." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "randomizerCallback(uint256,bytes32)": { + "details": "Callback function called by the randomizer contract when the random value is generated." + }, + "randomizerWithdraw(uint256)": { + "details": "Allows the governor to withdraw randomizer funds.", + "params": { + "_amount": "Amount to withdraw in wei." + } + }, + "receiveRandomness(uint256)": { + "details": "Return the random number.", + "returns": { + "randomNumber": "The random number or 0 if it is not ready or has not been requested." + } + }, + "requestRandomness(uint256)": { + "details": "Request a random number. The id of the request is tied to the sender." + }, + "setCallbackGasLimit(uint256)": { + "details": "Change the Randomizer callback gas limit.", + "params": { + "_callbackGasLimit": "the new limit." + } + }, + "setRandomizer(address)": { + "details": "Change the Randomizer address.", + "params": { + "_randomizer": "the new Randomizer address." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "title": "Random Number Generator that uses Randomizer.ai https://randomizer.ai/", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 24301, + "contract": "src/rng/RandomizerRNG.sol:RandomizerRNG", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 24303, + "contract": "src/rng/RandomizerRNG.sol:RandomizerRNG", + "label": "callbackGasLimit", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 24306, + "contract": "src/rng/RandomizerRNG.sol:RandomizerRNG", + "label": "randomizer", + "offset": 0, + "slot": "2", + "type": "t_contract(IRandomizer)24229" + }, + { + "astId": 24310, + "contract": "src/rng/RandomizerRNG.sol:RandomizerRNG", + "label": "randomNumbers", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 24314, + "contract": "src/rng/RandomizerRNG.sol:RandomizerRNG", + "label": "requesterToID", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_address,t_uint256)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_contract(IRandomizer)24229": { + "encoding": "inplace", + "label": "contract IRandomizer", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepolia/RandomizerRNG_Proxy.json b/contracts/deployments/arbitrumSepolia/RandomizerRNG_Proxy.json new file mode 100644 index 000000000..d877c2296 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/RandomizerRNG_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0xaE7F3AcA5c1E40D5E51eE61e20929bbDA0CAf4DC", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x58cf386fd52b9c1de0387c3fabb3f8a1c99513b9169a348557a61f903c692a72", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xaE7F3AcA5c1E40D5E51eE61e20929bbDA0CAf4DC", + "transactionIndex": 1, + "gasUsed": "1948110", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000004000000000000000000000000000000000000000000001000000000000000000000000000000000000000", + "blockHash": "0xfc0459102ab7158db096bbd6609f10e1804e895ef713f52f833617d07a21e404", + "transactionHash": "0x58cf386fd52b9c1de0387c3fabb3f8a1c99513b9169a348557a61f903c692a72", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842817, + "transactionHash": "0x58cf386fd52b9c1de0387c3fabb3f8a1c99513b9169a348557a61f903c692a72", + "address": "0xaE7F3AcA5c1E40D5E51eE61e20929bbDA0CAf4DC", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0xfc0459102ab7158db096bbd6609f10e1804e895ef713f52f833617d07a21e404" + } + ], + "blockNumber": 3842817, + "cumulativeGasUsed": "1948110", + "status": 1, + "byzantium": true + }, + "args": [ + "0x121F321f8F803fb88A895b969D6E26C672121149", + "0x485cc955000000000000000000000000e775d7fde1d0d09ae627c0131040012ccbcc4b9b000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepolia/SortitionModule.json b/contracts/deployments/arbitrumSepolia/SortitionModule.json new file mode 100644 index 000000000..a49225361 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/SortitionModule.json @@ -0,0 +1,1053 @@ +{ + "address": "0x3645F9e08D80E47c82aD9E33fCB4EA703822C831", + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum ISortitionModule.Phase", + "name": "_phase", + "type": "uint8" + } + ], + "name": "NewPhase", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedAlreadyTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedAlreadyTransferredWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedNotTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_unlock", + "type": "bool" + } + ], + "name": "StakeLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_K", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_STAKE_PATHS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxDrawingTime", + "type": "uint256" + } + ], + "name": "changeMaxDrawingTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minStakingTime", + "type": "uint256" + } + ], + "name": "changeMinStakingTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract RNG", + "name": "_rng", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_rngLookahead", + "type": "uint256" + } + ], + "name": "changeRandomNumberGenerator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "core", + "outputs": [ + { + "internalType": "contract KlerosCore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "createDisputeHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "createTree", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "delayedStakeReadIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "delayedStakeWriteIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "delayedStakes", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "stake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "alreadyTransferred", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disputesWithoutJurors", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [ + { + "internalType": "address", + "name": "drawnAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "executeDelayedStakes", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "getJurorBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "totalStaked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalLocked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakedInCourt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbCourts", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + } + ], + "name": "getJurorCourtIDs", + "outputs": [ + { + "internalType": "uint96[]", + "name": "", + "type": "uint96[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract KlerosCore", + "name": "_core", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minStakingTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxDrawingTime", + "type": "uint256" + }, + { + "internalType": "contract RNG", + "name": "_rng", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_rngLookahead", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + } + ], + "name": "isJurorStaked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "jurors", + "outputs": [ + { + "internalType": "uint256", + "name": "stakedPnk", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockedPnk", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastPhaseChange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "name": "latestDelayedStakeIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "lockStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxDrawingTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minStakingTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_randomNumber", + "type": "uint256" + } + ], + "name": "notifyRandomNumber", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "passPhase", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "penalizeStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "phase", + "outputs": [ + { + "internalType": "enum ISortitionModule.Phase", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "postDrawHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomNumberRequestBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rng", + "outputs": [ + { + "internalType": "contract RNG", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rngLookahead", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "setJurorInactive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_alreadyTransferred", + "type": "bool" + } + ], + "name": "setStake", + "outputs": [ + { + "internalType": "uint256", + "name": "pnkDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkWithdrawal", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "succeeded", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_ID", + "type": "bytes32" + } + ], + "name": "stakeOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "stakeOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "unlockStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "transactionHash": "0x1a08892a579e1cce13860922d4684ef58464db54b3a475b4763b6200d36a9bd9", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x3645F9e08D80E47c82aD9E33fCB4EA703822C831", + "transactionIndex": 1, + "gasUsed": "2154537", + "logsBloom": "0x00000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x5ba81045643db221920d5a188e5654258b7addfbdf51aa9fa14717c14c980771", + "transactionHash": "0x1a08892a579e1cce13860922d4684ef58464db54b3a475b4763b6200d36a9bd9", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842832, + "transactionHash": "0x1a08892a579e1cce13860922d4684ef58464db54b3a475b4763b6200d36a9bd9", + "address": "0x3645F9e08D80E47c82aD9E33fCB4EA703822C831", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x5ba81045643db221920d5a188e5654258b7addfbdf51aa9fa14717c14c980771" + } + ], + "blockNumber": 3842832, + "cumulativeGasUsed": "2154537", + "status": 1, + "byzantium": true + }, + "args": [ + "0xAf48e32f89339438572a04455b1C4B2fF1659c8f", + "0x54812d17000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c5900000000000000000000000033d0b8879368acd8ca868e656ade97bb97b9046800000000000000000000000000000000000000000000000000000000000007080000000000000000000000000000000000000000000000000000000000000708000000000000000000000000ae7f3aca5c1e40d5e51ee61e20929bbda0caf4dc0000000000000000000000000000000000000000000000000000000000000014" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "execute": { + "methodName": "initialize", + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "0x33d0b8879368acD8ca868e656Ade97bB97b90468", + 1800, + 1800, + "0xaE7F3AcA5c1E40D5E51eE61e20929bbDA0CAf4DC", + 20 + ] + }, + "implementation": "0xAf48e32f89339438572a04455b1C4B2fF1659c8f", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepolia/SortitionModule_Implementation.json b/contracts/deployments/arbitrumSepolia/SortitionModule_Implementation.json new file mode 100644 index 000000000..1d7716640 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/SortitionModule_Implementation.json @@ -0,0 +1,1533 @@ +{ + "address": "0xAf48e32f89339438572a04455b1C4B2fF1659c8f", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "FailedDelegateCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum ISortitionModule.Phase", + "name": "_phase", + "type": "uint8" + } + ], + "name": "NewPhase", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedAlreadyTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedAlreadyTransferredWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeDelayedNotTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_unlock", + "type": "bool" + } + ], + "name": "StakeLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_courtID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "StakeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_K", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_STAKE_PATHS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxDrawingTime", + "type": "uint256" + } + ], + "name": "changeMaxDrawingTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minStakingTime", + "type": "uint256" + } + ], + "name": "changeMinStakingTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract RNG", + "name": "_rng", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_rngLookahead", + "type": "uint256" + } + ], + "name": "changeRandomNumberGenerator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "core", + "outputs": [ + { + "internalType": "contract KlerosCore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "createDisputeHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "createTree", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "delayedStakeReadIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "delayedStakeWriteIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "delayedStakes", + "outputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "stake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "alreadyTransferred", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disputesWithoutJurors", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_coreDisputeID", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "draw", + "outputs": [ + { + "internalType": "address", + "name": "drawnAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_iterations", + "type": "uint256" + } + ], + "name": "executeDelayedStakes", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "getJurorBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "totalStaked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalLocked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakedInCourt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nbCourts", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + } + ], + "name": "getJurorCourtIDs", + "outputs": [ + { + "internalType": "uint96[]", + "name": "", + "type": "uint96[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "contract KlerosCore", + "name": "_core", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minStakingTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxDrawingTime", + "type": "uint256" + }, + { + "internalType": "contract RNG", + "name": "_rng", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_rngLookahead", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + } + ], + "name": "isJurorStaked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "jurors", + "outputs": [ + { + "internalType": "uint256", + "name": "stakedPnk", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockedPnk", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastPhaseChange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "name": "latestDelayedStakeIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "lockStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxDrawingTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minStakingTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_randomNumber", + "type": "uint256" + } + ], + "name": "notifyRandomNumber", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "passPhase", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "penalizeStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "phase", + "outputs": [ + { + "internalType": "enum ISortitionModule.Phase", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "postDrawHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "randomNumberRequestBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rng", + "outputs": [ + { + "internalType": "contract RNG", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rngLookahead", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "setJurorInactive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "_newStake", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_alreadyTransferred", + "type": "bool" + } + ], + "name": "setStake", + "outputs": [ + { + "internalType": "uint256", + "name": "pnkDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pnkWithdrawal", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "succeeded", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_key", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_ID", + "type": "bytes32" + } + ], + "name": "stakeOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_juror", + "type": "address" + }, + { + "internalType": "uint96", + "name": "_courtID", + "type": "uint96" + } + ], + "name": "stakeOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_relativeAmount", + "type": "uint256" + } + ], + "name": "unlockStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x7a363f531eac2935d3427b9bba625f00a0c7dbc5cd5e5359beb5984f23c220a5", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xAf48e32f89339438572a04455b1C4B2fF1659c8f", + "transactionIndex": 1, + "gasUsed": "15801538", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000800000000000000200000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xa95e0230e55ab353b974c7619bf6a1387bc642c56361ce37997aad7800a145fc", + "transactionHash": "0x7a363f531eac2935d3427b9bba625f00a0c7dbc5cd5e5359beb5984f23c220a5", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842828, + "transactionHash": "0x7a363f531eac2935d3427b9bba625f00a0c7dbc5cd5e5359beb5984f23c220a5", + "address": "0xAf48e32f89339438572a04455b1C4B2fF1659c8f", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "logIndex": 0, + "blockHash": "0xa95e0230e55ab353b974c7619bf6a1387bc642c56361ce37997aad7800a145fc" + } + ], + "blockNumber": 3842828, + "cumulativeGasUsed": "15801538", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "e9fdf269c6fad89c4e78ca88d7e75f64", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedDelegateCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"enum ISortitionModule.Phase\",\"name\":\"_phase\",\"type\":\"uint8\"}],\"name\":\"NewPhase\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeDelayedAlreadyTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeDelayedAlreadyTransferredWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeDelayedNotTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_unlock\",\"type\":\"bool\"}],\"name\":\"StakeLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_courtID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"StakeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_K\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_STAKE_PATHS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxDrawingTime\",\"type\":\"uint256\"}],\"name\":\"changeMaxDrawingTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minStakingTime\",\"type\":\"uint256\"}],\"name\":\"changeMinStakingTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_rngLookahead\",\"type\":\"uint256\"}],\"name\":\"changeRandomNumberGenerator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"core\",\"outputs\":[{\"internalType\":\"contract KlerosCore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"createDisputeHook\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"createTree\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"delayedStakeReadIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"delayedStakeWriteIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"delayedStakes\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"alreadyTransferred\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disputesWithoutJurors\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_coreDisputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"}],\"name\":\"draw\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"drawnAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_iterations\",\"type\":\"uint256\"}],\"name\":\"executeDelayedStakes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"getJurorBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalStaked\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalLocked\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"stakedInCourt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nbCourts\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"}],\"name\":\"getJurorCourtIDs\",\"outputs\":[{\"internalType\":\"uint96[]\",\"name\":\"\",\"type\":\"uint96[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract KlerosCore\",\"name\":\"_core\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_minStakingTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxDrawingTime\",\"type\":\"uint256\"},{\"internalType\":\"contract RNG\",\"name\":\"_rng\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_rngLookahead\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"}],\"name\":\"isJurorStaked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"jurors\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"stakedPnk\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lockedPnk\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastPhaseChange\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\"}],\"name\":\"latestDelayedStakeIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"}],\"name\":\"lockStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxDrawingTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minStakingTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_randomNumber\",\"type\":\"uint256\"}],\"name\":\"notifyRandomNumber\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passPhase\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"}],\"name\":\"penalizeStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"phase\",\"outputs\":[{\"internalType\":\"enum ISortitionModule.Phase\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"postDrawHook\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"randomNumberRequestBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rng\",\"outputs\":[{\"internalType\":\"contract RNG\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rngLookahead\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"setJurorInactive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"_newStake\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"_alreadyTransferred\",\"type\":\"bool\"}],\"name\":\"setStake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"pnkDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pnkWithdrawal\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"succeeded\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_ID\",\"type\":\"bytes32\"}],\"name\":\"stakeOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_juror\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_courtID\",\"type\":\"uint96\"}],\"name\":\"stakeOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_relativeAmount\",\"type\":\"uint256\"}],\"name\":\"unlockStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"A factory of trees that keeps track of staked values for sortition.\",\"errors\":{\"AlreadyInitialized()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}],\"UUPSUnauthorizedCallContext()\":[{\"details\":\"The call is from an unauthorized context.\"}],\"UUPSUnsupportedProxiableUUID(bytes32)\":[{\"details\":\"The storage `slot` is unsupported as a UUID.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address)\":{\"params\":{\"newImplementation\":\"Address of the new implementation the proxy is now forwarding calls to.\"}}},\"kind\":\"dev\",\"methods\":{\"changeMaxDrawingTime(uint256)\":{\"details\":\"Changes the `maxDrawingTime` storage variable.\",\"params\":{\"_maxDrawingTime\":\"The new value for the `maxDrawingTime` storage variable.\"}},\"changeMinStakingTime(uint256)\":{\"details\":\"Changes the `minStakingTime` storage variable.\",\"params\":{\"_minStakingTime\":\"The new value for the `minStakingTime` storage variable.\"}},\"changeRandomNumberGenerator(address,uint256)\":{\"details\":\"Changes the `_rng` and `_rngLookahead` storage variables.\",\"params\":{\"_rng\":\"The new value for the `RNGenerator` storage variable.\",\"_rngLookahead\":\"The new value for the `rngLookahead` storage variable.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.\"},\"createTree(bytes32,bytes)\":{\"details\":\"Create a sortition sum tree at the specified key.\",\"params\":{\"_extraData\":\"Extra data that contains the number of children each node in the tree should have.\",\"_key\":\"The key of the new tree.\"}},\"draw(bytes32,uint256,uint256)\":{\"details\":\"Draw an ID from a tree using a number. Note that this function reverts if the sum of all values in the tree is 0.\",\"params\":{\"_coreDisputeID\":\"Index of the dispute in Kleros Core.\",\"_key\":\"The key of the tree.\",\"_nonce\":\"Nonce to hash with random number.\"},\"returns\":{\"drawnAddress\":\"The drawn address. `O(k * log_k(n))` where `k` is the maximum number of children per node in the tree, and `n` is the maximum number of nodes ever appended.\"}},\"executeDelayedStakes(uint256)\":{\"details\":\"Executes the next delayed stakes.\",\"params\":{\"_iterations\":\"The number of delayed stakes to execute.\"}},\"getJurorCourtIDs(address)\":{\"details\":\"Gets the court identifiers where a specific `_juror` has staked.\",\"params\":{\"_juror\":\"The address of the juror.\"}},\"initialize(address,address,uint256,uint256,address,uint256)\":{\"details\":\"Initializer (constructor equivalent for upgradable contracts).\",\"params\":{\"_core\":\"The KlerosCore.\",\"_maxDrawingTime\":\"Time after which the drawing phase can be switched\",\"_minStakingTime\":\"Minimal time to stake\",\"_rng\":\"The random number generator.\",\"_rngLookahead\":\"Lookahead value for rng.\"}},\"notifyRandomNumber(uint256)\":{\"details\":\"Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().\",\"params\":{\"_randomNumber\":\"Random number returned by RNG contract.\"}},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement.\"},\"setJurorInactive(address)\":{\"details\":\"Unstakes the inactive juror from all courts. `O(n * (p * log_k(j)) )` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\",\"params\":{\"_account\":\"The juror to unstake.\"}},\"setStake(address,uint96,uint256,bool)\":{\"details\":\"Sets the specified juror's stake in a court. `O(n + p * log_k(j))` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\",\"params\":{\"_account\":\"The address of the juror.\",\"_alreadyTransferred\":\"True if the tokens were already transferred from juror. Only relevant for delayed stakes.\",\"_courtID\":\"The ID of the court.\",\"_newStake\":\"The new stake.\"},\"returns\":{\"pnkDeposit\":\"The amount of PNK to be deposited.\",\"pnkWithdrawal\":\"The amount of PNK to be withdrawn.\",\"succeeded\":\"True if the call succeeded, false otherwise.\"}},\"stakeOf(address,uint96)\":{\"details\":\"Get the stake of a juror in a court.\",\"params\":{\"_courtID\":\"The ID of the court.\",\"_juror\":\"The address of the juror.\"},\"returns\":{\"_0\":\"value The stake of the juror in the court.\"}},\"stakeOf(bytes32,bytes32)\":{\"details\":\"Get the stake of a juror in a court.\",\"params\":{\"_ID\":\"The stake path ID, corresponding to a juror.\",\"_key\":\"The key of the tree, corresponding to a court.\"},\"returns\":{\"_0\":\"The stake of the juror in the court.\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.\",\"params\":{\"data\":\"Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\",\"newImplementation\":\"Address of the new implementation contract.\"}}},\"title\":\"SortitionModule\",\"version\":1},\"userdoc\":{\"errors\":{\"FailedDelegateCall()\":[{\"notice\":\"Failed Delegated call\"}],\"InvalidImplementation(address)\":[{\"notice\":\"The `implementation` is not UUPS-compliant\"}]},\"events\":{\"Upgraded(address)\":{\"notice\":\"Emitted when the `implementation` has been successfully upgraded.\"}},\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/arbitration/SortitionModule.sol\":\"SortitionModule\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/arbitration/KlerosCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"./interfaces/IArbitratorV2.sol\\\";\\nimport {IDisputeKit} from \\\"./interfaces/IDisputeKit.sol\\\";\\nimport {ISortitionModule} from \\\"./interfaces/ISortitionModule.sol\\\";\\nimport {SafeERC20, IERC20} from \\\"../libraries/SafeERC20.sol\\\";\\nimport {Constants} from \\\"../libraries/Constants.sol\\\";\\nimport {OnError} from \\\"../libraries/Types.sol\\\";\\nimport {UUPSProxiable} from \\\"../proxy/UUPSProxiable.sol\\\";\\nimport {Initializable} from \\\"../proxy/Initializable.sol\\\";\\n\\n/// @title KlerosCore\\n/// Core arbitrator contract for Kleros v2.\\n/// Note that this contract trusts the PNK token, the dispute kit and the sortition module contracts.\\ncontract KlerosCore is IArbitratorV2, UUPSProxiable, Initializable {\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum Period {\\n evidence, // Evidence can be submitted. This is also when drawing has to take place.\\n commit, // Jurors commit a hashed vote. This is skipped for courts without hidden votes.\\n vote, // Jurors reveal/cast their vote depending on whether the court has hidden votes or not.\\n appeal, // The dispute can be appealed.\\n execution // Tokens are redistributed and the ruling is executed.\\n }\\n\\n struct Court {\\n uint96 parent; // The parent court.\\n bool hiddenVotes; // Whether to use commit and reveal or not.\\n uint256[] children; // List of child courts.\\n uint256 minStake; // Minimum PNKs needed to stake in the court.\\n uint256 alpha; // Basis point of PNKs that are lost when incoherent.\\n uint256 feeForJuror; // Arbitration fee paid per juror.\\n uint256 jurorsForCourtJump; // The appeal after the one that reaches this number of jurors will go to the parent court if any.\\n uint256[4] timesPerPeriod; // The time allotted to each dispute period in the form `timesPerPeriod[period]`.\\n mapping(uint256 => bool) supportedDisputeKits; // True if DK with this ID is supported by the court. Note that each court must support classic dispute kit.\\n bool disabled; // True if the court is disabled. Unused for now, will be implemented later.\\n }\\n\\n struct Dispute {\\n uint96 courtID; // The ID of the court the dispute is in.\\n IArbitrableV2 arbitrated; // The arbitrable contract.\\n Period period; // The current period of the dispute.\\n bool ruled; // True if the ruling has been executed, false otherwise.\\n uint256 lastPeriodChange; // The last time the period was changed.\\n Round[] rounds;\\n }\\n\\n struct Round {\\n uint256 disputeKitID; // Index of the dispute kit in the array.\\n uint256 pnkAtStakePerJuror; // The amount of PNKs at stake for each juror in this round.\\n uint256 totalFeesForJurors; // The total juror fees paid in this round.\\n uint256 nbVotes; // The total number of votes the dispute can possibly have in the current round. Former votes[_round].length.\\n uint256 repartitions; // A counter of reward repartitions made in this round.\\n uint256 pnkPenalties; // The amount of PNKs collected from penalties in this round.\\n address[] drawnJurors; // Addresses of the jurors that were drawn in this round.\\n uint256 sumFeeRewardPaid; // Total sum of arbitration fees paid to coherent jurors as a reward in this round.\\n uint256 sumPnkRewardPaid; // Total sum of PNK paid to coherent jurors as a reward in this round.\\n IERC20 feeToken; // The token used for paying fees in this round.\\n uint256 drawIterations; // The number of iterations passed drawing the jurors for this round.\\n }\\n\\n // Workaround \\\"stack too deep\\\" errors\\n struct ExecuteParams {\\n uint256 disputeID; // The ID of the dispute to execute.\\n uint256 round; // The round to execute.\\n uint256 coherentCount; // The number of coherent votes in the round.\\n uint256 numberOfVotesInRound; // The number of votes in the round.\\n uint256 pnkPenaltiesInRound; // The amount of PNKs collected from penalties in the round.\\n uint256 repartition; // The index of the repartition to execute.\\n }\\n\\n struct CurrencyRate {\\n bool feePaymentAccepted;\\n uint64 rateInEth;\\n uint8 rateDecimals;\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 private constant ALPHA_DIVISOR = 1e4; // The number to divide `Court.alpha` by.\\n uint256 private constant NON_PAYABLE_AMOUNT = (2 ** 256 - 2) / 2; // An amount higher than the supply of ETH.\\n\\n address public governor; // The governor of the contract.\\n IERC20 public pinakion; // The Pinakion token contract.\\n address public jurorProsecutionModule; // The module for juror's prosecution.\\n ISortitionModule public sortitionModule; // Sortition module for drawing.\\n Court[] public courts; // The courts.\\n IDisputeKit[] public disputeKits; // Array of dispute kits.\\n Dispute[] public disputes; // The disputes.\\n mapping(IERC20 => CurrencyRate) public currencyRates; // The price of each token in ETH.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event NewPeriod(uint256 indexed _disputeID, Period _period);\\n event AppealPossible(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event AppealDecision(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);\\n event CourtCreated(\\n uint256 indexed _courtID,\\n uint96 indexed _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod,\\n uint256[] _supportedDisputeKits\\n );\\n event CourtModified(\\n uint96 indexed _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] _timesPerPeriod\\n );\\n event DisputeKitCreated(uint256 indexed _disputeKitID, IDisputeKit indexed _disputeKitAddress);\\n event DisputeKitEnabled(uint96 indexed _courtID, uint256 indexed _disputeKitID, bool indexed _enable);\\n event CourtJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint96 indexed _fromCourtID,\\n uint96 _toCourtID\\n );\\n event DisputeKitJump(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 indexed _fromDisputeKitID,\\n uint256 _toDisputeKitID\\n );\\n event TokenAndETHShift(\\n address indexed _account,\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _degreeOfCoherency,\\n int256 _pnkAmount,\\n int256 _feeAmount,\\n IERC20 _feeToken\\n );\\n event LeftoverRewardSent(\\n uint256 indexed _disputeID,\\n uint256 indexed _roundID,\\n uint256 _pnkAmount,\\n uint256 _feeAmount,\\n IERC20 _feeToken\\n );\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _governor The governor's address.\\n /// @param _pinakion The address of the token contract.\\n /// @param _jurorProsecutionModule The address of the juror prosecution module.\\n /// @param _disputeKit The address of the default dispute kit.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the general court.\\n /// @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the general court.\\n /// @param _sortitionExtraData The extra data for sortition module.\\n /// @param _sortitionModuleAddress The sortition module responsible for sortition of the jurors.\\n function initialize(\\n address _governor,\\n IERC20 _pinakion,\\n address _jurorProsecutionModule,\\n IDisputeKit _disputeKit,\\n bool _hiddenVotes,\\n uint256[4] memory _courtParameters,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n ISortitionModule _sortitionModuleAddress\\n ) external reinitializer(1) {\\n governor = _governor;\\n pinakion = _pinakion;\\n jurorProsecutionModule = _jurorProsecutionModule;\\n sortitionModule = _sortitionModuleAddress;\\n\\n // NULL_DISPUTE_KIT: an empty element at index 0 to indicate when a dispute kit is not supported.\\n disputeKits.push();\\n\\n // DISPUTE_KIT_CLASSIC\\n disputeKits.push(_disputeKit);\\n\\n emit DisputeKitCreated(Constants.DISPUTE_KIT_CLASSIC, _disputeKit);\\n\\n // FORKING_COURT\\n // TODO: Fill the properties for the Forking court, emit CourtCreated.\\n courts.push();\\n sortitionModule.createTree(bytes32(uint256(Constants.FORKING_COURT)), _sortitionExtraData);\\n\\n // GENERAL_COURT\\n Court storage court = courts.push();\\n court.parent = Constants.FORKING_COURT;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _courtParameters[0];\\n court.alpha = _courtParameters[1];\\n court.feeForJuror = _courtParameters[2];\\n court.jurorsForCourtJump = _courtParameters[3];\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(uint256(Constants.GENERAL_COURT)), _sortitionExtraData);\\n\\n emit CourtCreated(\\n 1,\\n court.parent,\\n _hiddenVotes,\\n _courtParameters[0],\\n _courtParameters[1],\\n _courtParameters[2],\\n _courtParameters[3],\\n _timesPerPeriod,\\n new uint256[](0)\\n );\\n _enableDisputeKit(Constants.GENERAL_COURT, Constants.DISPUTE_KIT_CLASSIC, true);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /* @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Allows the governor to call anything on behalf of the contract.\\n /// @param _destination The destination of the call.\\n /// @param _amount The value sent with the call.\\n /// @param _data The data sent with the call.\\n function executeGovernorProposal(\\n address _destination,\\n uint256 _amount,\\n bytes memory _data\\n ) external onlyByGovernor {\\n (bool success, ) = _destination.call{value: _amount}(_data);\\n if (!success) revert UnsuccessfulCall();\\n }\\n\\n /// @dev Changes the `governor` storage variable.\\n /// @param _governor The new value for the `governor` storage variable.\\n function changeGovernor(address payable _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the `pinakion` storage variable.\\n /// @param _pinakion The new value for the `pinakion` storage variable.\\n function changePinakion(IERC20 _pinakion) external onlyByGovernor {\\n pinakion = _pinakion;\\n }\\n\\n /// @dev Changes the `jurorProsecutionModule` storage variable.\\n /// @param _jurorProsecutionModule The new value for the `jurorProsecutionModule` storage variable.\\n function changeJurorProsecutionModule(address _jurorProsecutionModule) external onlyByGovernor {\\n jurorProsecutionModule = _jurorProsecutionModule;\\n }\\n\\n /// @dev Changes the `_sortitionModule` storage variable.\\n /// Note that the new module should be initialized for all courts.\\n /// @param _sortitionModule The new value for the `sortitionModule` storage variable.\\n function changeSortitionModule(ISortitionModule _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Add a new supported dispute kit module to the court.\\n /// @param _disputeKitAddress The address of the dispute kit contract.\\n function addNewDisputeKit(IDisputeKit _disputeKitAddress) external onlyByGovernor {\\n uint256 disputeKitID = disputeKits.length;\\n disputeKits.push(_disputeKitAddress);\\n emit DisputeKitCreated(disputeKitID, _disputeKitAddress);\\n }\\n\\n /// @dev Creates a court under a specified parent court.\\n /// @param _parent The `parent` property value of the court.\\n /// @param _hiddenVotes The `hiddenVotes` property value of the court.\\n /// @param _minStake The `minStake` property value of the court.\\n /// @param _alpha The `alpha` property value of the court.\\n /// @param _feeForJuror The `feeForJuror` property value of the court.\\n /// @param _jurorsForCourtJump The `jurorsForCourtJump` property value of the court.\\n /// @param _timesPerPeriod The `timesPerPeriod` property value of the court.\\n /// @param _sortitionExtraData Extra data for sortition module.\\n /// @param _supportedDisputeKits Indexes of dispute kits that this court will support.\\n function createCourt(\\n uint96 _parent,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod,\\n bytes memory _sortitionExtraData,\\n uint256[] memory _supportedDisputeKits\\n ) external onlyByGovernor {\\n if (courts[_parent].minStake > _minStake) revert MinStakeLowerThanParentCourt();\\n if (_supportedDisputeKits.length == 0) revert UnsupportedDisputeKit();\\n if (_parent == Constants.FORKING_COURT) revert InvalidForkingCourtAsParent();\\n\\n uint256 courtID = courts.length;\\n Court storage court = courts.push();\\n\\n for (uint256 i = 0; i < _supportedDisputeKits.length; i++) {\\n if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n court.supportedDisputeKits[_supportedDisputeKits[i]] = true;\\n }\\n // Check that Classic DK support was added.\\n if (!court.supportedDisputeKits[Constants.DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic();\\n\\n court.parent = _parent;\\n court.children = new uint256[](0);\\n court.hiddenVotes = _hiddenVotes;\\n court.minStake = _minStake;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n\\n sortitionModule.createTree(bytes32(courtID), _sortitionExtraData);\\n\\n // Update the parent.\\n courts[_parent].children.push(courtID);\\n emit CourtCreated(\\n courtID,\\n _parent,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod,\\n _supportedDisputeKits\\n );\\n }\\n\\n function changeCourtParameters(\\n uint96 _courtID,\\n bool _hiddenVotes,\\n uint256 _minStake,\\n uint256 _alpha,\\n uint256 _feeForJuror,\\n uint256 _jurorsForCourtJump,\\n uint256[4] memory _timesPerPeriod\\n ) external onlyByGovernor {\\n Court storage court = courts[_courtID];\\n if (_courtID != Constants.GENERAL_COURT && courts[court.parent].minStake > _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n for (uint256 i = 0; i < court.children.length; i++) {\\n if (courts[court.children[i]].minStake < _minStake) {\\n revert MinStakeLowerThanParentCourt();\\n }\\n }\\n court.minStake = _minStake;\\n court.hiddenVotes = _hiddenVotes;\\n court.alpha = _alpha;\\n court.feeForJuror = _feeForJuror;\\n court.jurorsForCourtJump = _jurorsForCourtJump;\\n court.timesPerPeriod = _timesPerPeriod;\\n emit CourtModified(\\n _courtID,\\n _hiddenVotes,\\n _minStake,\\n _alpha,\\n _feeForJuror,\\n _jurorsForCourtJump,\\n _timesPerPeriod\\n );\\n }\\n\\n /// @dev Adds/removes court's support for specified dispute kits.\\n /// @param _courtID The ID of the court.\\n /// @param _disputeKitIDs The IDs of dispute kits which support should be added/removed.\\n /// @param _enable Whether add or remove the dispute kits from the court.\\n function enableDisputeKits(uint96 _courtID, uint256[] memory _disputeKitIDs, bool _enable) external onlyByGovernor {\\n for (uint256 i = 0; i < _disputeKitIDs.length; i++) {\\n if (_enable) {\\n if (_disputeKitIDs[i] == 0 || _disputeKitIDs[i] >= disputeKits.length) {\\n revert WrongDisputeKitIndex();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], true);\\n } else {\\n // Classic dispute kit must be supported by all courts.\\n if (_disputeKitIDs[i] == Constants.DISPUTE_KIT_CLASSIC) {\\n revert CannotDisableClassicDK();\\n }\\n _enableDisputeKit(_courtID, _disputeKitIDs[i], false);\\n }\\n }\\n }\\n\\n /// @dev Changes the supported fee tokens.\\n /// @param _feeToken The fee token.\\n /// @param _accepted Whether the token is supported or not as a method of fee payment.\\n function changeAcceptedFeeTokens(IERC20 _feeToken, bool _accepted) external onlyByGovernor {\\n currencyRates[_feeToken].feePaymentAccepted = _accepted;\\n emit AcceptedFeeToken(_feeToken, _accepted);\\n }\\n\\n /// @dev Changes the currency rate of a fee token.\\n /// @param _feeToken The fee token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n function changeCurrencyRates(IERC20 _feeToken, uint64 _rateInEth, uint8 _rateDecimals) external onlyByGovernor {\\n currencyRates[_feeToken].rateInEth = _rateInEth;\\n currencyRates[_feeToken].rateDecimals = _rateDecimals;\\n emit NewCurrencyRate(_feeToken, _rateInEth, _rateDecimals);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Sets the caller's stake in a court.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// Note that the existing delayed stake will be nullified as non-relevant.\\n function setStake(uint96 _courtID, uint256 _newStake) external {\\n _setStake(msg.sender, _courtID, _newStake, false, OnError.Revert);\\n }\\n\\n /// @dev Sets the stake of a specified account in a court, typically to apply a delayed stake or unstake inactive jurors.\\n /// @param _account The account whose stake is being set.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs have already been transferred to the contract.\\n function setStakeBySortitionModule(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external {\\n if (msg.sender != address(sortitionModule)) revert SortitionModuleOnly();\\n _setStake(_account, _courtID, _newStake, _alreadyTransferred, OnError.Return);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData\\n ) external payable override returns (uint256 disputeID) {\\n if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough();\\n\\n return _createDispute(_numberOfChoices, _extraData, Constants.NATIVE_CURRENCY, msg.value);\\n }\\n\\n /// @inheritdoc IArbitratorV2\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external override returns (uint256 disputeID) {\\n if (!currencyRates[_feeToken].feePaymentAccepted) revert TokenNotAccepted();\\n if (_feeAmount < arbitrationCost(_extraData, _feeToken)) revert ArbitrationFeesNotEnough();\\n\\n if (!_feeToken.safeTransferFrom(msg.sender, address(this), _feeAmount)) revert TransferFailed();\\n return _createDispute(_numberOfChoices, _extraData, _feeToken, _feeAmount);\\n }\\n\\n function _createDispute(\\n uint256 _numberOfChoices,\\n bytes memory _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) internal returns (uint256 disputeID) {\\n (uint96 courtID, , uint256 disputeKitID) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n if (!courts[courtID].supportedDisputeKits[disputeKitID]) revert DisputeKitNotSupportedByCourt();\\n\\n disputeID = disputes.length;\\n Dispute storage dispute = disputes.push();\\n dispute.courtID = courtID;\\n dispute.arbitrated = IArbitrableV2(msg.sender);\\n dispute.lastPeriodChange = block.timestamp;\\n\\n IDisputeKit disputeKit = disputeKits[disputeKitID];\\n Court storage court = courts[dispute.courtID];\\n Round storage round = dispute.rounds.push();\\n\\n // Obtain the feeForJuror in the same currency as the _feeAmount\\n uint256 feeForJuror = (_feeToken == Constants.NATIVE_CURRENCY)\\n ? court.feeForJuror\\n : convertEthToTokenAmount(_feeToken, court.feeForJuror);\\n round.nbVotes = _feeAmount / feeForJuror;\\n round.disputeKitID = disputeKitID;\\n round.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n round.totalFeesForJurors = _feeAmount;\\n round.feeToken = IERC20(_feeToken);\\n\\n sortitionModule.createDisputeHook(disputeID, 0); // Default round ID.\\n\\n disputeKit.createDispute(disputeID, _numberOfChoices, _extraData, round.nbVotes);\\n emit DisputeCreation(disputeID, IArbitrableV2(msg.sender));\\n }\\n\\n /// @dev Passes the period of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n function passPeriod(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n Court storage court = courts[dispute.courtID];\\n\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period == Period.evidence) {\\n if (\\n currentRound == 0 &&\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]\\n ) {\\n revert EvidenceNotPassedAndNotAppeal();\\n }\\n if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing();\\n dispute.period = court.hiddenVotes ? Period.commit : Period.vote;\\n } else if (dispute.period == Period.commit) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areCommitsAllCast(_disputeID)\\n ) {\\n revert CommitPeriodNotPassed();\\n }\\n dispute.period = Period.vote;\\n } else if (dispute.period == Period.vote) {\\n if (\\n block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&\\n !disputeKits[round.disputeKitID].areVotesAllCast(_disputeID)\\n ) {\\n revert VotePeriodNotPassed();\\n }\\n dispute.period = Period.appeal;\\n emit AppealPossible(_disputeID, dispute.arbitrated);\\n } else if (dispute.period == Period.appeal) {\\n if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) {\\n revert AppealPeriodNotPassed();\\n }\\n dispute.period = Period.execution;\\n } else if (dispute.period == Period.execution) {\\n revert DisputePeriodIsFinal();\\n }\\n\\n dispute.lastPeriodChange = block.timestamp;\\n emit NewPeriod(_disputeID, dispute.period);\\n }\\n\\n /// @dev Draws jurors for the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _iterations The number of iterations to run.\\n function draw(uint256 _disputeID, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n uint256 currentRound = dispute.rounds.length - 1;\\n Round storage round = dispute.rounds[currentRound];\\n if (dispute.period != Period.evidence) revert NotEvidencePeriod();\\n\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 startIndex = round.drawIterations; // for gas: less storage reads\\n uint256 i;\\n while (i < _iterations && round.drawnJurors.length < round.nbVotes) {\\n address drawnAddress = disputeKit.draw(_disputeID, startIndex + i++);\\n if (drawnAddress == address(0)) {\\n continue;\\n }\\n sortitionModule.lockStake(drawnAddress, round.pnkAtStakePerJuror);\\n emit Draw(drawnAddress, _disputeID, currentRound, round.drawnJurors.length);\\n round.drawnJurors.push(drawnAddress);\\n if (round.drawnJurors.length == round.nbVotes) {\\n sortitionModule.postDrawHook(_disputeID, currentRound);\\n }\\n }\\n round.drawIterations += i;\\n }\\n\\n /// @dev Appeals the ruling of a specified dispute.\\n /// Note: Access restricted to the Dispute Kit for this `disputeID`.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _numberOfChoices Number of choices for the dispute. Can be required during court jump.\\n /// @param _extraData Extradata for the dispute. Can be required during court jump.\\n function appeal(uint256 _disputeID, uint256 _numberOfChoices, bytes memory _extraData) external payable {\\n if (msg.value < appealCost(_disputeID)) revert AppealFeesNotEnough();\\n\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.appeal) revert DisputeNotAppealable();\\n\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n if (msg.sender != address(disputeKits[round.disputeKitID])) revert DisputeKitOnly();\\n\\n uint96 newCourtID = dispute.courtID;\\n uint256 newDisputeKitID = round.disputeKitID;\\n\\n // Warning: the extra round must be created before calling disputeKit.createDispute()\\n Round storage extraRound = dispute.rounds.push();\\n\\n if (round.nbVotes >= courts[newCourtID].jurorsForCourtJump) {\\n // Jump to parent court.\\n newCourtID = courts[newCourtID].parent;\\n\\n if (!courts[newCourtID].supportedDisputeKits[newDisputeKitID]) {\\n // Switch to classic dispute kit if parent court doesn't support the current one.\\n newDisputeKitID = Constants.DISPUTE_KIT_CLASSIC;\\n }\\n\\n if (newCourtID != dispute.courtID) {\\n emit CourtJump(_disputeID, dispute.rounds.length - 1, dispute.courtID, newCourtID);\\n }\\n }\\n\\n dispute.courtID = newCourtID;\\n dispute.period = Period.evidence;\\n dispute.lastPeriodChange = block.timestamp;\\n\\n Court storage court = courts[newCourtID];\\n extraRound.nbVotes = msg.value / court.feeForJuror; // As many votes that can be afforded by the provided funds.\\n extraRound.pnkAtStakePerJuror = (court.minStake * court.alpha) / ALPHA_DIVISOR;\\n extraRound.totalFeesForJurors = msg.value;\\n extraRound.disputeKitID = newDisputeKitID;\\n\\n sortitionModule.createDisputeHook(_disputeID, dispute.rounds.length - 1);\\n\\n // Dispute kit was changed, so create a dispute in the new DK contract.\\n if (extraRound.disputeKitID != round.disputeKitID) {\\n emit DisputeKitJump(_disputeID, dispute.rounds.length - 1, round.disputeKitID, extraRound.disputeKitID);\\n disputeKits[extraRound.disputeKitID].createDispute(\\n _disputeID,\\n _numberOfChoices,\\n _extraData,\\n extraRound.nbVotes\\n );\\n }\\n\\n emit AppealDecision(_disputeID, dispute.arbitrated);\\n emit NewPeriod(_disputeID, Period.evidence);\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute. Can be called in parts.\\n /// @param _disputeID The ID of the dispute.\\n /// @param _round The appeal round.\\n /// @param _iterations The number of iterations to run.\\n function execute(uint256 _disputeID, uint256 _round, uint256 _iterations) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n\\n Round storage round = dispute.rounds[_round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n uint256 start = round.repartitions;\\n uint256 end = round.repartitions + _iterations;\\n\\n uint256 pnkPenaltiesInRoundCache = round.pnkPenalties; // For saving gas.\\n uint256 numberOfVotesInRound = round.drawnJurors.length;\\n uint256 coherentCount = disputeKit.getCoherentCount(_disputeID, _round); // Total number of jurors that are eligible to a reward in this round.\\n\\n if (coherentCount == 0) {\\n // We loop over the votes once as there are no rewards because it is not a tie and no one in this round is coherent with the final outcome.\\n if (end > numberOfVotesInRound) end = numberOfVotesInRound;\\n } else {\\n // We loop over the votes twice, first to collect the PNK penalties, and second to distribute them as rewards along with arbitration fees.\\n if (end > numberOfVotesInRound * 2) end = numberOfVotesInRound * 2;\\n }\\n round.repartitions = end;\\n\\n for (uint256 i = start; i < end; i++) {\\n if (i < numberOfVotesInRound) {\\n pnkPenaltiesInRoundCache = _executePenalties(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n } else {\\n _executeRewards(\\n ExecuteParams(_disputeID, _round, coherentCount, numberOfVotesInRound, pnkPenaltiesInRoundCache, i)\\n );\\n }\\n }\\n if (round.pnkPenalties != pnkPenaltiesInRoundCache) {\\n round.pnkPenalties = pnkPenaltiesInRoundCache; // Reentrancy risk: breaks Check-Effect-Interact\\n }\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, penalties only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n /// @return pnkPenaltiesInRoundCache The updated penalties in round cache.\\n function _executePenalties(ExecuteParams memory _params) internal returns (uint256) {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition\\n );\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n // Fully coherent jurors won't be penalized.\\n uint256 penalty = (round.pnkAtStakePerJuror * (ALPHA_DIVISOR - degreeOfCoherence)) / ALPHA_DIVISOR;\\n _params.pnkPenaltiesInRound += penalty;\\n\\n // Unlock the PNKs affected by the penalty\\n address account = round.drawnJurors[_params.repartition];\\n sortitionModule.unlockStake(account, penalty);\\n\\n // Apply the penalty to the staked PNKs.\\n sortitionModule.penalizeStake(account, penalty);\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n -int256(penalty),\\n 0,\\n round.feeToken\\n );\\n\\n if (!disputeKit.isVoteActive(_params.disputeID, _params.round, _params.repartition)) {\\n // The juror is inactive, unstake them.\\n sortitionModule.setJurorInactive(account);\\n }\\n if (_params.repartition == _params.numberOfVotesInRound - 1 && _params.coherentCount == 0) {\\n // No one was coherent, send the rewards to the governor.\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(round.totalFeesForJurors);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, round.totalFeesForJurors);\\n }\\n pinakion.safeTransfer(governor, _params.pnkPenaltiesInRound);\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n _params.pnkPenaltiesInRound,\\n round.totalFeesForJurors,\\n round.feeToken\\n );\\n }\\n return _params.pnkPenaltiesInRound;\\n }\\n\\n /// @dev Distribute the PNKs at stake and the dispute fees for the specific round of the dispute, rewards only.\\n /// @param _params The parameters for the execution, see `ExecuteParams`.\\n function _executeRewards(ExecuteParams memory _params) internal {\\n Dispute storage dispute = disputes[_params.disputeID];\\n Round storage round = dispute.rounds[_params.round];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n\\n // [0, 1] value that determines how coherent the juror was in this round, in basis points.\\n uint256 degreeOfCoherence = disputeKit.getDegreeOfCoherence(\\n _params.disputeID,\\n _params.round,\\n _params.repartition % _params.numberOfVotesInRound\\n );\\n\\n // Make sure the degree doesn't exceed 1, though it should be ensured by the dispute kit.\\n if (degreeOfCoherence > ALPHA_DIVISOR) {\\n degreeOfCoherence = ALPHA_DIVISOR;\\n }\\n\\n address account = round.drawnJurors[_params.repartition % _params.numberOfVotesInRound];\\n uint256 pnkLocked = (round.pnkAtStakePerJuror * degreeOfCoherence) / ALPHA_DIVISOR;\\n\\n // Release the rest of the PNKs of the juror for this round.\\n sortitionModule.unlockStake(account, pnkLocked);\\n\\n // Give back the locked PNKs in case the juror fully unstaked earlier.\\n if (!sortitionModule.isJurorStaked(account)) {\\n pinakion.safeTransfer(account, pnkLocked);\\n }\\n\\n // Transfer the rewards\\n uint256 pnkReward = ((_params.pnkPenaltiesInRound / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumPnkRewardPaid += pnkReward;\\n uint256 feeReward = ((round.totalFeesForJurors / _params.coherentCount) * degreeOfCoherence) / ALPHA_DIVISOR;\\n round.sumFeeRewardPaid += feeReward;\\n pinakion.safeTransfer(account, pnkReward);\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(account).send(feeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(account, feeReward);\\n }\\n emit TokenAndETHShift(\\n account,\\n _params.disputeID,\\n _params.round,\\n degreeOfCoherence,\\n int256(pnkReward),\\n int256(feeReward),\\n round.feeToken\\n );\\n\\n // Transfer any residual rewards to the governor. It may happen due to partial coherence of the jurors.\\n if (_params.repartition == _params.numberOfVotesInRound * 2 - 1) {\\n uint256 leftoverPnkReward = _params.pnkPenaltiesInRound - round.sumPnkRewardPaid;\\n uint256 leftoverFeeReward = round.totalFeesForJurors - round.sumFeeRewardPaid;\\n if (leftoverPnkReward != 0 || leftoverFeeReward != 0) {\\n if (leftoverPnkReward != 0) {\\n pinakion.safeTransfer(governor, leftoverPnkReward);\\n }\\n if (leftoverFeeReward != 0) {\\n if (round.feeToken == Constants.NATIVE_CURRENCY) {\\n // The dispute fees were paid in ETH\\n payable(governor).send(leftoverFeeReward);\\n } else {\\n // The dispute fees were paid in ERC20\\n round.feeToken.safeTransfer(governor, leftoverFeeReward);\\n }\\n }\\n emit LeftoverRewardSent(\\n _params.disputeID,\\n _params.round,\\n leftoverPnkReward,\\n leftoverFeeReward,\\n round.feeToken\\n );\\n }\\n }\\n }\\n\\n /// @dev Executes a specified dispute's ruling.\\n /// @param _disputeID The ID of the dispute.\\n function executeRuling(uint256 _disputeID) external {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period != Period.execution) revert NotExecutionPeriod();\\n if (dispute.ruled) revert RulingAlreadyExecuted();\\n\\n (uint256 winningChoice, , ) = currentRuling(_disputeID);\\n dispute.ruled = true;\\n emit Ruling(dispute.arbitrated, _disputeID, winningChoice);\\n dispute.arbitrated.rule(_disputeID, winningChoice);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Compute the cost of arbitration denominated in ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes memory _extraData) public view override returns (uint256 cost) {\\n (uint96 courtID, uint256 minJurors, ) = _extraDataToCourtIDMinJurorsDisputeKit(_extraData);\\n cost = courts[courtID].feeForJuror * minJurors;\\n }\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) public view override returns (uint256 cost) {\\n cost = convertEthToTokenAmount(_feeToken, arbitrationCost(_extraData));\\n }\\n\\n /// @dev Gets the cost of appealing a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return cost The appeal cost.\\n function appealCost(uint256 _disputeID) public view returns (uint256 cost) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n if (round.nbVotes >= court.jurorsForCourtJump) {\\n // Jump to parent court.\\n if (dispute.courtID == Constants.GENERAL_COURT) {\\n // TODO: Handle the forking when appealed in General court.\\n cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.\\n } else {\\n cost = courts[court.parent].feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n } else {\\n // Stay in current court.\\n cost = court.feeForJuror * ((round.nbVotes * 2) + 1);\\n }\\n }\\n\\n /// @dev Gets the start and the end of a specified dispute's current appeal period.\\n /// @param _disputeID The ID of the dispute.\\n /// @return start The start of the appeal period.\\n /// @return end The end of the appeal period.\\n function appealPeriod(uint256 _disputeID) public view returns (uint256 start, uint256 end) {\\n Dispute storage dispute = disputes[_disputeID];\\n if (dispute.period == Period.appeal) {\\n start = dispute.lastPeriodChange;\\n end = dispute.lastPeriodChange + courts[dispute.courtID].timesPerPeriod[uint256(Period.appeal)];\\n } else {\\n start = 0;\\n end = 0;\\n }\\n }\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) public view returns (uint256 ruling, bool tied, bool overridden) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n IDisputeKit disputeKit = disputeKits[round.disputeKitID];\\n (ruling, tied, overridden) = disputeKit.currentRuling(_disputeID);\\n }\\n\\n function getRoundInfo(uint256 _disputeID, uint256 _round) external view returns (Round memory) {\\n return disputes[_disputeID].rounds[_round];\\n }\\n\\n function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {\\n return disputes[_disputeID].rounds.length;\\n }\\n\\n function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {\\n return courts[_courtID].supportedDisputeKits[_disputeKitID];\\n }\\n\\n /// @dev Gets the timesPerPeriod array for a given court.\\n /// @param _courtID The ID of the court to get the times from.\\n /// @return timesPerPeriod The timesPerPeriod array for the given court.\\n function getTimesPerPeriod(uint96 _courtID) external view returns (uint256[4] memory timesPerPeriod) {\\n timesPerPeriod = courts[_courtID].timesPerPeriod;\\n }\\n\\n // ************************************* //\\n // * Public Views for Dispute Kits * //\\n // ************************************* //\\n\\n /// @dev Gets the number of votes permitted for the specified dispute in the latest round.\\n /// @param _disputeID The ID of the dispute.\\n function getNumberOfVotes(uint256 _disputeID) external view returns (uint256) {\\n Dispute storage dispute = disputes[_disputeID];\\n return dispute.rounds[dispute.rounds.length - 1].nbVotes;\\n }\\n\\n /// @dev Returns true if the dispute kit will be switched to a parent DK.\\n /// @param _disputeID The ID of the dispute.\\n /// @return Whether DK will be switched or not.\\n function isDisputeKitJumping(uint256 _disputeID) external view returns (bool) {\\n Dispute storage dispute = disputes[_disputeID];\\n Round storage round = dispute.rounds[dispute.rounds.length - 1];\\n Court storage court = courts[dispute.courtID];\\n\\n if (round.nbVotes < court.jurorsForCourtJump) {\\n return false;\\n }\\n\\n // Jump if the parent court doesn't support the current DK.\\n return !courts[court.parent].supportedDisputeKits[round.disputeKitID];\\n }\\n\\n function getDisputeKitsLength() external view returns (uint256) {\\n return disputeKits.length;\\n }\\n\\n function convertEthToTokenAmount(IERC20 _toToken, uint256 _amountInEth) public view returns (uint256) {\\n return (_amountInEth * 10 ** currencyRates[_toToken].rateDecimals) / currencyRates[_toToken].rateInEth;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Toggles the dispute kit support for a given court.\\n /// @param _courtID The ID of the court to toggle the support for.\\n /// @param _disputeKitID The ID of the dispute kit to toggle the support for.\\n /// @param _enable Whether to enable or disable the support. Note that classic dispute kit should always be enabled.\\n function _enableDisputeKit(uint96 _courtID, uint256 _disputeKitID, bool _enable) internal {\\n courts[_courtID].supportedDisputeKits[_disputeKitID] = _enable;\\n emit DisputeKitEnabled(_courtID, _disputeKitID, _enable);\\n }\\n\\n /// @dev If called only once then set _onError to Revert, otherwise set it to Return\\n /// @param _account The account to set the stake for.\\n /// @param _courtID The ID of the court to set the stake for.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred Whether the PNKs were already transferred to/from the staking contract.\\n /// @param _onError Whether to revert or return false on error.\\n /// @return Whether the stake was successfully set or not.\\n function _setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred,\\n OnError _onError\\n ) internal returns (bool) {\\n if (_courtID == Constants.FORKING_COURT || _courtID > courts.length) {\\n _stakingFailed(_onError); // Staking directly into the forking court is not allowed.\\n return false;\\n }\\n if (_newStake != 0 && _newStake < courts[_courtID].minStake) {\\n _stakingFailed(_onError); // Staking less than the minimum stake is not allowed.\\n return false;\\n }\\n (uint256 pnkDeposit, uint256 pnkWithdrawal, bool sortitionSuccess) = sortitionModule.setStake(\\n _account,\\n _courtID,\\n _newStake,\\n _alreadyTransferred\\n );\\n if (!sortitionSuccess) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n if (pnkDeposit > 0) {\\n if (!pinakion.safeTransferFrom(_account, address(this), pnkDeposit)) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n }\\n if (pnkWithdrawal > 0) {\\n if (!pinakion.safeTransfer(_account, pnkWithdrawal)) {\\n _stakingFailed(_onError);\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /// @dev It may revert depending on the _onError parameter.\\n function _stakingFailed(OnError _onError) internal pure {\\n if (_onError == OnError.Return) return;\\n revert StakingFailed();\\n }\\n\\n /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.\\n /// Note that if extradata contains an incorrect value then this value will be switched to default.\\n /// @param _extraData The extra data bytes array. The first 32 bytes are the court ID, the next are the minimum number of jurors and the last are the dispute kit ID.\\n /// @return courtID The court ID.\\n /// @return minJurors The minimum number of jurors required.\\n /// @return disputeKitID The ID of the dispute kit.\\n function _extraDataToCourtIDMinJurorsDisputeKit(\\n bytes memory _extraData\\n ) internal view returns (uint96 courtID, uint256 minJurors, uint256 disputeKitID) {\\n // Note that if the extradata doesn't contain 32 bytes for the dispute kit ID it'll return the default 0 index.\\n if (_extraData.length >= 64) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n courtID := mload(add(_extraData, 0x20))\\n minJurors := mload(add(_extraData, 0x40))\\n disputeKitID := mload(add(_extraData, 0x60))\\n }\\n if (courtID == Constants.FORKING_COURT || courtID >= courts.length) {\\n courtID = Constants.GENERAL_COURT;\\n }\\n if (minJurors == 0) {\\n minJurors = Constants.DEFAULT_NB_OF_JURORS;\\n }\\n if (disputeKitID == Constants.NULL_DISPUTE_KIT || disputeKitID >= disputeKits.length) {\\n disputeKitID = Constants.DISPUTE_KIT_CLASSIC; // 0 index is not used.\\n }\\n } else {\\n courtID = Constants.GENERAL_COURT;\\n minJurors = Constants.DEFAULT_NB_OF_JURORS;\\n disputeKitID = Constants.DISPUTE_KIT_CLASSIC;\\n }\\n }\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error DisputeKitOnly();\\n error SortitionModuleOnly();\\n error UnsuccessfulCall();\\n error InvalidDisputKitParent();\\n error DepthLevelMax();\\n error MinStakeLowerThanParentCourt();\\n error UnsupportedDisputeKit();\\n error InvalidForkingCourtAsParent();\\n error WrongDisputeKitIndex();\\n error CannotDisableClassicDK();\\n error ArraysLengthMismatch();\\n error StakingFailed();\\n error ArbitrationFeesNotEnough();\\n error DisputeKitNotSupportedByCourt();\\n error MustSupportDisputeKitClassic();\\n error TokenNotAccepted();\\n error EvidenceNotPassedAndNotAppeal();\\n error DisputeStillDrawing();\\n error CommitPeriodNotPassed();\\n error VotePeriodNotPassed();\\n error AppealPeriodNotPassed();\\n error NotEvidencePeriod();\\n error AppealFeesNotEnough();\\n error DisputeNotAppealable();\\n error NotExecutionPeriod();\\n error RulingAlreadyExecuted();\\n error DisputePeriodIsFinal();\\n error TransferFailed();\\n}\\n\",\"keccak256\":\"0x43205bc90f6965b5c1380effd2c29994f6dfea074696e39d5df037343a768d6b\",\"license\":\"MIT\"},\"src/arbitration/SortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/**\\n * @custom:authors: [@epiqueras, @unknownunknown1, @jaybuidl, @shotaronowhere]\\n * @custom:reviewers: []\\n * @custom:auditors: []\\n * @custom:bounties: []\\n * @custom:deployments: []\\n */\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./KlerosCore.sol\\\";\\nimport \\\"./interfaces/ISortitionModule.sol\\\";\\nimport \\\"./interfaces/IDisputeKit.sol\\\";\\nimport \\\"../rng/RNG.sol\\\";\\nimport \\\"../proxy/UUPSProxiable.sol\\\";\\nimport \\\"../proxy/Initializable.sol\\\";\\nimport \\\"../libraries/Constants.sol\\\";\\n\\n/// @title SortitionModule\\n/// @dev A factory of trees that keeps track of staked values for sortition.\\ncontract SortitionModule is ISortitionModule, UUPSProxiable, Initializable {\\n // ************************************* //\\n // * Enums / Structs * //\\n // ************************************* //\\n\\n enum PreStakeHookResult {\\n ok, // Correct phase. All checks are passed.\\n stakeDelayedAlreadyTransferred, // Wrong phase but stake is increased, so transfer the tokens without updating the drawing chance.\\n stakeDelayedNotTransferred, // Wrong phase and stake is decreased. Delay the token transfer and drawing chance update.\\n failed // Checks didn't pass. Do no changes.\\n }\\n\\n struct SortitionSumTree {\\n uint256 K; // The maximum number of children per node.\\n // We use this to keep track of vacant positions in the tree after removing a leaf. This is for keeping the tree as balanced as possible without spending gas on moving nodes around.\\n uint256[] stack;\\n uint256[] nodes;\\n // Two-way mapping of IDs to node indexes. Note that node index 0 is reserved for the root node, and means the ID does not have a node.\\n mapping(bytes32 => uint256) IDsToNodeIndexes;\\n mapping(uint256 => bytes32) nodeIndexesToIDs;\\n }\\n\\n struct DelayedStake {\\n address account; // The address of the juror.\\n uint96 courtID; // The ID of the court.\\n uint256 stake; // The new stake.\\n bool alreadyTransferred; // True if tokens were already transferred before delayed stake's execution.\\n }\\n\\n struct Juror {\\n uint96[] courtIDs; // The IDs of courts where the juror's stake path ends. A stake path is a path from the general court to a court the juror directly staked in using `_setStake`.\\n uint256 stakedPnk; // The juror's total amount of tokens staked in subcourts. Reflects actual pnk balance.\\n uint256 lockedPnk; // The juror's total amount of tokens locked in disputes. Can reflect actual pnk balance when stakedPnk are fully withdrawn.\\n }\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant MAX_STAKE_PATHS = 4; // The maximum number of stake paths a juror can have.\\n uint256 public constant DEFAULT_K = 6; // Default number of children per node.\\n\\n address public governor; // The governor of the contract.\\n KlerosCore public core; // The core arbitrator contract.\\n Phase public phase; // The current phase.\\n uint256 public minStakingTime; // The time after which the phase can be switched to Drawing if there are open disputes.\\n uint256 public maxDrawingTime; // The time after which the phase can be switched back to Staking.\\n uint256 public lastPhaseChange; // The last time the phase was changed.\\n uint256 public randomNumberRequestBlock; // Number of the block when RNG request was made.\\n uint256 public disputesWithoutJurors; // The number of disputes that have not finished drawing jurors.\\n RNG public rng; // The random number generator.\\n uint256 public randomNumber; // Random number returned by RNG.\\n uint256 public rngLookahead; // Minimal block distance between requesting and obtaining a random number.\\n uint256 public delayedStakeWriteIndex; // The index of the last `delayedStake` item that was written to the array. 0 index is skipped.\\n uint256 public delayedStakeReadIndex; // The index of the next `delayedStake` item that should be processed. Starts at 1 because 0 index is skipped.\\n mapping(bytes32 => SortitionSumTree) sortitionSumTrees; // The mapping trees by keys.\\n mapping(address => Juror) public jurors; // The jurors.\\n mapping(uint256 => DelayedStake) public delayedStakes; // Stores the stakes that were changed during Drawing phase, to update them when the phase is switched to Staking.\\n mapping(address => mapping(uint96 => uint256)) public latestDelayedStakeIndex; // Maps the juror to its latest delayed stake. If there is already a delayed stake for this juror then it'll be replaced. latestDelayedStakeIndex[juror][courtID].\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n event StakeSet(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayedNotTransferred(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayedAlreadyTransferred(address indexed _address, uint256 _courtID, uint256 _amount);\\n event StakeDelayedAlreadyTransferredWithdrawn(address indexed _address, uint96 indexed _courtID, uint256 _amount);\\n event StakeLocked(address indexed _address, uint256 _relativeAmount, bool _unlock);\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(address(governor) == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n modifier onlyByCore() {\\n require(address(core) == msg.sender, \\\"Access not allowed: KlerosCore only.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @dev Initializer (constructor equivalent for upgradable contracts).\\n /// @param _core The KlerosCore.\\n /// @param _minStakingTime Minimal time to stake\\n /// @param _maxDrawingTime Time after which the drawing phase can be switched\\n /// @param _rng The random number generator.\\n /// @param _rngLookahead Lookahead value for rng.\\n function initialize(\\n address _governor,\\n KlerosCore _core,\\n uint256 _minStakingTime,\\n uint256 _maxDrawingTime,\\n RNG _rng,\\n uint256 _rngLookahead\\n ) external reinitializer(1) {\\n governor = _governor;\\n core = _core;\\n minStakingTime = _minStakingTime;\\n maxDrawingTime = _maxDrawingTime;\\n lastPhaseChange = block.timestamp;\\n rng = _rng;\\n rngLookahead = _rngLookahead;\\n delayedStakeReadIndex = 1;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Access Control to perform implementation upgrades (UUPS Proxiable)\\n * @dev Only the governor can perform upgrades (`onlyByGovernor`)\\n */\\n function _authorizeUpgrade(address) internal view override onlyByGovernor {\\n // NOP\\n }\\n\\n /// @dev Changes the `minStakingTime` storage variable.\\n /// @param _minStakingTime The new value for the `minStakingTime` storage variable.\\n function changeMinStakingTime(uint256 _minStakingTime) external onlyByGovernor {\\n minStakingTime = _minStakingTime;\\n }\\n\\n /// @dev Changes the `maxDrawingTime` storage variable.\\n /// @param _maxDrawingTime The new value for the `maxDrawingTime` storage variable.\\n function changeMaxDrawingTime(uint256 _maxDrawingTime) external onlyByGovernor {\\n maxDrawingTime = _maxDrawingTime;\\n }\\n\\n /// @dev Changes the `_rng` and `_rngLookahead` storage variables.\\n /// @param _rng The new value for the `RNGenerator` storage variable.\\n /// @param _rngLookahead The new value for the `rngLookahead` storage variable.\\n function changeRandomNumberGenerator(RNG _rng, uint256 _rngLookahead) external onlyByGovernor {\\n rng = _rng;\\n rngLookahead = _rngLookahead;\\n if (phase == Phase.generating) {\\n rng.requestRandomness(block.number + rngLookahead);\\n randomNumberRequestBlock = block.number;\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function passPhase() external {\\n if (phase == Phase.staking) {\\n require(\\n block.timestamp - lastPhaseChange >= minStakingTime,\\n \\\"The minimum staking time has not passed yet.\\\"\\n );\\n require(disputesWithoutJurors > 0, \\\"There are no disputes that need jurors.\\\");\\n rng.requestRandomness(block.number + rngLookahead);\\n randomNumberRequestBlock = block.number;\\n phase = Phase.generating;\\n } else if (phase == Phase.generating) {\\n randomNumber = rng.receiveRandomness(randomNumberRequestBlock + rngLookahead);\\n require(randomNumber != 0, \\\"Random number is not ready yet\\\");\\n phase = Phase.drawing;\\n } else if (phase == Phase.drawing) {\\n require(\\n disputesWithoutJurors == 0 || block.timestamp - lastPhaseChange >= maxDrawingTime,\\n \\\"There are still disputes without jurors and the maximum drawing time has not passed yet.\\\"\\n );\\n phase = Phase.staking;\\n }\\n\\n lastPhaseChange = block.timestamp;\\n emit NewPhase(phase);\\n }\\n\\n /// @dev Create a sortition sum tree at the specified key.\\n /// @param _key The key of the new tree.\\n /// @param _extraData Extra data that contains the number of children each node in the tree should have.\\n function createTree(bytes32 _key, bytes memory _extraData) external override onlyByCore {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint256 K = _extraDataToTreeK(_extraData);\\n require(tree.K == 0, \\\"Tree already exists.\\\");\\n require(K > 1, \\\"K must be greater than one.\\\");\\n tree.K = K;\\n tree.nodes.push(0);\\n }\\n\\n /// @dev Executes the next delayed stakes.\\n /// @param _iterations The number of delayed stakes to execute.\\n function executeDelayedStakes(uint256 _iterations) external {\\n require(phase == Phase.staking, \\\"Should be in Staking phase.\\\");\\n\\n uint256 actualIterations = (delayedStakeReadIndex + _iterations) - 1 > delayedStakeWriteIndex\\n ? (delayedStakeWriteIndex - delayedStakeReadIndex) + 1\\n : _iterations;\\n uint256 newDelayedStakeReadIndex = delayedStakeReadIndex + actualIterations;\\n\\n for (uint256 i = delayedStakeReadIndex; i < newDelayedStakeReadIndex; i++) {\\n DelayedStake storage delayedStake = delayedStakes[i];\\n // Delayed stake could've been manually removed already. In this case simply move on to the next item.\\n if (delayedStake.account != address(0)) {\\n core.setStakeBySortitionModule(\\n delayedStake.account,\\n delayedStake.courtID,\\n delayedStake.stake,\\n delayedStake.alreadyTransferred\\n );\\n delete latestDelayedStakeIndex[delayedStake.account][delayedStake.courtID];\\n delete delayedStakes[i];\\n }\\n }\\n delayedStakeReadIndex = newDelayedStakeReadIndex;\\n }\\n\\n function createDisputeHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore {\\n disputesWithoutJurors++;\\n }\\n\\n function postDrawHook(uint256 /*_disputeID*/, uint256 /*_roundID*/) external override onlyByCore {\\n disputesWithoutJurors--;\\n }\\n\\n /// @dev Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().\\n /// @param _randomNumber Random number returned by RNG contract.\\n function notifyRandomNumber(uint256 _randomNumber) public override {}\\n\\n /// @dev Sets the specified juror's stake in a court.\\n /// `O(n + p * log_k(j))` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The address of the juror.\\n /// @param _courtID The ID of the court.\\n /// @param _newStake The new stake.\\n /// @param _alreadyTransferred True if the tokens were already transferred from juror. Only relevant for delayed stakes.\\n /// @return pnkDeposit The amount of PNK to be deposited.\\n /// @return pnkWithdrawal The amount of PNK to be withdrawn.\\n /// @return succeeded True if the call succeeded, false otherwise.\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external override onlyByCore returns (uint256 pnkDeposit, uint256 pnkWithdrawal, bool succeeded) {\\n Juror storage juror = jurors[_account];\\n uint256 currentStake = stakeOf(_account, _courtID);\\n\\n uint256 nbCourts = juror.courtIDs.length;\\n if (_newStake == 0 && (nbCourts >= MAX_STAKE_PATHS || currentStake == 0)) {\\n return (0, 0, false); // Prevent staking beyond MAX_STAKE_PATHS but unstaking is always allowed.\\n }\\n\\n if (phase != Phase.staking) {\\n pnkWithdrawal = _deleteDelayedStake(_courtID, _account);\\n\\n // Store the stake change as delayed, to be applied when the phase switches back to Staking.\\n DelayedStake storage delayedStake = delayedStakes[++delayedStakeWriteIndex];\\n delayedStake.account = _account;\\n delayedStake.courtID = _courtID;\\n delayedStake.stake = _newStake;\\n latestDelayedStakeIndex[_account][_courtID] = delayedStakeWriteIndex;\\n if (_newStake > currentStake) {\\n // PNK deposit: tokens are transferred now.\\n delayedStake.alreadyTransferred = true;\\n pnkDeposit = _increaseStake(juror, _courtID, _newStake, currentStake);\\n emit StakeDelayedAlreadyTransferred(_account, _courtID, _newStake);\\n } else {\\n // PNK withdrawal: tokens are not transferred yet.\\n emit StakeDelayedNotTransferred(_account, _courtID, _newStake);\\n }\\n return (pnkDeposit, pnkWithdrawal, true);\\n }\\n\\n // Current phase is Staking: set normal stakes or delayed stakes (which may have been already transferred).\\n if (_newStake >= currentStake) {\\n if (!_alreadyTransferred) {\\n pnkDeposit = _increaseStake(juror, _courtID, _newStake, currentStake);\\n }\\n } else {\\n pnkWithdrawal += _decreaseStake(juror, _courtID, _newStake, currentStake);\\n }\\n\\n bytes32 stakePathID = _accountAndCourtIDToStakePathID(_account, _courtID);\\n bool finished = false;\\n uint96 currenCourtID = _courtID;\\n while (!finished) {\\n // Tokens are also implicitly staked in parent courts through sortition module to increase the chance of being drawn.\\n _set(bytes32(uint256(currenCourtID)), _newStake, stakePathID);\\n if (currenCourtID == Constants.GENERAL_COURT) {\\n finished = true;\\n } else {\\n (currenCourtID, , , , , , ) = core.courts(currenCourtID);\\n }\\n }\\n emit StakeSet(_account, _courtID, _newStake);\\n return (pnkDeposit, pnkWithdrawal, true);\\n }\\n\\n /// @dev Checks if there is already a delayed stake. In this case consider it irrelevant and remove it.\\n /// @param _courtID ID of the court.\\n /// @param _juror Juror whose stake to check.\\n function _deleteDelayedStake(uint96 _courtID, address _juror) internal returns (uint256 actualAmountToWithdraw) {\\n uint256 latestIndex = latestDelayedStakeIndex[_juror][_courtID];\\n if (latestIndex != 0) {\\n DelayedStake storage delayedStake = delayedStakes[latestIndex];\\n if (delayedStake.alreadyTransferred) {\\n // Sortition stake represents the stake value that was last updated during Staking phase.\\n uint256 sortitionStake = stakeOf(_juror, _courtID);\\n\\n // Withdraw the tokens that were added with the latest delayed stake.\\n uint256 amountToWithdraw = delayedStake.stake - sortitionStake;\\n actualAmountToWithdraw = amountToWithdraw;\\n Juror storage juror = jurors[_juror];\\n if (juror.stakedPnk <= actualAmountToWithdraw) {\\n actualAmountToWithdraw = juror.stakedPnk;\\n }\\n\\n // StakePnk can become lower because of penalty.\\n juror.stakedPnk -= actualAmountToWithdraw;\\n emit StakeDelayedAlreadyTransferredWithdrawn(_juror, _courtID, amountToWithdraw);\\n\\n if (sortitionStake == 0) {\\n // Delete the court otherwise it will be duplicated after staking.\\n for (uint256 i = juror.courtIDs.length; i > 0; i--) {\\n if (juror.courtIDs[i - 1] == _courtID) {\\n juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1];\\n juror.courtIDs.pop();\\n break;\\n }\\n }\\n }\\n }\\n delete delayedStakes[latestIndex];\\n delete latestDelayedStakeIndex[_juror][_courtID];\\n }\\n }\\n\\n function _increaseStake(\\n Juror storage juror,\\n uint96 _courtID,\\n uint256 _newStake,\\n uint256 _currentStake\\n ) internal returns (uint256 transferredAmount) {\\n // Stake increase\\n // When stakedPnk becomes lower than lockedPnk count the locked tokens in when transferring tokens from juror.\\n // (E.g. stakedPnk = 0, lockedPnk = 150) which can happen if the juror unstaked fully while having some tokens locked.\\n uint256 previouslyLocked = (juror.lockedPnk >= juror.stakedPnk) ? juror.lockedPnk - juror.stakedPnk : 0; // underflow guard\\n transferredAmount = (_newStake >= _currentStake + previouslyLocked) // underflow guard\\n ? _newStake - _currentStake - previouslyLocked\\n : 0;\\n if (_currentStake == 0) {\\n juror.courtIDs.push(_courtID);\\n }\\n // stakedPnk can become async with _currentStake (e.g. after penalty).\\n juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake;\\n }\\n\\n function _decreaseStake(\\n Juror storage juror,\\n uint96 _courtID,\\n uint256 _newStake,\\n uint256 _currentStake\\n ) internal returns (uint256 transferredAmount) {\\n // Stakes can be partially delayed only when stake is increased.\\n // Stake decrease: make sure locked tokens always stay in the contract. They can only be released during Execution.\\n if (juror.stakedPnk >= _currentStake - _newStake + juror.lockedPnk) {\\n // We have enough pnk staked to afford withdrawal while keeping locked tokens.\\n transferredAmount = _currentStake - _newStake;\\n } else if (juror.stakedPnk >= juror.lockedPnk) {\\n // Can't afford withdrawing the current stake fully. Take whatever is available while keeping locked tokens.\\n transferredAmount = juror.stakedPnk - juror.lockedPnk;\\n }\\n if (_newStake == 0) {\\n for (uint256 i = juror.courtIDs.length; i > 0; i--) {\\n if (juror.courtIDs[i - 1] == _courtID) {\\n juror.courtIDs[i - 1] = juror.courtIDs[juror.courtIDs.length - 1];\\n juror.courtIDs.pop();\\n break;\\n }\\n }\\n }\\n // stakedPnk can become async with _currentStake (e.g. after penalty).\\n juror.stakedPnk = (juror.stakedPnk >= _currentStake) ? juror.stakedPnk - _currentStake + _newStake : _newStake;\\n }\\n\\n function lockStake(address _account, uint256 _relativeAmount) external override onlyByCore {\\n jurors[_account].lockedPnk += _relativeAmount;\\n emit StakeLocked(_account, _relativeAmount, false);\\n }\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external override onlyByCore {\\n jurors[_account].lockedPnk -= _relativeAmount;\\n emit StakeLocked(_account, _relativeAmount, true);\\n }\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external override onlyByCore {\\n Juror storage juror = jurors[_account];\\n if (juror.stakedPnk >= _relativeAmount) {\\n juror.stakedPnk -= _relativeAmount;\\n } else {\\n juror.stakedPnk = 0; // stakedPnk might become lower after manual unstaking, but lockedPnk will always cover the difference.\\n }\\n }\\n\\n /// @dev Unstakes the inactive juror from all courts.\\n /// `O(n * (p * log_k(j)) )` where\\n /// `n` is the number of courts the juror has staked in,\\n /// `p` is the depth of the court tree,\\n /// `k` is the minimum number of children per node of one of these courts' sortition sum tree,\\n /// and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.\\n /// @param _account The juror to unstake.\\n function setJurorInactive(address _account) external override onlyByCore {\\n uint96[] memory courtIDs = getJurorCourtIDs(_account);\\n for (uint256 j = courtIDs.length; j > 0; j--) {\\n core.setStakeBySortitionModule(_account, courtIDs[j - 1], 0, false);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Draw an ID from a tree using a number.\\n /// Note that this function reverts if the sum of all values in the tree is 0.\\n /// @param _key The key of the tree.\\n /// @param _coreDisputeID Index of the dispute in Kleros Core.\\n /// @param _nonce Nonce to hash with random number.\\n /// @return drawnAddress The drawn address.\\n /// `O(k * log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function draw(\\n bytes32 _key,\\n uint256 _coreDisputeID,\\n uint256 _nonce\\n ) public view override returns (address drawnAddress) {\\n require(phase == Phase.drawing, \\\"Wrong phase.\\\");\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n\\n if (tree.nodes[0] == 0) {\\n return address(0); // No jurors staked.\\n }\\n\\n uint256 currentDrawnNumber = uint256(keccak256(abi.encodePacked(randomNumber, _coreDisputeID, _nonce))) %\\n tree.nodes[0];\\n\\n // While it still has children\\n uint256 treeIndex = 0;\\n while ((tree.K * treeIndex) + 1 < tree.nodes.length) {\\n for (uint256 i = 1; i <= tree.K; i++) {\\n // Loop over children.\\n uint256 nodeIndex = (tree.K * treeIndex) + i;\\n uint256 nodeValue = tree.nodes[nodeIndex];\\n\\n if (currentDrawnNumber >= nodeValue) {\\n // Go to the next child.\\n currentDrawnNumber -= nodeValue;\\n } else {\\n // Pick this child.\\n treeIndex = nodeIndex;\\n break;\\n }\\n }\\n }\\n drawnAddress = _stakePathIDToAccount(tree.nodeIndexesToIDs[treeIndex]);\\n }\\n\\n /// @dev Get the stake of a juror in a court.\\n /// @param _juror The address of the juror.\\n /// @param _courtID The ID of the court.\\n /// @return value The stake of the juror in the court.\\n function stakeOf(address _juror, uint96 _courtID) public view returns (uint256) {\\n bytes32 stakePathID = _accountAndCourtIDToStakePathID(_juror, _courtID);\\n return stakeOf(bytes32(uint256(_courtID)), stakePathID);\\n }\\n\\n /// @dev Get the stake of a juror in a court.\\n /// @param _key The key of the tree, corresponding to a court.\\n /// @param _ID The stake path ID, corresponding to a juror.\\n /// @return The stake of the juror in the court.\\n function stakeOf(bytes32 _key, bytes32 _ID) public view returns (uint256) {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint treeIndex = tree.IDsToNodeIndexes[_ID];\\n if (treeIndex == 0) {\\n return 0;\\n }\\n return tree.nodes[treeIndex];\\n }\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n )\\n external\\n view\\n override\\n returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts)\\n {\\n Juror storage juror = jurors[_juror];\\n totalStaked = juror.stakedPnk;\\n totalLocked = juror.lockedPnk;\\n stakedInCourt = stakeOf(_juror, _courtID);\\n nbCourts = juror.courtIDs.length;\\n }\\n\\n /// @dev Gets the court identifiers where a specific `_juror` has staked.\\n /// @param _juror The address of the juror.\\n function getJurorCourtIDs(address _juror) public view override returns (uint96[] memory) {\\n return jurors[_juror].courtIDs;\\n }\\n\\n function isJurorStaked(address _juror) external view override returns (bool) {\\n return jurors[_juror].stakedPnk > 0;\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Update all the parents of a node.\\n /// @param _key The key of the tree to update.\\n /// @param _treeIndex The index of the node to start from.\\n /// @param _plusOrMinus Whether to add (true) or substract (false).\\n /// @param _value The value to add or substract.\\n /// `O(log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function _updateParents(bytes32 _key, uint256 _treeIndex, bool _plusOrMinus, uint256 _value) private {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n\\n uint256 parentIndex = _treeIndex;\\n while (parentIndex != 0) {\\n parentIndex = (parentIndex - 1) / tree.K;\\n tree.nodes[parentIndex] = _plusOrMinus\\n ? tree.nodes[parentIndex] + _value\\n : tree.nodes[parentIndex] - _value;\\n }\\n }\\n\\n /// @dev Retrieves a juror's address from the stake path ID.\\n /// @param _stakePathID The stake path ID to unpack.\\n /// @return account The account.\\n function _stakePathIDToAccount(bytes32 _stakePathID) internal pure returns (address account) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n let ptr := mload(0x40)\\n for {\\n let i := 0x00\\n } lt(i, 0x14) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(add(ptr, 0x0c), i), byte(i, _stakePathID))\\n }\\n account := mload(ptr)\\n }\\n }\\n\\n function _extraDataToTreeK(bytes memory _extraData) internal pure returns (uint256 K) {\\n if (_extraData.length >= 32) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n K := mload(add(_extraData, 0x20))\\n }\\n } else {\\n K = DEFAULT_K;\\n }\\n }\\n\\n /// @dev Set a value in a tree.\\n /// @param _key The key of the tree.\\n /// @param _value The new value.\\n /// @param _ID The ID of the value.\\n /// `O(log_k(n))` where\\n /// `k` is the maximum number of children per node in the tree,\\n /// and `n` is the maximum number of nodes ever appended.\\n function _set(bytes32 _key, uint256 _value, bytes32 _ID) internal {\\n SortitionSumTree storage tree = sortitionSumTrees[_key];\\n uint256 treeIndex = tree.IDsToNodeIndexes[_ID];\\n\\n if (treeIndex == 0) {\\n // No existing node.\\n if (_value != 0) {\\n // Non zero value.\\n // Append.\\n // Add node.\\n if (tree.stack.length == 0) {\\n // No vacant spots.\\n // Get the index and append the value.\\n treeIndex = tree.nodes.length;\\n tree.nodes.push(_value);\\n\\n // Potentially append a new node and make the parent a sum node.\\n if (treeIndex != 1 && (treeIndex - 1) % tree.K == 0) {\\n // Is first child.\\n uint256 parentIndex = treeIndex / tree.K;\\n bytes32 parentID = tree.nodeIndexesToIDs[parentIndex];\\n uint256 newIndex = treeIndex + 1;\\n tree.nodes.push(tree.nodes[parentIndex]);\\n delete tree.nodeIndexesToIDs[parentIndex];\\n tree.IDsToNodeIndexes[parentID] = newIndex;\\n tree.nodeIndexesToIDs[newIndex] = parentID;\\n }\\n } else {\\n // Some vacant spot.\\n // Pop the stack and append the value.\\n treeIndex = tree.stack[tree.stack.length - 1];\\n tree.stack.pop();\\n tree.nodes[treeIndex] = _value;\\n }\\n\\n // Add label.\\n tree.IDsToNodeIndexes[_ID] = treeIndex;\\n tree.nodeIndexesToIDs[treeIndex] = _ID;\\n\\n _updateParents(_key, treeIndex, true, _value);\\n }\\n } else {\\n // Existing node.\\n if (_value == 0) {\\n // Zero value.\\n // Remove.\\n // Remember value and set to 0.\\n uint256 value = tree.nodes[treeIndex];\\n tree.nodes[treeIndex] = 0;\\n\\n // Push to stack.\\n tree.stack.push(treeIndex);\\n\\n // Clear label.\\n delete tree.IDsToNodeIndexes[_ID];\\n delete tree.nodeIndexesToIDs[treeIndex];\\n\\n _updateParents(_key, treeIndex, false, value);\\n } else if (_value != tree.nodes[treeIndex]) {\\n // New, non zero value.\\n // Set.\\n bool plusOrMinus = tree.nodes[treeIndex] <= _value;\\n uint256 plusOrMinusValue = plusOrMinus\\n ? _value - tree.nodes[treeIndex]\\n : tree.nodes[treeIndex] - _value;\\n tree.nodes[treeIndex] = _value;\\n\\n _updateParents(_key, treeIndex, plusOrMinus, plusOrMinusValue);\\n }\\n }\\n }\\n\\n /// @dev Packs an account and a court ID into a stake path ID.\\n /// @param _account The address of the juror to pack.\\n /// @param _courtID The court ID to pack.\\n /// @return stakePathID The stake path ID.\\n function _accountAndCourtIDToStakePathID(\\n address _account,\\n uint96 _courtID\\n ) internal pure returns (bytes32 stakePathID) {\\n assembly {\\n // solium-disable-line security/no-inline-assembly\\n let ptr := mload(0x40)\\n for {\\n let i := 0x00\\n } lt(i, 0x14) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(ptr, i), byte(add(0x0c, i), _account))\\n }\\n for {\\n let i := 0x14\\n } lt(i, 0x20) {\\n i := add(i, 0x01)\\n } {\\n mstore8(add(ptr, i), byte(i, _courtID))\\n }\\n stakePathID := mload(ptr)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4dd725bb26738ca3d7caa389f80fd50c10de2a9925b3f1d7e70348885c108102\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"src/arbitration/interfaces/IDisputeKit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @custom:authors: [@unknownunknown1, @jaybuidl]\\n/// @custom:reviewers: []\\n/// @custom:auditors: []\\n/// @custom:bounties: []\\n/// @custom:deployments: []\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IDisputeKit\\n/// An abstraction of the Dispute Kits intended for interfacing with KlerosCore.\\n/// It does not intend to abstract the interactions with the user (such as voting or appeal funding) to allow for implementation-specific parameters.\\ninterface IDisputeKit {\\n // ************************************ //\\n // * Events * //\\n // ************************************ //\\n\\n /// @dev Emitted when casting a vote to provide the justification of juror's choice.\\n /// @param _coreDisputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _juror Address of the juror.\\n /// @param _voteIDs The identifiers of the votes in the dispute.\\n /// @param _choice The choice juror voted for.\\n /// @param _justification Justification of the choice.\\n event VoteCast(\\n uint256 indexed _coreDisputeID,\\n address indexed _juror,\\n uint256[] _voteIDs,\\n uint256 indexed _choice,\\n string _justification\\n );\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Creates a local dispute and maps it to the dispute ID in the Core contract.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _numberOfChoices Number of choices of the dispute\\n /// @param _extraData Additional info about the dispute, for possible use in future dispute kits.\\n function createDispute(\\n uint256 _coreDisputeID,\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n uint256 _nbVotes\\n ) external;\\n\\n /// @dev Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core.\\n /// Note: Access restricted to Kleros Core only.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _nonce Nonce.\\n /// @return drawnAddress The drawn address.\\n function draw(uint256 _coreDisputeID, uint256 _nonce) external returns (address drawnAddress);\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n\\n /// @dev Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the vote.\\n /// @return The degree of coherence in basis points.\\n function getDegreeOfCoherence(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (uint256);\\n\\n /// @dev Gets the number of jurors who are eligible to a reward in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @return The number of coherent jurors.\\n function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);\\n\\n /// @dev Returns true if all of the jurors have cast their commits for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their commits for the last round.\\n function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if all of the jurors have cast their votes for the last round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @return Whether all of the jurors have cast their votes for the last round.\\n function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);\\n\\n /// @dev Returns true if the specified voter was active in this round.\\n /// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.\\n /// @param _coreRoundID The ID of the round in Kleros Core, not in the Dispute Kit.\\n /// @param _voteID The ID of the voter.\\n /// @return Whether the voter was active or not.\\n function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);\\n\\n function getRoundInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _choice\\n )\\n external\\n view\\n returns (\\n uint256 winningChoice,\\n bool tied,\\n uint256 totalVoted,\\n uint256 totalCommited,\\n uint256 nbVoters,\\n uint256 choiceCount\\n );\\n\\n function getVoteInfo(\\n uint256 _coreDisputeID,\\n uint256 _coreRoundID,\\n uint256 _voteID\\n ) external view returns (address account, bytes32 commit, uint256 choice, bool voted);\\n}\\n\",\"keccak256\":\"0x7fe6b1d9b991cc327cc5895f34208a7b1e3b6ebf8efb20fcb9f3ff0f40d2d209\",\"license\":\"MIT\"},\"src/arbitration/interfaces/ISortitionModule.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\ninterface ISortitionModule {\\n enum Phase {\\n staking, // Stake sum trees can be updated. Pass after `minStakingTime` passes and there is at least one dispute without jurors.\\n generating, // Waiting for a random number. Pass as soon as it is ready.\\n drawing // Jurors can be drawn. Pass after all disputes have jurors or `maxDrawingTime` passes.\\n }\\n\\n event NewPhase(Phase _phase);\\n\\n function createTree(bytes32 _key, bytes memory _extraData) external;\\n\\n function setStake(\\n address _account,\\n uint96 _courtID,\\n uint256 _newStake,\\n bool _alreadyTransferred\\n ) external returns (uint256 pnkDeposit, uint256 pnkWithdrawal, bool succeeded);\\n\\n function setJurorInactive(address _account) external;\\n\\n function lockStake(address _account, uint256 _relativeAmount) external;\\n\\n function unlockStake(address _account, uint256 _relativeAmount) external;\\n\\n function penalizeStake(address _account, uint256 _relativeAmount) external;\\n\\n function notifyRandomNumber(uint256 _drawnNumber) external;\\n\\n function draw(bytes32 _court, uint256 _coreDisputeID, uint256 _nonce) external view returns (address);\\n\\n function getJurorBalance(\\n address _juror,\\n uint96 _courtID\\n ) external view returns (uint256 totalStaked, uint256 totalLocked, uint256 stakedInCourt, uint256 nbCourts);\\n\\n function getJurorCourtIDs(address _juror) external view returns (uint96[] memory);\\n\\n function isJurorStaked(address _juror) external view returns (bool);\\n\\n function createDisputeHook(uint256 _disputeID, uint256 _roundID) external;\\n\\n function postDrawHook(uint256 _disputeID, uint256 _roundID) external;\\n}\\n\",\"keccak256\":\"0xa6d79053edfe04f7d3c8ad9b9ce3f182e45f2f74be40a77a304a93168549c474\",\"license\":\"MIT\"},\"src/libraries/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title Constants\\nlibrary Constants {\\n // Courts\\n uint96 internal constant FORKING_COURT = 0; // Index of the forking court.\\n uint96 internal constant GENERAL_COURT = 1; // Index of the default (general) court.\\n\\n // Dispute Kits\\n uint256 internal constant NULL_DISPUTE_KIT = 0; // Null pattern to indicate a top-level DK which has no parent.\\n uint256 internal constant DISPUTE_KIT_CLASSIC = 1; // Index of the default DK. 0 index is skipped.\\n\\n // Defaults\\n uint256 internal constant DEFAULT_NB_OF_JURORS = 3; // The default number of jurors in a dispute.\\n IERC20 internal constant NATIVE_CURRENCY = IERC20(address(0)); // The native currency, such as ETH on Arbitrum, Optimism and Ethereum L1.\\n}\\n\",\"keccak256\":\"0xc1dc3005bd8de9e68b6c8723db40e98c4c9d5e0c4ca444aa8f314866ebd9e73b\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Increases the allowance granted to `spender` by the caller.\\n /// @param _token Token to transfer.\\n /// @param _spender The address which will spend the funds.\\n /// @param _addedValue The amount of tokens to increase the allowance by.\\n function increaseAllowance(IERC20 _token, address _spender, uint256 _addedValue) internal returns (bool) {\\n _token.approve(_spender, _token.allowance(address(this), _spender) + _addedValue);\\n return true;\\n }\\n\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\\n\",\"keccak256\":\"0x37a19df56a98cd466fb6e70b8c56e13bfc439221bfabd8c5108d36d0e3ffc0e5\",\"license\":\"MIT\"},\"src/libraries/Types.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nenum OnError {\\n Revert,\\n Return\\n}\\n\",\"keccak256\":\"0xc7deebd8227dfaa46a36ae8d2c24fe1b5d5c776ab963b44943829ab4058b5701\",\"license\":\"MIT\"},\"src/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) \\n\\npragma solidity 0.8.18;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to the proxy constructor\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1))\\n bytes32 private constant _INITIALIZABLE_STORAGE =\\n 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error AlreadyInitialized();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n if (!(isTopLevelCall && initialized < 1) && !(address(this).code.length == 0 && initialized == 1)) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert AlreadyInitialized();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert AlreadyInitialized();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := _INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcfffacf78b92e89a0123aff2c86188abc5327bb59b223f04e1cc1267234bd828\",\"license\":\"MIT\"},\"src/proxy/UUPSProxiable.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxiable\\n * @author Simon Malatrait \\n * @dev This contract implements an upgradeability mechanism designed for UUPS proxies.\\n * The functions included here can perform an upgrade of an UUPS Proxy, when this contract is set as the implementation behind such a proxy.\\n *\\n * IMPORTANT: A UUPS proxy requires its upgradeability functions to be in the implementation as opposed to the transparent proxy.\\n * This means that if the proxy is upgraded to an implementation that does not support this interface, it will no longer be upgradeable.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSProxiable` with a custom implementation of upgrades.\\n *\\n * The `_authorizeUpgrade` function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSProxiable {\\n // ************************************* //\\n // * Event * //\\n // ************************************* //\\n\\n /**\\n * Emitted when the `implementation` has been successfully upgraded.\\n * @param newImplementation Address of the new implementation the proxy is now forwarding calls to.\\n */\\n event Upgraded(address indexed newImplementation);\\n\\n // ************************************* //\\n // * Error * //\\n // ************************************* //\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /// The `implementation` is not UUPS-compliant\\n error InvalidImplementation(address implementation);\\n\\n /// Failed Delegated call\\n error FailedDelegateCall();\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Storage variable of the proxiable contract address.\\n * It is used to check whether or not the current call is from the proxy.\\n */\\n address private immutable __self = address(this);\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract.\\n * @dev Called by {upgradeToAndCall}.\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Upgrade mechanism including access control and UUPS-compliance.\\n * @param newImplementation Address of the new implementation contract.\\n * @param data Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC1967-compliant implementation pointing to self.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual {\\n _authorizeUpgrade(newImplementation);\\n\\n /* Check that the execution is being performed through a delegatecall call and that the execution context is\\n a proxy contract with an implementation (as defined in ERC1967) pointing to self. */\\n if (address(this) == __self || _getImplementation() != __self) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n\\n try UUPSProxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n // Store the new implementation address to the implementation storage slot.\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, newImplementation)\\n }\\n emit Upgraded(newImplementation);\\n\\n if (data.length != 0) {\\n // The return data is not checked (checking, in case of success, that the newImplementation code is non-empty if the return data is empty) because the authorized callee is trusted.\\n (bool success, ) = newImplementation.delegatecall(data);\\n if (!success) {\\n revert FailedDelegateCall();\\n }\\n }\\n } catch {\\n revert InvalidImplementation(newImplementation);\\n }\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /**\\n * @dev Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the if statement.\\n */\\n function proxiableUUID() external view virtual returns (bytes32) {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n return IMPLEMENTATION_SLOT;\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbac7476deeee8ebbfc895a42e8b50a01c7549164a48ee2ddb0e2307946ee35f9\",\"license\":\"MIT\"},\"src/rng/RNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\ninterface RNG {\\n /// @dev Request a random number.\\n /// @param _block Block linked to the request.\\n function requestRandomness(uint256 _block) external;\\n\\n /// @dev Receive the random number.\\n /// @param _block Block the random number is linked to.\\n /// @return randomNumber Random Number. If the number is not ready or has not been required 0 instead.\\n function receiveRandomness(uint256 _block) external returns (uint256 randomNumber);\\n}\\n\",\"keccak256\":\"0x5afe7121f49aebe72218df356bd91b66c2171b9ad15e7945a15a091784291a43\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000d9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805468010000000000000000900460ff1615620000765760405162dc149f60e41b815260040160405180910390fd5b80546001600160401b0390811614620000d65780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051612e7e62000103600039600081816112550152818161127e01526114760152612e7e6000f3fe6080604052600436106102465760003560e01c80637dc38f1411610139578063c1572618116100b6578063dca5f6b01161007a578063dca5f6b0146106c6578063dd5e5cb514610712578063e534710d14610732578063f216de4c1461076a578063f2f4eb261461078a578063f6b4d82d146107aa57600080fd5b8063c15726181461061a578063ccbac9f514610630578063d09f392d14610646578063d1c1df4814610666578063d605787b146106a657600080fd5b8063b1c9fe6e116100fd578063b1c9fe6e1461058b578063b4a61608146105b9578063b5d69e99146105ce578063b888adfa146105ee578063c057eca71461060457600080fd5b80637dc38f14146104d8578063823cfd70146104ee578063965af6c71461050e578063a2473cc11461052e578063a5861b901461054e57600080fd5b80634c70a0d6116101c757806354812d171161018b57806354812d171461041757806356acb050146104375780635d2d78461461044d5780636624192f1461046d57806376fa9fc5146104b857600080fd5b80634c70a0d6146103825780634dbbebbc146103a25780634f1ef286146103c257806352d1902d146103d5578063543f8a36146103ea57600080fd5b80631b92bbbe1161020e5780631b92bbbe146102ee57806321e1625e1461030457806321ea9b3f1461032457806335975f4a14610342578063477a655c1461036257600080fd5b8063034327441461024b5780630b274f2e146102745780630b51806d1461028b5780630c340a24146102a05780630e083ec9146102d8575b600080fd5b34801561025757600080fd5b5061026160065481565b6040519081526020015b60405180910390f35b34801561028057600080fd5b50610289610814565b005b34801561029757600080fd5b50610261600681565b3480156102ac57600080fd5b506000546102c0906001600160a01b031681565b6040516001600160a01b03909116815260200161026b565b3480156102e457600080fd5b50610261600a5481565b3480156102fa57600080fd5b5061026160035481565b34801561031057600080fd5b5061028961031f366004612852565b610bec565b34801561033057600080fd5b5061028961033f36600461287e565b50565b34801561034e57600080fd5b5061028961035d36600461287e565b610c8f565b34801561036e57600080fd5b5061028961037d36600461293a565b610e7d565b34801561038e57600080fd5b506102c061039d366004612981565b610f74565b3480156103ae57600080fd5b506102896103bd366004612852565b611158565b6102896103d03660046129ad565b611241565b3480156103e157600080fd5b50610261611469565b3480156103f657600080fd5b5061040a6104053660046129e7565b6114c7565b60405161026b9190612a04565b34801561042357600080fd5b50610289610432366004612a51565b611565565b34801561044357600080fd5b50610261600b5481565b34801561045957600080fd5b50610289610468366004612ab8565b61168b565b34801561047957600080fd5b506104a86104883660046129e7565b6001600160a01b03166000908152600d6020526040902060010154151590565b604051901515815260200161026b565b3480156104c457600080fd5b506102616104d3366004612ab8565b6116ce565b3480156104e457600080fd5b5061026160095481565b3480156104fa57600080fd5b5061028961050936600461287e565b611729565b34801561051a57600080fd5b50610289610529366004612852565b611758565b34801561053a57600080fd5b50610261610549366004612aef565b6117f3565b34801561055a57600080fd5b5061056e610569366004612b36565b61181d565b60408051938452602084019290925215159082015260600161026b565b34801561059757600080fd5b506001546105ac90600160a01b900460ff1681565b60405161026b9190612b9f565b3480156105c557600080fd5b50610261600481565b3480156105da57600080fd5b506102896105e93660046129e7565b611be4565b3480156105fa57600080fd5b5061026160045481565b34801561061057600080fd5b5061026160025481565b34801561062657600080fd5b5061026160055481565b34801561063c57600080fd5b5061026160085481565b34801561065257600080fd5b50610289610661366004612ab8565b611cc6565b34801561067257600080fd5b50610686610681366004612aef565b611d00565b60408051948552602085019390935291830152606082015260800161026b565b3480156106b257600080fd5b506007546102c0906001600160a01b031681565b3480156106d257600080fd5b506106fd6106e13660046129e7565b600d602052600090815260409020600181015460029091015482565b6040805192835260208301919091520161026b565b34801561071e57600080fd5b5061028961072d36600461287e565b611d3f565b34801561073e57600080fd5b5061026161074d366004612aef565b600f60209081526000928352604080842090915290825290205481565b34801561077657600080fd5b50610289610785366004612852565b611d6e565b34801561079657600080fd5b506001546102c0906001600160a01b031681565b3480156107b657600080fd5b506108046107c536600461287e565b600e602052600090815260409020805460018201546002909201546001600160a01b03821692600160a01b9092046001600160601b0316919060ff1684565b60405161026b9493929190612bc7565b6000600154600160a01b900460ff16600281111561083457610834612b89565b036109a7576002546004546108499042612c0e565b10156108b15760405162461bcd60e51b815260206004820152602c60248201527f546865206d696e696d756d207374616b696e672074696d6520686173206e6f7460448201526b103830b9b9b2b2103cb2ba1760a11b60648201526084015b60405180910390fd5b6000600654116109135760405162461bcd60e51b815260206004820152602760248201527f546865726520617265206e6f2064697370757465732074686174206e65656420604482015266353ab937b9399760c91b60648201526084016108a8565b6007546009546001600160a01b0390911690637363ae1f906109359043612c21565b6040518263ffffffff1660e01b815260040161095391815260200190565b600060405180830381600087803b15801561096d57600080fd5b505af1158015610981573d6000803e3d6000fd5b505043600555505060018054819060ff60a01b1916600160a01b825b0217905550610ba1565b60018054600160a01b900460ff1660028111156109c6576109c6612b89565b03610abe576007546009546005546001600160a01b03909216916313cf9054916109ef91612c21565b6040518263ffffffff1660e01b8152600401610a0d91815260200190565b6020604051808303816000875af1158015610a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a509190612c34565b6008819055600003610aa45760405162461bcd60e51b815260206004820152601e60248201527f52616e646f6d206e756d626572206973206e6f7420726561647920796574000060448201526064016108a8565b600180546002919060ff60a01b1916600160a01b8361099d565b6002600154600160a01b900460ff166002811115610ade57610ade612b89565b03610ba1576006541580610b005750600354600454610afd9042612c0e565b10155b610b935760405162461bcd60e51b815260206004820152605860248201527f546865726520617265207374696c6c20646973707574657320776974686f757460448201527f206a75726f727320616e6420746865206d6178696d756d2064726177696e67206064820152773a34b6b2903430b9903737ba103830b9b9b2b2103cb2ba1760411b608482015260a4016108a8565b6001805460ff60a01b191690555b426004556001546040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b9391610be291600160a01b90910460ff1690612b9f565b60405180910390a1565b6001546001600160a01b03163314610c165760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d602052604081206002018054839290610c41908490612c21565b909155505060408051828152600060208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b091015b60405180910390a25050565b6000600154600160a01b900460ff166002811115610caf57610caf612b89565b14610cfc5760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520696e205374616b696e672070686173652e000000000060448201526064016108a8565b6000600a54600183600b54610d119190612c21565b610d1b9190612c0e565b11610d265781610d41565b600b54600a54610d369190612c0e565b610d41906001612c21565b9050600081600b54610d539190612c21565b600b549091505b81811015610e75576000818152600e6020526040902080546001600160a01b031615610e625760018054825491830154600284015460405163fbb519e760e01b81526001600160a01b039384169463fbb519e794610dd69490821693600160a01b9092046001600160601b031692909160ff1690600401612bc7565b600060405180830381600087803b158015610df057600080fd5b505af1158015610e04573d6000803e3d6000fd5b505082546001600160a01b0381166000908152600f60209081526040808320600160a01b9094046001600160601b03168352928152828220829055868252600e90529081208181556001810191909155600201805460ff1916905550505b5080610e6d81612c91565b915050610d5a565b50600b555050565b6001546001600160a01b03163314610ea75760405162461bcd60e51b81526004016108a890612c4d565b6000828152600c6020526040812090610ebf83611de6565b825490915015610f085760405162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b60448201526064016108a8565b60018111610f585760405162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e000000000060448201526064016108a8565b8155600201805460018101825560009182526020822001555050565b60006002600154600160a01b900460ff166002811115610f9657610f96612b89565b14610fd25760405162461bcd60e51b815260206004820152600c60248201526b2bb937b73390383430b9b29760a11b60448201526064016108a8565b6000848152600c6020526040812060028101805491929091610ff657610ff6612caa565b9060005260206000200154600003611012576000915050611151565b60008160020160008154811061102a5761102a612caa565b9060005260206000200154600854868660405160200161105d939291909283526020830191909152604082015260600190565b6040516020818303038152906040528051906020012060001c6110809190612cd6565b905060005b60028301548354611097908390612cea565b6110a2906001612c21565b10156111315760015b8354811161112b576000818386600001546110c69190612cea565b6110d09190612c21565b905060008560020182815481106110e9576110e9612caa565b9060005260206000200154905080851061110e576111078186612c0e565b9450611116565b50915061112b565b5050808061112390612c91565b9150506110ab565b50611085565b600081815260048401602052604090205461114b90611e01565b93505050505b9392505050565b6000546001600160a01b031633146111825760405162461bcd60e51b81526004016108a890612d01565b600780546001600160a01b0319166001600160a01b038416179055600981905560018054600160a01b900460ff1660028111156111c1576111c1612b89565b0361123d576007546009546001600160a01b0390911690637363ae1f906111e89043612c21565b6040518263ffffffff1660e01b815260040161120691815260200190565b600060405180830381600087803b15801561122057600080fd5b505af1158015611234573d6000803e3d6000fd5b50504360055550505b5050565b61124a82611e2c565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806112c857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166112bc600080516020612e298339815191525490565b6001600160a01b031614155b156112e65760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611340575060408051601f3d908101601f1916820190925261133d91810190612c34565b60015b61136857604051630c76093760e01b81526001600160a01b03831660048201526024016108a8565b600080516020612e29833981519152811461139957604051632a87526960e21b8152600481018290526024016108a8565b600080516020612e298339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611464576000836001600160a01b0316836040516114009190612d43565b600060405180830381855af49150503d806000811461143b576040519150601f19603f3d011682016040523d82523d6000602084013e611440565b606091505b5050905080611462576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114b45760405163703e46dd60e11b815260040160405180910390fd5b50600080516020612e2983398151915290565b6001600160a01b0381166000908152600d602090815260409182902080548351818402810184019094528084526060939283018282801561155957602002820191906000526020600020906000905b82829054906101000a90046001600160601b03166001600160601b0316815260200190600c0190602082600b010492830192600103820291508084116115165790505b50505050509050919050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806115af5750805467ffffffffffffffff808416911610155b156115cc5760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff8316908117600160401b178255600080546001600160a01b038b81166001600160a01b031992831617909255600180548b841690831617815560028a905560038990554260045560078054938916939092169290921790556009859055600b55815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050505050565b6001546001600160a01b031633146116b55760405162461bcd60e51b81526004016108a890612c4d565b600680549060006116c583612d72565b91905055505050565b6000828152600c60209081526040808320848452600381019092528220548083036116fe57600092505050611723565b81600201818154811061171357611713612caa565b9060005260206000200154925050505b92915050565b6000546001600160a01b031633146117535760405162461bcd60e51b81526004016108a890612d01565b600255565b6001546001600160a01b031633146117825760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d6020526040812060020180548392906117ad908490612c0e565b909155505060408051828152600160208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b09101610c83565b6000806118008484611e56565b90506118156001600160601b038416826116ce565b949350505050565b600154600090819081906001600160a01b0316331461184e5760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0387166000908152600d602052604081209061187189896117f3565b82549091508715801561188d575060048110158061188d575081155b156118a5576000806000955095509550505050611bda565b6000600154600160a01b900460ff1660028111156118c5576118c5612b89565b14611a7f576118d4898b611e9e565b94506000600e6000600a600081546118eb90612c91565b919050819055815260200190815260200160002090508a8160000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550898160000160146101000a8154816001600160601b0302191690836001600160601b03160217905550888160010181905550600a54600f60008d6001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160601b03166001600160601b031681526020019081526020016000208190555082891115611a235760028101805460ff191660011790556119ce848b8b86612155565b604080516001600160601b038d168152602081018c90529198506001600160a01b038d16917f792235ed84e4d70219b4fc973c509bbbdc2d3e22578dceea671f48829db949b0910160405180910390a2611a71565b604080516001600160601b038c168152602081018b90526001600160a01b038d16917fe9a844153bbed760d95005e769b4ef97fab26f7b01305c7028a0493b833bdbae910160405180910390a25b5060019350611bda92505050565b818810611a9f5786611a9a57611a97838a8a85612155565b95505b611ab8565b611aab838a8a85612235565b611ab59086612c21565b94505b6000611ac48b8b611e56565b905060008a5b81611b8257611ae36001600160601b0382168c8561242c565b6000196001600160601b03821601611afe5760019150611aca565b600154604051630fad06e960e11b81526001600160601b03831660048201526001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa158015611b4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b739190612d89565b50949550611aca945050505050565b604080516001600160601b038e168152602081018d90526001600160a01b038f16917f4732545d01e38980276a17e6d394f01577ba63f2fea5eba41af0757d9c060c5c910160405180910390a2506001955050505050505b9450945094915050565b6001546001600160a01b03163314611c0e5760405162461bcd60e51b81526004016108a890612c4d565b6000611c19826114c7565b80519091505b801561146457600180546001600160a01b03169063fbb519e79085908590611c479086612c0e565b81518110611c5757611c57612caa565b60200260200101516000806040518563ffffffff1660e01b8152600401611c819493929190612bc7565b600060405180830381600087803b158015611c9b57600080fd5b505af1158015611caf573d6000803e3d6000fd5b505050508080611cbe90612d72565b915050611c1f565b6001546001600160a01b03163314611cf05760405162461bcd60e51b81526004016108a890612c4d565b600680549060006116c583612c91565b6001600160a01b0382166000908152600d6020526040812060018101546002820154909290918190611d3287876117f3565b9054949793965094505050565b6000546001600160a01b03163314611d695760405162461bcd60e51b81526004016108a890612d01565b600355565b6001546001600160a01b03163314611d985760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d6020526040902060018101548211611dda5781816001016000828254611dcf9190612c0e565b909155506114649050565b60006001820155505050565b60006020825110611df957506020015190565b506006919050565b600060405160005b6014811015611e245783811a81600c84010153600101611e09565b505192915050565b6000546001600160a01b0316331461033f5760405162461bcd60e51b81526004016108a890612d01565b600060405160005b6014811015611e79578481600c011a81830153600101611e5e565b5060145b6020811015611e955783811a81830153600101611e7d565b50519392505050565b6001600160a01b0381166000908152600f602090815260408083206001600160601b0386168452909152812054801561214e576000818152600e60205260409020600281015460ff1615612101576000611ef885876117f3565b90506000818360010154611f0c9190612c0e565b6001600160a01b0387166000908152600d602052604090206001810154919650869250908210611f3e57806001015495505b85816001016000828254611f529190612c0e565b90915550506040518281526001600160601b038916906001600160a01b038916907f1222c35b9c82812f1fda75e2b299043b079c0bb3b53d44aee1ae96a97263ca699060200160405180910390a3826000036120fd5780545b80156120fb576001600160601b03891682611fc7600184612c0e565b81548110611fd757611fd7612caa565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036120e9578154829061201390600190612c0e565b8154811061202357612023612caa565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169083906120579084612c0e565b8154811061206757612067612caa565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550816000018054806120b3576120b3612dfe565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556120fb565b806120f381612d72565b915050611fab565b505b5050505b506000818152600e6020908152604080832083815560018101849055600201805460ff191690556001600160a01b0386168352600f82528083206001600160601b03881684529091528120555b5092915050565b60008085600101548660020154101561216f576000612183565b856001015486600201546121839190612c0e565b905061218f8184612c21565b84101561219d5760006121b2565b806121a88486612c0e565b6121b29190612c0e565b9150826000036121f7578554600180820188556000888152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918816021790555b82866001015410156122095783612224565b8383876001015461221a9190612c0e565b6122249190612c21565b866001018190555050949350505050565b60028401546000906122478484612c0e565b6122519190612c21565b85600101541061226c576122658383612c0e565b9050612292565b8460020154856001015410612292578460020154856001015461228f9190612c0e565b90505b826000036123ef5784545b80156123ed576001600160601b038516866122b9600184612c0e565b815481106122c9576122c9612caa565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036123db578554869061230590600190612c0e565b8154811061231557612315612caa565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169087906123499084612c0e565b8154811061235957612359612caa565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550856000018054806123a5576123a5612dfe565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556123ed565b806123e581612d72565b91505061229d565b505b8185600101541015612401578261241c565b828286600101546124129190612c0e565b61241c9190612c21565b8560010181905550949350505050565b6000838152600c602090815260408083208484526003810190925282205490918190036125f95783156125f45760018201546000036125475750600281018054600180820183556000928352602090922081018590559081148015906124a65750815461249a600183612c0e565b6124a49190612cd6565b155b156125425781546000906124ba9083612e14565b60008181526004850160205260408120549192506124d9846001612c21565b9050846002018560020184815481106124f4576124f4612caa565b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b6125c2565b60018083018054909161255991612c0e565b8154811061256957612569612caa565b906000526020600020015490508160010180548061258957612589612dfe565b60019003818190600052602060002001600090559055838260020182815481106125b5576125b5612caa565b6000918252602090912001555b600083815260038301602090815260408083208490558383526004850190915290208390556125f48582600187612780565b612779565b8360000361269757600082600201828154811061261857612618612caa565b90600052602060002001549050600083600201838154811061263c5761263c612caa565b6000918252602080832090910192909255600180860180549182018155825282822001849055858152600385018252604080822082905584825260048601909252908120819055612691908790849084612780565b50612779565b8160020181815481106126ac576126ac612caa565b90600052602060002001548414612779576000848360020183815481106126d5576126d5612caa565b90600052602060002001541115905060008161271b578584600201848154811061270157612701612caa565b90600052602060002001546127169190612c0e565b612746565b83600201838154811061273057612730612caa565b9060005260206000200154866127469190612c0e565b90508584600201848154811061275e5761275e612caa565b60009182526020909120015561277687848484612780565b50505b5050505050565b6000848152600c60205260409020835b80156128355781546127a3600183612c0e565b6127ad9190612e14565b9050836127e457828260020182815481106127ca576127ca612caa565b90600052602060002001546127df9190612c0e565b61280f565b828260020182815481106127fa576127fa612caa565b906000526020600020015461280f9190612c21565b82600201828154811061282457612824612caa565b600091825260209091200155612790565b505050505050565b6001600160a01b038116811461033f57600080fd5b6000806040838503121561286557600080fd5b82356128708161283d565b946020939093013593505050565b60006020828403121561289057600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126128be57600080fd5b813567ffffffffffffffff808211156128d9576128d9612897565b604051601f8301601f19908116603f0116810190828211818310171561290157612901612897565b8160405283815286602085880101111561291a57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561294d57600080fd5b82359150602083013567ffffffffffffffff81111561296b57600080fd5b612977858286016128ad565b9150509250929050565b60008060006060848603121561299657600080fd5b505081359360208301359350604090920135919050565b600080604083850312156129c057600080fd5b82356129cb8161283d565b9150602083013567ffffffffffffffff81111561296b57600080fd5b6000602082840312156129f957600080fd5b81356111518161283d565b6020808252825182820181905260009190848201906040850190845b81811015612a455783516001600160601b031683529284019291840191600101612a20565b50909695505050505050565b60008060008060008060c08789031215612a6a57600080fd5b8635612a758161283d565b95506020870135612a858161283d565b945060408701359350606087013592506080870135612aa38161283d565b8092505060a087013590509295509295509295565b60008060408385031215612acb57600080fd5b50508035926020909101359150565b6001600160601b038116811461033f57600080fd5b60008060408385031215612b0257600080fd5b8235612b0d8161283d565b91506020830135612b1d81612ada565b809150509250929050565b801515811461033f57600080fd5b60008060008060808587031215612b4c57600080fd5b8435612b578161283d565b93506020850135612b6781612ada565b9250604085013591506060850135612b7e81612b28565b939692955090935050565b634e487b7160e01b600052602160045260246000fd5b6020810160038310612bc157634e487b7160e01b600052602160045260246000fd5b91905290565b6001600160a01b039490941684526001600160601b0392909216602084015260408301521515606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561172357611723612bf8565b8082018082111561172357611723612bf8565b600060208284031215612c4657600080fd5b5051919050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600060018201612ca357612ca3612bf8565b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082612ce557612ce5612cc0565b500690565b808202811582820484141761172357611723612bf8565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b6000825160005b81811015612d645760208186018101518583015201612d4a565b506000920191825250919050565b600081612d8157612d81612bf8565b506000190190565b600080600080600080600060e0888a031215612da457600080fd5b8751612daf81612ada565b6020890151909750612dc081612b28565b8096505060408801519450606088015193506080880151925060a0880151915060c0880151612dee81612b28565b8091505092959891949750929550565b634e487b7160e01b600052603160045260246000fd5b600082612e2357612e23612cc0565b50049056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212205967b16de5f1e37654d9faecc6c9447e745fac6da4ff82098d0baa257f8c7c2c64736f6c63430008120033", + "deployedBytecode": "0x6080604052600436106102465760003560e01c80637dc38f1411610139578063c1572618116100b6578063dca5f6b01161007a578063dca5f6b0146106c6578063dd5e5cb514610712578063e534710d14610732578063f216de4c1461076a578063f2f4eb261461078a578063f6b4d82d146107aa57600080fd5b8063c15726181461061a578063ccbac9f514610630578063d09f392d14610646578063d1c1df4814610666578063d605787b146106a657600080fd5b8063b1c9fe6e116100fd578063b1c9fe6e1461058b578063b4a61608146105b9578063b5d69e99146105ce578063b888adfa146105ee578063c057eca71461060457600080fd5b80637dc38f14146104d8578063823cfd70146104ee578063965af6c71461050e578063a2473cc11461052e578063a5861b901461054e57600080fd5b80634c70a0d6116101c757806354812d171161018b57806354812d171461041757806356acb050146104375780635d2d78461461044d5780636624192f1461046d57806376fa9fc5146104b857600080fd5b80634c70a0d6146103825780634dbbebbc146103a25780634f1ef286146103c257806352d1902d146103d5578063543f8a36146103ea57600080fd5b80631b92bbbe1161020e5780631b92bbbe146102ee57806321e1625e1461030457806321ea9b3f1461032457806335975f4a14610342578063477a655c1461036257600080fd5b8063034327441461024b5780630b274f2e146102745780630b51806d1461028b5780630c340a24146102a05780630e083ec9146102d8575b600080fd5b34801561025757600080fd5b5061026160065481565b6040519081526020015b60405180910390f35b34801561028057600080fd5b50610289610814565b005b34801561029757600080fd5b50610261600681565b3480156102ac57600080fd5b506000546102c0906001600160a01b031681565b6040516001600160a01b03909116815260200161026b565b3480156102e457600080fd5b50610261600a5481565b3480156102fa57600080fd5b5061026160035481565b34801561031057600080fd5b5061028961031f366004612852565b610bec565b34801561033057600080fd5b5061028961033f36600461287e565b50565b34801561034e57600080fd5b5061028961035d36600461287e565b610c8f565b34801561036e57600080fd5b5061028961037d36600461293a565b610e7d565b34801561038e57600080fd5b506102c061039d366004612981565b610f74565b3480156103ae57600080fd5b506102896103bd366004612852565b611158565b6102896103d03660046129ad565b611241565b3480156103e157600080fd5b50610261611469565b3480156103f657600080fd5b5061040a6104053660046129e7565b6114c7565b60405161026b9190612a04565b34801561042357600080fd5b50610289610432366004612a51565b611565565b34801561044357600080fd5b50610261600b5481565b34801561045957600080fd5b50610289610468366004612ab8565b61168b565b34801561047957600080fd5b506104a86104883660046129e7565b6001600160a01b03166000908152600d6020526040902060010154151590565b604051901515815260200161026b565b3480156104c457600080fd5b506102616104d3366004612ab8565b6116ce565b3480156104e457600080fd5b5061026160095481565b3480156104fa57600080fd5b5061028961050936600461287e565b611729565b34801561051a57600080fd5b50610289610529366004612852565b611758565b34801561053a57600080fd5b50610261610549366004612aef565b6117f3565b34801561055a57600080fd5b5061056e610569366004612b36565b61181d565b60408051938452602084019290925215159082015260600161026b565b34801561059757600080fd5b506001546105ac90600160a01b900460ff1681565b60405161026b9190612b9f565b3480156105c557600080fd5b50610261600481565b3480156105da57600080fd5b506102896105e93660046129e7565b611be4565b3480156105fa57600080fd5b5061026160045481565b34801561061057600080fd5b5061026160025481565b34801561062657600080fd5b5061026160055481565b34801561063c57600080fd5b5061026160085481565b34801561065257600080fd5b50610289610661366004612ab8565b611cc6565b34801561067257600080fd5b50610686610681366004612aef565b611d00565b60408051948552602085019390935291830152606082015260800161026b565b3480156106b257600080fd5b506007546102c0906001600160a01b031681565b3480156106d257600080fd5b506106fd6106e13660046129e7565b600d602052600090815260409020600181015460029091015482565b6040805192835260208301919091520161026b565b34801561071e57600080fd5b5061028961072d36600461287e565b611d3f565b34801561073e57600080fd5b5061026161074d366004612aef565b600f60209081526000928352604080842090915290825290205481565b34801561077657600080fd5b50610289610785366004612852565b611d6e565b34801561079657600080fd5b506001546102c0906001600160a01b031681565b3480156107b657600080fd5b506108046107c536600461287e565b600e602052600090815260409020805460018201546002909201546001600160a01b03821692600160a01b9092046001600160601b0316919060ff1684565b60405161026b9493929190612bc7565b6000600154600160a01b900460ff16600281111561083457610834612b89565b036109a7576002546004546108499042612c0e565b10156108b15760405162461bcd60e51b815260206004820152602c60248201527f546865206d696e696d756d207374616b696e672074696d6520686173206e6f7460448201526b103830b9b9b2b2103cb2ba1760a11b60648201526084015b60405180910390fd5b6000600654116109135760405162461bcd60e51b815260206004820152602760248201527f546865726520617265206e6f2064697370757465732074686174206e65656420604482015266353ab937b9399760c91b60648201526084016108a8565b6007546009546001600160a01b0390911690637363ae1f906109359043612c21565b6040518263ffffffff1660e01b815260040161095391815260200190565b600060405180830381600087803b15801561096d57600080fd5b505af1158015610981573d6000803e3d6000fd5b505043600555505060018054819060ff60a01b1916600160a01b825b0217905550610ba1565b60018054600160a01b900460ff1660028111156109c6576109c6612b89565b03610abe576007546009546005546001600160a01b03909216916313cf9054916109ef91612c21565b6040518263ffffffff1660e01b8152600401610a0d91815260200190565b6020604051808303816000875af1158015610a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a509190612c34565b6008819055600003610aa45760405162461bcd60e51b815260206004820152601e60248201527f52616e646f6d206e756d626572206973206e6f7420726561647920796574000060448201526064016108a8565b600180546002919060ff60a01b1916600160a01b8361099d565b6002600154600160a01b900460ff166002811115610ade57610ade612b89565b03610ba1576006541580610b005750600354600454610afd9042612c0e565b10155b610b935760405162461bcd60e51b815260206004820152605860248201527f546865726520617265207374696c6c20646973707574657320776974686f757460448201527f206a75726f727320616e6420746865206d6178696d756d2064726177696e67206064820152773a34b6b2903430b9903737ba103830b9b9b2b2103cb2ba1760411b608482015260a4016108a8565b6001805460ff60a01b191690555b426004556001546040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b9391610be291600160a01b90910460ff1690612b9f565b60405180910390a1565b6001546001600160a01b03163314610c165760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d602052604081206002018054839290610c41908490612c21565b909155505060408051828152600060208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b091015b60405180910390a25050565b6000600154600160a01b900460ff166002811115610caf57610caf612b89565b14610cfc5760405162461bcd60e51b815260206004820152601b60248201527f53686f756c6420626520696e205374616b696e672070686173652e000000000060448201526064016108a8565b6000600a54600183600b54610d119190612c21565b610d1b9190612c0e565b11610d265781610d41565b600b54600a54610d369190612c0e565b610d41906001612c21565b9050600081600b54610d539190612c21565b600b549091505b81811015610e75576000818152600e6020526040902080546001600160a01b031615610e625760018054825491830154600284015460405163fbb519e760e01b81526001600160a01b039384169463fbb519e794610dd69490821693600160a01b9092046001600160601b031692909160ff1690600401612bc7565b600060405180830381600087803b158015610df057600080fd5b505af1158015610e04573d6000803e3d6000fd5b505082546001600160a01b0381166000908152600f60209081526040808320600160a01b9094046001600160601b03168352928152828220829055868252600e90529081208181556001810191909155600201805460ff1916905550505b5080610e6d81612c91565b915050610d5a565b50600b555050565b6001546001600160a01b03163314610ea75760405162461bcd60e51b81526004016108a890612c4d565b6000828152600c6020526040812090610ebf83611de6565b825490915015610f085760405162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b60448201526064016108a8565b60018111610f585760405162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e000000000060448201526064016108a8565b8155600201805460018101825560009182526020822001555050565b60006002600154600160a01b900460ff166002811115610f9657610f96612b89565b14610fd25760405162461bcd60e51b815260206004820152600c60248201526b2bb937b73390383430b9b29760a11b60448201526064016108a8565b6000848152600c6020526040812060028101805491929091610ff657610ff6612caa565b9060005260206000200154600003611012576000915050611151565b60008160020160008154811061102a5761102a612caa565b9060005260206000200154600854868660405160200161105d939291909283526020830191909152604082015260600190565b6040516020818303038152906040528051906020012060001c6110809190612cd6565b905060005b60028301548354611097908390612cea565b6110a2906001612c21565b10156111315760015b8354811161112b576000818386600001546110c69190612cea565b6110d09190612c21565b905060008560020182815481106110e9576110e9612caa565b9060005260206000200154905080851061110e576111078186612c0e565b9450611116565b50915061112b565b5050808061112390612c91565b9150506110ab565b50611085565b600081815260048401602052604090205461114b90611e01565b93505050505b9392505050565b6000546001600160a01b031633146111825760405162461bcd60e51b81526004016108a890612d01565b600780546001600160a01b0319166001600160a01b038416179055600981905560018054600160a01b900460ff1660028111156111c1576111c1612b89565b0361123d576007546009546001600160a01b0390911690637363ae1f906111e89043612c21565b6040518263ffffffff1660e01b815260040161120691815260200190565b600060405180830381600087803b15801561122057600080fd5b505af1158015611234573d6000803e3d6000fd5b50504360055550505b5050565b61124a82611e2c565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806112c857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166112bc600080516020612e298339815191525490565b6001600160a01b031614155b156112e65760405163703e46dd60e11b815260040160405180910390fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611340575060408051601f3d908101601f1916820190925261133d91810190612c34565b60015b61136857604051630c76093760e01b81526001600160a01b03831660048201526024016108a8565b600080516020612e29833981519152811461139957604051632a87526960e21b8152600481018290526024016108a8565b600080516020612e298339815191528390556040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2815115611464576000836001600160a01b0316836040516114009190612d43565b600060405180830381855af49150503d806000811461143b576040519150601f19603f3d011682016040523d82523d6000602084013e611440565b606091505b5050905080611462576040516339b21b5d60e11b815260040160405180910390fd5b505b505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114b45760405163703e46dd60e11b815260040160405180910390fd5b50600080516020612e2983398151915290565b6001600160a01b0381166000908152600d602090815260409182902080548351818402810184019094528084526060939283018282801561155957602002820191906000526020600020906000905b82829054906101000a90046001600160601b03166001600160601b0316815260200190600c0190602082600b010492830192600103820291508084116115165790505b50505050509050919050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e805460019190600160401b900460ff16806115af5750805467ffffffffffffffff808416911610155b156115cc5760405162dc149f60e41b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff8316908117600160401b178255600080546001600160a01b038b81166001600160a01b031992831617909255600180548b841690831617815560028a905560038990554260045560078054938916939092169290921790556009859055600b55815460ff60401b191682556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050505050565b6001546001600160a01b031633146116b55760405162461bcd60e51b81526004016108a890612c4d565b600680549060006116c583612d72565b91905055505050565b6000828152600c60209081526040808320848452600381019092528220548083036116fe57600092505050611723565b81600201818154811061171357611713612caa565b9060005260206000200154925050505b92915050565b6000546001600160a01b031633146117535760405162461bcd60e51b81526004016108a890612d01565b600255565b6001546001600160a01b031633146117825760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d6020526040812060020180548392906117ad908490612c0e565b909155505060408051828152600160208201526001600160a01b038416917f7a81a4ef419d50dbb5deb116fb983bf6ca7716bcbc84cd1cd2be81ccea9078b09101610c83565b6000806118008484611e56565b90506118156001600160601b038416826116ce565b949350505050565b600154600090819081906001600160a01b0316331461184e5760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0387166000908152600d602052604081209061187189896117f3565b82549091508715801561188d575060048110158061188d575081155b156118a5576000806000955095509550505050611bda565b6000600154600160a01b900460ff1660028111156118c5576118c5612b89565b14611a7f576118d4898b611e9e565b94506000600e6000600a600081546118eb90612c91565b919050819055815260200190815260200160002090508a8160000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550898160000160146101000a8154816001600160601b0302191690836001600160601b03160217905550888160010181905550600a54600f60008d6001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160601b03166001600160601b031681526020019081526020016000208190555082891115611a235760028101805460ff191660011790556119ce848b8b86612155565b604080516001600160601b038d168152602081018c90529198506001600160a01b038d16917f792235ed84e4d70219b4fc973c509bbbdc2d3e22578dceea671f48829db949b0910160405180910390a2611a71565b604080516001600160601b038c168152602081018b90526001600160a01b038d16917fe9a844153bbed760d95005e769b4ef97fab26f7b01305c7028a0493b833bdbae910160405180910390a25b5060019350611bda92505050565b818810611a9f5786611a9a57611a97838a8a85612155565b95505b611ab8565b611aab838a8a85612235565b611ab59086612c21565b94505b6000611ac48b8b611e56565b905060008a5b81611b8257611ae36001600160601b0382168c8561242c565b6000196001600160601b03821601611afe5760019150611aca565b600154604051630fad06e960e11b81526001600160601b03831660048201526001600160a01b0390911690631f5a0dd29060240160e060405180830381865afa158015611b4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b739190612d89565b50949550611aca945050505050565b604080516001600160601b038e168152602081018d90526001600160a01b038f16917f4732545d01e38980276a17e6d394f01577ba63f2fea5eba41af0757d9c060c5c910160405180910390a2506001955050505050505b9450945094915050565b6001546001600160a01b03163314611c0e5760405162461bcd60e51b81526004016108a890612c4d565b6000611c19826114c7565b80519091505b801561146457600180546001600160a01b03169063fbb519e79085908590611c479086612c0e565b81518110611c5757611c57612caa565b60200260200101516000806040518563ffffffff1660e01b8152600401611c819493929190612bc7565b600060405180830381600087803b158015611c9b57600080fd5b505af1158015611caf573d6000803e3d6000fd5b505050508080611cbe90612d72565b915050611c1f565b6001546001600160a01b03163314611cf05760405162461bcd60e51b81526004016108a890612c4d565b600680549060006116c583612c91565b6001600160a01b0382166000908152600d6020526040812060018101546002820154909290918190611d3287876117f3565b9054949793965094505050565b6000546001600160a01b03163314611d695760405162461bcd60e51b81526004016108a890612d01565b600355565b6001546001600160a01b03163314611d985760405162461bcd60e51b81526004016108a890612c4d565b6001600160a01b0382166000908152600d6020526040902060018101548211611dda5781816001016000828254611dcf9190612c0e565b909155506114649050565b60006001820155505050565b60006020825110611df957506020015190565b506006919050565b600060405160005b6014811015611e245783811a81600c84010153600101611e09565b505192915050565b6000546001600160a01b0316331461033f5760405162461bcd60e51b81526004016108a890612d01565b600060405160005b6014811015611e79578481600c011a81830153600101611e5e565b5060145b6020811015611e955783811a81830153600101611e7d565b50519392505050565b6001600160a01b0381166000908152600f602090815260408083206001600160601b0386168452909152812054801561214e576000818152600e60205260409020600281015460ff1615612101576000611ef885876117f3565b90506000818360010154611f0c9190612c0e565b6001600160a01b0387166000908152600d602052604090206001810154919650869250908210611f3e57806001015495505b85816001016000828254611f529190612c0e565b90915550506040518281526001600160601b038916906001600160a01b038916907f1222c35b9c82812f1fda75e2b299043b079c0bb3b53d44aee1ae96a97263ca699060200160405180910390a3826000036120fd5780545b80156120fb576001600160601b03891682611fc7600184612c0e565b81548110611fd757611fd7612caa565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036120e9578154829061201390600190612c0e565b8154811061202357612023612caa565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169083906120579084612c0e565b8154811061206757612067612caa565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550816000018054806120b3576120b3612dfe565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556120fb565b806120f381612d72565b915050611fab565b505b5050505b506000818152600e6020908152604080832083815560018101849055600201805460ff191690556001600160a01b0386168352600f82528083206001600160601b03881684529091528120555b5092915050565b60008085600101548660020154101561216f576000612183565b856001015486600201546121839190612c0e565b905061218f8184612c21565b84101561219d5760006121b2565b806121a88486612c0e565b6121b29190612c0e565b9150826000036121f7578554600180820188556000888152602090206002830401805491909216600c026101000a6001600160601b0381810219909216918816021790555b82866001015410156122095783612224565b8383876001015461221a9190612c0e565b6122249190612c21565b866001018190555050949350505050565b60028401546000906122478484612c0e565b6122519190612c21565b85600101541061226c576122658383612c0e565b9050612292565b8460020154856001015410612292578460020154856001015461228f9190612c0e565b90505b826000036123ef5784545b80156123ed576001600160601b038516866122b9600184612c0e565b815481106122c9576122c9612caa565b600091825260209091206002820401546001909116600c026101000a90046001600160601b0316036123db578554869061230590600190612c0e565b8154811061231557612315612caa565b600091825260209091206002820401546001918216600c026101000a90046001600160601b03169087906123499084612c0e565b8154811061235957612359612caa565b9060005260206000209060029182820401919006600c026101000a8154816001600160601b0302191690836001600160601b03160217905550856000018054806123a5576123a5612dfe565b60008281526020902060026000199092019182040180546001600160601b03600c60018516026101000a021916905590556123ed565b806123e581612d72565b91505061229d565b505b8185600101541015612401578261241c565b828286600101546124129190612c0e565b61241c9190612c21565b8560010181905550949350505050565b6000838152600c602090815260408083208484526003810190925282205490918190036125f95783156125f45760018201546000036125475750600281018054600180820183556000928352602090922081018590559081148015906124a65750815461249a600183612c0e565b6124a49190612cd6565b155b156125425781546000906124ba9083612e14565b60008181526004850160205260408120549192506124d9846001612c21565b9050846002018560020184815481106124f4576124f4612caa565b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b6125c2565b60018083018054909161255991612c0e565b8154811061256957612569612caa565b906000526020600020015490508160010180548061258957612589612dfe565b60019003818190600052602060002001600090559055838260020182815481106125b5576125b5612caa565b6000918252602090912001555b600083815260038301602090815260408083208490558383526004850190915290208390556125f48582600187612780565b612779565b8360000361269757600082600201828154811061261857612618612caa565b90600052602060002001549050600083600201838154811061263c5761263c612caa565b6000918252602080832090910192909255600180860180549182018155825282822001849055858152600385018252604080822082905584825260048601909252908120819055612691908790849084612780565b50612779565b8160020181815481106126ac576126ac612caa565b90600052602060002001548414612779576000848360020183815481106126d5576126d5612caa565b90600052602060002001541115905060008161271b578584600201848154811061270157612701612caa565b90600052602060002001546127169190612c0e565b612746565b83600201838154811061273057612730612caa565b9060005260206000200154866127469190612c0e565b90508584600201848154811061275e5761275e612caa565b60009182526020909120015561277687848484612780565b50505b5050505050565b6000848152600c60205260409020835b80156128355781546127a3600183612c0e565b6127ad9190612e14565b9050836127e457828260020182815481106127ca576127ca612caa565b90600052602060002001546127df9190612c0e565b61280f565b828260020182815481106127fa576127fa612caa565b906000526020600020015461280f9190612c21565b82600201828154811061282457612824612caa565b600091825260209091200155612790565b505050505050565b6001600160a01b038116811461033f57600080fd5b6000806040838503121561286557600080fd5b82356128708161283d565b946020939093013593505050565b60006020828403121561289057600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126128be57600080fd5b813567ffffffffffffffff808211156128d9576128d9612897565b604051601f8301601f19908116603f0116810190828211818310171561290157612901612897565b8160405283815286602085880101111561291a57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561294d57600080fd5b82359150602083013567ffffffffffffffff81111561296b57600080fd5b612977858286016128ad565b9150509250929050565b60008060006060848603121561299657600080fd5b505081359360208301359350604090920135919050565b600080604083850312156129c057600080fd5b82356129cb8161283d565b9150602083013567ffffffffffffffff81111561296b57600080fd5b6000602082840312156129f957600080fd5b81356111518161283d565b6020808252825182820181905260009190848201906040850190845b81811015612a455783516001600160601b031683529284019291840191600101612a20565b50909695505050505050565b60008060008060008060c08789031215612a6a57600080fd5b8635612a758161283d565b95506020870135612a858161283d565b945060408701359350606087013592506080870135612aa38161283d565b8092505060a087013590509295509295509295565b60008060408385031215612acb57600080fd5b50508035926020909101359150565b6001600160601b038116811461033f57600080fd5b60008060408385031215612b0257600080fd5b8235612b0d8161283d565b91506020830135612b1d81612ada565b809150509250929050565b801515811461033f57600080fd5b60008060008060808587031215612b4c57600080fd5b8435612b578161283d565b93506020850135612b6781612ada565b9250604085013591506060850135612b7e81612b28565b939692955090935050565b634e487b7160e01b600052602160045260246000fd5b6020810160038310612bc157634e487b7160e01b600052602160045260246000fd5b91905290565b6001600160a01b039490941684526001600160601b0392909216602084015260408301521515606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8181038181111561172357611723612bf8565b8082018082111561172357611723612bf8565b600060208284031215612c4657600080fd5b5051919050565b60208082526024908201527f416363657373206e6f7420616c6c6f7765643a204b6c65726f73436f7265206f60408201526337363c9760e11b606082015260800190565b600060018201612ca357612ca3612bf8565b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082612ce557612ce5612cc0565b500690565b808202811582820484141761172357611723612bf8565b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b6000825160005b81811015612d645760208186018101518583015201612d4a565b506000920191825250919050565b600081612d8157612d81612bf8565b506000190190565b600080600080600080600060e0888a031215612da457600080fd5b8751612daf81612ada565b6020890151909750612dc081612b28565b8096505060408801519450606088015193506080880151925060a0880151915060c0880151612dee81612b28565b8091505092959891949750929550565b634e487b7160e01b600052603160045260246000fd5b600082612e2357612e23612cc0565b50049056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212205967b16de5f1e37654d9faecc6c9447e745fac6da4ff82098d0baa257f8c7c2c64736f6c63430008120033", + "devdoc": { + "details": "A factory of trees that keeps track of staked values for sortition.", + "errors": { + "AlreadyInitialized()": [ + { + "details": "The contract is already initialized." + } + ], + "NotInitializing()": [ + { + "details": "The contract is not initializing." + } + ], + "UUPSUnauthorizedCallContext()": [ + { + "details": "The call is from an unauthorized context." + } + ], + "UUPSUnsupportedProxiableUUID(bytes32)": [ + { + "details": "The storage `slot` is unsupported as a UUID." + } + ] + }, + "events": { + "Initialized(uint64)": { + "details": "Triggered when the contract has been initialized or reinitialized." + }, + "Upgraded(address)": { + "params": { + "newImplementation": "Address of the new implementation the proxy is now forwarding calls to." + } + } + }, + "kind": "dev", + "methods": { + "changeMaxDrawingTime(uint256)": { + "details": "Changes the `maxDrawingTime` storage variable.", + "params": { + "_maxDrawingTime": "The new value for the `maxDrawingTime` storage variable." + } + }, + "changeMinStakingTime(uint256)": { + "details": "Changes the `minStakingTime` storage variable.", + "params": { + "_minStakingTime": "The new value for the `minStakingTime` storage variable." + } + }, + "changeRandomNumberGenerator(address,uint256)": { + "details": "Changes the `_rng` and `_rngLookahead` storage variables.", + "params": { + "_rng": "The new value for the `RNGenerator` storage variable.", + "_rngLookahead": "The new value for the `rngLookahead` storage variable." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface." + }, + "createTree(bytes32,bytes)": { + "details": "Create a sortition sum tree at the specified key.", + "params": { + "_extraData": "Extra data that contains the number of children each node in the tree should have.", + "_key": "The key of the new tree." + } + }, + "draw(bytes32,uint256,uint256)": { + "details": "Draw an ID from a tree using a number. Note that this function reverts if the sum of all values in the tree is 0.", + "params": { + "_coreDisputeID": "Index of the dispute in Kleros Core.", + "_key": "The key of the tree.", + "_nonce": "Nonce to hash with random number." + }, + "returns": { + "drawnAddress": "The drawn address. `O(k * log_k(n))` where `k` is the maximum number of children per node in the tree, and `n` is the maximum number of nodes ever appended." + } + }, + "executeDelayedStakes(uint256)": { + "details": "Executes the next delayed stakes.", + "params": { + "_iterations": "The number of delayed stakes to execute." + } + }, + "getJurorCourtIDs(address)": { + "details": "Gets the court identifiers where a specific `_juror` has staked.", + "params": { + "_juror": "The address of the juror." + } + }, + "initialize(address,address,uint256,uint256,address,uint256)": { + "details": "Initializer (constructor equivalent for upgradable contracts).", + "params": { + "_core": "The KlerosCore.", + "_maxDrawingTime": "Time after which the drawing phase can be switched", + "_minStakingTime": "Minimal time to stake", + "_rng": "The random number generator.", + "_rngLookahead": "Lookahead value for rng." + } + }, + "notifyRandomNumber(uint256)": { + "details": "Saves the random number to use it in sortition. Not used by this contract because the storing of the number is inlined in passPhase().", + "params": { + "_randomNumber": "Random number returned by RNG contract." + } + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 `proxiableUUID` function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the if statement." + }, + "setJurorInactive(address)": { + "details": "Unstakes the inactive juror from all courts. `O(n * (p * log_k(j)) )` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.", + "params": { + "_account": "The juror to unstake." + } + }, + "setStake(address,uint96,uint256,bool)": { + "details": "Sets the specified juror's stake in a court. `O(n + p * log_k(j))` where `n` is the number of courts the juror has staked in, `p` is the depth of the court tree, `k` is the minimum number of children per node of one of these courts' sortition sum tree, and `j` is the maximum number of jurors that ever staked in one of these courts simultaneously.", + "params": { + "_account": "The address of the juror.", + "_alreadyTransferred": "True if the tokens were already transferred from juror. Only relevant for delayed stakes.", + "_courtID": "The ID of the court.", + "_newStake": "The new stake." + }, + "returns": { + "pnkDeposit": "The amount of PNK to be deposited.", + "pnkWithdrawal": "The amount of PNK to be withdrawn.", + "succeeded": "True if the call succeeded, false otherwise." + } + }, + "stakeOf(address,uint96)": { + "details": "Get the stake of a juror in a court.", + "params": { + "_courtID": "The ID of the court.", + "_juror": "The address of the juror." + }, + "returns": { + "_0": "value The stake of the juror in the court." + } + }, + "stakeOf(bytes32,bytes32)": { + "details": "Get the stake of a juror in a court.", + "params": { + "_ID": "The stake path ID, corresponding to a juror.", + "_key": "The key of the tree, corresponding to a court." + }, + "returns": { + "_0": "The stake of the juror in the court." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade mechanism including access control and UUPS-compliance.Reverts if the execution is not performed via delegatecall or the execution context is not of a proxy with an ERC1967-compliant implementation pointing to self.", + "params": { + "data": "Data used in a delegate call to `newImplementation` if non-empty. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.", + "newImplementation": "Address of the new implementation contract." + } + } + }, + "title": "SortitionModule", + "version": 1 + }, + "userdoc": { + "errors": { + "FailedDelegateCall()": [ + { + "notice": "Failed Delegated call" + } + ], + "InvalidImplementation(address)": [ + { + "notice": "The `implementation` is not UUPS-compliant" + } + ] + }, + "events": { + "Upgraded(address)": { + "notice": "Emitted when the `implementation` has been successfully upgraded." + } + }, + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 3629, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "governor", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3632, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "core", + "offset": 0, + "slot": "1", + "type": "t_contract(KlerosCore)3566" + }, + { + "astId": 3635, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "phase", + "offset": 20, + "slot": "1", + "type": "t_enum(Phase)9702" + }, + { + "astId": 3637, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "minStakingTime", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 3639, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "maxDrawingTime", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 3641, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "lastPhaseChange", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 3643, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "randomNumberRequestBlock", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 3645, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "disputesWithoutJurors", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 3648, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "rng", + "offset": 0, + "slot": "7", + "type": "t_contract(RNG)11707" + }, + { + "astId": 3650, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "randomNumber", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 3652, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "rngLookahead", + "offset": 0, + "slot": "9", + "type": "t_uint256" + }, + { + "astId": 3654, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "delayedStakeWriteIndex", + "offset": 0, + "slot": "10", + "type": "t_uint256" + }, + { + "astId": 3656, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "delayedStakeReadIndex", + "offset": 0, + "slot": "11", + "type": "t_uint256" + }, + { + "astId": 3661, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "sortitionSumTrees", + "offset": 0, + "slot": "12", + "type": "t_mapping(t_bytes32,t_struct(SortitionSumTree)3604_storage)" + }, + { + "astId": 3666, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "jurors", + "offset": 0, + "slot": "13", + "type": "t_mapping(t_address,t_struct(Juror)3621_storage)" + }, + { + "astId": 3671, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "delayedStakes", + "offset": 0, + "slot": "14", + "type": "t_mapping(t_uint256,t_struct(DelayedStake)3613_storage)" + }, + { + "astId": 3677, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "latestDelayedStakeIndex", + "offset": 0, + "slot": "15", + "type": "t_mapping(t_address,t_mapping(t_uint96,t_uint256))" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_array(t_uint96)dyn_storage": { + "base": "t_uint96", + "encoding": "dynamic_array", + "label": "uint96[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(KlerosCore)3566": { + "encoding": "inplace", + "label": "contract KlerosCore", + "numberOfBytes": "20" + }, + "t_contract(RNG)11707": { + "encoding": "inplace", + "label": "contract RNG", + "numberOfBytes": "20" + }, + "t_enum(Phase)9702": { + "encoding": "inplace", + "label": "enum ISortitionModule.Phase", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_mapping(t_uint96,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(uint96 => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint96,t_uint256)" + }, + "t_mapping(t_address,t_struct(Juror)3621_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct SortitionModule.Juror)", + "numberOfBytes": "32", + "value": "t_struct(Juror)3621_storage" + }, + "t_mapping(t_bytes32,t_struct(SortitionSumTree)3604_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct SortitionModule.SortitionSumTree)", + "numberOfBytes": "32", + "value": "t_struct(SortitionSumTree)3604_storage" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint256,t_bytes32)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => bytes32)", + "numberOfBytes": "32", + "value": "t_bytes32" + }, + "t_mapping(t_uint256,t_struct(DelayedStake)3613_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct SortitionModule.DelayedStake)", + "numberOfBytes": "32", + "value": "t_struct(DelayedStake)3613_storage" + }, + "t_mapping(t_uint96,t_uint256)": { + "encoding": "mapping", + "key": "t_uint96", + "label": "mapping(uint96 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(DelayedStake)3613_storage": { + "encoding": "inplace", + "label": "struct SortitionModule.DelayedStake", + "members": [ + { + "astId": 3606, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "account", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3608, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "courtID", + "offset": 20, + "slot": "0", + "type": "t_uint96" + }, + { + "astId": 3610, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "stake", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 3612, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "alreadyTransferred", + "offset": 0, + "slot": "2", + "type": "t_bool" + } + ], + "numberOfBytes": "96" + }, + "t_struct(Juror)3621_storage": { + "encoding": "inplace", + "label": "struct SortitionModule.Juror", + "members": [ + { + "astId": 3616, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "courtIDs", + "offset": 0, + "slot": "0", + "type": "t_array(t_uint96)dyn_storage" + }, + { + "astId": 3618, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "stakedPnk", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 3620, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "lockedPnk", + "offset": 0, + "slot": "2", + "type": "t_uint256" + } + ], + "numberOfBytes": "96" + }, + "t_struct(SortitionSumTree)3604_storage": { + "encoding": "inplace", + "label": "struct SortitionModule.SortitionSumTree", + "members": [ + { + "astId": 3589, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "K", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 3592, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "stack", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 3595, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "nodes", + "offset": 0, + "slot": "2", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 3599, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "IDsToNodeIndexes", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_bytes32,t_uint256)" + }, + { + "astId": 3603, + "contract": "src/arbitration/SortitionModule.sol:SortitionModule", + "label": "nodeIndexesToIDs", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_bytes32)" + } + ], + "numberOfBytes": "160" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint96": { + "encoding": "inplace", + "label": "uint96", + "numberOfBytes": "12" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepolia/SortitionModule_Proxy.json b/contracts/deployments/arbitrumSepolia/SortitionModule_Proxy.json new file mode 100644 index 000000000..1456d2ddc --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/SortitionModule_Proxy.json @@ -0,0 +1,93 @@ +{ + "address": "0x3645F9e08D80E47c82aD9E33fCB4EA703822C831", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x1a08892a579e1cce13860922d4684ef58464db54b3a475b4763b6200d36a9bd9", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x3645F9e08D80E47c82aD9E33fCB4EA703822C831", + "transactionIndex": 1, + "gasUsed": "2154537", + "logsBloom": "0x00000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x5ba81045643db221920d5a188e5654258b7addfbdf51aa9fa14717c14c980771", + "transactionHash": "0x1a08892a579e1cce13860922d4684ef58464db54b3a475b4763b6200d36a9bd9", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842832, + "transactionHash": "0x1a08892a579e1cce13860922d4684ef58464db54b3a475b4763b6200d36a9bd9", + "address": "0x3645F9e08D80E47c82aD9E33fCB4EA703822C831", + "topics": [ + "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 0, + "blockHash": "0x5ba81045643db221920d5a188e5654258b7addfbdf51aa9fa14717c14c980771" + } + ], + "blockNumber": 3842832, + "cumulativeGasUsed": "2154537", + "status": 1, + "byzantium": true + }, + "args": [ + "0xAf48e32f89339438572a04455b1C4B2fF1659c8f", + "0x54812d17000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c5900000000000000000000000033d0b8879368acd8ca868e656ade97bb97b9046800000000000000000000000000000000000000000000000000000000000007080000000000000000000000000000000000000000000000000000000000000708000000000000000000000000ae7f3aca5c1e40d5e51ee61e20929bbda0caf4dc0000000000000000000000000000000000000000000000000000000000000014" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Simon Malatrait \",\"details\":\"This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\"}},\"stateVariables\":{\"IMPLEMENTATION_SLOT\":{\"details\":\"Storage slot with the address of the current implementation. This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\"}},\"title\":\"UUPS Proxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/proxy/UUPSProxy.sol\":\"UUPSProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"src/proxy/UUPSProxy.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// Adapted from \\n\\n/**\\n * @authors: [@malatrax]\\n * @reviewers: []\\n * @auditors: []\\n * @bounties: []\\n * @deployments: []\\n */\\npragma solidity 0.8.18;\\n\\n/**\\n * @title UUPS Proxy\\n * @author Simon Malatrait \\n * @dev This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.\\n * @dev This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.\\n * @dev We refer to the Proxiable contract (as per ERC-1822) with `implementation`.\\n */\\ncontract UUPSProxy {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n * NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)\\n */\\n bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _implementation, bytes memory _data) {\\n assembly {\\n sstore(IMPLEMENTATION_SLOT, _implementation)\\n }\\n\\n if (_data.length != 0) {\\n (bool success, ) = _implementation.delegatecall(_data);\\n require(success, \\\"Proxy Constructor failed\\\");\\n }\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * NOTE: This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n // ************************************* //\\n // * Internal Views * //\\n // ************************************* //\\n\\n function _getImplementation() internal view returns (address implementation) {\\n assembly {\\n implementation := sload(IMPLEMENTATION_SLOT)\\n }\\n }\\n\\n // ************************************* //\\n // * Fallback * //\\n // ************************************* //\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable {\\n _delegate(_getImplementation());\\n }\\n\\n receive() external payable {\\n _delegate(_getImplementation());\\n }\\n}\\n\",\"keccak256\":\"0xb42b4da7d7d4de880da62538361fe7ca2aca28577880e53bafa8d07eb9a08c48\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516102fe3803806102fe83398101604081905261002f9161014d565b817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55805160001461010c576000826001600160a01b031682604051610075919061021b565b600060405180830381855af49150503d80600081146100b0576040519150601f19603f3d011682016040523d82523d6000602084013e6100b5565b606091505b505090508061010a5760405162461bcd60e51b815260206004820152601860248201527f50726f787920436f6e7374727563746f72206661696c65640000000000000000604482015260640160405180910390fd5b505b5050610237565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561014457818101518382015260200161012c565b50506000910152565b6000806040838503121561016057600080fd5b82516001600160a01b038116811461017757600080fd5b60208401519092506001600160401b038082111561019457600080fd5b818501915085601f8301126101a857600080fd5b8151818111156101ba576101ba610113565b604051601f8201601f19908116603f011681019083821181831017156101e2576101e2610113565b816040528281528860208487010111156101fb57600080fd5b61020c836020830160208801610129565b80955050505050509250929050565b6000825161022d818460208701610129565b9190910192915050565b60b9806102456000396000f3fe608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "deployedBytecode": "0x608060405236603757603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6060565b005b603560317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015607e573d6000f35b3d6000fdfea26469706673582212207d50a904496089f6052d7370a78231ed4755a18daf824e0c243ac9c9c2a3b9ae64736f6c63430008120033", + "devdoc": { + "author": "Simon Malatrait ", + "details": "This contract implements a UUPS Proxy compliant with ERC-1967 & ERC-1822.This contract delegates all calls to another contract (UUPS Proxiable) through a fallback function and the use of the `delegatecall` EVM instruction.We refer to the Proxiable contract (as per ERC-1822) with `implementation`.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_implementation`. If `_data` is nonempty, it's used as data in a delegate call to `_implementation`. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor." + } + }, + "stateVariables": { + "IMPLEMENTATION_SLOT": { + "details": "Storage slot with the address of the current implementation. This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is validated in the constructor. NOTE: bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)" + } + }, + "title": "UUPS Proxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/contracts/deployments/arbitrumSepolia/WETH.json b/contracts/deployments/arbitrumSepolia/WETH.json new file mode 100644 index 000000000..ffa23293a --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/WETH.json @@ -0,0 +1,458 @@ +{ + "address": "0xAEE953CC26DbDeA52beBE3F97f281981f2B9d511", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xf91a0e7b9bf8d9f5e46432af0ed3dcf9b1fc0f35ed97e69201f5c92b6627f253", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0xAEE953CC26DbDeA52beBE3F97f281981f2B9d511", + "transactionIndex": 1, + "gasUsed": "4834141", + "logsBloom": "0x00000020000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000010000000001000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000200000000000000000000002000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x902e4567bed29221bff704416e5f67d81fb89baf362a63c9a23a5be31fd8f951", + "transactionHash": "0xf91a0e7b9bf8d9f5e46432af0ed3dcf9b1fc0f35ed97e69201f5c92b6627f253", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 3842792, + "transactionHash": "0xf91a0e7b9bf8d9f5e46432af0ed3dcf9b1fc0f35ed97e69201f5c92b6627f253", + "address": "0xAEE953CC26DbDeA52beBE3F97f281981f2B9d511", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000f1c7c037891525e360c59f708739ac09a7670c59" + ], + "data": "0x00000000000000000000000000000000000000000000d3c21bcecceda1000000", + "logIndex": 0, + "blockHash": "0x902e4567bed29221bff704416e5f67d81fb89baf362a63c9a23a5be31fd8f951" + } + ], + "blockNumber": 3842792, + "cumulativeGasUsed": "4834141", + "status": 1, + "byzantium": true + }, + "args": [ + "WETH", + "WETH" + ], + "numDeployments": 1, + "solcInputHash": "8e9cc2476be2df2a66044335eb796b9b", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/token/TestERC20.sol\":\"TestERC20\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * The default value of {decimals} is 18. To change this, you should override\\n * this function so it returns a different value.\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20 is Context, IERC20, IERC20Metadata {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the default value returned by this function, unless\\n * it's overridden.\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(address from, address to, uint256 amount) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(address owner, address spender, uint256 amount) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\\n}\\n\",\"keccak256\":\"0xa56ca923f70c1748830700250b19c61b70db9a683516dc5e216694a50445d99c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0xa92e4fa126feb6907daa0513ddd816b2eb91f30a808de54f63c17d0e162c3439\",\"license\":\"MIT\"},\"src/token/TestERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\n\\ncontract TestERC20 is ERC20 {\\n constructor(string memory _name, string memory _symbol) ERC20(_name, _symbol) {\\n _mint(msg.sender, 1000000 ether);\\n }\\n}\\n\",\"keccak256\":\"0x9f67e6b63ca87e6c98b2986364ce16a747ce4098e9146fffb17ea13863c0b7e4\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162000c5838038062000c5883398101604081905262000034916200020a565b8181600362000044838262000302565b50600462000053828262000302565b505050620000723369d3c21bcecceda10000006200007a60201b60201c565b5050620003f6565b6001600160a01b038216620000d55760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060026000828254620000e99190620003ce565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b505050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200016d57600080fd5b81516001600160401b03808211156200018a576200018a62000145565b604051601f8301601f19908116603f01168101908282118183101715620001b557620001b562000145565b81604052838152602092508683858801011115620001d257600080fd5b600091505b83821015620001f65785820183015181830184015290820190620001d7565b600093810190920192909252949350505050565b600080604083850312156200021e57600080fd5b82516001600160401b03808211156200023657600080fd5b62000244868387016200015b565b935060208501519150808211156200025b57600080fd5b506200026a858286016200015b565b9150509250929050565b600181811c908216806200028957607f821691505b602082108103620002aa57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200014057600081815260208120601f850160051c81016020861015620002d95750805b601f850160051c820191505b81811015620002fa57828155600101620002e5565b505050505050565b81516001600160401b038111156200031e576200031e62000145565b62000336816200032f845462000274565b84620002b0565b602080601f8311600181146200036e5760008415620003555750858301515b600019600386901b1c1916600185901b178555620002fa565b600085815260208120601f198616915b828110156200039f578886015182559484019460019091019084016200037e565b5085821015620003be5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80820180821115620003f057634e487b7160e01b600052601160045260246000fd5b92915050565b61085280620004066000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b411461015f578063a457c2d714610167578063a9059cbb1461017a578063dd62ed3e1461018d57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101a0565b6040516100c3919061069c565b60405180910390f35b6100df6100da366004610706565b610232565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610730565b61024c565b604051601281526020016100c3565b6100df610131366004610706565b610270565b6100f361014436600461076c565b6001600160a01b031660009081526020819052604090205490565b6100b6610292565b6100df610175366004610706565b6102a1565b6100df610188366004610706565b610321565b6100f361019b36600461078e565b61032f565b6060600380546101af906107c1565b80601f01602080910402602001604051908101604052809291908181526020018280546101db906107c1565b80156102285780601f106101fd57610100808354040283529160200191610228565b820191906000526020600020905b81548152906001019060200180831161020b57829003601f168201915b5050505050905090565b60003361024081858561035a565b60019150505b92915050565b60003361025a85828561047e565b6102658585856104f8565b506001949350505050565b600033610240818585610283838361032f565b61028d91906107fb565b61035a565b6060600480546101af906107c1565b600033816102af828661032f565b9050838110156103145760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b610265828686840361035a565b6000336102408185856104f8565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166103bc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161030b565b6001600160a01b03821661041d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161030b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600061048a848461032f565b905060001981146104f257818110156104e55760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161030b565b6104f2848484840361035a565b50505050565b6001600160a01b03831661055c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161030b565b6001600160a01b0382166105be5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161030b565b6001600160a01b038316600090815260208190526040902054818110156106365760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161030b565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36104f2565b600060208083528351808285015260005b818110156106c9578581018301518582016040015282016106ad565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b038116811461070157600080fd5b919050565b6000806040838503121561071957600080fd5b610722836106ea565b946020939093013593505050565b60008060006060848603121561074557600080fd5b61074e846106ea565b925061075c602085016106ea565b9150604084013590509250925092565b60006020828403121561077e57600080fd5b610787826106ea565b9392505050565b600080604083850312156107a157600080fd5b6107aa836106ea565b91506107b8602084016106ea565b90509250929050565b600181811c908216806107d557607f821691505b6020821081036107f557634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561024657634e487b7160e01b600052601160045260246000fdfea26469706673582212203a956e65a766c03ac95ae037cbdfb51b56810340c98132c2d2482405d386101b64736f6c63430008120033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b411461015f578063a457c2d714610167578063a9059cbb1461017a578063dd62ed3e1461018d57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101a0565b6040516100c3919061069c565b60405180910390f35b6100df6100da366004610706565b610232565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610730565b61024c565b604051601281526020016100c3565b6100df610131366004610706565b610270565b6100f361014436600461076c565b6001600160a01b031660009081526020819052604090205490565b6100b6610292565b6100df610175366004610706565b6102a1565b6100df610188366004610706565b610321565b6100f361019b36600461078e565b61032f565b6060600380546101af906107c1565b80601f01602080910402602001604051908101604052809291908181526020018280546101db906107c1565b80156102285780601f106101fd57610100808354040283529160200191610228565b820191906000526020600020905b81548152906001019060200180831161020b57829003601f168201915b5050505050905090565b60003361024081858561035a565b60019150505b92915050565b60003361025a85828561047e565b6102658585856104f8565b506001949350505050565b600033610240818585610283838361032f565b61028d91906107fb565b61035a565b6060600480546101af906107c1565b600033816102af828661032f565b9050838110156103145760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b610265828686840361035a565b6000336102408185856104f8565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166103bc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161030b565b6001600160a01b03821661041d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161030b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600061048a848461032f565b905060001981146104f257818110156104e55760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161030b565b6104f2848484840361035a565b50505050565b6001600160a01b03831661055c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161030b565b6001600160a01b0382166105be5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161030b565b6001600160a01b038316600090815260208190526040902054818110156106365760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161030b565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36104f2565b600060208083528351808285015260005b818110156106c9578581018301518582016040015282016106ad565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b038116811461070157600080fd5b919050565b6000806040838503121561071957600080fd5b610722836106ea565b946020939093013593505050565b60008060006060848603121561074557600080fd5b61074e846106ea565b925061075c602085016106ea565b9150604084013590509250925092565b60006020828403121561077e57600080fd5b610787826106ea565b9392505050565b600080604083850312156107a157600080fd5b6107aa836106ea565b91506107b8602084016106ea565b90509250929050565b600181811c908216806107d557607f821691505b6020821081036107f557634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561024657634e487b7160e01b600052601160045260246000fdfea26469706673582212203a956e65a766c03ac95ae037cbdfb51b56810340c98132c2d2482405d386101b64736f6c63430008120033", + "devdoc": { + "events": { + "Approval(address,address,uint256)": { + "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." + }, + "Transfer(address,address,uint256)": { + "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." + } + }, + "kind": "dev", + "methods": { + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "decimals()": { + "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." + }, + "decreaseAllowance(address,uint256)": { + "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." + }, + "increaseAllowance(address,uint256)": { + "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." + }, + "name()": { + "details": "Returns the name of the token." + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 128, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_balances", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 134, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_allowances", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 136, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_totalSupply", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 138, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_name", + "offset": 0, + "slot": "3", + "type": "t_string_storage" + }, + { + "astId": 140, + "contract": "src/token/TestERC20.sol:TestERC20", + "label": "_symbol", + "offset": 0, + "slot": "4", + "type": "t_string_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepolia/WETHFaucet.json b/contracts/deployments/arbitrumSepolia/WETHFaucet.json new file mode 100644 index 000000000..405063314 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/WETHFaucet.json @@ -0,0 +1,226 @@ +{ + "address": "0x922B84134e41BC5c9EDE7D5EFCE22Ba3D0e71835", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_token", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "amount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "balance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "changeAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "request", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "withdrewAlready", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xbfb4b10473c58ec57cdeb9470c1ec2e77f8e7f3a3b3fe0bef3b06f07bd415493", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x922B84134e41BC5c9EDE7D5EFCE22Ba3D0e71835", + "transactionIndex": 1, + "gasUsed": "2793705", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x9b0f884a08917ac9501a0154a2ba13a09449ceb5b34f40ebfd80b00a2fc74e09", + "transactionHash": "0xbfb4b10473c58ec57cdeb9470c1ec2e77f8e7f3a3b3fe0bef3b06f07bd415493", + "logs": [], + "blockNumber": 3842793, + "cumulativeGasUsed": "2793705", + "status": 1, + "byzantium": true + }, + "args": [ + "0xAEE953CC26DbDeA52beBE3F97f281981f2B9d511" + ], + "numDeployments": 1, + "solcInputHash": "4ee8a1f2013c130bec1668c5304bc76a", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"amount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"balance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"changeAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"request\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"withdrewAlready\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/token/Faucet.sol\":\"Faucet\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/token/Faucet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ncontract Faucet {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n IERC20 public token;\\n address public governor;\\n mapping(address => bool) public withdrewAlready;\\n uint256 public amount = 10_000 ether;\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(address(governor) == msg.sender, \\\"Access not allowed: Governor only.\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n constructor(IERC20 _token) {\\n token = _token;\\n governor = msg.sender;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n function changeGovernor(address _governor) public onlyByGovernor {\\n governor = _governor;\\n }\\n\\n function changeAmount(uint256 _amount) public onlyByGovernor {\\n amount = _amount;\\n }\\n\\n function withdraw() public onlyByGovernor {\\n token.transfer(governor, token.balanceOf(address(this)));\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n function request() public {\\n require(\\n !withdrewAlready[msg.sender],\\n \\\"You have used this faucet already. If you need more tokens, please use another address.\\\"\\n );\\n token.transfer(msg.sender, amount);\\n withdrewAlready[msg.sender] = true;\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n function balance() public view returns (uint) {\\n return token.balanceOf(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x3a54681cc304ccbfdb42215104b63809919a432ac5d3986d3021a11fcc7a1cc3\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405269021e19e0c9bab240000060035534801561001e57600080fd5b5060405161065538038061065583398101604081905261003d9161006b565b600080546001600160a01b039092166001600160a01b0319928316179055600180549091163317905561009b565b60006020828403121561007d57600080fd5b81516001600160a01b038116811461009457600080fd5b9392505050565b6105ab806100aa6000396000f3fe608060405234801561001057600080fd5b50600436106100835760003560e01c80630c340a2414610088578063338cdca1146100b15780633ccfd60b146100bb5780635c320516146100c3578063aa8c217c146100d6578063b69ef8a8146100ed578063d61c40dc146100f5578063e4c0aaf414610128578063fc0c546a1461013b575b600080fd5b60015461009b906001600160a01b031681565b6040516100a8919061049b565b60405180910390f35b6100b961014e565b005b6100b961028f565b6100b96100d13660046104af565b6103a9565b6100df60035481565b6040519081526020016100a8565b6100df6103d8565b6101186101033660046104c8565b60026020526000908152604090205460ff1681565b60405190151581526020016100a8565b6100b96101363660046104c8565b61044f565b60005461009b906001600160a01b031681565b3360009081526002602052604090205460ff16156101f95760405162461bcd60e51b815260206004820152605760248201527f596f752068617665207573656420746869732066617563657420616c7265616460448201527f792e20496620796f75206e656564206d6f726520746f6b656e732c20706c656160648201527639b2903ab9b29030b737ba3432b91030b2323932b9b99760491b608482015260a4015b60405180910390fd5b60005460035460405163a9059cbb60e01b815233600482015260248101919091526001600160a01b039091169063a9059cbb906044016020604051808303816000875af115801561024e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027291906104f8565b50336000908152600260205260409020805460ff19166001179055565b6001546001600160a01b031633146102b95760405162461bcd60e51b81526004016101f09061051a565b6000546001546040516370a0823160e01b81526001600160a01b039283169263a9059cbb92169083906370a08231906102f690309060040161049b565b602060405180830381865afa158015610313573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610337919061055c565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a691906104f8565b50565b6001546001600160a01b031633146103d35760405162461bcd60e51b81526004016101f09061051a565b600355565b600080546040516370a0823160e01b81526001600160a01b03909116906370a082319061040990309060040161049b565b602060405180830381865afa158015610426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a919061055c565b905090565b6001546001600160a01b031633146104795760405162461bcd60e51b81526004016101f09061051a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0391909116815260200190565b6000602082840312156104c157600080fd5b5035919050565b6000602082840312156104da57600080fd5b81356001600160a01b03811681146104f157600080fd5b9392505050565b60006020828403121561050a57600080fd5b815180151581146104f157600080fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60006020828403121561056e57600080fd5b505191905056fea26469706673582212204f7fd812260eacd88f23b436eb40b4943480e914005f0a0f2738f0d3c9696a5964736f6c63430008120033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100835760003560e01c80630c340a2414610088578063338cdca1146100b15780633ccfd60b146100bb5780635c320516146100c3578063aa8c217c146100d6578063b69ef8a8146100ed578063d61c40dc146100f5578063e4c0aaf414610128578063fc0c546a1461013b575b600080fd5b60015461009b906001600160a01b031681565b6040516100a8919061049b565b60405180910390f35b6100b961014e565b005b6100b961028f565b6100b96100d13660046104af565b6103a9565b6100df60035481565b6040519081526020016100a8565b6100df6103d8565b6101186101033660046104c8565b60026020526000908152604090205460ff1681565b60405190151581526020016100a8565b6100b96101363660046104c8565b61044f565b60005461009b906001600160a01b031681565b3360009081526002602052604090205460ff16156101f95760405162461bcd60e51b815260206004820152605760248201527f596f752068617665207573656420746869732066617563657420616c7265616460448201527f792e20496620796f75206e656564206d6f726520746f6b656e732c20706c656160648201527639b2903ab9b29030b737ba3432b91030b2323932b9b99760491b608482015260a4015b60405180910390fd5b60005460035460405163a9059cbb60e01b815233600482015260248101919091526001600160a01b039091169063a9059cbb906044016020604051808303816000875af115801561024e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027291906104f8565b50336000908152600260205260409020805460ff19166001179055565b6001546001600160a01b031633146102b95760405162461bcd60e51b81526004016101f09061051a565b6000546001546040516370a0823160e01b81526001600160a01b039283169263a9059cbb92169083906370a08231906102f690309060040161049b565b602060405180830381865afa158015610313573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610337919061055c565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a691906104f8565b50565b6001546001600160a01b031633146103d35760405162461bcd60e51b81526004016101f09061051a565b600355565b600080546040516370a0823160e01b81526001600160a01b03909116906370a082319061040990309060040161049b565b602060405180830381865afa158015610426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a919061055c565b905090565b6001546001600160a01b031633146104795760405162461bcd60e51b81526004016101f09061051a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0391909116815260200190565b6000602082840312156104c157600080fd5b5035919050565b6000602082840312156104da57600080fd5b81356001600160a01b03811681146104f157600080fd5b9392505050565b60006020828403121561050a57600080fd5b815180151581146104f157600080fd5b60208082526022908201527f416363657373206e6f7420616c6c6f7765643a20476f7665726e6f72206f6e6c6040820152613c9760f11b606082015260800190565b60006020828403121561056e57600080fd5b505191905056fea26469706673582212204f7fd812260eacd88f23b436eb40b4943480e914005f0a0f2738f0d3c9696a5964736f6c63430008120033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 24559, + "contract": "src/token/Faucet.sol:Faucet", + "label": "token", + "offset": 0, + "slot": "0", + "type": "t_contract(IERC20)1042" + }, + { + "astId": 24561, + "contract": "src/token/Faucet.sol:Faucet", + "label": "governor", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 24565, + "contract": "src/token/Faucet.sol:Faucet", + "label": "withdrewAlready", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 24568, + "contract": "src/token/Faucet.sol:Faucet", + "label": "amount", + "offset": 0, + "slot": "3", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)1042": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index 9a47be685..12b098756 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -79,7 +79,7 @@ const config: HardhatUserConfig = { chainId: 421614, url: `http://127.0.0.1:8545`, forking: { - url: `https://sepolia-rollup.arbitrum.io/rpc`, + url: process.env.ARBITRUM_SEPOLIA_RPC ?? "https://sepolia-rollup.arbitrum.io/rpc", }, accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], live: false, @@ -93,7 +93,7 @@ const config: HardhatUserConfig = { // Home chain --------------------------------------------------------------------------------- arbitrumSepolia: { chainId: 421614, - url: "https://sepolia-rollup.arbitrum.io/rpc", + url: process.env.ARBITRUM_SEPOLIA_RPC ?? "https://sepolia-rollup.arbitrum.io/rpc", accounts: (process.env.ARB_GOERLI_PRIVATE_KEY_WALLET_1 && [ process.env.ARB_GOERLI_PRIVATE_KEY_WALLET_1 as string, @@ -119,7 +119,7 @@ const config: HardhatUserConfig = { }, arbitrumSepoliaDevnet: { chainId: 421614, - url: "https://sepolia-rollup.arbitrum.io/rpc", + url: process.env.ARBITRUM_SEPOLIA_RPC ?? "https://sepolia-rollup.arbitrum.io/rpc", accounts: (process.env.ARB_GOERLI_PRIVATE_KEY_WALLET_1 && [ process.env.ARB_GOERLI_PRIVATE_KEY_WALLET_1 as string, diff --git a/services/bots/devnet/pm2.config.disputor-bot.devnet.js b/services/bots/devnet/pm2.config.disputor-bot.devnet.js new file mode 100644 index 000000000..a4c41a60e --- /dev/null +++ b/services/bots/devnet/pm2.config.disputor-bot.devnet.js @@ -0,0 +1,12 @@ +module.exports = { + apps: [ + { + name: "disputor-bot-devnet", + interpreter: "sh", + script: "yarn", + args: "bot:disputor --network arbitrumSepoliaDevnet", + restart_delay: 86400000, // 24 hours + autorestart: true, + }, + ], +}; diff --git a/web/.env.testnet.public b/web/.env.testnet.public index 5d5f8e3d1..939dbae91 100644 --- a/web/.env.testnet.public +++ b/web/.env.testnet.public @@ -3,3 +3,4 @@ export REACT_APP_DEPLOYMENT=testnet export REACT_APP_CORE_SUBGRAPH=https://api.studio.thegraph.com/query/61738/kleros-v2-core-testnet/v0.0.2 export REACT_APP_DRT_ARBSEPOLIA_SUBGRAPH=https://api.studio.thegraph.com/query/61738/kleros-v2-drt-arbisep-devnet/v0.0.2 export REACT_APP_STATUS_URL=https://kleros-v2.betteruptime.com/badge +export REACT_APP_GENESIS_BLOCK_ARBSEPOLIA=3842783 From 53907e94c1126f35d280259cd7b701bc593eee47 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Thu, 28 Dec 2023 23:45:50 +0100 Subject: [PATCH 68/77] feat: link to the Hermes bot and feature toggle to disable the form --- web/.gitignore | 2 + web/src/consts/index.ts | 2 + .../Menu/Settings/Notifications/index.tsx | 38 +++++++++++++++++-- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/web/.gitignore b/web/.gitignore index 15391189f..f958e33db 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -18,6 +18,8 @@ parcel-bundle-reports .DS_Store .env .env.test +.env.testnet +.env.devnet .env.local .env.development.local .env.test.local diff --git a/web/src/consts/index.ts b/web/src/consts/index.ts index a906253f1..0d869624a 100644 --- a/web/src/consts/index.ts +++ b/web/src/consts/index.ts @@ -3,6 +3,8 @@ import { version, gitCommitHash, gitCommitShortHash, gitBranch, gitTags, clean } export const ONE_BASIS_POINT = 10000n; export const IPFS_GATEWAY = process.env.REACT_APP_IPFS_GATEWAY || "https://cdn.kleros.link"; +export const HERMES_TELEGRAM_BOT_URL = + process.env.REACT_APP_HERMES_TELEGRAM_BOT_URL || "https://t.me/HermesTheKlerosV2MessengerBot"; export const GIT_BRANCH = gitBranch; export const GIT_TAGS = gitTags; diff --git a/web/src/layout/Header/navbar/Menu/Settings/Notifications/index.tsx b/web/src/layout/Header/navbar/Menu/Settings/Notifications/index.tsx index f2d1a4c94..c278fda6b 100644 --- a/web/src/layout/Header/navbar/Menu/Settings/Notifications/index.tsx +++ b/web/src/layout/Header/navbar/Menu/Settings/Notifications/index.tsx @@ -1,9 +1,10 @@ import React from "react"; import styled from "styled-components"; -import { ISettings } from "../../../index"; - +import { ISettings } from "layout/Header/navbar/index"; import FormContactDetails from "./FormContactDetails"; import { EnsureChain } from "components/EnsureChain"; +import TelegramLogo from "svgs/socialmedia/telegram.svg"; +import { HERMES_TELEGRAM_BOT_URL } from "consts/index"; const Container = styled.div` display: flex; @@ -33,13 +34,42 @@ const EnsureChainContainer = styled.div` padding-bottom: 16px; `; +const StyledSvg = styled.svg` + display: inline-block; + width: 18px; + height: 18px; + fill: ${({ theme }) => theme.primaryBlue}; +`; + +const StyledA = styled.a` + display: flex; + justify-content: center; + gap: 4px; + margin-top: 90px; + margin-bottom: 110px; + font-size: 16px; + + &:hover { + text-decoration: underline; + } +`; + const NotificationSettings: React.FC = ({ toggleIsSettingsOpen }) => { + const FEATURE_TOGGLE_TELEGRAM_FORM = false; // Disabled until the backend is ready return ( - - + + Subscribe to the Hermes Messenger Bot + + + {FEATURE_TOGGLE_TELEGRAM_FORM && ( + <> + + + + )} From 50853cf5058b393918d7e26e6ccdad3bf761c9fb Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Fri, 29 Dec 2023 00:30:20 +0100 Subject: [PATCH 69/77] fix(CVE-2020-36632): upgraded the 'flat' package indirectly --- package.json | 3 ++- yarn.lock | 58 +++++++++++++++++++++++++++++++++++----------------- 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index 629534917..f32b7f118 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,8 @@ "underscore@npm^3.0.4": "^1.12.1", "eth-sig-util@npm:^1.4.2": "3.0.0", "fast-xml-parser": "^4.2.5", - "@babel/traverse:^7.22.5": "^7.23.6" + "@babel/traverse:^7.22.5": "^7.23.6", + "yargs-unparser@npm:1.6.0": "1.6.4" }, "scripts": { "check-prerequisites": "scripts/check-prerequisites.sh", diff --git a/yarn.lock b/yarn.lock index 0ba7433f5..df47d6f78 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17800,17 +17800,6 @@ __metadata: languageName: node linkType: hard -"flat@npm:^4.1.0": - version: 4.1.1 - resolution: "flat@npm:4.1.1" - dependencies: - is-buffer: ~2.0.3 - bin: - flat: cli.js - checksum: 398be12185eb0f3c59797c3670a8c35d07020b673363175676afbaf53d6b213660e060488554cf82c25504986e1a6059bdbcc5d562e87ca3e972e8a33148e3ae - languageName: node - linkType: hard - "flat@npm:^5.0.2": version: 5.0.2 resolution: "flat@npm:5.0.2" @@ -20498,7 +20487,7 @@ __metadata: languageName: node linkType: hard -"is-buffer@npm:^2.0.0, is-buffer@npm:^2.0.5, is-buffer@npm:~2.0.3": +"is-buffer@npm:^2.0.0, is-buffer@npm:^2.0.5": version: 2.0.5 resolution: "is-buffer@npm:2.0.5" checksum: 764c9ad8b523a9f5a32af29bdf772b08eb48c04d2ad0a7240916ac2688c983bf5f8504bf25b35e66240edeb9d9085461f9b5dae1f3d2861c6b06a65fe983de42 @@ -33706,6 +33695,16 @@ __metadata: languageName: node linkType: hard +"yargs-parser@npm:^15.0.1": + version: 15.0.3 + resolution: "yargs-parser@npm:15.0.3" + dependencies: + camelcase: ^5.0.0 + decamelize: ^1.2.0 + checksum: 06611c1893fa9f1c25ae79df3c6e2edbac7c8d75257a4b55b8432cbc87ee03eda86bea0537f65b4b8a0d9684c83fa6e9ef61ef720a1e5cc8a9aa6893b54ee4c3 + languageName: node + linkType: hard + "yargs-parser@npm:^18.1.2": version: 18.1.3 resolution: "yargs-parser@npm:18.1.3" @@ -33731,13 +33730,15 @@ __metadata: linkType: hard "yargs-unparser@npm:1.6.0": - version: 1.6.0 - resolution: "yargs-unparser@npm:1.6.0" + version: 1.6.4 + resolution: "yargs-unparser@npm:1.6.4" dependencies: - flat: ^4.1.0 - lodash: ^4.17.15 - yargs: ^13.3.0 - checksum: ca662bb94af53d816d47f2162f0a1d135783f09de9fd47645a5cb18dd25532b0b710432b680d2c065ff45de122ba4a96433c41595fa7bfcc08eb12e889db95c1 + camelcase: ^5.3.1 + decamelize: ^1.2.0 + flat: ^5.0.2 + is-plain-obj: ^1.1.0 + yargs: ^14.2.3 + checksum: 428695924f6dc3b660cab37e5f1bb46a7bc64bb81e583beaaf40155f2d33440e3776518528e98902d256ed68fe4cc74c54c0188481ce8dba6857bc1656b5ca06 languageName: node linkType: hard @@ -33753,7 +33754,7 @@ __metadata: languageName: node linkType: hard -"yargs@npm:13.3.2, yargs@npm:^13.3.0": +"yargs@npm:13.3.2": version: 13.3.2 resolution: "yargs@npm:13.3.2" dependencies: @@ -33786,6 +33787,25 @@ __metadata: languageName: node linkType: hard +"yargs@npm:^14.2.3": + version: 14.2.3 + resolution: "yargs@npm:14.2.3" + dependencies: + cliui: ^5.0.0 + decamelize: ^1.2.0 + find-up: ^3.0.0 + get-caller-file: ^2.0.1 + require-directory: ^2.1.1 + require-main-filename: ^2.0.0 + set-blocking: ^2.0.0 + string-width: ^3.0.0 + which-module: ^2.0.0 + y18n: ^4.0.0 + yargs-parser: ^15.0.1 + checksum: 684fcb1896e6c873c31c09c5c16445d6253dfe505aa879cff56d49425f5bca44f2ab8d7a1c949f3b932ae8654128425e89770e5e2f2c3d816e5816b9eb6efb6f + languageName: node + linkType: hard + "yargs@npm:^15.3.1": version: 15.4.1 resolution: "yargs@npm:15.4.1" From 308dfa4a331232feb0ea033e5acfa2bc6d46be39 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Fri, 29 Dec 2023 00:42:01 +0100 Subject: [PATCH 70/77] fix(CVE-2023-52079): bumped parcel --- web/package.json | 4 +- yarn.lock | 1162 ++++++++++++++++++++++++++-------------------- 2 files changed, 651 insertions(+), 515 deletions(-) diff --git a/web/package.json b/web/package.json index e86fc436f..4ad65c23c 100644 --- a/web/package.json +++ b/web/package.json @@ -48,7 +48,7 @@ "@kleros/kleros-v2-prettier-config": "workspace:^", "@kleros/kleros-v2-tsconfig": "workspace:^", "@netlify/functions": "^1.6.0", - "@parcel/transformer-svg-react": "2.8.3", + "@parcel/transformer-svg-react": "2.10.3", "@parcel/watcher": "~2.2.0", "@types/amqplib": "^0.10.4", "@types/busboy": "^1.5.3", @@ -65,7 +65,7 @@ "eslint-plugin-react": "^7.33.0", "eslint-plugin-react-hooks": "^4.6.0", "lru-cache": "^7.18.3", - "parcel": "2.8.3", + "parcel": "2.10.3", "supabase": "^1.102.2", "typescript": "^5.3.3" }, diff --git a/yarn.lock b/yarn.lock index df47d6f78..75be255b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5560,7 +5560,7 @@ __metadata: "@kleros/kleros-v2-tsconfig": "workspace:^" "@kleros/ui-components-library": ^2.6.3 "@netlify/functions": ^1.6.0 - "@parcel/transformer-svg-react": 2.8.3 + "@parcel/transformer-svg-react": 2.10.3 "@parcel/watcher": ~2.2.0 "@sentry/react": ^7.55.2 "@sentry/tracing": ^7.55.2 @@ -5594,7 +5594,7 @@ __metadata: moment: ^2.29.4 overlayscrollbars: ^2.3.0 overlayscrollbars-react: ^0.5.2 - parcel: 2.8.3 + parcel: 2.10.3 react: ^18.2.0 react-chartjs-2: ^4.3.1 react-dom: ^18.2.0 @@ -5798,44 +5798,44 @@ __metadata: languageName: node linkType: hard -"@lmdb/lmdb-darwin-arm64@npm:2.5.2": - version: 2.5.2 - resolution: "@lmdb/lmdb-darwin-arm64@npm:2.5.2" +"@lmdb/lmdb-darwin-arm64@npm:2.8.5": + version: 2.8.5 + resolution: "@lmdb/lmdb-darwin-arm64@npm:2.8.5" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@lmdb/lmdb-darwin-x64@npm:2.5.2": - version: 2.5.2 - resolution: "@lmdb/lmdb-darwin-x64@npm:2.5.2" +"@lmdb/lmdb-darwin-x64@npm:2.8.5": + version: 2.8.5 + resolution: "@lmdb/lmdb-darwin-x64@npm:2.8.5" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@lmdb/lmdb-linux-arm64@npm:2.5.2": - version: 2.5.2 - resolution: "@lmdb/lmdb-linux-arm64@npm:2.5.2" +"@lmdb/lmdb-linux-arm64@npm:2.8.5": + version: 2.8.5 + resolution: "@lmdb/lmdb-linux-arm64@npm:2.8.5" conditions: os=linux & cpu=arm64 languageName: node linkType: hard -"@lmdb/lmdb-linux-arm@npm:2.5.2": - version: 2.5.2 - resolution: "@lmdb/lmdb-linux-arm@npm:2.5.2" +"@lmdb/lmdb-linux-arm@npm:2.8.5": + version: 2.8.5 + resolution: "@lmdb/lmdb-linux-arm@npm:2.8.5" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@lmdb/lmdb-linux-x64@npm:2.5.2": - version: 2.5.2 - resolution: "@lmdb/lmdb-linux-x64@npm:2.5.2" +"@lmdb/lmdb-linux-x64@npm:2.8.5": + version: 2.8.5 + resolution: "@lmdb/lmdb-linux-x64@npm:2.8.5" conditions: os=linux & cpu=x64 languageName: node linkType: hard -"@lmdb/lmdb-win32-x64@npm:2.5.2": - version: 2.5.2 - resolution: "@lmdb/lmdb-win32-x64@npm:2.5.2" +"@lmdb/lmdb-win32-x64@npm:2.8.5": + version: 2.8.5 + resolution: "@lmdb/lmdb-win32-x64@npm:2.8.5" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -6816,110 +6816,112 @@ __metadata: languageName: node linkType: hard -"@parcel/bundler-default@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/bundler-default@npm:2.8.3" +"@parcel/bundler-default@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/bundler-default@npm:2.10.3" dependencies: - "@parcel/diagnostic": 2.8.3 - "@parcel/graph": 2.8.3 - "@parcel/hash": 2.8.3 - "@parcel/plugin": 2.8.3 - "@parcel/utils": 2.8.3 + "@parcel/diagnostic": 2.10.3 + "@parcel/graph": 3.0.3 + "@parcel/plugin": 2.10.3 + "@parcel/rust": 2.10.3 + "@parcel/utils": 2.10.3 nullthrows: ^1.1.1 - checksum: 219b2be341cad20991659b7a3031454a081ce0787c161a4da8a73ae8a4af4468667b284caea9488e869b162763d308cfd6495ab35fe386413b14325d6667ea86 + checksum: 2fd80acec4aeb4306b6ad29d381e8c77003576efc9c057a24fac80c363b3a8ba0c4b7bbea1587312fe3f88ab1fbcac085dbb90cfee5759d33fa085bc550d7191 languageName: node linkType: hard -"@parcel/cache@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/cache@npm:2.8.3" +"@parcel/cache@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/cache@npm:2.10.3" dependencies: - "@parcel/fs": 2.8.3 - "@parcel/logger": 2.8.3 - "@parcel/utils": 2.8.3 - lmdb: 2.5.2 + "@parcel/fs": 2.10.3 + "@parcel/logger": 2.10.3 + "@parcel/utils": 2.10.3 + lmdb: 2.8.5 peerDependencies: - "@parcel/core": ^2.8.3 - checksum: cd679053d229f8d06536a8fc9d857e5fa58905492e1a97c4f6b1da82de0dcef202a609c1e36206d3cdb32e5da3a214525f868b98dfd7aa671a53dacceb004fd9 + "@parcel/core": ^2.10.3 + checksum: b7e9a000a78786c1adda97d23f29d5c35695637db5de305d7fb6d4f8e88bed9c98065f4d0b094a131b2deb392451b897635fd2234fa4cf3a8a6667ae0b6af5db languageName: node linkType: hard -"@parcel/codeframe@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/codeframe@npm:2.8.3" +"@parcel/codeframe@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/codeframe@npm:2.10.3" dependencies: chalk: ^4.1.0 - checksum: a6e82c30e6251dcae14f247a14f6cb265f766b8bf18b62dd6a1c4a103cfae364a08897b36c5c379d0d867169647cb72962266f77571f718ff68ef70a16b81c02 - languageName: node - linkType: hard - -"@parcel/compressor-raw@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/compressor-raw@npm:2.8.3" - dependencies: - "@parcel/plugin": 2.8.3 - checksum: ca3b8a4f60e5193cffaa8041e709513df9c6cb54f32c9d20fef993a9af2d84f1e2d8bf8f4092220a8abaec24679498f854e683511876187f35b4f94a5852cf85 - languageName: node - linkType: hard - -"@parcel/config-default@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/config-default@npm:2.8.3" - dependencies: - "@parcel/bundler-default": 2.8.3 - "@parcel/compressor-raw": 2.8.3 - "@parcel/namer-default": 2.8.3 - "@parcel/optimizer-css": 2.8.3 - "@parcel/optimizer-htmlnano": 2.8.3 - "@parcel/optimizer-image": 2.8.3 - "@parcel/optimizer-svgo": 2.8.3 - "@parcel/optimizer-terser": 2.8.3 - "@parcel/packager-css": 2.8.3 - "@parcel/packager-html": 2.8.3 - "@parcel/packager-js": 2.8.3 - "@parcel/packager-raw": 2.8.3 - "@parcel/packager-svg": 2.8.3 - "@parcel/reporter-dev-server": 2.8.3 - "@parcel/resolver-default": 2.8.3 - "@parcel/runtime-browser-hmr": 2.8.3 - "@parcel/runtime-js": 2.8.3 - "@parcel/runtime-react-refresh": 2.8.3 - "@parcel/runtime-service-worker": 2.8.3 - "@parcel/transformer-babel": 2.8.3 - "@parcel/transformer-css": 2.8.3 - "@parcel/transformer-html": 2.8.3 - "@parcel/transformer-image": 2.8.3 - "@parcel/transformer-js": 2.8.3 - "@parcel/transformer-json": 2.8.3 - "@parcel/transformer-postcss": 2.8.3 - "@parcel/transformer-posthtml": 2.8.3 - "@parcel/transformer-raw": 2.8.3 - "@parcel/transformer-react-refresh-wrap": 2.8.3 - "@parcel/transformer-svg": 2.8.3 - peerDependencies: - "@parcel/core": ^2.8.3 - checksum: 08c700a7a253f39e84e1d341b3e0f558a2410bb27bf8a128113d8d157c32a7ef6b6ebd95e2c26d9f35c1040b98ff229ab56782247746189b4c41b925d1efd251 - languageName: node - linkType: hard - -"@parcel/core@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/core@npm:2.8.3" + checksum: b8808789dc452079ce9a9d93b14e39713e4dc831ddec5a3bc69284632e347d6fb5714e3e4890de081f3cad2c3905643f9f95d88b1262744bb1967e3278b85842 + languageName: node + linkType: hard + +"@parcel/compressor-raw@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/compressor-raw@npm:2.10.3" + dependencies: + "@parcel/plugin": 2.10.3 + checksum: bf92cd0690ff8858bb5fea7b70bb659a77c091aa95a399ce09b67345ab87db74e6974b6ab9faad18c0deb12416da981f59e171e346291cb2a55fc3830dc0153e + languageName: node + linkType: hard + +"@parcel/config-default@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/config-default@npm:2.10.3" + dependencies: + "@parcel/bundler-default": 2.10.3 + "@parcel/compressor-raw": 2.10.3 + "@parcel/namer-default": 2.10.3 + "@parcel/optimizer-css": 2.10.3 + "@parcel/optimizer-htmlnano": 2.10.3 + "@parcel/optimizer-image": 2.10.3 + "@parcel/optimizer-svgo": 2.10.3 + "@parcel/optimizer-swc": 2.10.3 + "@parcel/packager-css": 2.10.3 + "@parcel/packager-html": 2.10.3 + "@parcel/packager-js": 2.10.3 + "@parcel/packager-raw": 2.10.3 + "@parcel/packager-svg": 2.10.3 + "@parcel/packager-wasm": 2.10.3 + "@parcel/reporter-dev-server": 2.10.3 + "@parcel/resolver-default": 2.10.3 + "@parcel/runtime-browser-hmr": 2.10.3 + "@parcel/runtime-js": 2.10.3 + "@parcel/runtime-react-refresh": 2.10.3 + "@parcel/runtime-service-worker": 2.10.3 + "@parcel/transformer-babel": 2.10.3 + "@parcel/transformer-css": 2.10.3 + "@parcel/transformer-html": 2.10.3 + "@parcel/transformer-image": 2.10.3 + "@parcel/transformer-js": 2.10.3 + "@parcel/transformer-json": 2.10.3 + "@parcel/transformer-postcss": 2.10.3 + "@parcel/transformer-posthtml": 2.10.3 + "@parcel/transformer-raw": 2.10.3 + "@parcel/transformer-react-refresh-wrap": 2.10.3 + "@parcel/transformer-svg": 2.10.3 + peerDependencies: + "@parcel/core": ^2.10.3 + checksum: 7dc834abfe81fecfa582ffeb37471328382bae1f7b3d1a45229766cdafd780b349d6b598ef2a550f72e5877726c759866b83c5b4d494a2723e8bd46910bb4b8c + languageName: node + linkType: hard + +"@parcel/core@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/core@npm:2.10.3" dependencies: "@mischnic/json-sourcemap": ^0.1.0 - "@parcel/cache": 2.8.3 - "@parcel/diagnostic": 2.8.3 - "@parcel/events": 2.8.3 - "@parcel/fs": 2.8.3 - "@parcel/graph": 2.8.3 - "@parcel/hash": 2.8.3 - "@parcel/logger": 2.8.3 - "@parcel/package-manager": 2.8.3 - "@parcel/plugin": 2.8.3 + "@parcel/cache": 2.10.3 + "@parcel/diagnostic": 2.10.3 + "@parcel/events": 2.10.3 + "@parcel/fs": 2.10.3 + "@parcel/graph": 3.0.3 + "@parcel/logger": 2.10.3 + "@parcel/package-manager": 2.10.3 + "@parcel/plugin": 2.10.3 + "@parcel/profiler": 2.10.3 + "@parcel/rust": 2.10.3 "@parcel/source-map": ^2.1.1 - "@parcel/types": 2.8.3 - "@parcel/utils": 2.8.3 - "@parcel/workers": 2.8.3 + "@parcel/types": 2.10.3 + "@parcel/utils": 2.10.3 + "@parcel/workers": 2.10.3 abortcontroller-polyfill: ^1.1.9 base-x: ^3.0.8 browserslist: ^4.6.6 @@ -6927,343 +6929,372 @@ __metadata: dotenv: ^7.0.0 dotenv-expand: ^5.1.0 json5: ^2.2.0 - msgpackr: ^1.5.4 + msgpackr: ^1.9.9 nullthrows: ^1.1.1 - semver: ^5.7.1 - checksum: 68adceb1b041208fe922bb52da218e6be90d6e016322f4eac5a5dbfbac72838080cf9bbce51785d65556a258293c02dffba4482217dbd9b723258101d925fb0e + semver: ^7.5.2 + checksum: 9d9def613a19b893c56a6fbf09df07a5abd483a545c4643d8584337c828d2da2e32e56b3a1962b81719da7f384160f1383b911383860755951475a59369efa24 languageName: node linkType: hard -"@parcel/diagnostic@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/diagnostic@npm:2.8.3" +"@parcel/diagnostic@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/diagnostic@npm:2.10.3" dependencies: "@mischnic/json-sourcemap": ^0.1.0 nullthrows: ^1.1.1 - checksum: c24d98a2dbf068ef334c595d51504cd063310c0327477b5d7bcf817af3f8ad79d56593cdf91d8d45cb4a41a48baf9090ae4100a96d2c197d4ed20bc5db9df2d9 + checksum: 4223a534db21a18fb47c79a9a10ca49b84bddb1135bef8772808af9f36b695d789460d103f0566902df849c8e419ef60f66ab538c597fc38e5643e717c3eb042 languageName: node linkType: hard -"@parcel/events@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/events@npm:2.8.3" - checksum: 9d23c6663e9afce1d1094c46d38eba0b0171835201140258c1dcd33f63cfbc20bb1abdc163cbb7a01d407a8cf06c8742c10035c8a835ebca261b19d8ee0fbf7e - languageName: node - linkType: hard - -"@parcel/fs-search@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/fs-search@npm:2.8.3" - dependencies: - detect-libc: ^1.0.3 - checksum: 25e8eda6942fbf28e02cef1f5e94acafb3e33275a20b0a3e553402f04d2d24026be796b645728e872949dc8555b03a7d26d615a4f8eeed03a3af76aed535cc10 +"@parcel/events@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/events@npm:2.10.3" + checksum: f8b6c53a24378f02ccb8e5beb7f47d70a2b1e25f12541cf0e49be6daf998001806f9da862e908be291e9b44d880b387eee8b2790a7abf22bbefaafc07bd1664d languageName: node linkType: hard -"@parcel/fs@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/fs@npm:2.8.3" +"@parcel/fs@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/fs@npm:2.10.3" dependencies: - "@parcel/fs-search": 2.8.3 - "@parcel/types": 2.8.3 - "@parcel/utils": 2.8.3 + "@parcel/rust": 2.10.3 + "@parcel/types": 2.10.3 + "@parcel/utils": 2.10.3 "@parcel/watcher": ^2.0.7 - "@parcel/workers": 2.8.3 + "@parcel/workers": 2.10.3 peerDependencies: - "@parcel/core": ^2.8.3 - checksum: cc421552daef3c7676030867a1b4ed45d64d5f4221b0b12d487a86183a39544290fd3e7ed9104b1b58c05f2a6b5ec0698ce37a9cd49c484d94ed6b445f26d598 + "@parcel/core": ^2.10.3 + checksum: 916a7a0d6b3c98aa089d85445971f4fb6bf90ef94fb5d941e0c27d4cb775309027a537b5c144352299eadc516fe30f681c3843a24a4e518a24074c25830819c0 languageName: node linkType: hard -"@parcel/graph@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/graph@npm:2.8.3" +"@parcel/graph@npm:3.0.3": + version: 3.0.3 + resolution: "@parcel/graph@npm:3.0.3" dependencies: nullthrows: ^1.1.1 - checksum: ceed8445f5a23396cca001a54ee0620bd7d6ecbb455977c16bd2f446da14c1791817ed715a4cf70d6ba66310991eeee44d692f15f70ff52e75b98b629da25a88 - languageName: node - linkType: hard - -"@parcel/hash@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/hash@npm:2.8.3" - dependencies: - detect-libc: ^1.0.3 - xxhash-wasm: ^0.4.2 - checksum: 29cef199feda672756c930a8b45ee91e46607aa1b6659c38658758fe2f88870c20e0d4e8738d96ca8b44df60c1b767b5593110e2d24b99382214158c759258d0 + checksum: f906c7709b37abb5e8fb47919de2a1b763a0ee2851fe42f924d16a27f98435a92f0520c1c9990d31d9c835cbd25e9eeb57447ee4b9e8b56556857ad1fb28495a languageName: node linkType: hard -"@parcel/logger@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/logger@npm:2.8.3" +"@parcel/logger@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/logger@npm:2.10.3" dependencies: - "@parcel/diagnostic": 2.8.3 - "@parcel/events": 2.8.3 - checksum: 04fd46313138ea8e38c5bd051cd79ee245ad0a7bb6d5d12a892cafa79755af81ec1b6ddc83a79224bb74170bc1323f016cf849981326adb391f43920976ec9dc + "@parcel/diagnostic": 2.10.3 + "@parcel/events": 2.10.3 + checksum: f67f4010122b6b2e65d9789d328e0672cb250d7e0bf66528c317ddd8d95a771c67c87d75d049b5ed6b0b5858c860052301e9418faeee0c7f3d27e79d688874f5 languageName: node linkType: hard -"@parcel/markdown-ansi@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/markdown-ansi@npm:2.8.3" +"@parcel/markdown-ansi@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/markdown-ansi@npm:2.10.3" dependencies: chalk: ^4.1.0 - checksum: 1985f149b2ac08347f954230922fdcc45d7ceedba9b7f458078843a018d950a56cb512fb951537b4f995e861b9290b0757cfc0eadf542a13b124175b5ef02945 + checksum: e683f8ce1dd12f2a414e3f7840de3a46f0477c4dbf603dfa9b49372367bf248d115b2c73fbba85ad0dff27bd156a55761aa22d12afba098197dc3c7a4f9e6730 languageName: node linkType: hard -"@parcel/namer-default@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/namer-default@npm:2.8.3" +"@parcel/namer-default@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/namer-default@npm:2.10.3" dependencies: - "@parcel/diagnostic": 2.8.3 - "@parcel/plugin": 2.8.3 + "@parcel/diagnostic": 2.10.3 + "@parcel/plugin": 2.10.3 nullthrows: ^1.1.1 - checksum: 7c2c3434460d8fa6c9d482a9bfc681e47322ad82c8beef193eee9e45831374860d0f89de4c69e2e5cf41301cad19c7e87f5b536ca7d684aa383e783bcce02ef1 + checksum: ea6adf6c5cb44d97ce929b967b6ebf5d383c907284166ee57554a8d3815b7da42a867202e8f69ee190de35287639e2ed74f8cd540ecf232232dcc8423a3a613a languageName: node linkType: hard -"@parcel/node-resolver-core@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/node-resolver-core@npm:2.8.3" +"@parcel/node-resolver-core@npm:3.1.3": + version: 3.1.3 + resolution: "@parcel/node-resolver-core@npm:3.1.3" dependencies: - "@parcel/diagnostic": 2.8.3 - "@parcel/utils": 2.8.3 + "@mischnic/json-sourcemap": ^0.1.0 + "@parcel/diagnostic": 2.10.3 + "@parcel/fs": 2.10.3 + "@parcel/rust": 2.10.3 + "@parcel/utils": 2.10.3 nullthrows: ^1.1.1 - semver: ^5.7.1 - checksum: 4976d3ecc9acc6ee05c7709291f4576c269bc84f896c8bf9e6171ce6f9fbd9c2dd7e3db4e11542b3b29093c73f5451724c94bf7b0735b9920ddcdeecf1809968 + semver: ^7.5.2 + checksum: 7daa061d8170eee165005686b9ac82823a5fda5465246226bd8ca163b9434ebfa70163bf64b103f56e0fe7d6b72f10ebf24e0bcc2f832e258876484d0707636e languageName: node linkType: hard -"@parcel/optimizer-css@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/optimizer-css@npm:2.8.3" +"@parcel/optimizer-css@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/optimizer-css@npm:2.10.3" dependencies: - "@parcel/diagnostic": 2.8.3 - "@parcel/plugin": 2.8.3 + "@parcel/diagnostic": 2.10.3 + "@parcel/plugin": 2.10.3 "@parcel/source-map": ^2.1.1 - "@parcel/utils": 2.8.3 + "@parcel/utils": 2.10.3 browserslist: ^4.6.6 lightningcss: ^1.16.1 nullthrows: ^1.1.1 - checksum: ffac43a2c20243d57b8627257b5a74462ebc0f4aa780b3117237240c9c3e9ca37ddcc8312296be9fe571a78f5a44cc14fa47ca9490d3796d673d8313d6cd8c9a + checksum: f157c14136b24bace773d721d29192dd913770dea3b65348993ce0bd6dbdeb186c4a4bfc42b6912a4674814d4ed73761568bd976e09f1d988a66095d8da83920 languageName: node linkType: hard -"@parcel/optimizer-htmlnano@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/optimizer-htmlnano@npm:2.8.3" +"@parcel/optimizer-htmlnano@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/optimizer-htmlnano@npm:2.10.3" dependencies: - "@parcel/plugin": 2.8.3 + "@parcel/plugin": 2.10.3 htmlnano: ^2.0.0 nullthrows: ^1.1.1 posthtml: ^0.16.5 svgo: ^2.4.0 - checksum: ca1cab7b1ecc16f209ad867fbdd8b2f446fd831d8688db068491fa22786a5aa3a0debb4290e0f003830c6b06c6f3a4c3a3cd9cdb033e7fa6cded8a19887d5f23 + checksum: d2d7c4d5596e64b5a1ee81824aabb132853fbd065e2e8816e061702872ec4cec3527d9f63206d20d78176a4d1e075f25d5f90590b6540b8aa57f0295c59c687b languageName: node linkType: hard -"@parcel/optimizer-image@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/optimizer-image@npm:2.8.3" +"@parcel/optimizer-image@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/optimizer-image@npm:2.10.3" dependencies: - "@parcel/diagnostic": 2.8.3 - "@parcel/plugin": 2.8.3 - "@parcel/utils": 2.8.3 - "@parcel/workers": 2.8.3 - detect-libc: ^1.0.3 - checksum: 72c5acffaea833237f62e23c8fb183eb85863ccddeb11304b2299b28973b957daba1e34854d347314edf35d83cba695c0d7600e1ae125dec4cc3151abd8f2e31 + "@parcel/diagnostic": 2.10.3 + "@parcel/plugin": 2.10.3 + "@parcel/rust": 2.10.3 + "@parcel/utils": 2.10.3 + "@parcel/workers": 2.10.3 + peerDependencies: + "@parcel/core": ^2.10.3 + checksum: 40a4132b9edc344fcab6607b69a3b05743ad1478319183b5eb54c3ee21d676eb9ecdd78ada676998a7cd3a1daaf0cb02c65504cbe9343001e10fd7fff7d1b03d languageName: node linkType: hard -"@parcel/optimizer-svgo@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/optimizer-svgo@npm:2.8.3" +"@parcel/optimizer-svgo@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/optimizer-svgo@npm:2.10.3" dependencies: - "@parcel/diagnostic": 2.8.3 - "@parcel/plugin": 2.8.3 - "@parcel/utils": 2.8.3 + "@parcel/diagnostic": 2.10.3 + "@parcel/plugin": 2.10.3 + "@parcel/utils": 2.10.3 svgo: ^2.4.0 - checksum: b3544c08fac4009de1ec6f88136a58cdec70b072433b13fb99f9e6584dc4731afea82ae13d27e4121ed5aaec9e4481225a54251ce52b6ece835908300c26fa33 + checksum: f26c8c931f0648b6c908e6d9639be010cb3f0551eaaf46f205bba39fcdb5190a20a094847f91036734a0b9749bf607ae22b0bedbecaebe30fa198965523fc228 languageName: node linkType: hard -"@parcel/optimizer-terser@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/optimizer-terser@npm:2.8.3" +"@parcel/optimizer-swc@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/optimizer-swc@npm:2.10.3" dependencies: - "@parcel/diagnostic": 2.8.3 - "@parcel/plugin": 2.8.3 + "@parcel/diagnostic": 2.10.3 + "@parcel/plugin": 2.10.3 "@parcel/source-map": ^2.1.1 - "@parcel/utils": 2.8.3 + "@parcel/utils": 2.10.3 + "@swc/core": ^1.3.36 nullthrows: ^1.1.1 - terser: ^5.2.0 - checksum: ee1959f5965c7eee8ad1519f9d2554810030f326e959dd5e44aa014c29a51c2ab777dfbbf604a6b4436b75176a8694b7b8c9d99f945d57dea7828225762c8823 + checksum: 6eb1e2c923cff94f71a3d5a8218f826440ac7c0162cc45d9b27ae20ad62f1ab0dcd5efea4cbabebb3cbfe0d6d56b26693754e5daca8469ab36914d7ece1be3ba languageName: node linkType: hard -"@parcel/package-manager@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/package-manager@npm:2.8.3" +"@parcel/package-manager@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/package-manager@npm:2.10.3" dependencies: - "@parcel/diagnostic": 2.8.3 - "@parcel/fs": 2.8.3 - "@parcel/logger": 2.8.3 - "@parcel/types": 2.8.3 - "@parcel/utils": 2.8.3 - "@parcel/workers": 2.8.3 - semver: ^5.7.1 + "@parcel/diagnostic": 2.10.3 + "@parcel/fs": 2.10.3 + "@parcel/logger": 2.10.3 + "@parcel/node-resolver-core": 3.1.3 + "@parcel/types": 2.10.3 + "@parcel/utils": 2.10.3 + "@parcel/workers": 2.10.3 + semver: ^7.5.2 peerDependencies: - "@parcel/core": ^2.8.3 - checksum: 572a5aacfd7bc545d9aa35ff2125f1231226b550f9b0fe2c36d68a82ec8ffb047035e25fdb883bc2331a6eaf69c98bb5d6752644546d962de7bf544c6243a959 + "@parcel/core": ^2.10.3 + checksum: d25958e342cd6886b7d92b12100f8f58dadc80c925a28e25b8a7aa7349955d701c927b42e97ecff8b078452ff92dd4b976782b47fda7268533e9412de86c710f languageName: node linkType: hard -"@parcel/packager-css@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/packager-css@npm:2.8.3" +"@parcel/packager-css@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/packager-css@npm:2.10.3" dependencies: - "@parcel/plugin": 2.8.3 + "@parcel/diagnostic": 2.10.3 + "@parcel/plugin": 2.10.3 "@parcel/source-map": ^2.1.1 - "@parcel/utils": 2.8.3 + "@parcel/utils": 2.10.3 nullthrows: ^1.1.1 - checksum: bb28fc9f02df83a1fd8eac7043466debb67398190819282a40a52ff299b0f4c3f474bfa7806be776ce36a66cc89574128a9fa210d2c0c9cb905bbb4dbbd2b926 + checksum: 5da9263a0fcf233c0793029518220a8bbcc4f8707196c1a85acfbf96ebfb821fdc4da2ce01af92b16178e6db4e214d627fc61902fecd65910c1dcecb6af60273 languageName: node linkType: hard -"@parcel/packager-html@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/packager-html@npm:2.8.3" +"@parcel/packager-html@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/packager-html@npm:2.10.3" dependencies: - "@parcel/plugin": 2.8.3 - "@parcel/types": 2.8.3 - "@parcel/utils": 2.8.3 + "@parcel/plugin": 2.10.3 + "@parcel/types": 2.10.3 + "@parcel/utils": 2.10.3 nullthrows: ^1.1.1 posthtml: ^0.16.5 - checksum: 631f98fca0fdd3f11fe4cfbc1e0ad73b86f7fb00be7164fef5633c600a13282ae592b8f7d9aa31d4f66bd645ae57ce27e67db51a81b2a91c286ed5c8b36a4a87 + checksum: 85bfdba8be5be33f37c520cc6b770151ab7ad263032aff1126a64a1df9676f25478f7d3e67ea76374362287bbed3419939ae0e6d576b2a20f60f51a23f24fa58 languageName: node linkType: hard -"@parcel/packager-js@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/packager-js@npm:2.8.3" +"@parcel/packager-js@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/packager-js@npm:2.10.3" dependencies: - "@parcel/diagnostic": 2.8.3 - "@parcel/hash": 2.8.3 - "@parcel/plugin": 2.8.3 + "@parcel/diagnostic": 2.10.3 + "@parcel/plugin": 2.10.3 + "@parcel/rust": 2.10.3 "@parcel/source-map": ^2.1.1 - "@parcel/utils": 2.8.3 + "@parcel/types": 2.10.3 + "@parcel/utils": 2.10.3 globals: ^13.2.0 nullthrows: ^1.1.1 - checksum: 92ac88244b6104c5905ab95d882b755134042654ab48106ca84ab18441fb7240b66f049e407146958aead0812345823da729a4a37f32be17afd2b44cbdebc926 + checksum: 1e383bdf39c495d23ac52acb4a821ef9d405ae4eee160a9571dee005faa60e1404046c59250c99898691da6fffa18e9dee5e317b6d06ee7503717ebbb4f7e59f languageName: node linkType: hard -"@parcel/packager-raw@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/packager-raw@npm:2.8.3" +"@parcel/packager-raw@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/packager-raw@npm:2.10.3" dependencies: - "@parcel/plugin": 2.8.3 - checksum: 26236dd64624a25fc1d749fb96b1bc3a6854b14d4386109670572f55feda4bb6affde19b1c9e971c4e50bfb53fd88e32da8303c83a3cb18ceaf12dd310685c34 + "@parcel/plugin": 2.10.3 + checksum: 7f6615fa93c18e14014de07e677587ccfd1e275972d577c3ef4359969f8fca4ec12351be04a0d34e6287b63041259a0b31bc239555b7cdff7cfec734667f6e4f languageName: node linkType: hard -"@parcel/packager-svg@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/packager-svg@npm:2.8.3" +"@parcel/packager-svg@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/packager-svg@npm:2.10.3" dependencies: - "@parcel/plugin": 2.8.3 - "@parcel/types": 2.8.3 - "@parcel/utils": 2.8.3 + "@parcel/plugin": 2.10.3 + "@parcel/types": 2.10.3 + "@parcel/utils": 2.10.3 posthtml: ^0.16.4 - checksum: 45c966ad8e6dbb25049adca66d761089a09cda83558d8767b46501a023b8d94b050f1a2899b1c8b18eac6cf87d2605ad5aa9a4cb2f9d90474794576dafb2e4fc + checksum: fcc64795be57a3c32e7861d424d3aaaa585cda126a0f7e03d28ffb4cd2105218ae4d1ce8ac68cb986a8fe5b77adf80722de18b6af4d094f368c810aff346f58c + languageName: node + linkType: hard + +"@parcel/packager-wasm@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/packager-wasm@npm:2.10.3" + dependencies: + "@parcel/plugin": 2.10.3 + checksum: 971a8b1ef763fb593d80536b7728545bc471208fecb05344fb5b4af7f38dc9f5f5faad8047388d4bfcff8bba7b96cf1437789e017e40b0fd95a6da99b03db942 languageName: node linkType: hard -"@parcel/plugin@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/plugin@npm:2.8.3" +"@parcel/plugin@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/plugin@npm:2.10.3" dependencies: - "@parcel/types": 2.8.3 - checksum: a69ac66f5cc28197cf689f1c4144398457d62a086621a22b3b45fe863909a094b616dad415ec01673a9eb731b05fe9060bcb340c07efcd48343577a540fbfdf7 + "@parcel/types": 2.10.3 + checksum: d5d18e815856bf76d4e5a6b3daaefa21030a67e46b38cebb9ee4d4aa98b352bce3f54d8c3fc4136692c31e85ca23f1366bd86f77c78cd0daeacbad82a59068d0 + languageName: node + linkType: hard + +"@parcel/profiler@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/profiler@npm:2.10.3" + dependencies: + "@parcel/diagnostic": 2.10.3 + "@parcel/events": 2.10.3 + chrome-trace-event: ^1.0.2 + checksum: b6d797c7abddb2e8861a77fc3f8e11d329a41e3257ba6d5eddfb5cb158d3299d380d49114dfccac54ce73c9ba82e779a39fe3f0e62b40aae4eb8ade5ed3e8726 languageName: node linkType: hard -"@parcel/reporter-cli@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/reporter-cli@npm:2.8.3" +"@parcel/reporter-cli@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/reporter-cli@npm:2.10.3" dependencies: - "@parcel/plugin": 2.8.3 - "@parcel/types": 2.8.3 - "@parcel/utils": 2.8.3 + "@parcel/plugin": 2.10.3 + "@parcel/types": 2.10.3 + "@parcel/utils": 2.10.3 chalk: ^4.1.0 term-size: ^2.2.1 - checksum: 791dd4706aac706427a563455d9db5fa330b77e94fe4226b3751cd527327d8540d62400a8040e85a5fd29ecb6e673507e9d4a1fa754c093f1c005078670eef85 + checksum: 7b6f4c0e964955422a20936ca53bb864fe0e1a9729a68e303ab9daa6ead8fabb48b695614852549357a881734a230980967d7e1c76f2f78b279e14e28725f2ed languageName: node linkType: hard -"@parcel/reporter-dev-server@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/reporter-dev-server@npm:2.8.3" +"@parcel/reporter-dev-server@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/reporter-dev-server@npm:2.10.3" dependencies: - "@parcel/plugin": 2.8.3 - "@parcel/utils": 2.8.3 - checksum: 329db9fd0cdc3ddc36d8156a7d67747335c76b1368116c98e266218f1e1ce4ea108981441bcb78961f64e2067a2d8a1745d8aa069398d50e67278e1333293723 + "@parcel/plugin": 2.10.3 + "@parcel/utils": 2.10.3 + checksum: 0dd35076154e705ea0f00ffbb7fd452a7fd98d0c13cf9af2b72a8762509dfe87594c00e0cfd886ee6d2a4134379581eb281f5e1fde4eb4b4360fb547bc1f3db9 languageName: node linkType: hard -"@parcel/resolver-default@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/resolver-default@npm:2.8.3" +"@parcel/reporter-tracer@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/reporter-tracer@npm:2.10.3" dependencies: - "@parcel/node-resolver-core": 2.8.3 - "@parcel/plugin": 2.8.3 - checksum: 40515a62c1a301050144e1427ac7a591afedea50e89baff0ab4ed05ad8424f5df6ad4a7b5e413956a199ecef18bf8220b353fb115af72fac4187a62e8a997d1d + "@parcel/plugin": 2.10.3 + "@parcel/utils": 2.10.3 + chrome-trace-event: ^1.0.3 + nullthrows: ^1.1.1 + checksum: 818ff5a49c836fc965ebd21373c0924453ae9b5fe2f9bde5e4735cb1bdd16db81af65f2f48235a95e34c9bacec6081b29bf612dc0e3e4d1db7811bec91ac1b2d + languageName: node + linkType: hard + +"@parcel/resolver-default@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/resolver-default@npm:2.10.3" + dependencies: + "@parcel/node-resolver-core": 3.1.3 + "@parcel/plugin": 2.10.3 + checksum: 4c6025a129fbdb42964c84e58df3dc555bb77dae2d134a6e98de652e14de1c1b600766add5e95ccaffb3c7bfc006111fdb9aabeb96f815c875c9e3846d66e484 languageName: node linkType: hard -"@parcel/runtime-browser-hmr@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/runtime-browser-hmr@npm:2.8.3" +"@parcel/runtime-browser-hmr@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/runtime-browser-hmr@npm:2.10.3" dependencies: - "@parcel/plugin": 2.8.3 - "@parcel/utils": 2.8.3 - checksum: 56c276c7b03bb4c301d7dbe94c5183404af4064286f67682399e848ff894bfb5ea783dad11082290d40f2f07be64252dd236b993baf2e3e8fbb30a572f95a0dc + "@parcel/plugin": 2.10.3 + "@parcel/utils": 2.10.3 + checksum: 6977acaf7797e070626667bef7849cfaebad89323c2da718c690f05f44b778bba7045469d704e7995fe06fd4e4f77194a8059218c85bcb186a05c753c0cf4c7c languageName: node linkType: hard -"@parcel/runtime-js@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/runtime-js@npm:2.8.3" +"@parcel/runtime-js@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/runtime-js@npm:2.10.3" dependencies: - "@parcel/plugin": 2.8.3 - "@parcel/utils": 2.8.3 + "@parcel/diagnostic": 2.10.3 + "@parcel/plugin": 2.10.3 + "@parcel/utils": 2.10.3 nullthrows: ^1.1.1 - checksum: ee5e04f84d522a6f53753c3956d37cacb2bdabb2539e2f40e640762b3cc43b20efc495331fe254d92d82a06c3e1b4690c17125090a12300d75ad7c3a9ca3e2f0 + checksum: a0c3f95eefbd9e6a9678d838bedac997ef4ebb797c1aef25d2e72217a70fdf54ae44a1ef0ff4c0161e0df004ee6a44b66958edfd5df9f95cd2017f049f0be2f0 languageName: node linkType: hard -"@parcel/runtime-react-refresh@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/runtime-react-refresh@npm:2.8.3" +"@parcel/runtime-react-refresh@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/runtime-react-refresh@npm:2.10.3" dependencies: - "@parcel/plugin": 2.8.3 - "@parcel/utils": 2.8.3 + "@parcel/plugin": 2.10.3 + "@parcel/utils": 2.10.3 react-error-overlay: 6.0.9 react-refresh: ^0.9.0 - checksum: 327159be0c8183f1cff139de973e8e8ca6b83dc2fc94846a89415fabf8cd8535e95ed3ae9750ac08e73a303de57c18c4e5da959ecbe73af75f1d3c9a98f5c20b + checksum: 00f69e6a57918c628fdd4ee2dc4b65e81bdc0be15074d32ffdd6db3aa6d00b0ce0a4e005aba028fc0deaccf38f8b319bf0b5900999cbca5530ad29ab7a0a4074 languageName: node linkType: hard -"@parcel/runtime-service-worker@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/runtime-service-worker@npm:2.8.3" +"@parcel/runtime-service-worker@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/runtime-service-worker@npm:2.10.3" dependencies: - "@parcel/plugin": 2.8.3 - "@parcel/utils": 2.8.3 + "@parcel/plugin": 2.10.3 + "@parcel/utils": 2.10.3 nullthrows: ^1.1.1 - checksum: 0646fee9a9378c0844c223d0eaf1c46e817738e70b2e993434717fb6aab998339b37a32c5bd9db891fcb8bc44dc3d7530564f84a5cd978d6dd47f204f18bd44a + checksum: 01370853dfc535804353169f349b1d7a8291f4daa0b7728c052c1d9759e4b338fced1801490d8dd6aa12816135f475124daa9c747f7ba68c7c899064b3abb88f + languageName: node + linkType: hard + +"@parcel/rust@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/rust@npm:2.10.3" + checksum: 5c1a086742b0a53c935bc992a71cadc8fc3f5bd7ce7fce5dcf13a4079a867ef6df09422cd668e44c3cec0be19630441ca11c95081fc922287312893c5c0ebe1a languageName: node linkType: hard @@ -7276,205 +7307,206 @@ __metadata: languageName: node linkType: hard -"@parcel/transformer-babel@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/transformer-babel@npm:2.8.3" +"@parcel/transformer-babel@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/transformer-babel@npm:2.10.3" dependencies: - "@parcel/diagnostic": 2.8.3 - "@parcel/plugin": 2.8.3 + "@parcel/diagnostic": 2.10.3 + "@parcel/plugin": 2.10.3 "@parcel/source-map": ^2.1.1 - "@parcel/utils": 2.8.3 + "@parcel/utils": 2.10.3 browserslist: ^4.6.6 json5: ^2.2.0 nullthrows: ^1.1.1 - semver: ^5.7.0 - checksum: a27bbe8d893854a77d9a8c9b45490728b2db81ad0782b7d9085d00c50155840477dd4ada8e382e0b02f9f5f8761da48bd6d3feb62ddd582e6608f92d4468df80 + semver: ^7.5.2 + checksum: 5dc31a9ff4b4f7a1400a16c2f2d44badcf330dfc98ff935ece813ce9efd926d34bc230a60c146bd3bb43b2da675f1289b3b55b8386f2739abb521e5c34970d59 languageName: node linkType: hard -"@parcel/transformer-css@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/transformer-css@npm:2.8.3" +"@parcel/transformer-css@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/transformer-css@npm:2.10.3" dependencies: - "@parcel/diagnostic": 2.8.3 - "@parcel/plugin": 2.8.3 + "@parcel/diagnostic": 2.10.3 + "@parcel/plugin": 2.10.3 "@parcel/source-map": ^2.1.1 - "@parcel/utils": 2.8.3 + "@parcel/utils": 2.10.3 browserslist: ^4.6.6 lightningcss: ^1.16.1 nullthrows: ^1.1.1 - checksum: 31375a140550968a36f7a8eb998c03f20200d202b7c62c98fb49b05f719777ca545d08f356dec9ca6d9a601ba0020abce5cf4672fe425bc99a540dccf262a6cc + checksum: f9cf5f04ceae726cf8a5c95ba326a73125423245fe34317593dde9956bead1e48021254ffffd0b5b41cd8f71a953580e1216d0897557c7d0999f360a7797ad43 languageName: node linkType: hard -"@parcel/transformer-html@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/transformer-html@npm:2.8.3" +"@parcel/transformer-html@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/transformer-html@npm:2.10.3" dependencies: - "@parcel/diagnostic": 2.8.3 - "@parcel/hash": 2.8.3 - "@parcel/plugin": 2.8.3 + "@parcel/diagnostic": 2.10.3 + "@parcel/plugin": 2.10.3 + "@parcel/rust": 2.10.3 nullthrows: ^1.1.1 posthtml: ^0.16.5 posthtml-parser: ^0.10.1 posthtml-render: ^3.0.0 - semver: ^5.7.1 + semver: ^7.5.2 srcset: 4 - checksum: 21600a3e0ac9e05aa6f6066ef94f8ba7e0de62a8ae59a812230907f5731dcf73dc5308fb74b32bfb6dab16089d13f72043965e1e87e8c4daec8447a9081af8eb + checksum: ecf9f0c18791bdb1b2c65abbe8ef1fd0fe6bb33d4831c294efc78cf8094e7444e1746b86ad82e2cb7fec02c7c94fd8c0a6190201a12ff83e22b6d243cd665ece languageName: node linkType: hard -"@parcel/transformer-image@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/transformer-image@npm:2.8.3" +"@parcel/transformer-image@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/transformer-image@npm:2.10.3" dependencies: - "@parcel/plugin": 2.8.3 - "@parcel/utils": 2.8.3 - "@parcel/workers": 2.8.3 + "@parcel/plugin": 2.10.3 + "@parcel/utils": 2.10.3 + "@parcel/workers": 2.10.3 nullthrows: ^1.1.1 peerDependencies: - "@parcel/core": ^2.8.3 - checksum: f4b3464828e1b3d44e7da5c7a71272f5f53f830d9bb371e8dd8b2f32040f4426f3efeae12949947e34b39f7755a253f0b48c6eeec6d86ad43baf0b30717f1f47 + "@parcel/core": ^2.10.3 + checksum: 5e1fc73ca2e38f0fcb67cc0851e27a2d0f1bcb01c5b6f6e0ba8195987c32a26111cd27ba26d6d9f0374773c04f98dd88e1e4fcec770a596f0618b4a9bae3e46f languageName: node linkType: hard -"@parcel/transformer-js@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/transformer-js@npm:2.8.3" +"@parcel/transformer-js@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/transformer-js@npm:2.10.3" dependencies: - "@parcel/diagnostic": 2.8.3 - "@parcel/plugin": 2.8.3 + "@parcel/diagnostic": 2.10.3 + "@parcel/plugin": 2.10.3 + "@parcel/rust": 2.10.3 "@parcel/source-map": ^2.1.1 - "@parcel/utils": 2.8.3 - "@parcel/workers": 2.8.3 - "@swc/helpers": ^0.4.12 + "@parcel/utils": 2.10.3 + "@parcel/workers": 2.10.3 + "@swc/helpers": ^0.5.0 browserslist: ^4.6.6 - detect-libc: ^1.0.3 nullthrows: ^1.1.1 regenerator-runtime: ^0.13.7 - semver: ^5.7.1 + semver: ^7.5.2 peerDependencies: - "@parcel/core": ^2.8.3 - checksum: 29fb203502309e11452837e4ae60589300c0d91fae35cf4774e70959e9f4532960ef4619959ce9c95f0060020faabbcfd024b076f41c7d5f7e126c3547244ff6 + "@parcel/core": ^2.10.3 + checksum: 7d534ea520808a3f12fa0751f88034a6212e0ec876934b570a48bd905ddea20d1fd8d543e23fd6fa4674591ccad476f1495e7b9732209a22d287674b82df6b02 languageName: node linkType: hard -"@parcel/transformer-json@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/transformer-json@npm:2.8.3" +"@parcel/transformer-json@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/transformer-json@npm:2.10.3" dependencies: - "@parcel/plugin": 2.8.3 + "@parcel/plugin": 2.10.3 json5: ^2.2.0 - checksum: 04da28b0f0ff1ec1d7c6383b880daa2918f85ba1375351690a9a07ea4de102531d5f6addb3091ae5109623e270e1d2cdf582661f4a0805bd982a653a06d26890 + checksum: f08d2a13b284484e4d062b6650d65329d0da1da04dadd770da9911a44b40a051e745f80b5b61e82ad74d99816c7cb10e0094144b5b033cb17c85d38a916f4714 languageName: node linkType: hard -"@parcel/transformer-postcss@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/transformer-postcss@npm:2.8.3" +"@parcel/transformer-postcss@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/transformer-postcss@npm:2.10.3" dependencies: - "@parcel/diagnostic": 2.8.3 - "@parcel/hash": 2.8.3 - "@parcel/plugin": 2.8.3 - "@parcel/utils": 2.8.3 + "@parcel/diagnostic": 2.10.3 + "@parcel/plugin": 2.10.3 + "@parcel/rust": 2.10.3 + "@parcel/utils": 2.10.3 clone: ^2.1.1 nullthrows: ^1.1.1 postcss-value-parser: ^4.2.0 - semver: ^5.7.1 - checksum: 2c75cb5cec7112d12a28ac5cddc9f2e939f76e006929757804431b266e7541aae5df6ba8601727c33c7b53f0f971a6df5dfb4394fa0baf284bd2c6fc9b507650 + semver: ^7.5.2 + checksum: bcea34678d39231cd91cebdc8790b4b9f6e56b9a8c94cadd54ab90b43d282505fe17c8b5414b0fdf82d7b66620bffc587c21f2613356085cba7e7dfc5badea77 languageName: node linkType: hard -"@parcel/transformer-posthtml@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/transformer-posthtml@npm:2.8.3" +"@parcel/transformer-posthtml@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/transformer-posthtml@npm:2.10.3" dependencies: - "@parcel/plugin": 2.8.3 - "@parcel/utils": 2.8.3 + "@parcel/plugin": 2.10.3 + "@parcel/utils": 2.10.3 nullthrows: ^1.1.1 posthtml: ^0.16.5 posthtml-parser: ^0.10.1 posthtml-render: ^3.0.0 - semver: ^5.7.1 - checksum: 130c95782aebb2491f2d89685db573b3b85ed1f7d9862684db2ab9d11fe8148995185a4e144b818de06d596cf687c5bd57b6b8648d2856cf830a9674c2ec3237 + semver: ^7.5.2 + checksum: afa94afee4b0e1769227bbd6a8928bd5ce8c38711bc8164cb9a76af2134643d28c3b1887a8237b9c2572f0a30f7181aaeb3ed3c1a4882b064a3f30e2f145b77d languageName: node linkType: hard -"@parcel/transformer-raw@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/transformer-raw@npm:2.8.3" +"@parcel/transformer-raw@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/transformer-raw@npm:2.10.3" dependencies: - "@parcel/plugin": 2.8.3 - checksum: 371263bb526373c229aa3e730f2a1d6687bd6b771203d73237c04da3a3ada86c4fcf0b534d3fb366a7b3842df0cf98ae1e033602613cafd9f702f47a6568a83c + "@parcel/plugin": 2.10.3 + checksum: 26f5b5c1f80f60b6ea404cce9372591f643accc3357b7164b208888d47e7b9731433d3ef4e62034cadbc998ef84cfa0d9e6b63a842e0f09157d3f5d46324342f languageName: node linkType: hard -"@parcel/transformer-react-refresh-wrap@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/transformer-react-refresh-wrap@npm:2.8.3" +"@parcel/transformer-react-refresh-wrap@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/transformer-react-refresh-wrap@npm:2.10.3" dependencies: - "@parcel/plugin": 2.8.3 - "@parcel/utils": 2.8.3 + "@parcel/plugin": 2.10.3 + "@parcel/utils": 2.10.3 react-refresh: ^0.9.0 - checksum: e9648e04b7f9b29f47ec7baedfba9cc36bbb7e44be6ad4b6b4433c20d1b5a3184a3043b712add16a5cc06300289305d5fa9ebb73c6dc926d04df7c52d9bc3316 + checksum: 5959b5860d1ac342bd3eaf9fcbde2065c84ef4347100f36ae29cc322a87aea5b1175142fe6c181f9fddbc858384755787f5b9398da2078d5881f2b2f94caf19b languageName: node linkType: hard -"@parcel/transformer-svg-react@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/transformer-svg-react@npm:2.8.3" +"@parcel/transformer-svg-react@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/transformer-svg-react@npm:2.10.3" dependencies: - "@parcel/plugin": 2.8.3 + "@parcel/plugin": 2.10.3 "@svgr/core": ^6.2.0 "@svgr/plugin-jsx": ^6.2.0 "@svgr/plugin-svgo": ^6.2.0 - checksum: 0becee4a08c46b2ffde246aab6b52e03d3b9c12b945d83ac412005e05195579481ce7b7f94923e6b3a7b65cc4bde029343279ed1794d5a22e975f92f4e8f400d + checksum: dd868059cdeef9c7d1c2ae906662da39d977b570da53917265ad7837241bbe881249c663ed2b959e0cad3be71bbdc046fbd8d88c83c7980de7ef8b4f950d278a languageName: node linkType: hard -"@parcel/transformer-svg@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/transformer-svg@npm:2.8.3" +"@parcel/transformer-svg@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/transformer-svg@npm:2.10.3" dependencies: - "@parcel/diagnostic": 2.8.3 - "@parcel/hash": 2.8.3 - "@parcel/plugin": 2.8.3 + "@parcel/diagnostic": 2.10.3 + "@parcel/plugin": 2.10.3 + "@parcel/rust": 2.10.3 nullthrows: ^1.1.1 posthtml: ^0.16.5 posthtml-parser: ^0.10.1 posthtml-render: ^3.0.0 - semver: ^5.7.1 - checksum: 1f3db309e47d07849a2b4ffe11b508fd7ae792c0c0ce7b03e442fffb25f5e7425c5027428729bf2b587309265bba0be6da635d62c51ae8ab7e54483eff3f575e + semver: ^7.5.2 + checksum: aa1c3378fc4b809cca9dd90804030d204a587e3a4bebf5f0cf3853eaf6eff0cf82b47e304df2b532831eaabe48143a996a789d3d199f156de534ff03c68a3c8e languageName: node linkType: hard -"@parcel/types@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/types@npm:2.8.3" +"@parcel/types@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/types@npm:2.10.3" dependencies: - "@parcel/cache": 2.8.3 - "@parcel/diagnostic": 2.8.3 - "@parcel/fs": 2.8.3 - "@parcel/package-manager": 2.8.3 + "@parcel/cache": 2.10.3 + "@parcel/diagnostic": 2.10.3 + "@parcel/fs": 2.10.3 + "@parcel/package-manager": 2.10.3 "@parcel/source-map": ^2.1.1 - "@parcel/workers": 2.8.3 + "@parcel/workers": 2.10.3 utility-types: ^3.10.0 - checksum: ece0abdd5c7cce32a246155f6828f6a92830341dfbceb81c9aaf7da44e0733b87ea8a607412dfe4b5ec59d7c9a3c1b1463b94ec8a5a82b745541881952003a16 + checksum: ffc6d24df95b5458e02e2a841fac6bee6ba9f78f3f0c3ae9e465a546a3a05e91ab2781850785a6e153ce20f456b9d4427ea0754cdc8efaabf2fee5823ac5f89b languageName: node linkType: hard -"@parcel/utils@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/utils@npm:2.8.3" +"@parcel/utils@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/utils@npm:2.10.3" dependencies: - "@parcel/codeframe": 2.8.3 - "@parcel/diagnostic": 2.8.3 - "@parcel/hash": 2.8.3 - "@parcel/logger": 2.8.3 - "@parcel/markdown-ansi": 2.8.3 + "@parcel/codeframe": 2.10.3 + "@parcel/diagnostic": 2.10.3 + "@parcel/logger": 2.10.3 + "@parcel/markdown-ansi": 2.10.3 + "@parcel/rust": 2.10.3 "@parcel/source-map": ^2.1.1 chalk: ^4.1.0 - checksum: 69edf3e7c3ef1ccd4caa6ca838a64b27b27668b213212579111405824ed969e6555857b33f0b9e793e97399a60f034904addde19b98628b37a2fcbbb9141cafa + nullthrows: ^1.1.1 + checksum: fb9aa1ee1a9de81a917a58e4f0960440597accdd68d00e775d69b5ddcf6c82ceb348f412301cfaa78560f36786283cab6105d647cd6442c6be2693b2afec61f3 languageName: node linkType: hard @@ -7750,19 +7782,19 @@ __metadata: languageName: node linkType: hard -"@parcel/workers@npm:2.8.3": - version: 2.8.3 - resolution: "@parcel/workers@npm:2.8.3" +"@parcel/workers@npm:2.10.3": + version: 2.10.3 + resolution: "@parcel/workers@npm:2.10.3" dependencies: - "@parcel/diagnostic": 2.8.3 - "@parcel/logger": 2.8.3 - "@parcel/types": 2.8.3 - "@parcel/utils": 2.8.3 - chrome-trace-event: ^1.0.2 + "@parcel/diagnostic": 2.10.3 + "@parcel/logger": 2.10.3 + "@parcel/profiler": 2.10.3 + "@parcel/types": 2.10.3 + "@parcel/utils": 2.10.3 nullthrows: ^1.1.1 peerDependencies: - "@parcel/core": ^2.8.3 - checksum: e3168b3e9ee6bd8e92472e11af9228aca689c5d31841410c908ab31f2a11adf939481d9f4d945ae44d7d3ec1e07980fb3ca5c2f87be82e31a02a94f4655c8e01 + "@parcel/core": ^2.10.3 + checksum: 5418cfa25d22b1d786d754c20030b4aa081b62e96daf247459549df7f4971229635fa5ecb2860ee500af08a172f0eed689654ed867148c18ae0dae9aac1e68f2 languageName: node linkType: hard @@ -8937,6 +8969,129 @@ __metadata: languageName: node linkType: hard +"@swc/core-darwin-arm64@npm:1.3.101": + version: 1.3.101 + resolution: "@swc/core-darwin-arm64@npm:1.3.101" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@swc/core-darwin-x64@npm:1.3.101": + version: 1.3.101 + resolution: "@swc/core-darwin-x64@npm:1.3.101" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@swc/core-linux-arm-gnueabihf@npm:1.3.101": + version: 1.3.101 + resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.101" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@swc/core-linux-arm64-gnu@npm:1.3.101": + version: 1.3.101 + resolution: "@swc/core-linux-arm64-gnu@npm:1.3.101" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@swc/core-linux-arm64-musl@npm:1.3.101": + version: 1.3.101 + resolution: "@swc/core-linux-arm64-musl@npm:1.3.101" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@swc/core-linux-x64-gnu@npm:1.3.101": + version: 1.3.101 + resolution: "@swc/core-linux-x64-gnu@npm:1.3.101" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@swc/core-linux-x64-musl@npm:1.3.101": + version: 1.3.101 + resolution: "@swc/core-linux-x64-musl@npm:1.3.101" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@swc/core-win32-arm64-msvc@npm:1.3.101": + version: 1.3.101 + resolution: "@swc/core-win32-arm64-msvc@npm:1.3.101" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@swc/core-win32-ia32-msvc@npm:1.3.101": + version: 1.3.101 + resolution: "@swc/core-win32-ia32-msvc@npm:1.3.101" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@swc/core-win32-x64-msvc@npm:1.3.101": + version: 1.3.101 + resolution: "@swc/core-win32-x64-msvc@npm:1.3.101" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@swc/core@npm:^1.3.36": + version: 1.3.101 + resolution: "@swc/core@npm:1.3.101" + dependencies: + "@swc/core-darwin-arm64": 1.3.101 + "@swc/core-darwin-x64": 1.3.101 + "@swc/core-linux-arm-gnueabihf": 1.3.101 + "@swc/core-linux-arm64-gnu": 1.3.101 + "@swc/core-linux-arm64-musl": 1.3.101 + "@swc/core-linux-x64-gnu": 1.3.101 + "@swc/core-linux-x64-musl": 1.3.101 + "@swc/core-win32-arm64-msvc": 1.3.101 + "@swc/core-win32-ia32-msvc": 1.3.101 + "@swc/core-win32-x64-msvc": 1.3.101 + "@swc/counter": ^0.1.1 + "@swc/types": ^0.1.5 + peerDependencies: + "@swc/helpers": ^0.5.0 + dependenciesMeta: + "@swc/core-darwin-arm64": + optional: true + "@swc/core-darwin-x64": + optional: true + "@swc/core-linux-arm-gnueabihf": + optional: true + "@swc/core-linux-arm64-gnu": + optional: true + "@swc/core-linux-arm64-musl": + optional: true + "@swc/core-linux-x64-gnu": + optional: true + "@swc/core-linux-x64-musl": + optional: true + "@swc/core-win32-arm64-msvc": + optional: true + "@swc/core-win32-ia32-msvc": + optional: true + "@swc/core-win32-x64-msvc": + optional: true + peerDependenciesMeta: + "@swc/helpers": + optional: true + checksum: d9db5cc3306dc48e3f9fda4597c702de99851156a904be1974d69684589b52c73918270dbef06568e2ba5f9efb17a92333b361a79d1e138fad19a386c0f8c2c1 + languageName: node + linkType: hard + +"@swc/counter@npm:^0.1.1": + version: 0.1.2 + resolution: "@swc/counter@npm:0.1.2" + checksum: 8427c594f1f0cf44b83885e9c8fe1e370c9db44ae96e07a37c117a6260ee97797d0709483efbcc244e77bac578690215f45b23254c4cd8a70fb25ddbb50bf33e + languageName: node + linkType: hard + "@swc/helpers@npm:^0.3.2": version: 0.3.17 resolution: "@swc/helpers@npm:0.3.17" @@ -8946,12 +9101,19 @@ __metadata: languageName: node linkType: hard -"@swc/helpers@npm:^0.4.12": - version: 0.4.14 - resolution: "@swc/helpers@npm:0.4.14" +"@swc/helpers@npm:^0.5.0": + version: 0.5.3 + resolution: "@swc/helpers@npm:0.5.3" dependencies: tslib: ^2.4.0 - checksum: 273fd3f3fc461a92f3790cc551ea054745c6d6959afbe1232e6d7aa1c722bbc114d308aab96bef5c78fc0303c85c7b472ef00e2253251cc89737f3b1af56e5a5 + checksum: 61c3f7ccd47fc70ad91437df88be6b458cdc11e311cb331288827d7c50befffc72aa18fe913ec2a9e70fbf44e4b818bed38bfd7c329d689e1ff3c198d084cd02 + languageName: node + linkType: hard + +"@swc/types@npm:^0.1.5": + version: 0.1.5 + resolution: "@swc/types@npm:0.1.5" + checksum: 6aee11f62d3d805a64848e0bd5f0e0e615f958e327a9e1260056c368d7d28764d89e38bd8005a536c9bf18afbcd303edd84099d60df34a2975d62540f61df13b languageName: node linkType: hard @@ -13469,7 +13631,7 @@ __metadata: languageName: node linkType: hard -"chrome-trace-event@npm:^1.0.2": +"chrome-trace-event@npm:^1.0.2, chrome-trace-event@npm:^1.0.3": version: 1.0.3 resolution: "chrome-trace-event@npm:1.0.3" checksum: cb8b1fc7e881aaef973bd0c4a43cd353c2ad8323fb471a041e64f7c2dd849cde4aad15f8b753331a32dda45c973f032c8a03b8177fc85d60eaa75e91e08bfb97 @@ -15321,6 +15483,13 @@ __metadata: languageName: node linkType: hard +"detect-libc@npm:^2.0.1": + version: 2.0.2 + resolution: "detect-libc@npm:2.0.2" + checksum: 2b2cd3649b83d576f4be7cc37eb3b1815c79969c8b1a03a40a4d55d83bc74d010753485753448eacb98784abf22f7dbd3911fd3b60e29fda28fed2d1a997944d + languageName: node + linkType: hard + "detect-newline@npm:^3.0.0": version: 3.1.0 resolution: "detect-newline@npm:3.1.0" @@ -22835,21 +23004,21 @@ __metadata: languageName: node linkType: hard -"lmdb@npm:2.5.2": - version: 2.5.2 - resolution: "lmdb@npm:2.5.2" - dependencies: - "@lmdb/lmdb-darwin-arm64": 2.5.2 - "@lmdb/lmdb-darwin-x64": 2.5.2 - "@lmdb/lmdb-linux-arm": 2.5.2 - "@lmdb/lmdb-linux-arm64": 2.5.2 - "@lmdb/lmdb-linux-x64": 2.5.2 - "@lmdb/lmdb-win32-x64": 2.5.2 - msgpackr: ^1.5.4 - node-addon-api: ^4.3.0 +"lmdb@npm:2.8.5": + version: 2.8.5 + resolution: "lmdb@npm:2.8.5" + dependencies: + "@lmdb/lmdb-darwin-arm64": 2.8.5 + "@lmdb/lmdb-darwin-x64": 2.8.5 + "@lmdb/lmdb-linux-arm": 2.8.5 + "@lmdb/lmdb-linux-arm64": 2.8.5 + "@lmdb/lmdb-linux-x64": 2.8.5 + "@lmdb/lmdb-win32-x64": 2.8.5 + msgpackr: ^1.9.5 + node-addon-api: ^6.1.0 node-gyp: latest - node-gyp-build-optional-packages: 5.0.3 - ordered-binary: ^1.2.4 + node-gyp-build-optional-packages: 5.1.1 + ordered-binary: ^1.4.1 weak-lru-cache: ^1.2.2 dependenciesMeta: "@lmdb/lmdb-darwin-arm64": @@ -22864,7 +23033,9 @@ __metadata: optional: true "@lmdb/lmdb-win32-x64": optional: true - checksum: 3362dc2b03c6fbdfc02291001007e4096767476e65fbf8d5e332ef473946a0d108319748ef5974ebb84cf6ffa4015c039920f130bcc09c03a751b03a9fd93dff + bin: + download-lmdb-prebuilds: bin/download-prebuilds.js + checksum: b1ec76650d3b19d4c966cd7a4ee2324270c7d20f46b569d23bc287c7c7e7da667d3d330aa78be1aa2717af63b3531cd1d53a5ee4faf1c293c038513e4f3aa832 languageName: node linkType: hard @@ -24477,15 +24648,15 @@ __metadata: languageName: node linkType: hard -"msgpackr@npm:^1.5.4": - version: 1.9.5 - resolution: "msgpackr@npm:1.9.5" +"msgpackr@npm:^1.9.5, msgpackr@npm:^1.9.9": + version: 1.10.1 + resolution: "msgpackr@npm:1.10.1" dependencies: msgpackr-extract: ^3.0.2 dependenciesMeta: msgpackr-extract: optional: true - checksum: 4a9ebbdd61b985aeb47072f65b242e21a65fba90372dc45927d1a9aba2d0f7fbdb84fbe7c2ea224444c58040e2a81f6778582c16ecaf883a471613c3e9aa4bc3 + checksum: e422d18b01051598b23701eebeb4b9e2c686b9c7826b20f564724837ba2b5cd4af74c91a549eaeaf8186645cc95e8196274a4a19442aa3286ac611b98069c194 languageName: node linkType: hard @@ -24761,12 +24932,12 @@ __metadata: languageName: node linkType: hard -"node-addon-api@npm:^4.3.0": - version: 4.3.0 - resolution: "node-addon-api@npm:4.3.0" +"node-addon-api@npm:^6.1.0": + version: 6.1.0 + resolution: "node-addon-api@npm:6.1.0" dependencies: node-gyp: latest - checksum: 3de396e23cc209f539c704583e8e99c148850226f6e389a641b92e8967953713228109f919765abc1f4355e801e8f41842f96210b8d61c7dcc10a477002dcf00 + checksum: 3a539510e677cfa3a833aca5397300e36141aca064cdc487554f2017110709a03a95da937e98c2a14ec3c626af7b2d1b6dabe629a481f9883143d0d5bff07bf2 languageName: node linkType: hard @@ -24826,25 +24997,27 @@ __metadata: languageName: node linkType: hard -"node-gyp-build-optional-packages@npm:5.0.3": - version: 5.0.3 - resolution: "node-gyp-build-optional-packages@npm:5.0.3" +"node-gyp-build-optional-packages@npm:5.0.7": + version: 5.0.7 + resolution: "node-gyp-build-optional-packages@npm:5.0.7" bin: node-gyp-build-optional-packages: bin.js node-gyp-build-optional-packages-optional: optional.js node-gyp-build-optional-packages-test: build-test.js - checksum: be3f0235925c8361e5bc1a03848f5e24815b0df8aa90bd13f1eac91cd86264bbb8b7689ca6cd083b02c8099c7b54f9fb83066c7bb77c2389dc4eceab921f084f + checksum: bcb4537af15bcb3811914ea0db8f69284ca10db1cc7543a167a4c41ae4b9b5044b133f789fdadad0b7adc6931f6ae7def3c75b0bc7b05836881aae52400163e6 languageName: node linkType: hard -"node-gyp-build-optional-packages@npm:5.0.7": - version: 5.0.7 - resolution: "node-gyp-build-optional-packages@npm:5.0.7" +"node-gyp-build-optional-packages@npm:5.1.1": + version: 5.1.1 + resolution: "node-gyp-build-optional-packages@npm:5.1.1" + dependencies: + detect-libc: ^2.0.1 bin: node-gyp-build-optional-packages: bin.js node-gyp-build-optional-packages-optional: optional.js node-gyp-build-optional-packages-test: build-test.js - checksum: bcb4537af15bcb3811914ea0db8f69284ca10db1cc7543a167a4c41ae4b9b5044b133f789fdadad0b7adc6931f6ae7def3c75b0bc7b05836881aae52400163e6 + checksum: f3cb197862516e6879377adaa58142ae9013ab69c86cf2645f8b008db339354145d8ebd9140a13ec7ece5ce28a372ca7e14660379d3a3dd7b908a6f2743606e9 languageName: node linkType: hard @@ -25412,10 +25585,10 @@ __metadata: languageName: node linkType: hard -"ordered-binary@npm:^1.2.4": - version: 1.4.1 - resolution: "ordered-binary@npm:1.4.1" - checksum: 274940b4ef983562e11371c84415c265432a4e1337ab85f8e7669eeab6afee8f655c6c12ecee1cd121aaf399c32f5c781b0d50e460bd42da004eba16dcc66574 +"ordered-binary@npm:^1.4.1": + version: 1.5.1 + resolution: "ordered-binary@npm:1.5.1" + checksum: ec4d3a6bd7f8c84afec9def1e599e7d460a45d11f94d07b16fdf62db4d2bc16405d79ef0277c2fdf86332fd2539761278981787d2ecf52376ade8b678104a0e6 languageName: node linkType: hard @@ -25654,27 +25827,27 @@ __metadata: languageName: node linkType: hard -"parcel@npm:2.8.3": - version: 2.8.3 - resolution: "parcel@npm:2.8.3" +"parcel@npm:2.10.3": + version: 2.10.3 + resolution: "parcel@npm:2.10.3" dependencies: - "@parcel/config-default": 2.8.3 - "@parcel/core": 2.8.3 - "@parcel/diagnostic": 2.8.3 - "@parcel/events": 2.8.3 - "@parcel/fs": 2.8.3 - "@parcel/logger": 2.8.3 - "@parcel/package-manager": 2.8.3 - "@parcel/reporter-cli": 2.8.3 - "@parcel/reporter-dev-server": 2.8.3 - "@parcel/utils": 2.8.3 + "@parcel/config-default": 2.10.3 + "@parcel/core": 2.10.3 + "@parcel/diagnostic": 2.10.3 + "@parcel/events": 2.10.3 + "@parcel/fs": 2.10.3 + "@parcel/logger": 2.10.3 + "@parcel/package-manager": 2.10.3 + "@parcel/reporter-cli": 2.10.3 + "@parcel/reporter-dev-server": 2.10.3 + "@parcel/reporter-tracer": 2.10.3 + "@parcel/utils": 2.10.3 chalk: ^4.1.0 commander: ^7.0.0 get-port: ^4.2.0 - v8-compile-cache: ^2.0.0 bin: parcel: lib/bin.js - checksum: 09cd2dc23c2ec0417e9de93face185a08679d744c6cbb627fce6ffb507f8af1f8d0642f063e0cf771b699419a29db8ee7ca60cdb32966a65dd3b03da35473bfa + checksum: 3a277e8e85064227b2d3335520b272023b887df6ef4a8b56a145e00bec7c1fab581081bb0d9bdad026dc4fee64e622ae6386da2d34cc716e7a83ad97ac970100 languageName: node linkType: hard @@ -29190,7 +29363,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.5.4, semver@npm:^7.5.4": +"semver@npm:7.5.4, semver@npm:^7.5.2, semver@npm:^7.5.4": version: 7.5.4 resolution: "semver@npm:7.5.4" dependencies: @@ -29201,15 +29374,6 @@ __metadata: languageName: node linkType: hard -"semver@npm:^5.7.1": - version: 5.7.2 - resolution: "semver@npm:5.7.2" - bin: - semver: bin/semver - checksum: fb4ab5e0dd1c22ce0c937ea390b4a822147a9c53dbd2a9a0132f12fe382902beef4fbf12cf51bb955248d8d15874ce8cd89532569756384f994309825f10b686 - languageName: node - linkType: hard - "semver@npm:^6.0.0, semver@npm:^6.1.0, semver@npm:^6.1.1, semver@npm:^6.1.2, semver@npm:^6.3.0": version: 6.3.0 resolution: "semver@npm:6.3.0" @@ -31054,20 +31218,6 @@ __metadata: languageName: node linkType: hard -"terser@npm:^5.2.0": - version: 5.19.2 - resolution: "terser@npm:5.19.2" - dependencies: - "@jridgewell/source-map": ^0.3.3 - acorn: ^8.8.2 - commander: ^2.20.0 - source-map-support: ~0.5.20 - bin: - terser: bin/terser - checksum: e059177775b4d4f4cff219ad89293175aefbd1b081252270444dc83e42a2c5f07824eb2a85eae6e22ef6eb7ef04b21af36dd7d1dd7cfb93912310e57d416a205 - languageName: node - linkType: hard - "test-exclude@npm:^6.0.0": version: 6.0.0 resolution: "test-exclude@npm:6.0.0" @@ -32428,13 +32578,6 @@ __metadata: languageName: node linkType: hard -"v8-compile-cache@npm:^2.0.0": - version: 2.3.0 - resolution: "v8-compile-cache@npm:2.3.0" - checksum: adb0a271eaa2297f2f4c536acbfee872d0dd26ec2d76f66921aa7fc437319132773483344207bdbeee169225f4739016d8d2dbf0553913a52bb34da6d0334f8e - languageName: node - linkType: hard - "v8-to-istanbul@npm:^8.1.0": version: 8.1.1 resolution: "v8-to-istanbul@npm:8.1.1" @@ -33608,13 +33751,6 @@ __metadata: languageName: node linkType: hard -"xxhash-wasm@npm:^0.4.2": - version: 0.4.2 - resolution: "xxhash-wasm@npm:0.4.2" - checksum: 747b32fcfed1dc9a1e7592b134e4e65794bc10fd5d32515792e486bf4d0b65f9dec790cfc49ce2f9c01dd02e3593c3a6cd51df1ef37adf003c5bbd386c43c64d - languageName: node - linkType: hard - "y18n@npm:^4.0.0": version: 4.0.3 resolution: "y18n@npm:4.0.3" From dc1b554b829f32a47c7b86d17604c82772e8a687 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Fri, 29 Dec 2023 01:07:50 +0100 Subject: [PATCH 71/77] chore: bumped yarn and node to the latest minor version --- .yarn/releases/yarn-3.3.1.cjs | 823 -------------------------------- .yarn/releases/yarn-3.7.0.cjs | 875 ++++++++++++++++++++++++++++++++++ .yarnrc.yml | 2 +- bot-pinner/package.json | 5 +- contracts/package.json | 6 +- package.json | 6 +- subgraph/package.json | 4 +- web/package.json | 6 +- yarn.lock | 8 +- 9 files changed, 894 insertions(+), 841 deletions(-) delete mode 100755 .yarn/releases/yarn-3.3.1.cjs create mode 100755 .yarn/releases/yarn-3.7.0.cjs diff --git a/.yarn/releases/yarn-3.3.1.cjs b/.yarn/releases/yarn-3.3.1.cjs deleted file mode 100755 index 53a282e43..000000000 --- a/.yarn/releases/yarn-3.3.1.cjs +++ /dev/null @@ -1,823 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable */ -//prettier-ignore -(()=>{var dfe=Object.create;var jS=Object.defineProperty;var Cfe=Object.getOwnPropertyDescriptor;var mfe=Object.getOwnPropertyNames;var Efe=Object.getPrototypeOf,Ife=Object.prototype.hasOwnProperty;var J=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var y=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ht=(r,e)=>{for(var t in e)jS(r,t,{get:e[t],enumerable:!0})},yfe=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of mfe(e))!Ife.call(r,n)&&n!==t&&jS(r,n,{get:()=>e[n],enumerable:!(i=Cfe(e,n))||i.enumerable});return r};var ne=(r,e,t)=>(t=r!=null?dfe(Efe(r)):{},yfe(e||!r||!r.__esModule?jS(t,"default",{value:r,enumerable:!0}):t,r));var aK=y((uZe,oK)=>{oK.exports=sK;sK.sync=Gfe;var iK=J("fs");function Hfe(r,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var i=0;i{uK.exports=lK;lK.sync=Yfe;var AK=J("fs");function lK(r,e,t){AK.stat(r,function(i,n){t(i,i?!1:cK(n,e))})}function Yfe(r,e){return cK(AK.statSync(r),e)}function cK(r,e){return r.isFile()&&jfe(r,e)}function jfe(r,e){var t=r.mode,i=r.uid,n=r.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),l=parseInt("010",8),c=parseInt("001",8),u=a|l,g=t&c||t&l&&n===o||t&a&&i===s||t&u&&s===0;return g}});var hK=y((hZe,fK)=>{var fZe=J("fs"),OI;process.platform==="win32"||global.TESTING_WINDOWS?OI=aK():OI=gK();fK.exports=av;av.sync=qfe;function av(r,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){av(r,e||{},function(s,o){s?n(s):i(o)})})}OI(r,e||{},function(i,n){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,n=!1),t(i,n)})}function qfe(r,e){try{return OI.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var yK=y((pZe,IK)=>{var _g=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",pK=J("path"),Jfe=_g?";":":",dK=hK(),CK=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),mK=(r,e)=>{let t=e.colon||Jfe,i=r.match(/\//)||_g&&r.match(/\\/)?[""]:[..._g?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],n=_g?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=_g?n.split(t):[""];return _g&&r.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},EK=(r,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:i,pathExt:n,pathExtExe:s}=mK(r,e),o=[],a=c=>new Promise((u,g)=>{if(c===i.length)return e.all&&o.length?u(o):g(CK(r));let f=i[c],h=/^".*"$/.test(f)?f.slice(1,-1):f,p=pK.join(h,r),C=!h&&/^\.[\\\/]/.test(r)?r.slice(0,2)+p:p;u(l(C,c,0))}),l=(c,u,g)=>new Promise((f,h)=>{if(g===n.length)return f(a(u+1));let p=n[g];dK(c+p,{pathExt:s},(C,w)=>{if(!C&&w)if(e.all)o.push(c+p);else return f(c+p);return f(l(c,u,g+1))})});return t?a(0).then(c=>t(null,c),t):a(0)},Wfe=(r,e)=>{e=e||{};let{pathEnv:t,pathExt:i,pathExtExe:n}=mK(r,e),s=[];for(let o=0;o{"use strict";var wK=(r={})=>{let e=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};Av.exports=wK;Av.exports.default=wK});var vK=y((CZe,SK)=>{"use strict";var bK=J("path"),zfe=yK(),Vfe=BK();function QK(r,e){let t=r.options.env||process.env,i=process.cwd(),n=r.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(r.options.cwd)}catch{}let o;try{o=zfe.sync(r.command,{path:t[Vfe({env:t})],pathExt:e?bK.delimiter:void 0})}catch{}finally{s&&process.chdir(i)}return o&&(o=bK.resolve(n?r.options.cwd:"",o)),o}function Xfe(r){return QK(r)||QK(r,!0)}SK.exports=Xfe});var xK=y((mZe,cv)=>{"use strict";var lv=/([()\][%!^"`<>&|;, *?])/g;function _fe(r){return r=r.replace(lv,"^$1"),r}function Zfe(r,e){return r=`${r}`,r=r.replace(/(\\*)"/g,'$1$1\\"'),r=r.replace(/(\\*)$/,"$1$1"),r=`"${r}"`,r=r.replace(lv,"^$1"),e&&(r=r.replace(lv,"^$1")),r}cv.exports.command=_fe;cv.exports.argument=Zfe});var DK=y((EZe,PK)=>{"use strict";PK.exports=/^#!(.*)/});var RK=y((IZe,kK)=>{"use strict";var $fe=DK();kK.exports=(r="")=>{let e=r.match($fe);if(!e)return null;let[t,i]=e[0].replace(/#! ?/,"").split(" "),n=t.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n}});var NK=y((yZe,FK)=>{"use strict";var uv=J("fs"),ehe=RK();function the(r){let t=Buffer.alloc(150),i;try{i=uv.openSync(r,"r"),uv.readSync(i,t,0,150,0),uv.closeSync(i)}catch{}return ehe(t.toString())}FK.exports=the});var MK=y((wZe,OK)=>{"use strict";var rhe=J("path"),TK=vK(),LK=xK(),ihe=NK(),nhe=process.platform==="win32",she=/\.(?:com|exe)$/i,ohe=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function ahe(r){r.file=TK(r);let e=r.file&&ihe(r.file);return e?(r.args.unshift(r.file),r.command=e,TK(r)):r.file}function Ahe(r){if(!nhe)return r;let e=ahe(r),t=!she.test(e);if(r.options.forceShell||t){let i=ohe.test(e);r.command=rhe.normalize(r.command),r.command=LK.command(r.command),r.args=r.args.map(s=>LK.argument(s,i));let n=[r.command].concat(r.args).join(" ");r.args=["/d","/s","/c",`"${n}"`],r.command=process.env.comspec||"cmd.exe",r.options.windowsVerbatimArguments=!0}return r}function lhe(r,e,t){e&&!Array.isArray(e)&&(t=e,e=null),e=e?e.slice(0):[],t=Object.assign({},t);let i={command:r,args:e,options:t,file:void 0,original:{command:r,args:e}};return t.shell?i:Ahe(i)}OK.exports=lhe});var HK=y((BZe,KK)=>{"use strict";var gv=process.platform==="win32";function fv(r,e){return Object.assign(new Error(`${e} ${r.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${r.command}`,path:r.command,spawnargs:r.args})}function che(r,e){if(!gv)return;let t=r.emit;r.emit=function(i,n){if(i==="exit"){let s=UK(n,e,"spawn");if(s)return t.call(r,"error",s)}return t.apply(r,arguments)}}function UK(r,e){return gv&&r===1&&!e.file?fv(e.original,"spawn"):null}function uhe(r,e){return gv&&r===1&&!e.file?fv(e.original,"spawnSync"):null}KK.exports={hookChildProcess:che,verifyENOENT:UK,verifyENOENTSync:uhe,notFoundError:fv}});var dv=y((bZe,Zg)=>{"use strict";var GK=J("child_process"),hv=MK(),pv=HK();function YK(r,e,t){let i=hv(r,e,t),n=GK.spawn(i.command,i.args,i.options);return pv.hookChildProcess(n,i),n}function ghe(r,e,t){let i=hv(r,e,t),n=GK.spawnSync(i.command,i.args,i.options);return n.error=n.error||pv.verifyENOENTSync(n.status,i),n}Zg.exports=YK;Zg.exports.spawn=YK;Zg.exports.sync=ghe;Zg.exports._parse=hv;Zg.exports._enoent=pv});var qK=y((QZe,jK)=>{"use strict";function fhe(r,e){function t(){this.constructor=r}t.prototype=e.prototype,r.prototype=new t}function uc(r,e,t,i){this.message=r,this.expected=e,this.found=t,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,uc)}fhe(uc,Error);uc.buildMessage=function(r,e){var t={literal:function(c){return'"'+n(c.text)+'"'},class:function(c){var u="",g;for(g=0;g0){for(g=1,f=1;g>",re=de(">>",!1),me=">&",tt=de(">&",!1),Rt=">",It=de(">",!1),Ur="<<<",oi=de("<<<",!1),pi="<&",pr=de("<&",!1),di="<",ai=de("<",!1),Os=function(m){return{type:"argument",segments:[].concat(...m)}},dr=function(m){return m},Bi="$'",_n=de("$'",!1),pa="'",EA=de("'",!1),kg=function(m){return[{type:"text",text:m}]},Zn='""',IA=de('""',!1),da=function(){return{type:"text",text:""}},Jp='"',yA=de('"',!1),wA=function(m){return m},Br=function(m){return{type:"arithmetic",arithmetic:m,quoted:!0}},Vl=function(m){return{type:"shell",shell:m,quoted:!0}},Rg=function(m){return{type:"variable",...m,quoted:!0}},Eo=function(m){return{type:"text",text:m}},Fg=function(m){return{type:"arithmetic",arithmetic:m,quoted:!1}},Wp=function(m){return{type:"shell",shell:m,quoted:!1}},zp=function(m){return{type:"variable",...m,quoted:!1}},Pr=function(m){return{type:"glob",pattern:m}},oe=/^[^']/,Io=Ye(["'"],!0,!1),kn=function(m){return m.join("")},Ng=/^[^$"]/,bt=Ye(["$",'"'],!0,!1),Xl=`\\ -`,Rn=de(`\\ -`,!1),$n=function(){return""},es="\\",ut=de("\\",!1),yo=/^[\\$"`]/,at=Ye(["\\","$",'"',"`"],!1,!1),ln=function(m){return m},S="\\a",Lt=de("\\a",!1),Tg=function(){return"a"},_l="\\b",Vp=de("\\b",!1),Xp=function(){return"\b"},_p=/^[Ee]/,Zp=Ye(["E","e"],!1,!1),$p=function(){return"\x1B"},G="\\f",yt=de("\\f",!1),BA=function(){return"\f"},Wi="\\n",Zl=de("\\n",!1),We=function(){return` -`},Ca="\\r",Lg=de("\\r",!1),uI=function(){return"\r"},ed="\\t",gI=de("\\t",!1),ar=function(){return" "},Fn="\\v",$l=de("\\v",!1),td=function(){return"\v"},Ms=/^[\\'"?]/,ma=Ye(["\\","'",'"',"?"],!1,!1),cn=function(m){return String.fromCharCode(parseInt(m,16))},ke="\\x",Og=de("\\x",!1),ec="\\u",Us=de("\\u",!1),tc="\\U",bA=de("\\U",!1),Mg=function(m){return String.fromCodePoint(parseInt(m,16))},Ug=/^[0-7]/,Ea=Ye([["0","7"]],!1,!1),Ia=/^[0-9a-fA-f]/,$e=Ye([["0","9"],["a","f"],["A","f"]],!1,!1),wo=rt(),QA="-",rc=de("-",!1),Ks="+",ic=de("+",!1),fI=".",rd=de(".",!1),Kg=function(m,Q,F){return{type:"number",value:(m==="-"?-1:1)*parseFloat(Q.join("")+"."+F.join(""))}},id=function(m,Q){return{type:"number",value:(m==="-"?-1:1)*parseInt(Q.join(""))}},hI=function(m){return{type:"variable",...m}},nc=function(m){return{type:"variable",name:m}},pI=function(m){return m},Hg="*",SA=de("*",!1),Nr="/",dI=de("/",!1),Hs=function(m,Q,F){return{type:Q==="*"?"multiplication":"division",right:F}},Gs=function(m,Q){return Q.reduce((F,K)=>({left:F,...K}),m)},Gg=function(m,Q,F){return{type:Q==="+"?"addition":"subtraction",right:F}},vA="$((",R=de("$((",!1),q="))",pe=de("))",!1),Ne=function(m){return m},xe="$(",qe=de("$(",!1),dt=function(m){return m},Ft="${",Nn=de("${",!1),vS=":-",AU=de(":-",!1),lU=function(m,Q){return{name:m,defaultValue:Q}},xS=":-}",cU=de(":-}",!1),uU=function(m){return{name:m,defaultValue:[]}},PS=":+",gU=de(":+",!1),fU=function(m,Q){return{name:m,alternativeValue:Q}},DS=":+}",hU=de(":+}",!1),pU=function(m){return{name:m,alternativeValue:[]}},kS=function(m){return{name:m}},dU="$",CU=de("$",!1),mU=function(m){return e.isGlobPattern(m)},EU=function(m){return m},RS=/^[a-zA-Z0-9_]/,FS=Ye([["a","z"],["A","Z"],["0","9"],"_"],!1,!1),NS=function(){return O()},TS=/^[$@*?#a-zA-Z0-9_\-]/,LS=Ye(["$","@","*","?","#",["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),IU=/^[(){}<>$|&; \t"']/,Yg=Ye(["(",")","{","}","<",">","$","|","&",";"," "," ",'"',"'"],!1,!1),OS=/^[<>&; \t"']/,MS=Ye(["<",">","&",";"," "," ",'"',"'"],!1,!1),CI=/^[ \t]/,mI=Ye([" "," "],!1,!1),b=0,Fe=0,xA=[{line:1,column:1}],d=0,E=[],I=0,k;if("startRule"in e){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');n=i[e.startRule]}function O(){return r.substring(Fe,b)}function X(){return Et(Fe,b)}function te(m,Q){throw Q=Q!==void 0?Q:Et(Fe,b),Fi([At(m)],r.substring(Fe,b),Q)}function ye(m,Q){throw Q=Q!==void 0?Q:Et(Fe,b),Tn(m,Q)}function de(m,Q){return{type:"literal",text:m,ignoreCase:Q}}function Ye(m,Q,F){return{type:"class",parts:m,inverted:Q,ignoreCase:F}}function rt(){return{type:"any"}}function wt(){return{type:"end"}}function At(m){return{type:"other",description:m}}function et(m){var Q=xA[m],F;if(Q)return Q;for(F=m-1;!xA[F];)F--;for(Q=xA[F],Q={line:Q.line,column:Q.column};Fd&&(d=b,E=[]),E.push(m))}function Tn(m,Q){return new uc(m,null,null,Q)}function Fi(m,Q,F){return new uc(uc.buildMessage(m,Q),m,Q,F)}function PA(){var m,Q;return m=b,Q=Kr(),Q===t&&(Q=null),Q!==t&&(Fe=m,Q=s(Q)),m=Q,m}function Kr(){var m,Q,F,K,ce;if(m=b,Q=Hr(),Q!==t){for(F=[],K=Me();K!==t;)F.push(K),K=Me();F!==t?(K=ya(),K!==t?(ce=ts(),ce===t&&(ce=null),ce!==t?(Fe=m,Q=o(Q,K,ce),m=Q):(b=m,m=t)):(b=m,m=t)):(b=m,m=t)}else b=m,m=t;if(m===t)if(m=b,Q=Hr(),Q!==t){for(F=[],K=Me();K!==t;)F.push(K),K=Me();F!==t?(K=ya(),K===t&&(K=null),K!==t?(Fe=m,Q=a(Q,K),m=Q):(b=m,m=t)):(b=m,m=t)}else b=m,m=t;return m}function ts(){var m,Q,F,K,ce;for(m=b,Q=[],F=Me();F!==t;)Q.push(F),F=Me();if(Q!==t)if(F=Kr(),F!==t){for(K=[],ce=Me();ce!==t;)K.push(ce),ce=Me();K!==t?(Fe=m,Q=l(F),m=Q):(b=m,m=t)}else b=m,m=t;else b=m,m=t;return m}function ya(){var m;return r.charCodeAt(b)===59?(m=c,b++):(m=t,I===0&&Be(u)),m===t&&(r.charCodeAt(b)===38?(m=g,b++):(m=t,I===0&&Be(f))),m}function Hr(){var m,Q,F;return m=b,Q=yU(),Q!==t?(F=$ge(),F===t&&(F=null),F!==t?(Fe=m,Q=h(Q,F),m=Q):(b=m,m=t)):(b=m,m=t),m}function $ge(){var m,Q,F,K,ce,Qe,ft;for(m=b,Q=[],F=Me();F!==t;)Q.push(F),F=Me();if(Q!==t)if(F=efe(),F!==t){for(K=[],ce=Me();ce!==t;)K.push(ce),ce=Me();if(K!==t)if(ce=Hr(),ce!==t){for(Qe=[],ft=Me();ft!==t;)Qe.push(ft),ft=Me();Qe!==t?(Fe=m,Q=p(F,ce),m=Q):(b=m,m=t)}else b=m,m=t;else b=m,m=t}else b=m,m=t;else b=m,m=t;return m}function efe(){var m;return r.substr(b,2)===C?(m=C,b+=2):(m=t,I===0&&Be(w)),m===t&&(r.substr(b,2)===B?(m=B,b+=2):(m=t,I===0&&Be(v))),m}function yU(){var m,Q,F;return m=b,Q=ife(),Q!==t?(F=tfe(),F===t&&(F=null),F!==t?(Fe=m,Q=D(Q,F),m=Q):(b=m,m=t)):(b=m,m=t),m}function tfe(){var m,Q,F,K,ce,Qe,ft;for(m=b,Q=[],F=Me();F!==t;)Q.push(F),F=Me();if(Q!==t)if(F=rfe(),F!==t){for(K=[],ce=Me();ce!==t;)K.push(ce),ce=Me();if(K!==t)if(ce=yU(),ce!==t){for(Qe=[],ft=Me();ft!==t;)Qe.push(ft),ft=Me();Qe!==t?(Fe=m,Q=T(F,ce),m=Q):(b=m,m=t)}else b=m,m=t;else b=m,m=t}else b=m,m=t;else b=m,m=t;return m}function rfe(){var m;return r.substr(b,2)===H?(m=H,b+=2):(m=t,I===0&&Be(j)),m===t&&(r.charCodeAt(b)===124?(m=$,b++):(m=t,I===0&&Be(V))),m}function EI(){var m,Q,F,K,ce,Qe;if(m=b,Q=FU(),Q!==t)if(r.charCodeAt(b)===61?(F=W,b++):(F=t,I===0&&Be(Z)),F!==t)if(K=bU(),K!==t){for(ce=[],Qe=Me();Qe!==t;)ce.push(Qe),Qe=Me();ce!==t?(Fe=m,Q=A(Q,K),m=Q):(b=m,m=t)}else b=m,m=t;else b=m,m=t;else b=m,m=t;if(m===t)if(m=b,Q=FU(),Q!==t)if(r.charCodeAt(b)===61?(F=W,b++):(F=t,I===0&&Be(Z)),F!==t){for(K=[],ce=Me();ce!==t;)K.push(ce),ce=Me();K!==t?(Fe=m,Q=ae(Q),m=Q):(b=m,m=t)}else b=m,m=t;else b=m,m=t;return m}function ife(){var m,Q,F,K,ce,Qe,ft,Bt,Vr,Ci,rs;for(m=b,Q=[],F=Me();F!==t;)Q.push(F),F=Me();if(Q!==t)if(r.charCodeAt(b)===40?(F=ge,b++):(F=t,I===0&&Be(_)),F!==t){for(K=[],ce=Me();ce!==t;)K.push(ce),ce=Me();if(K!==t)if(ce=Kr(),ce!==t){for(Qe=[],ft=Me();ft!==t;)Qe.push(ft),ft=Me();if(Qe!==t)if(r.charCodeAt(b)===41?(ft=L,b++):(ft=t,I===0&&Be(N)),ft!==t){for(Bt=[],Vr=Me();Vr!==t;)Bt.push(Vr),Vr=Me();if(Bt!==t){for(Vr=[],Ci=nd();Ci!==t;)Vr.push(Ci),Ci=nd();if(Vr!==t){for(Ci=[],rs=Me();rs!==t;)Ci.push(rs),rs=Me();Ci!==t?(Fe=m,Q=ue(ce,Vr),m=Q):(b=m,m=t)}else b=m,m=t}else b=m,m=t}else b=m,m=t;else b=m,m=t}else b=m,m=t;else b=m,m=t}else b=m,m=t;else b=m,m=t;if(m===t){for(m=b,Q=[],F=Me();F!==t;)Q.push(F),F=Me();if(Q!==t)if(r.charCodeAt(b)===123?(F=we,b++):(F=t,I===0&&Be(Te)),F!==t){for(K=[],ce=Me();ce!==t;)K.push(ce),ce=Me();if(K!==t)if(ce=Kr(),ce!==t){for(Qe=[],ft=Me();ft!==t;)Qe.push(ft),ft=Me();if(Qe!==t)if(r.charCodeAt(b)===125?(ft=Pe,b++):(ft=t,I===0&&Be(Le)),ft!==t){for(Bt=[],Vr=Me();Vr!==t;)Bt.push(Vr),Vr=Me();if(Bt!==t){for(Vr=[],Ci=nd();Ci!==t;)Vr.push(Ci),Ci=nd();if(Vr!==t){for(Ci=[],rs=Me();rs!==t;)Ci.push(rs),rs=Me();Ci!==t?(Fe=m,Q=se(ce,Vr),m=Q):(b=m,m=t)}else b=m,m=t}else b=m,m=t}else b=m,m=t;else b=m,m=t}else b=m,m=t;else b=m,m=t}else b=m,m=t;else b=m,m=t;if(m===t){for(m=b,Q=[],F=Me();F!==t;)Q.push(F),F=Me();if(Q!==t){for(F=[],K=EI();K!==t;)F.push(K),K=EI();if(F!==t){for(K=[],ce=Me();ce!==t;)K.push(ce),ce=Me();if(K!==t){if(ce=[],Qe=BU(),Qe!==t)for(;Qe!==t;)ce.push(Qe),Qe=BU();else ce=t;if(ce!==t){for(Qe=[],ft=Me();ft!==t;)Qe.push(ft),ft=Me();Qe!==t?(Fe=m,Q=Ae(F,ce),m=Q):(b=m,m=t)}else b=m,m=t}else b=m,m=t}else b=m,m=t}else b=m,m=t;if(m===t){for(m=b,Q=[],F=Me();F!==t;)Q.push(F),F=Me();if(Q!==t){if(F=[],K=EI(),K!==t)for(;K!==t;)F.push(K),K=EI();else F=t;if(F!==t){for(K=[],ce=Me();ce!==t;)K.push(ce),ce=Me();K!==t?(Fe=m,Q=be(F),m=Q):(b=m,m=t)}else b=m,m=t}else b=m,m=t}}}return m}function wU(){var m,Q,F,K,ce;for(m=b,Q=[],F=Me();F!==t;)Q.push(F),F=Me();if(Q!==t){if(F=[],K=II(),K!==t)for(;K!==t;)F.push(K),K=II();else F=t;if(F!==t){for(K=[],ce=Me();ce!==t;)K.push(ce),ce=Me();K!==t?(Fe=m,Q=fe(F),m=Q):(b=m,m=t)}else b=m,m=t}else b=m,m=t;return m}function BU(){var m,Q,F;for(m=b,Q=[],F=Me();F!==t;)Q.push(F),F=Me();if(Q!==t?(F=nd(),F!==t?(Fe=m,Q=le(F),m=Q):(b=m,m=t)):(b=m,m=t),m===t){for(m=b,Q=[],F=Me();F!==t;)Q.push(F),F=Me();Q!==t?(F=II(),F!==t?(Fe=m,Q=le(F),m=Q):(b=m,m=t)):(b=m,m=t)}return m}function nd(){var m,Q,F,K,ce;for(m=b,Q=[],F=Me();F!==t;)Q.push(F),F=Me();return Q!==t?(Ge.test(r.charAt(b))?(F=r.charAt(b),b++):(F=t,I===0&&Be(ie)),F===t&&(F=null),F!==t?(K=nfe(),K!==t?(ce=II(),ce!==t?(Fe=m,Q=Y(F,K,ce),m=Q):(b=m,m=t)):(b=m,m=t)):(b=m,m=t)):(b=m,m=t),m}function nfe(){var m;return r.substr(b,2)===he?(m=he,b+=2):(m=t,I===0&&Be(re)),m===t&&(r.substr(b,2)===me?(m=me,b+=2):(m=t,I===0&&Be(tt)),m===t&&(r.charCodeAt(b)===62?(m=Rt,b++):(m=t,I===0&&Be(It)),m===t&&(r.substr(b,3)===Ur?(m=Ur,b+=3):(m=t,I===0&&Be(oi)),m===t&&(r.substr(b,2)===pi?(m=pi,b+=2):(m=t,I===0&&Be(pr)),m===t&&(r.charCodeAt(b)===60?(m=di,b++):(m=t,I===0&&Be(ai))))))),m}function II(){var m,Q,F;for(m=b,Q=[],F=Me();F!==t;)Q.push(F),F=Me();return Q!==t?(F=bU(),F!==t?(Fe=m,Q=le(F),m=Q):(b=m,m=t)):(b=m,m=t),m}function bU(){var m,Q,F;if(m=b,Q=[],F=QU(),F!==t)for(;F!==t;)Q.push(F),F=QU();else Q=t;return Q!==t&&(Fe=m,Q=Os(Q)),m=Q,m}function QU(){var m,Q;return m=b,Q=sfe(),Q!==t&&(Fe=m,Q=dr(Q)),m=Q,m===t&&(m=b,Q=ofe(),Q!==t&&(Fe=m,Q=dr(Q)),m=Q,m===t&&(m=b,Q=afe(),Q!==t&&(Fe=m,Q=dr(Q)),m=Q,m===t&&(m=b,Q=Afe(),Q!==t&&(Fe=m,Q=dr(Q)),m=Q))),m}function sfe(){var m,Q,F,K;return m=b,r.substr(b,2)===Bi?(Q=Bi,b+=2):(Q=t,I===0&&Be(_n)),Q!==t?(F=ufe(),F!==t?(r.charCodeAt(b)===39?(K=pa,b++):(K=t,I===0&&Be(EA)),K!==t?(Fe=m,Q=kg(F),m=Q):(b=m,m=t)):(b=m,m=t)):(b=m,m=t),m}function ofe(){var m,Q,F,K;return m=b,r.charCodeAt(b)===39?(Q=pa,b++):(Q=t,I===0&&Be(EA)),Q!==t?(F=lfe(),F!==t?(r.charCodeAt(b)===39?(K=pa,b++):(K=t,I===0&&Be(EA)),K!==t?(Fe=m,Q=kg(F),m=Q):(b=m,m=t)):(b=m,m=t)):(b=m,m=t),m}function afe(){var m,Q,F,K;if(m=b,r.substr(b,2)===Zn?(Q=Zn,b+=2):(Q=t,I===0&&Be(IA)),Q!==t&&(Fe=m,Q=da()),m=Q,m===t)if(m=b,r.charCodeAt(b)===34?(Q=Jp,b++):(Q=t,I===0&&Be(yA)),Q!==t){for(F=[],K=SU();K!==t;)F.push(K),K=SU();F!==t?(r.charCodeAt(b)===34?(K=Jp,b++):(K=t,I===0&&Be(yA)),K!==t?(Fe=m,Q=wA(F),m=Q):(b=m,m=t)):(b=m,m=t)}else b=m,m=t;return m}function Afe(){var m,Q,F;if(m=b,Q=[],F=vU(),F!==t)for(;F!==t;)Q.push(F),F=vU();else Q=t;return Q!==t&&(Fe=m,Q=wA(Q)),m=Q,m}function SU(){var m,Q;return m=b,Q=kU(),Q!==t&&(Fe=m,Q=Br(Q)),m=Q,m===t&&(m=b,Q=RU(),Q!==t&&(Fe=m,Q=Vl(Q)),m=Q,m===t&&(m=b,Q=GS(),Q!==t&&(Fe=m,Q=Rg(Q)),m=Q,m===t&&(m=b,Q=cfe(),Q!==t&&(Fe=m,Q=Eo(Q)),m=Q))),m}function vU(){var m,Q;return m=b,Q=kU(),Q!==t&&(Fe=m,Q=Fg(Q)),m=Q,m===t&&(m=b,Q=RU(),Q!==t&&(Fe=m,Q=Wp(Q)),m=Q,m===t&&(m=b,Q=GS(),Q!==t&&(Fe=m,Q=zp(Q)),m=Q,m===t&&(m=b,Q=hfe(),Q!==t&&(Fe=m,Q=Pr(Q)),m=Q,m===t&&(m=b,Q=ffe(),Q!==t&&(Fe=m,Q=Eo(Q)),m=Q)))),m}function lfe(){var m,Q,F;for(m=b,Q=[],oe.test(r.charAt(b))?(F=r.charAt(b),b++):(F=t,I===0&&Be(Io));F!==t;)Q.push(F),oe.test(r.charAt(b))?(F=r.charAt(b),b++):(F=t,I===0&&Be(Io));return Q!==t&&(Fe=m,Q=kn(Q)),m=Q,m}function cfe(){var m,Q,F;if(m=b,Q=[],F=xU(),F===t&&(Ng.test(r.charAt(b))?(F=r.charAt(b),b++):(F=t,I===0&&Be(bt))),F!==t)for(;F!==t;)Q.push(F),F=xU(),F===t&&(Ng.test(r.charAt(b))?(F=r.charAt(b),b++):(F=t,I===0&&Be(bt)));else Q=t;return Q!==t&&(Fe=m,Q=kn(Q)),m=Q,m}function xU(){var m,Q,F;return m=b,r.substr(b,2)===Xl?(Q=Xl,b+=2):(Q=t,I===0&&Be(Rn)),Q!==t&&(Fe=m,Q=$n()),m=Q,m===t&&(m=b,r.charCodeAt(b)===92?(Q=es,b++):(Q=t,I===0&&Be(ut)),Q!==t?(yo.test(r.charAt(b))?(F=r.charAt(b),b++):(F=t,I===0&&Be(at)),F!==t?(Fe=m,Q=ln(F),m=Q):(b=m,m=t)):(b=m,m=t)),m}function ufe(){var m,Q,F;for(m=b,Q=[],F=PU(),F===t&&(oe.test(r.charAt(b))?(F=r.charAt(b),b++):(F=t,I===0&&Be(Io)));F!==t;)Q.push(F),F=PU(),F===t&&(oe.test(r.charAt(b))?(F=r.charAt(b),b++):(F=t,I===0&&Be(Io)));return Q!==t&&(Fe=m,Q=kn(Q)),m=Q,m}function PU(){var m,Q,F;return m=b,r.substr(b,2)===S?(Q=S,b+=2):(Q=t,I===0&&Be(Lt)),Q!==t&&(Fe=m,Q=Tg()),m=Q,m===t&&(m=b,r.substr(b,2)===_l?(Q=_l,b+=2):(Q=t,I===0&&Be(Vp)),Q!==t&&(Fe=m,Q=Xp()),m=Q,m===t&&(m=b,r.charCodeAt(b)===92?(Q=es,b++):(Q=t,I===0&&Be(ut)),Q!==t?(_p.test(r.charAt(b))?(F=r.charAt(b),b++):(F=t,I===0&&Be(Zp)),F!==t?(Fe=m,Q=$p(),m=Q):(b=m,m=t)):(b=m,m=t),m===t&&(m=b,r.substr(b,2)===G?(Q=G,b+=2):(Q=t,I===0&&Be(yt)),Q!==t&&(Fe=m,Q=BA()),m=Q,m===t&&(m=b,r.substr(b,2)===Wi?(Q=Wi,b+=2):(Q=t,I===0&&Be(Zl)),Q!==t&&(Fe=m,Q=We()),m=Q,m===t&&(m=b,r.substr(b,2)===Ca?(Q=Ca,b+=2):(Q=t,I===0&&Be(Lg)),Q!==t&&(Fe=m,Q=uI()),m=Q,m===t&&(m=b,r.substr(b,2)===ed?(Q=ed,b+=2):(Q=t,I===0&&Be(gI)),Q!==t&&(Fe=m,Q=ar()),m=Q,m===t&&(m=b,r.substr(b,2)===Fn?(Q=Fn,b+=2):(Q=t,I===0&&Be($l)),Q!==t&&(Fe=m,Q=td()),m=Q,m===t&&(m=b,r.charCodeAt(b)===92?(Q=es,b++):(Q=t,I===0&&Be(ut)),Q!==t?(Ms.test(r.charAt(b))?(F=r.charAt(b),b++):(F=t,I===0&&Be(ma)),F!==t?(Fe=m,Q=ln(F),m=Q):(b=m,m=t)):(b=m,m=t),m===t&&(m=gfe()))))))))),m}function gfe(){var m,Q,F,K,ce,Qe,ft,Bt,Vr,Ci,rs,YS;return m=b,r.charCodeAt(b)===92?(Q=es,b++):(Q=t,I===0&&Be(ut)),Q!==t?(F=US(),F!==t?(Fe=m,Q=cn(F),m=Q):(b=m,m=t)):(b=m,m=t),m===t&&(m=b,r.substr(b,2)===ke?(Q=ke,b+=2):(Q=t,I===0&&Be(Og)),Q!==t?(F=b,K=b,ce=US(),ce!==t?(Qe=Ln(),Qe!==t?(ce=[ce,Qe],K=ce):(b=K,K=t)):(b=K,K=t),K===t&&(K=US()),K!==t?F=r.substring(F,b):F=K,F!==t?(Fe=m,Q=cn(F),m=Q):(b=m,m=t)):(b=m,m=t),m===t&&(m=b,r.substr(b,2)===ec?(Q=ec,b+=2):(Q=t,I===0&&Be(Us)),Q!==t?(F=b,K=b,ce=Ln(),ce!==t?(Qe=Ln(),Qe!==t?(ft=Ln(),ft!==t?(Bt=Ln(),Bt!==t?(ce=[ce,Qe,ft,Bt],K=ce):(b=K,K=t)):(b=K,K=t)):(b=K,K=t)):(b=K,K=t),K!==t?F=r.substring(F,b):F=K,F!==t?(Fe=m,Q=cn(F),m=Q):(b=m,m=t)):(b=m,m=t),m===t&&(m=b,r.substr(b,2)===tc?(Q=tc,b+=2):(Q=t,I===0&&Be(bA)),Q!==t?(F=b,K=b,ce=Ln(),ce!==t?(Qe=Ln(),Qe!==t?(ft=Ln(),ft!==t?(Bt=Ln(),Bt!==t?(Vr=Ln(),Vr!==t?(Ci=Ln(),Ci!==t?(rs=Ln(),rs!==t?(YS=Ln(),YS!==t?(ce=[ce,Qe,ft,Bt,Vr,Ci,rs,YS],K=ce):(b=K,K=t)):(b=K,K=t)):(b=K,K=t)):(b=K,K=t)):(b=K,K=t)):(b=K,K=t)):(b=K,K=t)):(b=K,K=t),K!==t?F=r.substring(F,b):F=K,F!==t?(Fe=m,Q=Mg(F),m=Q):(b=m,m=t)):(b=m,m=t)))),m}function US(){var m;return Ug.test(r.charAt(b))?(m=r.charAt(b),b++):(m=t,I===0&&Be(Ea)),m}function Ln(){var m;return Ia.test(r.charAt(b))?(m=r.charAt(b),b++):(m=t,I===0&&Be($e)),m}function ffe(){var m,Q,F,K,ce;if(m=b,Q=[],F=b,r.charCodeAt(b)===92?(K=es,b++):(K=t,I===0&&Be(ut)),K!==t?(r.length>b?(ce=r.charAt(b),b++):(ce=t,I===0&&Be(wo)),ce!==t?(Fe=F,K=ln(ce),F=K):(b=F,F=t)):(b=F,F=t),F===t&&(F=b,K=b,I++,ce=NU(),I--,ce===t?K=void 0:(b=K,K=t),K!==t?(r.length>b?(ce=r.charAt(b),b++):(ce=t,I===0&&Be(wo)),ce!==t?(Fe=F,K=ln(ce),F=K):(b=F,F=t)):(b=F,F=t)),F!==t)for(;F!==t;)Q.push(F),F=b,r.charCodeAt(b)===92?(K=es,b++):(K=t,I===0&&Be(ut)),K!==t?(r.length>b?(ce=r.charAt(b),b++):(ce=t,I===0&&Be(wo)),ce!==t?(Fe=F,K=ln(ce),F=K):(b=F,F=t)):(b=F,F=t),F===t&&(F=b,K=b,I++,ce=NU(),I--,ce===t?K=void 0:(b=K,K=t),K!==t?(r.length>b?(ce=r.charAt(b),b++):(ce=t,I===0&&Be(wo)),ce!==t?(Fe=F,K=ln(ce),F=K):(b=F,F=t)):(b=F,F=t));else Q=t;return Q!==t&&(Fe=m,Q=kn(Q)),m=Q,m}function KS(){var m,Q,F,K,ce,Qe;if(m=b,r.charCodeAt(b)===45?(Q=QA,b++):(Q=t,I===0&&Be(rc)),Q===t&&(r.charCodeAt(b)===43?(Q=Ks,b++):(Q=t,I===0&&Be(ic))),Q===t&&(Q=null),Q!==t){if(F=[],Ge.test(r.charAt(b))?(K=r.charAt(b),b++):(K=t,I===0&&Be(ie)),K!==t)for(;K!==t;)F.push(K),Ge.test(r.charAt(b))?(K=r.charAt(b),b++):(K=t,I===0&&Be(ie));else F=t;if(F!==t)if(r.charCodeAt(b)===46?(K=fI,b++):(K=t,I===0&&Be(rd)),K!==t){if(ce=[],Ge.test(r.charAt(b))?(Qe=r.charAt(b),b++):(Qe=t,I===0&&Be(ie)),Qe!==t)for(;Qe!==t;)ce.push(Qe),Ge.test(r.charAt(b))?(Qe=r.charAt(b),b++):(Qe=t,I===0&&Be(ie));else ce=t;ce!==t?(Fe=m,Q=Kg(Q,F,ce),m=Q):(b=m,m=t)}else b=m,m=t;else b=m,m=t}else b=m,m=t;if(m===t){if(m=b,r.charCodeAt(b)===45?(Q=QA,b++):(Q=t,I===0&&Be(rc)),Q===t&&(r.charCodeAt(b)===43?(Q=Ks,b++):(Q=t,I===0&&Be(ic))),Q===t&&(Q=null),Q!==t){if(F=[],Ge.test(r.charAt(b))?(K=r.charAt(b),b++):(K=t,I===0&&Be(ie)),K!==t)for(;K!==t;)F.push(K),Ge.test(r.charAt(b))?(K=r.charAt(b),b++):(K=t,I===0&&Be(ie));else F=t;F!==t?(Fe=m,Q=id(Q,F),m=Q):(b=m,m=t)}else b=m,m=t;if(m===t&&(m=b,Q=GS(),Q!==t&&(Fe=m,Q=hI(Q)),m=Q,m===t&&(m=b,Q=sc(),Q!==t&&(Fe=m,Q=nc(Q)),m=Q,m===t)))if(m=b,r.charCodeAt(b)===40?(Q=ge,b++):(Q=t,I===0&&Be(_)),Q!==t){for(F=[],K=Me();K!==t;)F.push(K),K=Me();if(F!==t)if(K=DU(),K!==t){for(ce=[],Qe=Me();Qe!==t;)ce.push(Qe),Qe=Me();ce!==t?(r.charCodeAt(b)===41?(Qe=L,b++):(Qe=t,I===0&&Be(N)),Qe!==t?(Fe=m,Q=pI(K),m=Q):(b=m,m=t)):(b=m,m=t)}else b=m,m=t;else b=m,m=t}else b=m,m=t}return m}function HS(){var m,Q,F,K,ce,Qe,ft,Bt;if(m=b,Q=KS(),Q!==t){for(F=[],K=b,ce=[],Qe=Me();Qe!==t;)ce.push(Qe),Qe=Me();if(ce!==t)if(r.charCodeAt(b)===42?(Qe=Hg,b++):(Qe=t,I===0&&Be(SA)),Qe===t&&(r.charCodeAt(b)===47?(Qe=Nr,b++):(Qe=t,I===0&&Be(dI))),Qe!==t){for(ft=[],Bt=Me();Bt!==t;)ft.push(Bt),Bt=Me();ft!==t?(Bt=KS(),Bt!==t?(Fe=K,ce=Hs(Q,Qe,Bt),K=ce):(b=K,K=t)):(b=K,K=t)}else b=K,K=t;else b=K,K=t;for(;K!==t;){for(F.push(K),K=b,ce=[],Qe=Me();Qe!==t;)ce.push(Qe),Qe=Me();if(ce!==t)if(r.charCodeAt(b)===42?(Qe=Hg,b++):(Qe=t,I===0&&Be(SA)),Qe===t&&(r.charCodeAt(b)===47?(Qe=Nr,b++):(Qe=t,I===0&&Be(dI))),Qe!==t){for(ft=[],Bt=Me();Bt!==t;)ft.push(Bt),Bt=Me();ft!==t?(Bt=KS(),Bt!==t?(Fe=K,ce=Hs(Q,Qe,Bt),K=ce):(b=K,K=t)):(b=K,K=t)}else b=K,K=t;else b=K,K=t}F!==t?(Fe=m,Q=Gs(Q,F),m=Q):(b=m,m=t)}else b=m,m=t;return m}function DU(){var m,Q,F,K,ce,Qe,ft,Bt;if(m=b,Q=HS(),Q!==t){for(F=[],K=b,ce=[],Qe=Me();Qe!==t;)ce.push(Qe),Qe=Me();if(ce!==t)if(r.charCodeAt(b)===43?(Qe=Ks,b++):(Qe=t,I===0&&Be(ic)),Qe===t&&(r.charCodeAt(b)===45?(Qe=QA,b++):(Qe=t,I===0&&Be(rc))),Qe!==t){for(ft=[],Bt=Me();Bt!==t;)ft.push(Bt),Bt=Me();ft!==t?(Bt=HS(),Bt!==t?(Fe=K,ce=Gg(Q,Qe,Bt),K=ce):(b=K,K=t)):(b=K,K=t)}else b=K,K=t;else b=K,K=t;for(;K!==t;){for(F.push(K),K=b,ce=[],Qe=Me();Qe!==t;)ce.push(Qe),Qe=Me();if(ce!==t)if(r.charCodeAt(b)===43?(Qe=Ks,b++):(Qe=t,I===0&&Be(ic)),Qe===t&&(r.charCodeAt(b)===45?(Qe=QA,b++):(Qe=t,I===0&&Be(rc))),Qe!==t){for(ft=[],Bt=Me();Bt!==t;)ft.push(Bt),Bt=Me();ft!==t?(Bt=HS(),Bt!==t?(Fe=K,ce=Gg(Q,Qe,Bt),K=ce):(b=K,K=t)):(b=K,K=t)}else b=K,K=t;else b=K,K=t}F!==t?(Fe=m,Q=Gs(Q,F),m=Q):(b=m,m=t)}else b=m,m=t;return m}function kU(){var m,Q,F,K,ce,Qe;if(m=b,r.substr(b,3)===vA?(Q=vA,b+=3):(Q=t,I===0&&Be(R)),Q!==t){for(F=[],K=Me();K!==t;)F.push(K),K=Me();if(F!==t)if(K=DU(),K!==t){for(ce=[],Qe=Me();Qe!==t;)ce.push(Qe),Qe=Me();ce!==t?(r.substr(b,2)===q?(Qe=q,b+=2):(Qe=t,I===0&&Be(pe)),Qe!==t?(Fe=m,Q=Ne(K),m=Q):(b=m,m=t)):(b=m,m=t)}else b=m,m=t;else b=m,m=t}else b=m,m=t;return m}function RU(){var m,Q,F,K;return m=b,r.substr(b,2)===xe?(Q=xe,b+=2):(Q=t,I===0&&Be(qe)),Q!==t?(F=Kr(),F!==t?(r.charCodeAt(b)===41?(K=L,b++):(K=t,I===0&&Be(N)),K!==t?(Fe=m,Q=dt(F),m=Q):(b=m,m=t)):(b=m,m=t)):(b=m,m=t),m}function GS(){var m,Q,F,K,ce,Qe;return m=b,r.substr(b,2)===Ft?(Q=Ft,b+=2):(Q=t,I===0&&Be(Nn)),Q!==t?(F=sc(),F!==t?(r.substr(b,2)===vS?(K=vS,b+=2):(K=t,I===0&&Be(AU)),K!==t?(ce=wU(),ce!==t?(r.charCodeAt(b)===125?(Qe=Pe,b++):(Qe=t,I===0&&Be(Le)),Qe!==t?(Fe=m,Q=lU(F,ce),m=Q):(b=m,m=t)):(b=m,m=t)):(b=m,m=t)):(b=m,m=t)):(b=m,m=t),m===t&&(m=b,r.substr(b,2)===Ft?(Q=Ft,b+=2):(Q=t,I===0&&Be(Nn)),Q!==t?(F=sc(),F!==t?(r.substr(b,3)===xS?(K=xS,b+=3):(K=t,I===0&&Be(cU)),K!==t?(Fe=m,Q=uU(F),m=Q):(b=m,m=t)):(b=m,m=t)):(b=m,m=t),m===t&&(m=b,r.substr(b,2)===Ft?(Q=Ft,b+=2):(Q=t,I===0&&Be(Nn)),Q!==t?(F=sc(),F!==t?(r.substr(b,2)===PS?(K=PS,b+=2):(K=t,I===0&&Be(gU)),K!==t?(ce=wU(),ce!==t?(r.charCodeAt(b)===125?(Qe=Pe,b++):(Qe=t,I===0&&Be(Le)),Qe!==t?(Fe=m,Q=fU(F,ce),m=Q):(b=m,m=t)):(b=m,m=t)):(b=m,m=t)):(b=m,m=t)):(b=m,m=t),m===t&&(m=b,r.substr(b,2)===Ft?(Q=Ft,b+=2):(Q=t,I===0&&Be(Nn)),Q!==t?(F=sc(),F!==t?(r.substr(b,3)===DS?(K=DS,b+=3):(K=t,I===0&&Be(hU)),K!==t?(Fe=m,Q=pU(F),m=Q):(b=m,m=t)):(b=m,m=t)):(b=m,m=t),m===t&&(m=b,r.substr(b,2)===Ft?(Q=Ft,b+=2):(Q=t,I===0&&Be(Nn)),Q!==t?(F=sc(),F!==t?(r.charCodeAt(b)===125?(K=Pe,b++):(K=t,I===0&&Be(Le)),K!==t?(Fe=m,Q=kS(F),m=Q):(b=m,m=t)):(b=m,m=t)):(b=m,m=t),m===t&&(m=b,r.charCodeAt(b)===36?(Q=dU,b++):(Q=t,I===0&&Be(CU)),Q!==t?(F=sc(),F!==t?(Fe=m,Q=kS(F),m=Q):(b=m,m=t)):(b=m,m=t)))))),m}function hfe(){var m,Q,F;return m=b,Q=pfe(),Q!==t?(Fe=b,F=mU(Q),F?F=void 0:F=t,F!==t?(Fe=m,Q=EU(Q),m=Q):(b=m,m=t)):(b=m,m=t),m}function pfe(){var m,Q,F,K,ce;if(m=b,Q=[],F=b,K=b,I++,ce=TU(),I--,ce===t?K=void 0:(b=K,K=t),K!==t?(r.length>b?(ce=r.charAt(b),b++):(ce=t,I===0&&Be(wo)),ce!==t?(Fe=F,K=ln(ce),F=K):(b=F,F=t)):(b=F,F=t),F!==t)for(;F!==t;)Q.push(F),F=b,K=b,I++,ce=TU(),I--,ce===t?K=void 0:(b=K,K=t),K!==t?(r.length>b?(ce=r.charAt(b),b++):(ce=t,I===0&&Be(wo)),ce!==t?(Fe=F,K=ln(ce),F=K):(b=F,F=t)):(b=F,F=t);else Q=t;return Q!==t&&(Fe=m,Q=kn(Q)),m=Q,m}function FU(){var m,Q,F;if(m=b,Q=[],RS.test(r.charAt(b))?(F=r.charAt(b),b++):(F=t,I===0&&Be(FS)),F!==t)for(;F!==t;)Q.push(F),RS.test(r.charAt(b))?(F=r.charAt(b),b++):(F=t,I===0&&Be(FS));else Q=t;return Q!==t&&(Fe=m,Q=NS()),m=Q,m}function sc(){var m,Q,F;if(m=b,Q=[],TS.test(r.charAt(b))?(F=r.charAt(b),b++):(F=t,I===0&&Be(LS)),F!==t)for(;F!==t;)Q.push(F),TS.test(r.charAt(b))?(F=r.charAt(b),b++):(F=t,I===0&&Be(LS));else Q=t;return Q!==t&&(Fe=m,Q=NS()),m=Q,m}function NU(){var m;return IU.test(r.charAt(b))?(m=r.charAt(b),b++):(m=t,I===0&&Be(Yg)),m}function TU(){var m;return OS.test(r.charAt(b))?(m=r.charAt(b),b++):(m=t,I===0&&Be(MS)),m}function Me(){var m,Q;if(m=[],CI.test(r.charAt(b))?(Q=r.charAt(b),b++):(Q=t,I===0&&Be(mI)),Q!==t)for(;Q!==t;)m.push(Q),CI.test(r.charAt(b))?(Q=r.charAt(b),b++):(Q=t,I===0&&Be(mI));else m=t;return m}if(k=n(),k!==t&&b===r.length)return k;throw k!==t&&b{"use strict";function phe(r,e){function t(){this.constructor=r}t.prototype=e.prototype,r.prototype=new t}function fc(r,e,t,i){this.message=r,this.expected=e,this.found=t,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,fc)}phe(fc,Error);fc.buildMessage=function(r,e){var t={literal:function(c){return'"'+n(c.text)+'"'},class:function(c){var u="",g;for(g=0;g0){for(g=1,f=1;gH&&(H=v,j=[]),j.push(ie))}function Le(ie,Y){return new fc(ie,null,null,Y)}function se(ie,Y,he){return new fc(fc.buildMessage(ie,Y),ie,Y,he)}function Ae(){var ie,Y,he,re;return ie=v,Y=be(),Y!==t?(r.charCodeAt(v)===47?(he=s,v++):(he=t,$===0&&Pe(o)),he!==t?(re=be(),re!==t?(D=ie,Y=a(Y,re),ie=Y):(v=ie,ie=t)):(v=ie,ie=t)):(v=ie,ie=t),ie===t&&(ie=v,Y=be(),Y!==t&&(D=ie,Y=l(Y)),ie=Y),ie}function be(){var ie,Y,he,re;return ie=v,Y=fe(),Y!==t?(r.charCodeAt(v)===64?(he=c,v++):(he=t,$===0&&Pe(u)),he!==t?(re=Ge(),re!==t?(D=ie,Y=g(Y,re),ie=Y):(v=ie,ie=t)):(v=ie,ie=t)):(v=ie,ie=t),ie===t&&(ie=v,Y=fe(),Y!==t&&(D=ie,Y=f(Y)),ie=Y),ie}function fe(){var ie,Y,he,re,me;return ie=v,r.charCodeAt(v)===64?(Y=c,v++):(Y=t,$===0&&Pe(u)),Y!==t?(he=le(),he!==t?(r.charCodeAt(v)===47?(re=s,v++):(re=t,$===0&&Pe(o)),re!==t?(me=le(),me!==t?(D=ie,Y=h(),ie=Y):(v=ie,ie=t)):(v=ie,ie=t)):(v=ie,ie=t)):(v=ie,ie=t),ie===t&&(ie=v,Y=le(),Y!==t&&(D=ie,Y=h()),ie=Y),ie}function le(){var ie,Y,he;if(ie=v,Y=[],p.test(r.charAt(v))?(he=r.charAt(v),v++):(he=t,$===0&&Pe(C)),he!==t)for(;he!==t;)Y.push(he),p.test(r.charAt(v))?(he=r.charAt(v),v++):(he=t,$===0&&Pe(C));else Y=t;return Y!==t&&(D=ie,Y=h()),ie=Y,ie}function Ge(){var ie,Y,he;if(ie=v,Y=[],w.test(r.charAt(v))?(he=r.charAt(v),v++):(he=t,$===0&&Pe(B)),he!==t)for(;he!==t;)Y.push(he),w.test(r.charAt(v))?(he=r.charAt(v),v++):(he=t,$===0&&Pe(B));else Y=t;return Y!==t&&(D=ie,Y=h()),ie=Y,ie}if(V=n(),V!==t&&v===r.length)return V;throw V!==t&&v{"use strict";function XK(r){return typeof r>"u"||r===null}function Che(r){return typeof r=="object"&&r!==null}function mhe(r){return Array.isArray(r)?r:XK(r)?[]:[r]}function Ehe(r,e){var t,i,n,s;if(e)for(s=Object.keys(e),t=0,i=s.length;t{"use strict";function md(r,e){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=e,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}md.prototype=Object.create(Error.prototype);md.prototype.constructor=md;md.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t};_K.exports=md});var e2=y((YZe,$K)=>{"use strict";var ZK=pc();function wv(r,e,t,i,n){this.name=r,this.buffer=e,this.position=t,this.line=i,this.column=n}wv.prototype.getSnippet=function(e,t){var i,n,s,o,a;if(!this.buffer)return null;for(e=e||4,t=t||75,i="",n=this.position;n>0&&`\0\r -\x85\u2028\u2029`.indexOf(this.buffer.charAt(n-1))===-1;)if(n-=1,this.position-n>t/2-1){i=" ... ",n+=5;break}for(s="",o=this.position;ot/2-1){s=" ... ",o-=5;break}return a=this.buffer.slice(n,o),ZK.repeat(" ",e)+i+a+s+` -`+ZK.repeat(" ",e+this.position-n+i.length)+"^"};wv.prototype.toString=function(e){var t,i="";return this.name&&(i+='in "'+this.name+'" '),i+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet(),t&&(i+=`: -`+t)),i};$K.exports=wv});var Ai=y((jZe,r2)=>{"use strict";var t2=tf(),whe=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],Bhe=["scalar","sequence","mapping"];function bhe(r){var e={};return r!==null&&Object.keys(r).forEach(function(t){r[t].forEach(function(i){e[String(i)]=t})}),e}function Qhe(r,e){if(e=e||{},Object.keys(e).forEach(function(t){if(whe.indexOf(t)===-1)throw new t2('Unknown option "'+t+'" is met in definition of "'+r+'" YAML type.')}),this.tag=r,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=bhe(e.styleAliases||null),Bhe.indexOf(this.kind)===-1)throw new t2('Unknown kind "'+this.kind+'" is specified for "'+r+'" YAML type.')}r2.exports=Qhe});var dc=y((qZe,n2)=>{"use strict";var i2=pc(),jI=tf(),She=Ai();function Bv(r,e,t){var i=[];return r.include.forEach(function(n){t=Bv(n,e,t)}),r[e].forEach(function(n){t.forEach(function(s,o){s.tag===n.tag&&s.kind===n.kind&&i.push(o)}),t.push(n)}),t.filter(function(n,s){return i.indexOf(s)===-1})}function vhe(){var r={scalar:{},sequence:{},mapping:{},fallback:{}},e,t;function i(n){r[n.kind][n.tag]=r.fallback[n.tag]=n}for(e=0,t=arguments.length;e{"use strict";var xhe=Ai();s2.exports=new xhe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(r){return r!==null?r:""}})});var A2=y((WZe,a2)=>{"use strict";var Phe=Ai();a2.exports=new Phe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(r){return r!==null?r:[]}})});var c2=y((zZe,l2)=>{"use strict";var Dhe=Ai();l2.exports=new Dhe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(r){return r!==null?r:{}}})});var qI=y((VZe,u2)=>{"use strict";var khe=dc();u2.exports=new khe({explicit:[o2(),A2(),c2()]})});var f2=y((XZe,g2)=>{"use strict";var Rhe=Ai();function Fhe(r){if(r===null)return!0;var e=r.length;return e===1&&r==="~"||e===4&&(r==="null"||r==="Null"||r==="NULL")}function Nhe(){return null}function The(r){return r===null}g2.exports=new Rhe("tag:yaml.org,2002:null",{kind:"scalar",resolve:Fhe,construct:Nhe,predicate:The,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var p2=y((_Ze,h2)=>{"use strict";var Lhe=Ai();function Ohe(r){if(r===null)return!1;var e=r.length;return e===4&&(r==="true"||r==="True"||r==="TRUE")||e===5&&(r==="false"||r==="False"||r==="FALSE")}function Mhe(r){return r==="true"||r==="True"||r==="TRUE"}function Uhe(r){return Object.prototype.toString.call(r)==="[object Boolean]"}h2.exports=new Lhe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Ohe,construct:Mhe,predicate:Uhe,represent:{lowercase:function(r){return r?"true":"false"},uppercase:function(r){return r?"TRUE":"FALSE"},camelcase:function(r){return r?"True":"False"}},defaultStyle:"lowercase"})});var C2=y((ZZe,d2)=>{"use strict";var Khe=pc(),Hhe=Ai();function Ghe(r){return 48<=r&&r<=57||65<=r&&r<=70||97<=r&&r<=102}function Yhe(r){return 48<=r&&r<=55}function jhe(r){return 48<=r&&r<=57}function qhe(r){if(r===null)return!1;var e=r.length,t=0,i=!1,n;if(!e)return!1;if(n=r[t],(n==="-"||n==="+")&&(n=r[++t]),n==="0"){if(t+1===e)return!0;if(n=r[++t],n==="b"){for(t++;t=0?"0b"+r.toString(2):"-0b"+r.toString(2).slice(1)},octal:function(r){return r>=0?"0"+r.toString(8):"-0"+r.toString(8).slice(1)},decimal:function(r){return r.toString(10)},hexadecimal:function(r){return r>=0?"0x"+r.toString(16).toUpperCase():"-0x"+r.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var I2=y(($Ze,E2)=>{"use strict";var m2=pc(),zhe=Ai(),Vhe=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Xhe(r){return!(r===null||!Vhe.test(r)||r[r.length-1]==="_")}function _he(r){var e,t,i,n;return e=r.replace(/_/g,"").toLowerCase(),t=e[0]==="-"?-1:1,n=[],"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:e.indexOf(":")>=0?(e.split(":").forEach(function(s){n.unshift(parseFloat(s,10))}),e=0,i=1,n.forEach(function(s){e+=s*i,i*=60}),t*e):t*parseFloat(e,10)}var Zhe=/^[-+]?[0-9]+e/;function $he(r,e){var t;if(isNaN(r))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===r)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===r)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(m2.isNegativeZero(r))return"-0.0";return t=r.toString(10),Zhe.test(t)?t.replace("e",".e"):t}function epe(r){return Object.prototype.toString.call(r)==="[object Number]"&&(r%1!==0||m2.isNegativeZero(r))}E2.exports=new zhe("tag:yaml.org,2002:float",{kind:"scalar",resolve:Xhe,construct:_he,predicate:epe,represent:$he,defaultStyle:"lowercase"})});var bv=y((e$e,y2)=>{"use strict";var tpe=dc();y2.exports=new tpe({include:[qI()],implicit:[f2(),p2(),C2(),I2()]})});var Qv=y((t$e,w2)=>{"use strict";var rpe=dc();w2.exports=new rpe({include:[bv()]})});var S2=y((r$e,Q2)=>{"use strict";var ipe=Ai(),B2=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),b2=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function npe(r){return r===null?!1:B2.exec(r)!==null||b2.exec(r)!==null}function spe(r){var e,t,i,n,s,o,a,l=0,c=null,u,g,f;if(e=B2.exec(r),e===null&&(e=b2.exec(r)),e===null)throw new Error("Date resolve error");if(t=+e[1],i=+e[2]-1,n=+e[3],!e[4])return new Date(Date.UTC(t,i,n));if(s=+e[4],o=+e[5],a=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(u=+e[10],g=+(e[11]||0),c=(u*60+g)*6e4,e[9]==="-"&&(c=-c)),f=new Date(Date.UTC(t,i,n,s,o,a,l)),c&&f.setTime(f.getTime()-c),f}function ope(r){return r.toISOString()}Q2.exports=new ipe("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:npe,construct:spe,instanceOf:Date,represent:ope})});var x2=y((i$e,v2)=>{"use strict";var ape=Ai();function Ape(r){return r==="<<"||r===null}v2.exports=new ape("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Ape})});var k2=y((n$e,D2)=>{"use strict";var Cc;try{P2=J,Cc=P2("buffer").Buffer}catch{}var P2,lpe=Ai(),Sv=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function cpe(r){if(r===null)return!1;var e,t,i=0,n=r.length,s=Sv;for(t=0;t64)){if(e<0)return!1;i+=6}return i%8===0}function upe(r){var e,t,i=r.replace(/[\r\n=]/g,""),n=i.length,s=Sv,o=0,a=[];for(e=0;e>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(i.charAt(e));return t=n%4*6,t===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):t===18?(a.push(o>>10&255),a.push(o>>2&255)):t===12&&a.push(o>>4&255),Cc?Cc.from?Cc.from(a):new Cc(a):a}function gpe(r){var e="",t=0,i,n,s=r.length,o=Sv;for(i=0;i>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]),t=(t<<8)+r[i];return n=s%3,n===0?(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]):n===2?(e+=o[t>>10&63],e+=o[t>>4&63],e+=o[t<<2&63],e+=o[64]):n===1&&(e+=o[t>>2&63],e+=o[t<<4&63],e+=o[64],e+=o[64]),e}function fpe(r){return Cc&&Cc.isBuffer(r)}D2.exports=new lpe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:cpe,construct:upe,predicate:fpe,represent:gpe})});var F2=y((s$e,R2)=>{"use strict";var hpe=Ai(),ppe=Object.prototype.hasOwnProperty,dpe=Object.prototype.toString;function Cpe(r){if(r===null)return!0;var e=[],t,i,n,s,o,a=r;for(t=0,i=a.length;t{"use strict";var Epe=Ai(),Ipe=Object.prototype.toString;function ype(r){if(r===null)return!0;var e,t,i,n,s,o=r;for(s=new Array(o.length),e=0,t=o.length;e{"use strict";var Bpe=Ai(),bpe=Object.prototype.hasOwnProperty;function Qpe(r){if(r===null)return!0;var e,t=r;for(e in t)if(bpe.call(t,e)&&t[e]!==null)return!1;return!0}function Spe(r){return r!==null?r:{}}L2.exports=new Bpe("tag:yaml.org,2002:set",{kind:"mapping",resolve:Qpe,construct:Spe})});var nf=y((A$e,M2)=>{"use strict";var vpe=dc();M2.exports=new vpe({include:[Qv()],implicit:[S2(),x2()],explicit:[k2(),F2(),T2(),O2()]})});var K2=y((l$e,U2)=>{"use strict";var xpe=Ai();function Ppe(){return!0}function Dpe(){}function kpe(){return""}function Rpe(r){return typeof r>"u"}U2.exports=new xpe("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:Ppe,construct:Dpe,predicate:Rpe,represent:kpe})});var G2=y((c$e,H2)=>{"use strict";var Fpe=Ai();function Npe(r){if(r===null||r.length===0)return!1;var e=r,t=/\/([gim]*)$/.exec(r),i="";return!(e[0]==="/"&&(t&&(i=t[1]),i.length>3||e[e.length-i.length-1]!=="/"))}function Tpe(r){var e=r,t=/\/([gim]*)$/.exec(r),i="";return e[0]==="/"&&(t&&(i=t[1]),e=e.slice(1,e.length-i.length-1)),new RegExp(e,i)}function Lpe(r){var e="/"+r.source+"/";return r.global&&(e+="g"),r.multiline&&(e+="m"),r.ignoreCase&&(e+="i"),e}function Ope(r){return Object.prototype.toString.call(r)==="[object RegExp]"}H2.exports=new Fpe("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:Npe,construct:Tpe,predicate:Ope,represent:Lpe})});var q2=y((u$e,j2)=>{"use strict";var JI;try{Y2=J,JI=Y2("esprima")}catch{typeof window<"u"&&(JI=window.esprima)}var Y2,Mpe=Ai();function Upe(r){if(r===null)return!1;try{var e="("+r+")",t=JI.parse(e,{range:!0});return!(t.type!=="Program"||t.body.length!==1||t.body[0].type!=="ExpressionStatement"||t.body[0].expression.type!=="ArrowFunctionExpression"&&t.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function Kpe(r){var e="("+r+")",t=JI.parse(e,{range:!0}),i=[],n;if(t.type!=="Program"||t.body.length!==1||t.body[0].type!=="ExpressionStatement"||t.body[0].expression.type!=="ArrowFunctionExpression"&&t.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return t.body[0].expression.params.forEach(function(s){i.push(s.name)}),n=t.body[0].expression.body.range,t.body[0].expression.body.type==="BlockStatement"?new Function(i,e.slice(n[0]+1,n[1]-1)):new Function(i,"return "+e.slice(n[0],n[1]))}function Hpe(r){return r.toString()}function Gpe(r){return Object.prototype.toString.call(r)==="[object Function]"}j2.exports=new Mpe("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:Upe,construct:Kpe,predicate:Gpe,represent:Hpe})});var Ed=y((g$e,W2)=>{"use strict";var J2=dc();W2.exports=J2.DEFAULT=new J2({include:[nf()],explicit:[K2(),G2(),q2()]})});var gH=y((f$e,Id)=>{"use strict";var Qa=pc(),eH=tf(),Ype=e2(),tH=nf(),jpe=Ed(),NA=Object.prototype.hasOwnProperty,WI=1,rH=2,iH=3,zI=4,vv=1,qpe=2,z2=3,Jpe=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Wpe=/[\x85\u2028\u2029]/,zpe=/[,\[\]\{\}]/,nH=/^(?:!|!!|![a-z\-]+!)$/i,sH=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function V2(r){return Object.prototype.toString.call(r)}function So(r){return r===10||r===13}function Ec(r){return r===9||r===32}function fn(r){return r===9||r===32||r===10||r===13}function sf(r){return r===44||r===91||r===93||r===123||r===125}function Vpe(r){var e;return 48<=r&&r<=57?r-48:(e=r|32,97<=e&&e<=102?e-97+10:-1)}function Xpe(r){return r===120?2:r===117?4:r===85?8:0}function _pe(r){return 48<=r&&r<=57?r-48:-1}function X2(r){return r===48?"\0":r===97?"\x07":r===98?"\b":r===116||r===9?" ":r===110?` -`:r===118?"\v":r===102?"\f":r===114?"\r":r===101?"\x1B":r===32?" ":r===34?'"':r===47?"/":r===92?"\\":r===78?"\x85":r===95?"\xA0":r===76?"\u2028":r===80?"\u2029":""}function Zpe(r){return r<=65535?String.fromCharCode(r):String.fromCharCode((r-65536>>10)+55296,(r-65536&1023)+56320)}var oH=new Array(256),aH=new Array(256);for(mc=0;mc<256;mc++)oH[mc]=X2(mc)?1:0,aH[mc]=X2(mc);var mc;function $pe(r,e){this.input=r,this.filename=e.filename||null,this.schema=e.schema||jpe,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=r.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function AH(r,e){return new eH(e,new Ype(r.filename,r.input,r.position,r.line,r.position-r.lineStart))}function gt(r,e){throw AH(r,e)}function VI(r,e){r.onWarning&&r.onWarning.call(null,AH(r,e))}var _2={YAML:function(e,t,i){var n,s,o;e.version!==null&>(e,"duplication of %YAML directive"),i.length!==1&>(e,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),n===null&>(e,"ill-formed argument of the YAML directive"),s=parseInt(n[1],10),o=parseInt(n[2],10),s!==1&>(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&VI(e,"unsupported YAML version of the document")},TAG:function(e,t,i){var n,s;i.length!==2&>(e,"TAG directive accepts exactly two arguments"),n=i[0],s=i[1],nH.test(n)||gt(e,"ill-formed tag handle (first argument) of the TAG directive"),NA.call(e.tagMap,n)&>(e,'there is a previously declared suffix for "'+n+'" tag handle'),sH.test(s)||gt(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[n]=s}};function FA(r,e,t,i){var n,s,o,a;if(e1&&(r.result+=Qa.repeat(` -`,e-1))}function ede(r,e,t){var i,n,s,o,a,l,c,u,g=r.kind,f=r.result,h;if(h=r.input.charCodeAt(r.position),fn(h)||sf(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(n=r.input.charCodeAt(r.position+1),fn(n)||t&&sf(n)))return!1;for(r.kind="scalar",r.result="",s=o=r.position,a=!1;h!==0;){if(h===58){if(n=r.input.charCodeAt(r.position+1),fn(n)||t&&sf(n))break}else if(h===35){if(i=r.input.charCodeAt(r.position-1),fn(i))break}else{if(r.position===r.lineStart&&XI(r)||t&&sf(h))break;if(So(h))if(l=r.line,c=r.lineStart,u=r.lineIndent,_r(r,!1,-1),r.lineIndent>=e){a=!0,h=r.input.charCodeAt(r.position);continue}else{r.position=o,r.line=l,r.lineStart=c,r.lineIndent=u;break}}a&&(FA(r,s,o,!1),Pv(r,r.line-l),s=o=r.position,a=!1),Ec(h)||(o=r.position+1),h=r.input.charCodeAt(++r.position)}return FA(r,s,o,!1),r.result?!0:(r.kind=g,r.result=f,!1)}function tde(r,e){var t,i,n;if(t=r.input.charCodeAt(r.position),t!==39)return!1;for(r.kind="scalar",r.result="",r.position++,i=n=r.position;(t=r.input.charCodeAt(r.position))!==0;)if(t===39)if(FA(r,i,r.position,!0),t=r.input.charCodeAt(++r.position),t===39)i=r.position,r.position++,n=r.position;else return!0;else So(t)?(FA(r,i,n,!0),Pv(r,_r(r,!1,e)),i=n=r.position):r.position===r.lineStart&&XI(r)?gt(r,"unexpected end of the document within a single quoted scalar"):(r.position++,n=r.position);gt(r,"unexpected end of the stream within a single quoted scalar")}function rde(r,e){var t,i,n,s,o,a;if(a=r.input.charCodeAt(r.position),a!==34)return!1;for(r.kind="scalar",r.result="",r.position++,t=i=r.position;(a=r.input.charCodeAt(r.position))!==0;){if(a===34)return FA(r,t,r.position,!0),r.position++,!0;if(a===92){if(FA(r,t,r.position,!0),a=r.input.charCodeAt(++r.position),So(a))_r(r,!1,e);else if(a<256&&oH[a])r.result+=aH[a],r.position++;else if((o=Xpe(a))>0){for(n=o,s=0;n>0;n--)a=r.input.charCodeAt(++r.position),(o=Vpe(a))>=0?s=(s<<4)+o:gt(r,"expected hexadecimal character");r.result+=Zpe(s),r.position++}else gt(r,"unknown escape sequence");t=i=r.position}else So(a)?(FA(r,t,i,!0),Pv(r,_r(r,!1,e)),t=i=r.position):r.position===r.lineStart&&XI(r)?gt(r,"unexpected end of the document within a double quoted scalar"):(r.position++,i=r.position)}gt(r,"unexpected end of the stream within a double quoted scalar")}function ide(r,e){var t=!0,i,n=r.tag,s,o=r.anchor,a,l,c,u,g,f={},h,p,C,w;if(w=r.input.charCodeAt(r.position),w===91)l=93,g=!1,s=[];else if(w===123)l=125,g=!0,s={};else return!1;for(r.anchor!==null&&(r.anchorMap[r.anchor]=s),w=r.input.charCodeAt(++r.position);w!==0;){if(_r(r,!0,e),w=r.input.charCodeAt(r.position),w===l)return r.position++,r.tag=n,r.anchor=o,r.kind=g?"mapping":"sequence",r.result=s,!0;t||gt(r,"missed comma between flow collection entries"),p=h=C=null,c=u=!1,w===63&&(a=r.input.charCodeAt(r.position+1),fn(a)&&(c=u=!0,r.position++,_r(r,!0,e))),i=r.line,af(r,e,WI,!1,!0),p=r.tag,h=r.result,_r(r,!0,e),w=r.input.charCodeAt(r.position),(u||r.line===i)&&w===58&&(c=!0,w=r.input.charCodeAt(++r.position),_r(r,!0,e),af(r,e,WI,!1,!0),C=r.result),g?of(r,s,f,p,h,C):c?s.push(of(r,null,f,p,h,C)):s.push(h),_r(r,!0,e),w=r.input.charCodeAt(r.position),w===44?(t=!0,w=r.input.charCodeAt(++r.position)):t=!1}gt(r,"unexpected end of the stream within a flow collection")}function nde(r,e){var t,i,n=vv,s=!1,o=!1,a=e,l=0,c=!1,u,g;if(g=r.input.charCodeAt(r.position),g===124)i=!1;else if(g===62)i=!0;else return!1;for(r.kind="scalar",r.result="";g!==0;)if(g=r.input.charCodeAt(++r.position),g===43||g===45)vv===n?n=g===43?z2:qpe:gt(r,"repeat of a chomping mode identifier");else if((u=_pe(g))>=0)u===0?gt(r,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?gt(r,"repeat of an indentation width identifier"):(a=e+u-1,o=!0);else break;if(Ec(g)){do g=r.input.charCodeAt(++r.position);while(Ec(g));if(g===35)do g=r.input.charCodeAt(++r.position);while(!So(g)&&g!==0)}for(;g!==0;){for(xv(r),r.lineIndent=0,g=r.input.charCodeAt(r.position);(!o||r.lineIndenta&&(a=r.lineIndent),So(g)){l++;continue}if(r.lineIndente)&&l!==0)gt(r,"bad indentation of a sequence entry");else if(r.lineIndente)&&(af(r,e,zI,!0,n)&&(p?f=r.result:h=r.result),p||(of(r,c,u,g,f,h,s,o),g=f=h=null),_r(r,!0,-1),w=r.input.charCodeAt(r.position)),r.lineIndent>e&&w!==0)gt(r,"bad indentation of a mapping entry");else if(r.lineIndente?l=1:r.lineIndent===e?l=0:r.lineIndente?l=1:r.lineIndent===e?l=0:r.lineIndent tag; it should be "scalar", not "'+r.kind+'"'),g=0,f=r.implicitTypes.length;g tag; it should be "'+h.kind+'", not "'+r.kind+'"'),h.resolve(r.result)?(r.result=h.construct(r.result),r.anchor!==null&&(r.anchorMap[r.anchor]=r.result)):gt(r,"cannot resolve a node with !<"+r.tag+"> explicit tag")):gt(r,"unknown tag !<"+r.tag+">");return r.listener!==null&&r.listener("close",r),r.tag!==null||r.anchor!==null||u}function lde(r){var e=r.position,t,i,n,s=!1,o;for(r.version=null,r.checkLineBreaks=r.legacy,r.tagMap={},r.anchorMap={};(o=r.input.charCodeAt(r.position))!==0&&(_r(r,!0,-1),o=r.input.charCodeAt(r.position),!(r.lineIndent>0||o!==37));){for(s=!0,o=r.input.charCodeAt(++r.position),t=r.position;o!==0&&!fn(o);)o=r.input.charCodeAt(++r.position);for(i=r.input.slice(t,r.position),n=[],i.length<1&>(r,"directive name must not be less than one character in length");o!==0;){for(;Ec(o);)o=r.input.charCodeAt(++r.position);if(o===35){do o=r.input.charCodeAt(++r.position);while(o!==0&&!So(o));break}if(So(o))break;for(t=r.position;o!==0&&!fn(o);)o=r.input.charCodeAt(++r.position);n.push(r.input.slice(t,r.position))}o!==0&&xv(r),NA.call(_2,i)?_2[i](r,i,n):VI(r,'unknown document directive "'+i+'"')}if(_r(r,!0,-1),r.lineIndent===0&&r.input.charCodeAt(r.position)===45&&r.input.charCodeAt(r.position+1)===45&&r.input.charCodeAt(r.position+2)===45?(r.position+=3,_r(r,!0,-1)):s&>(r,"directives end mark is expected"),af(r,r.lineIndent-1,zI,!1,!0),_r(r,!0,-1),r.checkLineBreaks&&Wpe.test(r.input.slice(e,r.position))&&VI(r,"non-ASCII line breaks are interpreted as content"),r.documents.push(r.result),r.position===r.lineStart&&XI(r)){r.input.charCodeAt(r.position)===46&&(r.position+=3,_r(r,!0,-1));return}if(r.position"u"&&(t=e,e=null);var i=lH(r,t);if(typeof e!="function")return i;for(var n=0,s=i.length;n"u"&&(t=e,e=null),cH(r,e,Qa.extend({schema:tH},t))}function ude(r,e){return uH(r,Qa.extend({schema:tH},e))}Id.exports.loadAll=cH;Id.exports.load=uH;Id.exports.safeLoadAll=cde;Id.exports.safeLoad=ude});var TH=y((h$e,Fv)=>{"use strict";var wd=pc(),Bd=tf(),gde=Ed(),fde=nf(),IH=Object.prototype.toString,yH=Object.prototype.hasOwnProperty,hde=9,yd=10,pde=13,dde=32,Cde=33,mde=34,wH=35,Ede=37,Ide=38,yde=39,wde=42,BH=44,Bde=45,bH=58,bde=61,Qde=62,Sde=63,vde=64,QH=91,SH=93,xde=96,vH=123,Pde=124,xH=125,Ti={};Ti[0]="\\0";Ti[7]="\\a";Ti[8]="\\b";Ti[9]="\\t";Ti[10]="\\n";Ti[11]="\\v";Ti[12]="\\f";Ti[13]="\\r";Ti[27]="\\e";Ti[34]='\\"';Ti[92]="\\\\";Ti[133]="\\N";Ti[160]="\\_";Ti[8232]="\\L";Ti[8233]="\\P";var Dde=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function kde(r,e){var t,i,n,s,o,a,l;if(e===null)return{};for(t={},i=Object.keys(e),n=0,s=i.length;n0?r.charCodeAt(s-1):null,f=f&&pH(o,a)}else{for(s=0;si&&r[g+1]!==" ",g=s);else if(!Af(o))return _I;a=s>0?r.charCodeAt(s-1):null,f=f&&pH(o,a)}c=c||u&&s-g-1>i&&r[g+1]!==" "}return!l&&!c?f&&!n(r)?DH:kH:t>9&&PH(r)?_I:c?FH:RH}function Ode(r,e,t,i){r.dump=function(){if(e.length===0)return"''";if(!r.noCompatMode&&Dde.indexOf(e)!==-1)return"'"+e+"'";var n=r.indent*Math.max(1,t),s=r.lineWidth===-1?-1:Math.max(Math.min(r.lineWidth,40),r.lineWidth-n),o=i||r.flowLevel>-1&&t>=r.flowLevel;function a(l){return Fde(r,l)}switch(Lde(e,o,r.indent,s,a)){case DH:return e;case kH:return"'"+e.replace(/'/g,"''")+"'";case RH:return"|"+dH(e,r.indent)+CH(hH(e,n));case FH:return">"+dH(e,r.indent)+CH(hH(Mde(e,s),n));case _I:return'"'+Ude(e,s)+'"';default:throw new Bd("impossible error: invalid scalar style")}}()}function dH(r,e){var t=PH(r)?String(e):"",i=r[r.length-1]===` -`,n=i&&(r[r.length-2]===` -`||r===` -`),s=n?"+":i?"":"-";return t+s+` -`}function CH(r){return r[r.length-1]===` -`?r.slice(0,-1):r}function Mde(r,e){for(var t=/(\n+)([^\n]*)/g,i=function(){var c=r.indexOf(` -`);return c=c!==-1?c:r.length,t.lastIndex=c,mH(r.slice(0,c),e)}(),n=r[0]===` -`||r[0]===" ",s,o;o=t.exec(r);){var a=o[1],l=o[2];s=l[0]===" ",i+=a+(!n&&!s&&l!==""?` -`:"")+mH(l,e),n=s}return i}function mH(r,e){if(r===""||r[0]===" ")return r;for(var t=/ [^ ]/g,i,n=0,s,o=0,a=0,l="";i=t.exec(r);)a=i.index,a-n>e&&(s=o>n?o:a,l+=` -`+r.slice(n,s),n=s+1),o=a;return l+=` -`,r.length-n>e&&o>n?l+=r.slice(n,o)+` -`+r.slice(o+1):l+=r.slice(n),l.slice(1)}function Ude(r){for(var e="",t,i,n,s=0;s=55296&&t<=56319&&(i=r.charCodeAt(s+1),i>=56320&&i<=57343)){e+=fH((t-55296)*1024+i-56320+65536),s++;continue}n=Ti[t],e+=!n&&Af(t)?r[s]:n||fH(t)}return e}function Kde(r,e,t){var i="",n=r.tag,s,o;for(s=0,o=t.length;s1024&&(u+="? "),u+=r.dump+(r.condenseFlow?'"':"")+":"+(r.condenseFlow?"":" "),Ic(r,e,c,!1,!1)&&(u+=r.dump,i+=u));r.tag=n,r.dump="{"+i+"}"}function Yde(r,e,t,i){var n="",s=r.tag,o=Object.keys(t),a,l,c,u,g,f;if(r.sortKeys===!0)o.sort();else if(typeof r.sortKeys=="function")o.sort(r.sortKeys);else if(r.sortKeys)throw new Bd("sortKeys must be a boolean or a function");for(a=0,l=o.length;a1024,g&&(r.dump&&yd===r.dump.charCodeAt(0)?f+="?":f+="? "),f+=r.dump,g&&(f+=Dv(r,e)),Ic(r,e+1,u,!0,g)&&(r.dump&&yd===r.dump.charCodeAt(0)?f+=":":f+=": ",f+=r.dump,n+=f));r.tag=s,r.dump=n||"{}"}function EH(r,e,t){var i,n,s,o,a,l;for(n=t?r.explicitTypes:r.implicitTypes,s=0,o=n.length;s tag resolver accepts not "'+l+'" style');r.dump=i}return!0}return!1}function Ic(r,e,t,i,n,s){r.tag=null,r.dump=t,EH(r,t,!1)||EH(r,t,!0);var o=IH.call(r.dump);i&&(i=r.flowLevel<0||r.flowLevel>e);var a=o==="[object Object]"||o==="[object Array]",l,c;if(a&&(l=r.duplicates.indexOf(t),c=l!==-1),(r.tag!==null&&r.tag!=="?"||c||r.indent!==2&&e>0)&&(n=!1),c&&r.usedDuplicates[l])r.dump="*ref_"+l;else{if(a&&c&&!r.usedDuplicates[l]&&(r.usedDuplicates[l]=!0),o==="[object Object]")i&&Object.keys(r.dump).length!==0?(Yde(r,e,r.dump,n),c&&(r.dump="&ref_"+l+r.dump)):(Gde(r,e,r.dump),c&&(r.dump="&ref_"+l+" "+r.dump));else if(o==="[object Array]"){var u=r.noArrayIndent&&e>0?e-1:e;i&&r.dump.length!==0?(Hde(r,u,r.dump,n),c&&(r.dump="&ref_"+l+r.dump)):(Kde(r,u,r.dump),c&&(r.dump="&ref_"+l+" "+r.dump))}else if(o==="[object String]")r.tag!=="?"&&Ode(r,r.dump,e,s);else{if(r.skipInvalid)return!1;throw new Bd("unacceptable kind of an object to dump "+o)}r.tag!==null&&r.tag!=="?"&&(r.dump="!<"+r.tag+"> "+r.dump)}return!0}function jde(r,e){var t=[],i=[],n,s;for(kv(r,t,i),n=0,s=i.length;n{"use strict";var ZI=gH(),LH=TH();function $I(r){return function(){throw new Error("Function "+r+" is deprecated and cannot be used.")}}Tr.exports.Type=Ai();Tr.exports.Schema=dc();Tr.exports.FAILSAFE_SCHEMA=qI();Tr.exports.JSON_SCHEMA=bv();Tr.exports.CORE_SCHEMA=Qv();Tr.exports.DEFAULT_SAFE_SCHEMA=nf();Tr.exports.DEFAULT_FULL_SCHEMA=Ed();Tr.exports.load=ZI.load;Tr.exports.loadAll=ZI.loadAll;Tr.exports.safeLoad=ZI.safeLoad;Tr.exports.safeLoadAll=ZI.safeLoadAll;Tr.exports.dump=LH.dump;Tr.exports.safeDump=LH.safeDump;Tr.exports.YAMLException=tf();Tr.exports.MINIMAL_SCHEMA=qI();Tr.exports.SAFE_SCHEMA=nf();Tr.exports.DEFAULT_SCHEMA=Ed();Tr.exports.scan=$I("scan");Tr.exports.parse=$I("parse");Tr.exports.compose=$I("compose");Tr.exports.addConstructor=$I("addConstructor")});var UH=y((d$e,MH)=>{"use strict";var Jde=OH();MH.exports=Jde});var HH=y((C$e,KH)=>{"use strict";function Wde(r,e){function t(){this.constructor=r}t.prototype=e.prototype,r.prototype=new t}function yc(r,e,t,i){this.message=r,this.expected=e,this.found=t,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,yc)}Wde(yc,Error);yc.buildMessage=function(r,e){var t={literal:function(c){return'"'+n(c.text)+'"'},class:function(c){var u="",g;for(g=0;g0){for(g=1,f=1;g({[Ne]:pe})))},H=function(R){return R},j=function(R){return R},$=Ms("correct indentation"),V=" ",W=ar(" ",!1),Z=function(R){return R.length===vA*Gg},A=function(R){return R.length===(vA+1)*Gg},ae=function(){return vA++,!0},ge=function(){return vA--,!0},_=function(){return Lg()},L=Ms("pseudostring"),N=/^[^\r\n\t ?:,\][{}#&*!|>'"%@`\-]/,ue=Fn(["\r",` -`," "," ","?",":",",","]","[","{","}","#","&","*","!","|",">","'",'"',"%","@","`","-"],!0,!1),we=/^[^\r\n\t ,\][{}:#"']/,Te=Fn(["\r",` -`," "," ",",","]","[","{","}",":","#",'"',"'"],!0,!1),Pe=function(){return Lg().replace(/^ *| *$/g,"")},Le="--",se=ar("--",!1),Ae=/^[a-zA-Z\/0-9]/,be=Fn([["a","z"],["A","Z"],"/",["0","9"]],!1,!1),fe=/^[^\r\n\t :,]/,le=Fn(["\r",` -`," "," ",":",","],!0,!1),Ge="null",ie=ar("null",!1),Y=function(){return null},he="true",re=ar("true",!1),me=function(){return!0},tt="false",Rt=ar("false",!1),It=function(){return!1},Ur=Ms("string"),oi='"',pi=ar('"',!1),pr=function(){return""},di=function(R){return R},ai=function(R){return R.join("")},Os=/^[^"\\\0-\x1F\x7F]/,dr=Fn(['"',"\\",["\0",""],"\x7F"],!0,!1),Bi='\\"',_n=ar('\\"',!1),pa=function(){return'"'},EA="\\\\",kg=ar("\\\\",!1),Zn=function(){return"\\"},IA="\\/",da=ar("\\/",!1),Jp=function(){return"/"},yA="\\b",wA=ar("\\b",!1),Br=function(){return"\b"},Vl="\\f",Rg=ar("\\f",!1),Eo=function(){return"\f"},Fg="\\n",Wp=ar("\\n",!1),zp=function(){return` -`},Pr="\\r",oe=ar("\\r",!1),Io=function(){return"\r"},kn="\\t",Ng=ar("\\t",!1),bt=function(){return" "},Xl="\\u",Rn=ar("\\u",!1),$n=function(R,q,pe,Ne){return String.fromCharCode(parseInt(`0x${R}${q}${pe}${Ne}`))},es=/^[0-9a-fA-F]/,ut=Fn([["0","9"],["a","f"],["A","F"]],!1,!1),yo=Ms("blank space"),at=/^[ \t]/,ln=Fn([" "," "],!1,!1),S=Ms("white space"),Lt=/^[ \t\n\r]/,Tg=Fn([" "," ",` -`,"\r"],!1,!1),_l=`\r -`,Vp=ar(`\r -`,!1),Xp=` -`,_p=ar(` -`,!1),Zp="\r",$p=ar("\r",!1),G=0,yt=0,BA=[{line:1,column:1}],Wi=0,Zl=[],We=0,Ca;if("startRule"in e){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');n=i[e.startRule]}function Lg(){return r.substring(yt,G)}function uI(){return cn(yt,G)}function ed(R,q){throw q=q!==void 0?q:cn(yt,G),ec([Ms(R)],r.substring(yt,G),q)}function gI(R,q){throw q=q!==void 0?q:cn(yt,G),Og(R,q)}function ar(R,q){return{type:"literal",text:R,ignoreCase:q}}function Fn(R,q,pe){return{type:"class",parts:R,inverted:q,ignoreCase:pe}}function $l(){return{type:"any"}}function td(){return{type:"end"}}function Ms(R){return{type:"other",description:R}}function ma(R){var q=BA[R],pe;if(q)return q;for(pe=R-1;!BA[pe];)pe--;for(q=BA[pe],q={line:q.line,column:q.column};peWi&&(Wi=G,Zl=[]),Zl.push(R))}function Og(R,q){return new yc(R,null,null,q)}function ec(R,q,pe){return new yc(yc.buildMessage(R,q),R,q,pe)}function Us(){var R;return R=Mg(),R}function tc(){var R,q,pe;for(R=G,q=[],pe=bA();pe!==t;)q.push(pe),pe=bA();return q!==t&&(yt=R,q=s(q)),R=q,R}function bA(){var R,q,pe,Ne,xe;return R=G,q=Ia(),q!==t?(r.charCodeAt(G)===45?(pe=o,G++):(pe=t,We===0&&ke(a)),pe!==t?(Ne=Nr(),Ne!==t?(xe=Ea(),xe!==t?(yt=R,q=l(xe),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t),R}function Mg(){var R,q,pe;for(R=G,q=[],pe=Ug();pe!==t;)q.push(pe),pe=Ug();return q!==t&&(yt=R,q=c(q)),R=q,R}function Ug(){var R,q,pe,Ne,xe,qe,dt,Ft,Nn;if(R=G,q=Nr(),q===t&&(q=null),q!==t){if(pe=G,r.charCodeAt(G)===35?(Ne=u,G++):(Ne=t,We===0&&ke(g)),Ne!==t){if(xe=[],qe=G,dt=G,We++,Ft=Gs(),We--,Ft===t?dt=void 0:(G=dt,dt=t),dt!==t?(r.length>G?(Ft=r.charAt(G),G++):(Ft=t,We===0&&ke(f)),Ft!==t?(dt=[dt,Ft],qe=dt):(G=qe,qe=t)):(G=qe,qe=t),qe!==t)for(;qe!==t;)xe.push(qe),qe=G,dt=G,We++,Ft=Gs(),We--,Ft===t?dt=void 0:(G=dt,dt=t),dt!==t?(r.length>G?(Ft=r.charAt(G),G++):(Ft=t,We===0&&ke(f)),Ft!==t?(dt=[dt,Ft],qe=dt):(G=qe,qe=t)):(G=qe,qe=t);else xe=t;xe!==t?(Ne=[Ne,xe],pe=Ne):(G=pe,pe=t)}else G=pe,pe=t;if(pe===t&&(pe=null),pe!==t){if(Ne=[],xe=Hs(),xe!==t)for(;xe!==t;)Ne.push(xe),xe=Hs();else Ne=t;Ne!==t?(yt=R,q=h(),R=q):(G=R,R=t)}else G=R,R=t}else G=R,R=t;if(R===t&&(R=G,q=Ia(),q!==t?(pe=rc(),pe!==t?(Ne=Nr(),Ne===t&&(Ne=null),Ne!==t?(r.charCodeAt(G)===58?(xe=p,G++):(xe=t,We===0&&ke(C)),xe!==t?(qe=Nr(),qe===t&&(qe=null),qe!==t?(dt=Ea(),dt!==t?(yt=R,q=w(pe,dt),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t),R===t&&(R=G,q=Ia(),q!==t?(pe=Ks(),pe!==t?(Ne=Nr(),Ne===t&&(Ne=null),Ne!==t?(r.charCodeAt(G)===58?(xe=p,G++):(xe=t,We===0&&ke(C)),xe!==t?(qe=Nr(),qe===t&&(qe=null),qe!==t?(dt=Ea(),dt!==t?(yt=R,q=w(pe,dt),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t),R===t))){if(R=G,q=Ia(),q!==t)if(pe=Ks(),pe!==t)if(Ne=Nr(),Ne!==t)if(xe=fI(),xe!==t){if(qe=[],dt=Hs(),dt!==t)for(;dt!==t;)qe.push(dt),dt=Hs();else qe=t;qe!==t?(yt=R,q=w(pe,xe),R=q):(G=R,R=t)}else G=R,R=t;else G=R,R=t;else G=R,R=t;else G=R,R=t;if(R===t)if(R=G,q=Ia(),q!==t)if(pe=Ks(),pe!==t){if(Ne=[],xe=G,qe=Nr(),qe===t&&(qe=null),qe!==t?(r.charCodeAt(G)===44?(dt=B,G++):(dt=t,We===0&&ke(v)),dt!==t?(Ft=Nr(),Ft===t&&(Ft=null),Ft!==t?(Nn=Ks(),Nn!==t?(yt=xe,qe=D(pe,Nn),xe=qe):(G=xe,xe=t)):(G=xe,xe=t)):(G=xe,xe=t)):(G=xe,xe=t),xe!==t)for(;xe!==t;)Ne.push(xe),xe=G,qe=Nr(),qe===t&&(qe=null),qe!==t?(r.charCodeAt(G)===44?(dt=B,G++):(dt=t,We===0&&ke(v)),dt!==t?(Ft=Nr(),Ft===t&&(Ft=null),Ft!==t?(Nn=Ks(),Nn!==t?(yt=xe,qe=D(pe,Nn),xe=qe):(G=xe,xe=t)):(G=xe,xe=t)):(G=xe,xe=t)):(G=xe,xe=t);else Ne=t;Ne!==t?(xe=Nr(),xe===t&&(xe=null),xe!==t?(r.charCodeAt(G)===58?(qe=p,G++):(qe=t,We===0&&ke(C)),qe!==t?(dt=Nr(),dt===t&&(dt=null),dt!==t?(Ft=Ea(),Ft!==t?(yt=R,q=T(pe,Ne,Ft),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)}else G=R,R=t;else G=R,R=t}return R}function Ea(){var R,q,pe,Ne,xe,qe,dt;if(R=G,q=G,We++,pe=G,Ne=Gs(),Ne!==t?(xe=$e(),xe!==t?(r.charCodeAt(G)===45?(qe=o,G++):(qe=t,We===0&&ke(a)),qe!==t?(dt=Nr(),dt!==t?(Ne=[Ne,xe,qe,dt],pe=Ne):(G=pe,pe=t)):(G=pe,pe=t)):(G=pe,pe=t)):(G=pe,pe=t),We--,pe!==t?(G=q,q=void 0):q=t,q!==t?(pe=Hs(),pe!==t?(Ne=wo(),Ne!==t?(xe=tc(),xe!==t?(qe=QA(),qe!==t?(yt=R,q=H(xe),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t),R===t&&(R=G,q=Gs(),q!==t?(pe=wo(),pe!==t?(Ne=Mg(),Ne!==t?(xe=QA(),xe!==t?(yt=R,q=H(Ne),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t),R===t))if(R=G,q=ic(),q!==t){if(pe=[],Ne=Hs(),Ne!==t)for(;Ne!==t;)pe.push(Ne),Ne=Hs();else pe=t;pe!==t?(yt=R,q=j(q),R=q):(G=R,R=t)}else G=R,R=t;return R}function Ia(){var R,q,pe;for(We++,R=G,q=[],r.charCodeAt(G)===32?(pe=V,G++):(pe=t,We===0&&ke(W));pe!==t;)q.push(pe),r.charCodeAt(G)===32?(pe=V,G++):(pe=t,We===0&&ke(W));return q!==t?(yt=G,pe=Z(q),pe?pe=void 0:pe=t,pe!==t?(q=[q,pe],R=q):(G=R,R=t)):(G=R,R=t),We--,R===t&&(q=t,We===0&&ke($)),R}function $e(){var R,q,pe;for(R=G,q=[],r.charCodeAt(G)===32?(pe=V,G++):(pe=t,We===0&&ke(W));pe!==t;)q.push(pe),r.charCodeAt(G)===32?(pe=V,G++):(pe=t,We===0&&ke(W));return q!==t?(yt=G,pe=A(q),pe?pe=void 0:pe=t,pe!==t?(q=[q,pe],R=q):(G=R,R=t)):(G=R,R=t),R}function wo(){var R;return yt=G,R=ae(),R?R=void 0:R=t,R}function QA(){var R;return yt=G,R=ge(),R?R=void 0:R=t,R}function rc(){var R;return R=nc(),R===t&&(R=rd()),R}function Ks(){var R,q,pe;if(R=nc(),R===t){if(R=G,q=[],pe=Kg(),pe!==t)for(;pe!==t;)q.push(pe),pe=Kg();else q=t;q!==t&&(yt=R,q=_()),R=q}return R}function ic(){var R;return R=id(),R===t&&(R=hI(),R===t&&(R=nc(),R===t&&(R=rd()))),R}function fI(){var R;return R=id(),R===t&&(R=nc(),R===t&&(R=Kg())),R}function rd(){var R,q,pe,Ne,xe,qe;if(We++,R=G,N.test(r.charAt(G))?(q=r.charAt(G),G++):(q=t,We===0&&ke(ue)),q!==t){for(pe=[],Ne=G,xe=Nr(),xe===t&&(xe=null),xe!==t?(we.test(r.charAt(G))?(qe=r.charAt(G),G++):(qe=t,We===0&&ke(Te)),qe!==t?(xe=[xe,qe],Ne=xe):(G=Ne,Ne=t)):(G=Ne,Ne=t);Ne!==t;)pe.push(Ne),Ne=G,xe=Nr(),xe===t&&(xe=null),xe!==t?(we.test(r.charAt(G))?(qe=r.charAt(G),G++):(qe=t,We===0&&ke(Te)),qe!==t?(xe=[xe,qe],Ne=xe):(G=Ne,Ne=t)):(G=Ne,Ne=t);pe!==t?(yt=R,q=Pe(),R=q):(G=R,R=t)}else G=R,R=t;return We--,R===t&&(q=t,We===0&&ke(L)),R}function Kg(){var R,q,pe,Ne,xe;if(R=G,r.substr(G,2)===Le?(q=Le,G+=2):(q=t,We===0&&ke(se)),q===t&&(q=null),q!==t)if(Ae.test(r.charAt(G))?(pe=r.charAt(G),G++):(pe=t,We===0&&ke(be)),pe!==t){for(Ne=[],fe.test(r.charAt(G))?(xe=r.charAt(G),G++):(xe=t,We===0&&ke(le));xe!==t;)Ne.push(xe),fe.test(r.charAt(G))?(xe=r.charAt(G),G++):(xe=t,We===0&&ke(le));Ne!==t?(yt=R,q=Pe(),R=q):(G=R,R=t)}else G=R,R=t;else G=R,R=t;return R}function id(){var R,q;return R=G,r.substr(G,4)===Ge?(q=Ge,G+=4):(q=t,We===0&&ke(ie)),q!==t&&(yt=R,q=Y()),R=q,R}function hI(){var R,q;return R=G,r.substr(G,4)===he?(q=he,G+=4):(q=t,We===0&&ke(re)),q!==t&&(yt=R,q=me()),R=q,R===t&&(R=G,r.substr(G,5)===tt?(q=tt,G+=5):(q=t,We===0&&ke(Rt)),q!==t&&(yt=R,q=It()),R=q),R}function nc(){var R,q,pe,Ne;return We++,R=G,r.charCodeAt(G)===34?(q=oi,G++):(q=t,We===0&&ke(pi)),q!==t?(r.charCodeAt(G)===34?(pe=oi,G++):(pe=t,We===0&&ke(pi)),pe!==t?(yt=R,q=pr(),R=q):(G=R,R=t)):(G=R,R=t),R===t&&(R=G,r.charCodeAt(G)===34?(q=oi,G++):(q=t,We===0&&ke(pi)),q!==t?(pe=pI(),pe!==t?(r.charCodeAt(G)===34?(Ne=oi,G++):(Ne=t,We===0&&ke(pi)),Ne!==t?(yt=R,q=di(pe),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)),We--,R===t&&(q=t,We===0&&ke(Ur)),R}function pI(){var R,q,pe;if(R=G,q=[],pe=Hg(),pe!==t)for(;pe!==t;)q.push(pe),pe=Hg();else q=t;return q!==t&&(yt=R,q=ai(q)),R=q,R}function Hg(){var R,q,pe,Ne,xe,qe;return Os.test(r.charAt(G))?(R=r.charAt(G),G++):(R=t,We===0&&ke(dr)),R===t&&(R=G,r.substr(G,2)===Bi?(q=Bi,G+=2):(q=t,We===0&&ke(_n)),q!==t&&(yt=R,q=pa()),R=q,R===t&&(R=G,r.substr(G,2)===EA?(q=EA,G+=2):(q=t,We===0&&ke(kg)),q!==t&&(yt=R,q=Zn()),R=q,R===t&&(R=G,r.substr(G,2)===IA?(q=IA,G+=2):(q=t,We===0&&ke(da)),q!==t&&(yt=R,q=Jp()),R=q,R===t&&(R=G,r.substr(G,2)===yA?(q=yA,G+=2):(q=t,We===0&&ke(wA)),q!==t&&(yt=R,q=Br()),R=q,R===t&&(R=G,r.substr(G,2)===Vl?(q=Vl,G+=2):(q=t,We===0&&ke(Rg)),q!==t&&(yt=R,q=Eo()),R=q,R===t&&(R=G,r.substr(G,2)===Fg?(q=Fg,G+=2):(q=t,We===0&&ke(Wp)),q!==t&&(yt=R,q=zp()),R=q,R===t&&(R=G,r.substr(G,2)===Pr?(q=Pr,G+=2):(q=t,We===0&&ke(oe)),q!==t&&(yt=R,q=Io()),R=q,R===t&&(R=G,r.substr(G,2)===kn?(q=kn,G+=2):(q=t,We===0&&ke(Ng)),q!==t&&(yt=R,q=bt()),R=q,R===t&&(R=G,r.substr(G,2)===Xl?(q=Xl,G+=2):(q=t,We===0&&ke(Rn)),q!==t?(pe=SA(),pe!==t?(Ne=SA(),Ne!==t?(xe=SA(),xe!==t?(qe=SA(),qe!==t?(yt=R,q=$n(pe,Ne,xe,qe),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)))))))))),R}function SA(){var R;return es.test(r.charAt(G))?(R=r.charAt(G),G++):(R=t,We===0&&ke(ut)),R}function Nr(){var R,q;if(We++,R=[],at.test(r.charAt(G))?(q=r.charAt(G),G++):(q=t,We===0&&ke(ln)),q!==t)for(;q!==t;)R.push(q),at.test(r.charAt(G))?(q=r.charAt(G),G++):(q=t,We===0&&ke(ln));else R=t;return We--,R===t&&(q=t,We===0&&ke(yo)),R}function dI(){var R,q;if(We++,R=[],Lt.test(r.charAt(G))?(q=r.charAt(G),G++):(q=t,We===0&&ke(Tg)),q!==t)for(;q!==t;)R.push(q),Lt.test(r.charAt(G))?(q=r.charAt(G),G++):(q=t,We===0&&ke(Tg));else R=t;return We--,R===t&&(q=t,We===0&&ke(S)),R}function Hs(){var R,q,pe,Ne,xe,qe;if(R=G,q=Gs(),q!==t){for(pe=[],Ne=G,xe=Nr(),xe===t&&(xe=null),xe!==t?(qe=Gs(),qe!==t?(xe=[xe,qe],Ne=xe):(G=Ne,Ne=t)):(G=Ne,Ne=t);Ne!==t;)pe.push(Ne),Ne=G,xe=Nr(),xe===t&&(xe=null),xe!==t?(qe=Gs(),qe!==t?(xe=[xe,qe],Ne=xe):(G=Ne,Ne=t)):(G=Ne,Ne=t);pe!==t?(q=[q,pe],R=q):(G=R,R=t)}else G=R,R=t;return R}function Gs(){var R;return r.substr(G,2)===_l?(R=_l,G+=2):(R=t,We===0&&ke(Vp)),R===t&&(r.charCodeAt(G)===10?(R=Xp,G++):(R=t,We===0&&ke(_p)),R===t&&(r.charCodeAt(G)===13?(R=Zp,G++):(R=t,We===0&&ke($p)))),R}let Gg=2,vA=0;if(Ca=n(),Ca!==t&&G===r.length)return Ca;throw Ca!==t&&G{"use strict";var $de=r=>{let e=!1,t=!1,i=!1;for(let n=0;n{if(!(typeof r=="string"||Array.isArray(r)))throw new TypeError("Expected the input to be `string | string[]`");e=Object.assign({pascalCase:!1},e);let t=n=>e.pascalCase?n.charAt(0).toUpperCase()+n.slice(1):n;return Array.isArray(r)?r=r.map(n=>n.trim()).filter(n=>n.length).join("-"):r=r.trim(),r.length===0?"":r.length===1?e.pascalCase?r.toUpperCase():r.toLowerCase():(r!==r.toLowerCase()&&(r=$de(r)),r=r.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(n,s)=>s.toUpperCase()).replace(/\d+(\w|$)/g,n=>n.toUpperCase()),t(r))};Tv.exports=JH;Tv.exports.default=JH});var zH=y((B$e,eCe)=>{eCe.exports=[{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI",pr:"SYSTEM_PULLREQUEST_PULLREQUESTID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Shippable",constant:"SHIPPABLE",env:"SHIPPABLE",pr:{IS_PULL_REQUEST:"true"}},{name:"Solano CI",constant:"SOLANO",env:"TDDIUM",pr:"TDDIUM_PR_ID"},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vercel",constant:"VERCEL",env:"NOW_BUILDER"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"}]});var wc=y(Mn=>{"use strict";var XH=zH(),vo=process.env;Object.defineProperty(Mn,"_vendors",{value:XH.map(function(r){return r.constant})});Mn.name=null;Mn.isPR=null;XH.forEach(function(r){let t=(Array.isArray(r.env)?r.env:[r.env]).every(function(i){return VH(i)});if(Mn[r.constant]=t,t)switch(Mn.name=r.name,typeof r.pr){case"string":Mn.isPR=!!vo[r.pr];break;case"object":"env"in r.pr?Mn.isPR=r.pr.env in vo&&vo[r.pr.env]!==r.pr.ne:"any"in r.pr?Mn.isPR=r.pr.any.some(function(i){return!!vo[i]}):Mn.isPR=VH(r.pr);break;default:Mn.isPR=null}});Mn.isCI=!!(vo.CI||vo.CONTINUOUS_INTEGRATION||vo.BUILD_NUMBER||vo.RUN_ID||Mn.name);function VH(r){return typeof r=="string"?!!vo[r]:Object.keys(r).every(function(e){return vo[e]===r[e]})}});var ry=y(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});var tCe=0,rCe=1,iCe=2,nCe="",sCe="\0",oCe=-1,aCe=/^(-h|--help)(?:=([0-9]+))?$/,ACe=/^(--[a-z]+(?:-[a-z]+)*|-[a-zA-Z]+)$/,lCe=/^-[a-zA-Z]{2,}$/,cCe=/^([^=]+)=([\s\S]*)$/,uCe=process.env.DEBUG_CLI==="1";Un.BATCH_REGEX=lCe;Un.BINDING_REGEX=cCe;Un.DEBUG=uCe;Un.END_OF_INPUT=sCe;Un.HELP_COMMAND_INDEX=oCe;Un.HELP_REGEX=aCe;Un.NODE_ERRORED=iCe;Un.NODE_INITIAL=tCe;Un.NODE_SUCCESS=rCe;Un.OPTION_REGEX=ACe;Un.START_OF_INPUT=nCe});var iy=y(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});var gCe=ry(),Lv=class extends Error{constructor(e){super(e),this.clipanion={type:"usage"},this.name="UsageError"}},Ov=class extends Error{constructor(e,t){if(super(),this.input=e,this.candidates=t,this.clipanion={type:"none"},this.name="UnknownSyntaxError",this.candidates.length===0)this.message="Command not found, but we're not sure what's the alternative.";else if(this.candidates.every(i=>i.reason!==null&&i.reason===t[0].reason)){let[{reason:i}]=this.candidates;this.message=`${i} - -${this.candidates.map(({usage:n})=>`$ ${n}`).join(` -`)}`}else if(this.candidates.length===1){let[{usage:i}]=this.candidates;this.message=`Command not found; did you mean: - -$ ${i} -${Uv(e)}`}else this.message=`Command not found; did you mean one of: - -${this.candidates.map(({usage:i},n)=>`${`${n}.`.padStart(4)} ${i}`).join(` -`)} - -${Uv(e)}`}},Mv=class extends Error{constructor(e,t){super(),this.input=e,this.usages=t,this.clipanion={type:"none"},this.name="AmbiguousSyntaxError",this.message=`Cannot find which to pick amongst the following alternatives: - -${this.usages.map((i,n)=>`${`${n}.`.padStart(4)} ${i}`).join(` -`)} - -${Uv(e)}`}},Uv=r=>`While running ${r.filter(e=>e!==gCe.END_OF_INPUT).map(e=>{let t=JSON.stringify(e);return e.match(/\s/)||e.length===0||t!==`"${e}"`?t:e}).join(" ")}`;Qd.AmbiguousSyntaxError=Mv;Qd.UnknownSyntaxError=Ov;Qd.UsageError=Lv});var va=y(TA=>{"use strict";Object.defineProperty(TA,"__esModule",{value:!0});var _H=iy(),ZH=Symbol("clipanion/isOption");function fCe(r){return{...r,[ZH]:!0}}function hCe(r,e){return typeof r>"u"?[r,e]:typeof r=="object"&&r!==null&&!Array.isArray(r)?[void 0,r]:[r,e]}function Kv(r,e=!1){let t=r.replace(/^\.: /,"");return e&&(t=t[0].toLowerCase()+t.slice(1)),t}function $H(r,e){return e.length===1?new _H.UsageError(`${r}: ${Kv(e[0],!0)}`):new _H.UsageError(`${r}: -${e.map(t=>` -- ${Kv(t)}`).join("")}`)}function pCe(r,e,t){if(typeof t>"u")return e;let i=[],n=[],s=a=>{let l=e;return e=a,s.bind(null,l)};if(!t(e,{errors:i,coercions:n,coercion:s}))throw $H(`Invalid value for ${r}`,i);for(let[,a]of n)a();return e}TA.applyValidator=pCe;TA.cleanValidationError=Kv;TA.formatError=$H;TA.isOptionSymbol=ZH;TA.makeCommandOption=fCe;TA.rerouteArguments=hCe});var ns=y(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});var eG=/^[a-zA-Z_][a-zA-Z0-9_]*$/,tG=/^#[0-9a-f]{6}$/i,rG=/^#[0-9a-f]{6}([0-9a-f]{2})?$/i,iG=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,nG=/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$/i,Hv=/^(?:[1-9]\d{3}(-?)(?:(?:0[1-9]|1[0-2])\1(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])\1(?:29|30)|(?:0[13578]|1[02])(?:\1)31|00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[0-5]))|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)(?:(-?)02(?:\2)29|-?366))T(?:[01]\d|2[0-3])(:?)[0-5]\d(?:\3[0-5]\d)?(?:Z|[+-][01]\d(?:\3[0-5]\d)?)$/,sG=r=>()=>r;function Qt({test:r}){return sG(r)()}function Zr(r){return r===null?"null":r===void 0?"undefined":r===""?"an empty string":JSON.stringify(r)}function LA(r,e){var t,i,n;return typeof e=="number"?`${(t=r==null?void 0:r.p)!==null&&t!==void 0?t:"."}[${e}]`:eG.test(e)?`${(i=r==null?void 0:r.p)!==null&&i!==void 0?i:""}.${e}`:`${(n=r==null?void 0:r.p)!==null&&n!==void 0?n:"."}[${JSON.stringify(e)}]`}function Bc(r,e){return t=>{let i=r[e];return r[e]=t,Bc(r,e).bind(null,i)}}function oG(r,e){return t=>{r[e]=t}}function ny(r,e,t){return r===1?e:t}function pt({errors:r,p:e}={},t){return r==null||r.push(`${e!=null?e:"."}: ${t}`),!1}var aG=()=>Qt({test:(r,e)=>!0});function dCe(r){return Qt({test:(e,t)=>e!==r?pt(t,`Expected a literal (got ${Zr(r)})`):!0})}var CCe=()=>Qt({test:(r,e)=>typeof r!="string"?pt(e,`Expected a string (got ${Zr(r)})`):!0});function mCe(r){let e=Array.isArray(r)?r:Object.values(r),t=new Set(e);return Qt({test:(i,n)=>t.has(i)?!0:pt(n,`Expected a valid enumeration value (got ${Zr(i)})`)})}var ECe=new Map([["true",!0],["True",!0],["1",!0],[1,!0],["false",!1],["False",!1],["0",!1],[0,!1]]),ICe=()=>Qt({test:(r,e)=>{var t;if(typeof r!="boolean"){if(typeof(e==null?void 0:e.coercions)<"u"){if(typeof(e==null?void 0:e.coercion)>"u")return pt(e,"Unbound coercion result");let i=ECe.get(r);if(typeof i<"u")return e.coercions.push([(t=e.p)!==null&&t!==void 0?t:".",e.coercion.bind(null,i)]),!0}return pt(e,`Expected a boolean (got ${Zr(r)})`)}return!0}}),yCe=()=>Qt({test:(r,e)=>{var t;if(typeof r!="number"){if(typeof(e==null?void 0:e.coercions)<"u"){if(typeof(e==null?void 0:e.coercion)>"u")return pt(e,"Unbound coercion result");let i;if(typeof r=="string"){let n;try{n=JSON.parse(r)}catch{}if(typeof n=="number")if(JSON.stringify(n)===r)i=n;else return pt(e,`Received a number that can't be safely represented by the runtime (${r})`)}if(typeof i<"u")return e.coercions.push([(t=e.p)!==null&&t!==void 0?t:".",e.coercion.bind(null,i)]),!0}return pt(e,`Expected a number (got ${Zr(r)})`)}return!0}}),wCe=()=>Qt({test:(r,e)=>{var t;if(!(r instanceof Date)){if(typeof(e==null?void 0:e.coercions)<"u"){if(typeof(e==null?void 0:e.coercion)>"u")return pt(e,"Unbound coercion result");let i;if(typeof r=="string"&&Hv.test(r))i=new Date(r);else{let n;if(typeof r=="string"){let s;try{s=JSON.parse(r)}catch{}typeof s=="number"&&(n=s)}else typeof r=="number"&&(n=r);if(typeof n<"u")if(Number.isSafeInteger(n)||!Number.isSafeInteger(n*1e3))i=new Date(n*1e3);else return pt(e,`Received a timestamp that can't be safely represented by the runtime (${r})`)}if(typeof i<"u")return e.coercions.push([(t=e.p)!==null&&t!==void 0?t:".",e.coercion.bind(null,i)]),!0}return pt(e,`Expected a date (got ${Zr(r)})`)}return!0}}),BCe=(r,{delimiter:e}={})=>Qt({test:(t,i)=>{var n;if(typeof t=="string"&&typeof e<"u"&&typeof(i==null?void 0:i.coercions)<"u"){if(typeof(i==null?void 0:i.coercion)>"u")return pt(i,"Unbound coercion result");t=t.split(e),i.coercions.push([(n=i.p)!==null&&n!==void 0?n:".",i.coercion.bind(null,t)])}if(!Array.isArray(t))return pt(i,`Expected an array (got ${Zr(t)})`);let s=!0;for(let o=0,a=t.length;o{let t=AG(r.length);return Qt({test:(i,n)=>{var s;if(typeof i=="string"&&typeof e<"u"&&typeof(n==null?void 0:n.coercions)<"u"){if(typeof(n==null?void 0:n.coercion)>"u")return pt(n,"Unbound coercion result");i=i.split(e),n.coercions.push([(s=n.p)!==null&&s!==void 0?s:".",n.coercion.bind(null,i)])}if(!Array.isArray(i))return pt(n,`Expected a tuple (got ${Zr(i)})`);let o=t(i,Object.assign({},n));for(let a=0,l=i.length;aQt({test:(t,i)=>{if(typeof t!="object"||t===null)return pt(i,`Expected an object (got ${Zr(t)})`);let n=Object.keys(t),s=!0;for(let o=0,a=n.length;o{let t=Object.keys(r);return Qt({test:(i,n)=>{if(typeof i!="object"||i===null)return pt(n,`Expected an object (got ${Zr(i)})`);let s=new Set([...t,...Object.keys(i)]),o={},a=!0;for(let l of s){if(l==="constructor"||l==="__proto__")a=pt(Object.assign(Object.assign({},n),{p:LA(n,l)}),"Unsafe property name");else{let c=Object.prototype.hasOwnProperty.call(r,l)?r[l]:void 0,u=Object.prototype.hasOwnProperty.call(i,l)?i[l]:void 0;typeof c<"u"?a=c(u,Object.assign(Object.assign({},n),{p:LA(n,l),coercion:Bc(i,l)}))&&a:e===null?a=pt(Object.assign(Object.assign({},n),{p:LA(n,l)}),`Extraneous property (got ${Zr(u)})`):Object.defineProperty(o,l,{enumerable:!0,get:()=>u,set:oG(i,l)})}if(!a&&(n==null?void 0:n.errors)==null)break}return e!==null&&(a||(n==null?void 0:n.errors)!=null)&&(a=e(o,n)&&a),a}})},vCe=r=>Qt({test:(e,t)=>e instanceof r?!0:pt(t,`Expected an instance of ${r.name} (got ${Zr(e)})`)}),xCe=(r,{exclusive:e=!1}={})=>Qt({test:(t,i)=>{var n,s,o;let a=[],l=typeof(i==null?void 0:i.errors)<"u"?[]:void 0;for(let c=0,u=r.length;c1?pt(i,`Expected to match exactly a single predicate (matched ${a.join(", ")})`):(o=i==null?void 0:i.errors)===null||o===void 0||o.push(...l),!1}}),PCe=(r,e)=>Qt({test:(t,i)=>{var n,s;let o={value:t},a=typeof(i==null?void 0:i.coercions)<"u"?Bc(o,"value"):void 0,l=typeof(i==null?void 0:i.coercions)<"u"?[]:void 0;if(!r(t,Object.assign(Object.assign({},i),{coercion:a,coercions:l})))return!1;let c=[];if(typeof l<"u")for(let[,u]of l)c.push(u());try{if(typeof(i==null?void 0:i.coercions)<"u"){if(o.value!==t){if(typeof(i==null?void 0:i.coercion)>"u")return pt(i,"Unbound coercion result");i.coercions.push([(n=i.p)!==null&&n!==void 0?n:".",i.coercion.bind(null,o.value)])}(s=i==null?void 0:i.coercions)===null||s===void 0||s.push(...l)}return e.every(u=>u(o.value,i))}finally{for(let u of c)u()}}}),DCe=r=>Qt({test:(e,t)=>typeof e>"u"?!0:r(e,t)}),kCe=r=>Qt({test:(e,t)=>e===null?!0:r(e,t)}),RCe=r=>Qt({test:(e,t)=>e.length>=r?!0:pt(t,`Expected to have a length of at least ${r} elements (got ${e.length})`)}),FCe=r=>Qt({test:(e,t)=>e.length<=r?!0:pt(t,`Expected to have a length of at most ${r} elements (got ${e.length})`)}),AG=r=>Qt({test:(e,t)=>e.length!==r?pt(t,`Expected to have a length of exactly ${r} elements (got ${e.length})`):!0}),NCe=({map:r}={})=>Qt({test:(e,t)=>{let i=new Set,n=new Set;for(let s=0,o=e.length;sQt({test:(r,e)=>r<=0?!0:pt(e,`Expected to be negative (got ${r})`)}),LCe=()=>Qt({test:(r,e)=>r>=0?!0:pt(e,`Expected to be positive (got ${r})`)}),OCe=r=>Qt({test:(e,t)=>e>=r?!0:pt(t,`Expected to be at least ${r} (got ${e})`)}),MCe=r=>Qt({test:(e,t)=>e<=r?!0:pt(t,`Expected to be at most ${r} (got ${e})`)}),UCe=(r,e)=>Qt({test:(t,i)=>t>=r&&t<=e?!0:pt(i,`Expected to be in the [${r}; ${e}] range (got ${t})`)}),KCe=(r,e)=>Qt({test:(t,i)=>t>=r&&tQt({test:(e,t)=>e!==Math.round(e)?pt(t,`Expected to be an integer (got ${e})`):Number.isSafeInteger(e)?!0:pt(t,`Expected to be a safe integer (got ${e})`)}),GCe=r=>Qt({test:(e,t)=>r.test(e)?!0:pt(t,`Expected to match the pattern ${r.toString()} (got ${Zr(e)})`)}),YCe=()=>Qt({test:(r,e)=>r!==r.toLowerCase()?pt(e,`Expected to be all-lowercase (got ${r})`):!0}),jCe=()=>Qt({test:(r,e)=>r!==r.toUpperCase()?pt(e,`Expected to be all-uppercase (got ${r})`):!0}),qCe=()=>Qt({test:(r,e)=>nG.test(r)?!0:pt(e,`Expected to be a valid UUID v4 (got ${Zr(r)})`)}),JCe=()=>Qt({test:(r,e)=>Hv.test(r)?!1:pt(e,`Expected to be a valid ISO 8601 date string (got ${Zr(r)})`)}),WCe=({alpha:r=!1})=>Qt({test:(e,t)=>(r?tG.test(e):rG.test(e))?!0:pt(t,`Expected to be a valid hexadecimal color string (got ${Zr(e)})`)}),zCe=()=>Qt({test:(r,e)=>iG.test(r)?!0:pt(e,`Expected to be a valid base 64 string (got ${Zr(r)})`)}),VCe=(r=aG())=>Qt({test:(e,t)=>{let i;try{i=JSON.parse(e)}catch{return pt(t,`Expected to be a valid JSON string (got ${Zr(e)})`)}return r(i,t)}}),XCe=r=>{let e=new Set(r);return Qt({test:(t,i)=>{let n=new Set(Object.keys(t)),s=[];for(let o of e)n.has(o)||s.push(o);return s.length>0?pt(i,`Missing required ${ny(s.length,"property","properties")} ${s.map(o=>`"${o}"`).join(", ")}`):!0}})},_Ce=r=>{let e=new Set(r);return Qt({test:(t,i)=>{let n=new Set(Object.keys(t)),s=[];for(let o of e)n.has(o)&&s.push(o);return s.length>0?pt(i,`Forbidden ${ny(s.length,"property","properties")} ${s.map(o=>`"${o}"`).join(", ")}`):!0}})},ZCe=r=>{let e=new Set(r);return Qt({test:(t,i)=>{let n=new Set(Object.keys(t)),s=[];for(let o of e)n.has(o)&&s.push(o);return s.length>1?pt(i,`Mutually exclusive properties ${s.map(o=>`"${o}"`).join(", ")}`):!0}})};(function(r){r.Forbids="Forbids",r.Requires="Requires"})(st.KeyRelationship||(st.KeyRelationship={}));var $Ce={[st.KeyRelationship.Forbids]:{expect:!1,message:"forbids using"},[st.KeyRelationship.Requires]:{expect:!0,message:"requires using"}},eme=(r,e,t,{ignore:i=[]}={})=>{let n=new Set(i),s=new Set(t),o=$Ce[e];return Qt({test:(a,l)=>{let c=new Set(Object.keys(a));if(!c.has(r)||n.has(a[r]))return!0;let u=[];for(let g of s)(c.has(g)&&!n.has(a[g]))!==o.expect&&u.push(g);return u.length>=1?pt(l,`Property "${r}" ${o.message} ${ny(u.length,"property","properties")} ${u.map(g=>`"${g}"`).join(", ")}`):!0}})};st.applyCascade=PCe;st.base64RegExp=iG;st.colorStringAlphaRegExp=rG;st.colorStringRegExp=tG;st.computeKey=LA;st.getPrintable=Zr;st.hasExactLength=AG;st.hasForbiddenKeys=_Ce;st.hasKeyRelationship=eme;st.hasMaxLength=FCe;st.hasMinLength=RCe;st.hasMutuallyExclusiveKeys=ZCe;st.hasRequiredKeys=XCe;st.hasUniqueItems=NCe;st.isArray=BCe;st.isAtLeast=OCe;st.isAtMost=MCe;st.isBase64=zCe;st.isBoolean=ICe;st.isDate=wCe;st.isDict=QCe;st.isEnum=mCe;st.isHexColor=WCe;st.isISO8601=JCe;st.isInExclusiveRange=KCe;st.isInInclusiveRange=UCe;st.isInstanceOf=vCe;st.isInteger=HCe;st.isJSON=VCe;st.isLiteral=dCe;st.isLowerCase=YCe;st.isNegative=TCe;st.isNullable=kCe;st.isNumber=yCe;st.isObject=SCe;st.isOneOf=xCe;st.isOptional=DCe;st.isPositive=LCe;st.isString=CCe;st.isTuple=bCe;st.isUUID4=qCe;st.isUnknown=aG;st.isUpperCase=jCe;st.iso8601RegExp=Hv;st.makeCoercionFn=Bc;st.makeSetter=oG;st.makeTrait=sG;st.makeValidator=Qt;st.matchesRegExp=GCe;st.plural=ny;st.pushError=pt;st.simpleKeyRegExp=eG;st.uuid4RegExp=nG});var bc=y(Gv=>{"use strict";Object.defineProperty(Gv,"__esModule",{value:!0});var lG=va();function tme(r){if(r&&r.__esModule)return r;var e=Object.create(null);return r&&Object.keys(r).forEach(function(t){if(t!=="default"){var i=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:function(){return r[t]}})}}),e.default=r,Object.freeze(e)}var Sd=class{constructor(){this.help=!1}static Usage(e){return e}async catch(e){throw e}async validateAndExecute(){let t=this.constructor.schema;if(Array.isArray(t)){let{isDict:n,isUnknown:s,applyCascade:o}=await Promise.resolve().then(function(){return tme(ns())}),a=o(n(s()),t),l=[],c=[];if(!a(this,{errors:l,coercions:c}))throw lG.formatError("Invalid option schema",l);for(let[,g]of c)g()}else if(t!=null)throw new Error("Invalid command schema");let i=await this.execute();return typeof i<"u"?i:0}};Sd.isOption=lG.isOptionSymbol;Sd.Default=[];Gv.Command=Sd});var jv=y(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});var cG=80,Yv=Array(cG).fill("\u2501");for(let r=0;r<=24;++r)Yv[Yv.length-r]=`\x1B[38;5;${232+r}m\u2501`;var rme={header:r=>`\x1B[1m\u2501\u2501\u2501 ${r}${r.length`\x1B[1m${r}\x1B[22m`,error:r=>`\x1B[31m\x1B[1m${r}\x1B[22m\x1B[39m`,code:r=>`\x1B[36m${r}\x1B[39m`},ime={header:r=>r,bold:r=>r,error:r=>r,code:r=>r};function nme(r){let e=r.split(` -`),t=e.filter(n=>n.match(/\S/)),i=t.length>0?t.reduce((n,s)=>Math.min(n,s.length-s.trimStart().length),Number.MAX_VALUE):0;return e.map(n=>n.slice(i).trimRight()).join(` -`)}function sme(r,{format:e,paragraphs:t}){return r=r.replace(/\r\n?/g,` -`),r=nme(r),r=r.replace(/^\n+|\n+$/g,""),r=r.replace(/^(\s*)-([^\n]*?)\n+/gm,`$1-$2 - -`),r=r.replace(/\n(\n)?\n*/g,"$1"),t&&(r=r.split(/\n/).map(i=>{let n=i.match(/^\s*[*-][\t ]+(.*)/);if(!n)return i.match(/(.{1,80})(?: |$)/g).join(` -`);let s=i.length-i.trimStart().length;return n[1].match(new RegExp(`(.{1,${78-s}})(?: |$)`,"g")).map((o,a)=>" ".repeat(s)+(a===0?"- ":" ")+o).join(` -`)}).join(` - -`)),r=r.replace(/(`+)((?:.|[\n])*?)\1/g,(i,n,s)=>e.code(n+s+n)),r=r.replace(/(\*\*)((?:.|[\n])*?)\1/g,(i,n,s)=>e.bold(n+s+n)),r?`${r} -`:""}vd.formatMarkdownish=sme;vd.richFormat=rme;vd.textFormat=ime});var ly=y(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});var lt=ry(),ay=iy();function Vi(r){lt.DEBUG&&console.log(r)}var uG={candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,path:[],positionals:[],options:[],remainder:null,selectedIndex:lt.HELP_COMMAND_INDEX};function qv(){return{nodes:[Li(),Li(),Li()]}}function gG(r){let e=qv(),t=[],i=e.nodes.length;for(let n of r){t.push(i);for(let s=0;s{if(e.has(i))return;e.add(i);let n=r.nodes[i];for(let o of Object.values(n.statics))for(let{to:a}of o)t(a);for(let[,{to:o}]of n.dynamics)t(o);for(let{to:o}of n.shortcuts)t(o);let s=new Set(n.shortcuts.map(({to:o})=>o));for(;n.shortcuts.length>0;){let{to:o}=n.shortcuts.shift(),a=r.nodes[o];for(let[l,c]of Object.entries(a.statics)){let u=Object.prototype.hasOwnProperty.call(n.statics,l)?n.statics[l]:n.statics[l]=[];for(let g of c)u.some(({to:f})=>g.to===f)||u.push(g)}for(let[l,c]of a.dynamics)n.dynamics.some(([u,{to:g}])=>l===u&&c.to===g)||n.dynamics.push([l,c]);for(let l of a.shortcuts)s.has(l.to)||(n.shortcuts.push(l),s.add(l.to))}};t(lt.NODE_INITIAL)}function hG(r,{prefix:e=""}={}){if(lt.DEBUG){Vi(`${e}Nodes are:`);for(let t=0;tl!==lt.NODE_ERRORED).map(({state:l})=>({usage:l.candidateUsage,reason:null})));if(a.every(({node:l})=>l===lt.NODE_ERRORED))throw new ay.UnknownSyntaxError(e,a.map(({state:l})=>({usage:l.candidateUsage,reason:l.errorMessage})));i=pG(a)}if(i.length>0){Vi(" Results:");for(let s of i)Vi(` - ${s.node} -> ${JSON.stringify(s.state)}`)}else Vi(" No results");return i}function ome(r,e){if(e.selectedIndex!==null)return!0;if(Object.prototype.hasOwnProperty.call(r.statics,lt.END_OF_INPUT)){for(let{to:t}of r.statics[lt.END_OF_INPUT])if(t===lt.NODE_SUCCESS)return!0}return!1}function ame(r,e,t){let i=t&&e.length>0?[""]:[],n=Jv(r,e,t),s=[],o=new Set,a=(l,c,u=!0)=>{let g=[c];for(;g.length>0;){let h=g;g=[];for(let p of h){let C=r.nodes[p],w=Object.keys(C.statics);for(let B of Object.keys(C.statics)){let v=w[0];for(let{to:D,reducer:T}of C.statics[v])T==="pushPath"&&(u||l.push(v),g.push(D))}}u=!1}let f=JSON.stringify(l);o.has(f)||(s.push(l),o.add(f))};for(let{node:l,state:c}of n){if(c.remainder!==null){a([c.remainder],l);continue}let u=r.nodes[l],g=ome(u,c);for(let[f,h]of Object.entries(u.statics))(g&&f!==lt.END_OF_INPUT||!f.startsWith("-")&&h.some(({reducer:p})=>p==="pushPath"))&&a([...i,f],l);if(!!g)for(let[f,{to:h}]of u.dynamics){if(h===lt.NODE_ERRORED)continue;let p=IG(f,c);if(p!==null)for(let C of p)a([...i,C],l)}}return[...s].sort()}function Ame(r,e){let t=Jv(r,[...e,lt.END_OF_INPUT]);return dG(e,t.map(({state:i})=>i))}function pG(r){let e=0;for(let{state:t}of r)t.path.length>e&&(e=t.path.length);return r.filter(({state:t})=>t.path.length===e)}function dG(r,e){let t=e.filter(g=>g.selectedIndex!==null);if(t.length===0)throw new Error;let i=t.filter(g=>g.requiredOptions.every(f=>f.some(h=>g.options.find(p=>p.name===h))));if(i.length===0)throw new ay.UnknownSyntaxError(r,t.map(g=>({usage:g.candidateUsage,reason:null})));let n=0;for(let g of i)g.path.length>n&&(n=g.path.length);let s=i.filter(g=>g.path.length===n),o=g=>g.positionals.filter(({extra:f})=>!f).length+g.options.length,a=s.map(g=>({state:g,positionalCount:o(g)})),l=0;for(let{positionalCount:g}of a)g>l&&(l=g);let c=a.filter(({positionalCount:g})=>g===l).map(({state:g})=>g),u=CG(c);if(u.length>1)throw new ay.AmbiguousSyntaxError(r,u.map(g=>g.candidateUsage));return u[0]}function CG(r){let e=[],t=[];for(let i of r)i.selectedIndex===lt.HELP_COMMAND_INDEX?t.push(i):e.push(i);return t.length>0&&e.push({...uG,path:mG(...t.map(i=>i.path)),options:t.reduce((i,n)=>i.concat(n.options),[])}),e}function mG(r,e,...t){return e===void 0?Array.from(r):mG(r.filter((i,n)=>i===e[n]),...t)}function Li(){return{dynamics:[],shortcuts:[],statics:{}}}function Wv(r){return r===lt.NODE_SUCCESS||r===lt.NODE_ERRORED}function sy(r,e=0){return{to:Wv(r.to)?r.to:r.to>2?r.to+e-2:r.to+e,reducer:r.reducer}}function EG(r,e=0){let t=Li();for(let[i,n]of r.dynamics)t.dynamics.push([i,sy(n,e)]);for(let i of r.shortcuts)t.shortcuts.push(sy(i,e));for(let[i,n]of Object.entries(r.statics))t.statics[i]=n.map(s=>sy(s,e));return t}function Ei(r,e,t,i,n){r.nodes[e].dynamics.push([t,{to:i,reducer:n}])}function Qc(r,e,t,i){r.nodes[e].shortcuts.push({to:t,reducer:i})}function xo(r,e,t,i,n){(Object.prototype.hasOwnProperty.call(r.nodes[e].statics,t)?r.nodes[e].statics[t]:r.nodes[e].statics[t]=[]).push({to:i,reducer:n})}function xd(r,e,t,i){if(Array.isArray(e)){let[n,...s]=e;return r[n](t,i,...s)}else return r[e](t,i)}function IG(r,e){let t=Array.isArray(r)?Pd[r[0]]:Pd[r];if(typeof t.suggest>"u")return null;let i=Array.isArray(r)?r.slice(1):[];return t.suggest(e,...i)}var Pd={always:()=>!0,isOptionLike:(r,e)=>!r.ignoreOptions&&e!=="-"&&e.startsWith("-"),isNotOptionLike:(r,e)=>r.ignoreOptions||e==="-"||!e.startsWith("-"),isOption:(r,e,t,i)=>!r.ignoreOptions&&e===t,isBatchOption:(r,e,t)=>!r.ignoreOptions&<.BATCH_REGEX.test(e)&&[...e.slice(1)].every(i=>t.includes(`-${i}`)),isBoundOption:(r,e,t,i)=>{let n=e.match(lt.BINDING_REGEX);return!r.ignoreOptions&&!!n&<.OPTION_REGEX.test(n[1])&&t.includes(n[1])&&i.filter(s=>s.names.includes(n[1])).every(s=>s.allowBinding)},isNegatedOption:(r,e,t)=>!r.ignoreOptions&&e===`--no-${t.slice(2)}`,isHelp:(r,e)=>!r.ignoreOptions&<.HELP_REGEX.test(e),isUnsupportedOption:(r,e,t)=>!r.ignoreOptions&&e.startsWith("-")&<.OPTION_REGEX.test(e)&&!t.includes(e),isInvalidOption:(r,e)=>!r.ignoreOptions&&e.startsWith("-")&&!lt.OPTION_REGEX.test(e)};Pd.isOption.suggest=(r,e,t=!0)=>t?null:[e];var oy={setCandidateState:(r,e,t)=>({...r,...t}),setSelectedIndex:(r,e,t)=>({...r,selectedIndex:t}),pushBatch:(r,e)=>({...r,options:r.options.concat([...e.slice(1)].map(t=>({name:`-${t}`,value:!0})))}),pushBound:(r,e)=>{let[,t,i]=e.match(lt.BINDING_REGEX);return{...r,options:r.options.concat({name:t,value:i})}},pushPath:(r,e)=>({...r,path:r.path.concat(e)}),pushPositional:(r,e)=>({...r,positionals:r.positionals.concat({value:e,extra:!1})}),pushExtra:(r,e)=>({...r,positionals:r.positionals.concat({value:e,extra:!0})}),pushExtraNoLimits:(r,e)=>({...r,positionals:r.positionals.concat({value:e,extra:Po})}),pushTrue:(r,e,t=e)=>({...r,options:r.options.concat({name:e,value:!0})}),pushFalse:(r,e,t=e)=>({...r,options:r.options.concat({name:t,value:!1})}),pushUndefined:(r,e)=>({...r,options:r.options.concat({name:e,value:void 0})}),pushStringValue:(r,e)=>{var t;let i={...r,options:[...r.options]},n=r.options[r.options.length-1];return n.value=((t=n.value)!==null&&t!==void 0?t:[]).concat([e]),i},setStringValue:(r,e)=>{let t={...r,options:[...r.options]},i=r.options[r.options.length-1];return i.value=e,t},inhibateOptions:r=>({...r,ignoreOptions:!0}),useHelp:(r,e,t)=>{let[,,i]=e.match(lt.HELP_REGEX);return typeof i<"u"?{...r,options:[{name:"-c",value:String(t)},{name:"-i",value:i}]}:{...r,options:[{name:"-c",value:String(t)}]}},setError:(r,e,t)=>e===lt.END_OF_INPUT?{...r,errorMessage:`${t}.`}:{...r,errorMessage:`${t} ("${e}").`},setOptionArityError:(r,e)=>{let t=r.options[r.options.length-1];return{...r,errorMessage:`Not enough arguments to option ${t.name}.`}}},Po=Symbol(),Ay=class{constructor(e,t){this.allOptionNames=[],this.arity={leading:[],trailing:[],extra:[],proxy:!1},this.options=[],this.paths=[],this.cliIndex=e,this.cliOpts=t}addPath(e){this.paths.push(e)}setArity({leading:e=this.arity.leading,trailing:t=this.arity.trailing,extra:i=this.arity.extra,proxy:n=this.arity.proxy}){Object.assign(this.arity,{leading:e,trailing:t,extra:i,proxy:n})}addPositional({name:e="arg",required:t=!0}={}){if(!t&&this.arity.extra===Po)throw new Error("Optional parameters cannot be declared when using .rest() or .proxy()");if(!t&&this.arity.trailing.length>0)throw new Error("Optional parameters cannot be declared after the required trailing positional arguments");!t&&this.arity.extra!==Po?this.arity.extra.push(e):this.arity.extra!==Po&&this.arity.extra.length===0?this.arity.leading.push(e):this.arity.trailing.push(e)}addRest({name:e="arg",required:t=0}={}){if(this.arity.extra===Po)throw new Error("Infinite lists cannot be declared multiple times in the same command");if(this.arity.trailing.length>0)throw new Error("Infinite lists cannot be declared after the required trailing positional arguments");for(let i=0;i1)throw new Error("The arity cannot be higher than 1 when the option only supports the --arg=value syntax");if(!Number.isInteger(i))throw new Error(`The arity must be an integer, got ${i}`);if(i<0)throw new Error(`The arity must be positive, got ${i}`);this.allOptionNames.push(...e),this.options.push({names:e,description:t,arity:i,hidden:n,required:s,allowBinding:o})}setContext(e){this.context=e}usage({detailed:e=!0,inlineOptions:t=!0}={}){let i=[this.cliOpts.binaryName],n=[];if(this.paths.length>0&&i.push(...this.paths[0]),e){for(let{names:o,arity:a,hidden:l,description:c,required:u}of this.options){if(l)continue;let g=[];for(let h=0;h`:`[${f}]`)}i.push(...this.arity.leading.map(o=>`<${o}>`)),this.arity.extra===Po?i.push("..."):i.push(...this.arity.extra.map(o=>`[${o}]`)),i.push(...this.arity.trailing.map(o=>`<${o}>`))}return{usage:i.join(" "),options:n}}compile(){if(typeof this.context>"u")throw new Error("Assertion failed: No context attached");let e=qv(),t=lt.NODE_INITIAL,i=this.usage().usage,n=this.options.filter(a=>a.required).map(a=>a.names);t=ss(e,Li()),xo(e,lt.NODE_INITIAL,lt.START_OF_INPUT,t,["setCandidateState",{candidateUsage:i,requiredOptions:n}]);let s=this.arity.proxy?"always":"isNotOptionLike",o=this.paths.length>0?this.paths:[[]];for(let a of o){let l=t;if(a.length>0){let f=ss(e,Li());Qc(e,l,f),this.registerOptions(e,f),l=f}for(let f=0;f0||!this.arity.proxy){let f=ss(e,Li());Ei(e,l,"isHelp",f,["useHelp",this.cliIndex]),xo(e,f,lt.END_OF_INPUT,lt.NODE_SUCCESS,["setSelectedIndex",lt.HELP_COMMAND_INDEX]),this.registerOptions(e,l)}this.arity.leading.length>0&&xo(e,l,lt.END_OF_INPUT,lt.NODE_ERRORED,["setError","Not enough positional arguments"]);let c=l;for(let f=0;f0||f+1!==this.arity.leading.length)&&xo(e,h,lt.END_OF_INPUT,lt.NODE_ERRORED,["setError","Not enough positional arguments"]),Ei(e,c,"isNotOptionLike",h,"pushPositional"),c=h}let u=c;if(this.arity.extra===Po||this.arity.extra.length>0){let f=ss(e,Li());if(Qc(e,c,f),this.arity.extra===Po){let h=ss(e,Li());this.arity.proxy||this.registerOptions(e,h),Ei(e,c,s,h,"pushExtraNoLimits"),Ei(e,h,s,h,"pushExtraNoLimits"),Qc(e,h,f)}else for(let h=0;h0&&xo(e,u,lt.END_OF_INPUT,lt.NODE_ERRORED,["setError","Not enough positional arguments"]);let g=u;for(let f=0;fo.length>s.length?o:s,"");if(i.arity===0)for(let s of i.names)Ei(e,t,["isOption",s,i.hidden||s!==n],t,"pushTrue"),s.startsWith("--")&&!s.startsWith("--no-")&&Ei(e,t,["isNegatedOption",s],t,["pushFalse",s]);else{let s=ss(e,Li());for(let o of i.names)Ei(e,t,["isOption",o,i.hidden||o!==n],s,"pushUndefined");for(let o=0;o=0&&eAme(i,n),suggest:(n,s)=>ame(i,n,s)}}};Ar.CliBuilder=Dd;Ar.CommandBuilder=Ay;Ar.NoLimits=Po;Ar.aggregateHelpStates=CG;Ar.cloneNode=EG;Ar.cloneTransition=sy;Ar.debug=Vi;Ar.debugMachine=hG;Ar.execute=xd;Ar.injectNode=ss;Ar.isTerminalNode=Wv;Ar.makeAnyOfMachine=gG;Ar.makeNode=Li;Ar.makeStateMachine=qv;Ar.reducers=oy;Ar.registerDynamic=Ei;Ar.registerShortcut=Qc;Ar.registerStatic=xo;Ar.runMachineInternal=Jv;Ar.selectBestState=dG;Ar.simplifyMachine=fG;Ar.suggest=IG;Ar.tests=Pd;Ar.trimSmallerBranches=pG});var yG=y(zv=>{"use strict";Object.defineProperty(zv,"__esModule",{value:!0});var lme=bc(),kd=class extends lme.Command{constructor(e){super(),this.contexts=e,this.commands=[]}static from(e,t){let i=new kd(t);i.path=e.path;for(let n of e.options)switch(n.name){case"-c":i.commands.push(Number(n.value));break;case"-i":i.index=Number(n.value);break}return i}async execute(){let e=this.commands;if(typeof this.index<"u"&&this.index>=0&&this.index1){this.context.stdout.write(`Multiple commands match your selection: -`),this.context.stdout.write(` -`);let t=0;for(let i of this.commands)this.context.stdout.write(this.cli.usage(this.contexts[i].commandClass,{prefix:`${t++}. `.padStart(5)}));this.context.stdout.write(` -`),this.context.stdout.write(`Run again with -h= to see the longer details of any of those commands. -`)}}};zv.HelpCommand=kd});var vG=y(Vv=>{"use strict";Object.defineProperty(Vv,"__esModule",{value:!0});var cme=ry(),wG=bc(),ume=J("tty"),gme=ly(),hn=jv(),fme=yG();function hme(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var BG=hme(ume),bG=Symbol("clipanion/errorCommand");function pme(){return process.env.FORCE_COLOR==="0"?1:process.env.FORCE_COLOR==="1"||typeof process.stdout<"u"&&process.stdout.isTTY?8:1}var OA=class{constructor({binaryLabel:e,binaryName:t="...",binaryVersion:i,enableCapture:n=!1,enableColors:s}={}){this.registrations=new Map,this.builder=new gme.CliBuilder({binaryName:t}),this.binaryLabel=e,this.binaryName=t,this.binaryVersion=i,this.enableCapture=n,this.enableColors=s}static from(e,t={}){let i=new OA(t);for(let n of e)i.register(n);return i}register(e){var t;let i=new Map,n=new e;for(let l in n){let c=n[l];typeof c=="object"&&c!==null&&c[wG.Command.isOption]&&i.set(l,c)}let s=this.builder.command(),o=s.cliIndex,a=(t=e.paths)!==null&&t!==void 0?t:n.paths;if(typeof a<"u")for(let l of a)s.addPath(l);this.registrations.set(e,{specs:i,builder:s,index:o});for(let[l,{definition:c}]of i.entries())c(s,l);s.setContext({commandClass:e})}process(e){let{contexts:t,process:i}=this.builder.compile(),n=i(e);switch(n.selectedIndex){case cme.HELP_COMMAND_INDEX:return fme.HelpCommand.from(n,t);default:{let{commandClass:s}=t[n.selectedIndex],o=this.registrations.get(s);if(typeof o>"u")throw new Error("Assertion failed: Expected the command class to have been registered.");let a=new s;a.path=n.path;try{for(let[l,{transformer:c}]of o.specs.entries())a[l]=c(o.builder,l,n);return a}catch(l){throw l[bG]=a,l}}break}}async run(e,t){var i;let n,s={...OA.defaultContext,...t},o=(i=this.enableColors)!==null&&i!==void 0?i:s.colorDepth>1;if(!Array.isArray(e))n=e;else try{n=this.process(e)}catch(c){return s.stdout.write(this.error(c,{colored:o})),1}if(n.help)return s.stdout.write(this.usage(n,{colored:o,detailed:!0})),0;n.context=s,n.cli={binaryLabel:this.binaryLabel,binaryName:this.binaryName,binaryVersion:this.binaryVersion,enableCapture:this.enableCapture,enableColors:this.enableColors,definitions:()=>this.definitions(),error:(c,u)=>this.error(c,u),format:c=>this.format(c),process:c=>this.process(c),run:(c,u)=>this.run(c,{...s,...u}),usage:(c,u)=>this.usage(c,u)};let a=this.enableCapture?dme(s):SG,l;try{l=await a(()=>n.validateAndExecute().catch(c=>n.catch(c).then(()=>0)))}catch(c){return s.stdout.write(this.error(c,{colored:o,command:n})),1}return l}async runExit(e,t){process.exitCode=await this.run(e,t)}suggest(e,t){let{suggest:i}=this.builder.compile();return i(e,t)}definitions({colored:e=!1}={}){let t=[];for(let[i,{index:n}]of this.registrations){if(typeof i.usage>"u")continue;let{usage:s}=this.getUsageByIndex(n,{detailed:!1}),{usage:o,options:a}=this.getUsageByIndex(n,{detailed:!0,inlineOptions:!1}),l=typeof i.usage.category<"u"?hn.formatMarkdownish(i.usage.category,{format:this.format(e),paragraphs:!1}):void 0,c=typeof i.usage.description<"u"?hn.formatMarkdownish(i.usage.description,{format:this.format(e),paragraphs:!1}):void 0,u=typeof i.usage.details<"u"?hn.formatMarkdownish(i.usage.details,{format:this.format(e),paragraphs:!0}):void 0,g=typeof i.usage.examples<"u"?i.usage.examples.map(([f,h])=>[hn.formatMarkdownish(f,{format:this.format(e),paragraphs:!1}),h.replace(/\$0/g,this.binaryName)]):void 0;t.push({path:s,usage:o,category:l,description:c,details:u,examples:g,options:a})}return t}usage(e=null,{colored:t,detailed:i=!1,prefix:n="$ "}={}){var s;if(e===null){for(let l of this.registrations.keys()){let c=l.paths,u=typeof l.usage<"u";if(!c||c.length===0||c.length===1&&c[0].length===0||((s=c==null?void 0:c.some(h=>h.length===0))!==null&&s!==void 0?s:!1))if(e){e=null;break}else e=l;else if(u){e=null;continue}}e&&(i=!0)}let o=e!==null&&e instanceof wG.Command?e.constructor:e,a="";if(o)if(i){let{description:l="",details:c="",examples:u=[]}=o.usage||{};l!==""&&(a+=hn.formatMarkdownish(l,{format:this.format(t),paragraphs:!1}).replace(/^./,h=>h.toUpperCase()),a+=` -`),(c!==""||u.length>0)&&(a+=`${this.format(t).header("Usage")} -`,a+=` -`);let{usage:g,options:f}=this.getUsageByRegistration(o,{inlineOptions:!1});if(a+=`${this.format(t).bold(n)}${g} -`,f.length>0){a+=` -`,a+=`${hn.richFormat.header("Options")} -`;let h=f.reduce((p,C)=>Math.max(p,C.definition.length),0);a+=` -`;for(let{definition:p,description:C}of f)a+=` ${this.format(t).bold(p.padEnd(h))} ${hn.formatMarkdownish(C,{format:this.format(t),paragraphs:!1})}`}if(c!==""&&(a+=` -`,a+=`${this.format(t).header("Details")} -`,a+=` -`,a+=hn.formatMarkdownish(c,{format:this.format(t),paragraphs:!0})),u.length>0){a+=` -`,a+=`${this.format(t).header("Examples")} -`;for(let[h,p]of u)a+=` -`,a+=hn.formatMarkdownish(h,{format:this.format(t),paragraphs:!1}),a+=`${p.replace(/^/m,` ${this.format(t).bold(n)}`).replace(/\$0/g,this.binaryName)} -`}}else{let{usage:l}=this.getUsageByRegistration(o);a+=`${this.format(t).bold(n)}${l} -`}else{let l=new Map;for(let[f,{index:h}]of this.registrations.entries()){if(typeof f.usage>"u")continue;let p=typeof f.usage.category<"u"?hn.formatMarkdownish(f.usage.category,{format:this.format(t),paragraphs:!1}):null,C=l.get(p);typeof C>"u"&&l.set(p,C=[]);let{usage:w}=this.getUsageByIndex(h);C.push({commandClass:f,usage:w})}let c=Array.from(l.keys()).sort((f,h)=>f===null?-1:h===null?1:f.localeCompare(h,"en",{usage:"sort",caseFirst:"upper"})),u=typeof this.binaryLabel<"u",g=typeof this.binaryVersion<"u";u||g?(u&&g?a+=`${this.format(t).header(`${this.binaryLabel} - ${this.binaryVersion}`)} - -`:u?a+=`${this.format(t).header(`${this.binaryLabel}`)} -`:a+=`${this.format(t).header(`${this.binaryVersion}`)} -`,a+=` ${this.format(t).bold(n)}${this.binaryName} -`):a+=`${this.format(t).bold(n)}${this.binaryName} -`;for(let f of c){let h=l.get(f).slice().sort((C,w)=>C.usage.localeCompare(w.usage,"en",{usage:"sort",caseFirst:"upper"})),p=f!==null?f.trim():"General commands";a+=` -`,a+=`${this.format(t).header(`${p}`)} -`;for(let{commandClass:C,usage:w}of h){let B=C.usage.description||"undocumented";a+=` -`,a+=` ${this.format(t).bold(w)} -`,a+=` ${hn.formatMarkdownish(B,{format:this.format(t),paragraphs:!1})}`}}a+=` -`,a+=hn.formatMarkdownish("You can also print more details about any of these commands by calling them with the `-h,--help` flag right after the command name.",{format:this.format(t),paragraphs:!0})}return a}error(e,t){var i,{colored:n,command:s=(i=e[bG])!==null&&i!==void 0?i:null}=t===void 0?{}:t;e instanceof Error||(e=new Error(`Execution failed with a non-error rejection (rejected value: ${JSON.stringify(e)})`));let o="",a=e.name.replace(/([a-z])([A-Z])/g,"$1 $2");a==="Error"&&(a="Internal Error"),o+=`${this.format(n).error(a)}: ${e.message} -`;let l=e.clipanion;return typeof l<"u"?l.type==="usage"&&(o+=` -`,o+=this.usage(s)):e.stack&&(o+=`${e.stack.replace(/^.*\n/,"")} -`),o}format(e){var t;return((t=e!=null?e:this.enableColors)!==null&&t!==void 0?t:OA.defaultContext.colorDepth>1)?hn.richFormat:hn.textFormat}getUsageByRegistration(e,t){let i=this.registrations.get(e);if(typeof i>"u")throw new Error("Assertion failed: Unregistered command");return this.getUsageByIndex(i.index,t)}getUsageByIndex(e,t){return this.builder.getBuilderByIndex(e).usage(t)}};OA.defaultContext={stdin:process.stdin,stdout:process.stdout,stderr:process.stderr,colorDepth:"getColorDepth"in BG.default.WriteStream.prototype?BG.default.WriteStream.prototype.getColorDepth():pme()};var QG;function dme(r){let e=QG;if(typeof e>"u"){if(r.stdout===process.stdout&&r.stderr===process.stderr)return SG;let{AsyncLocalStorage:t}=J("async_hooks");e=QG=new t;let i=process.stdout._write;process.stdout._write=function(s,o,a){let l=e.getStore();return typeof l>"u"?i.call(this,s,o,a):l.stdout.write(s,o,a)};let n=process.stderr._write;process.stderr._write=function(s,o,a){let l=e.getStore();return typeof l>"u"?n.call(this,s,o,a):l.stderr.write(s,o,a)}}return t=>e.run(r,t)}function SG(r){return r()}Vv.Cli=OA});var xG=y(Xv=>{"use strict";Object.defineProperty(Xv,"__esModule",{value:!0});var Cme=bc(),cy=class extends Cme.Command{async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.definitions(),null,2)} -`)}};cy.paths=[["--clipanion=definitions"]];Xv.DefinitionsCommand=cy});var PG=y(_v=>{"use strict";Object.defineProperty(_v,"__esModule",{value:!0});var mme=bc(),uy=class extends mme.Command{async execute(){this.context.stdout.write(this.cli.usage())}};uy.paths=[["-h"],["--help"]];_v.HelpCommand=uy});var DG=y(Zv=>{"use strict";Object.defineProperty(Zv,"__esModule",{value:!0});var Eme=bc(),gy=class extends Eme.Command{async execute(){var e;this.context.stdout.write(`${(e=this.cli.binaryVersion)!==null&&e!==void 0?e:""} -`)}};gy.paths=[["-v"],["--version"]];Zv.VersionCommand=gy});var kG=y(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});var Ime=xG(),yme=PG(),wme=DG();Rd.DefinitionsCommand=Ime.DefinitionsCommand;Rd.HelpCommand=yme.HelpCommand;Rd.VersionCommand=wme.VersionCommand});var FG=y($v=>{"use strict";Object.defineProperty($v,"__esModule",{value:!0});var RG=va();function Bme(r,e,t){let[i,n]=RG.rerouteArguments(e,t!=null?t:{}),{arity:s=1}=n,o=r.split(","),a=new Set(o);return RG.makeCommandOption({definition(l){l.addOption({names:o,arity:s,hidden:n==null?void 0:n.hidden,description:n==null?void 0:n.description,required:n.required})},transformer(l,c,u){let g=typeof i<"u"?[...i]:void 0;for(let{name:f,value:h}of u.options)!a.has(f)||(g=g!=null?g:[],g.push(h));return g}})}$v.Array=Bme});var TG=y(ex=>{"use strict";Object.defineProperty(ex,"__esModule",{value:!0});var NG=va();function bme(r,e,t){let[i,n]=NG.rerouteArguments(e,t!=null?t:{}),s=r.split(","),o=new Set(s);return NG.makeCommandOption({definition(a){a.addOption({names:s,allowBinding:!1,arity:0,hidden:n.hidden,description:n.description,required:n.required})},transformer(a,l,c){let u=i;for(let{name:g,value:f}of c.options)!o.has(g)||(u=f);return u}})}ex.Boolean=bme});var OG=y(tx=>{"use strict";Object.defineProperty(tx,"__esModule",{value:!0});var LG=va();function Qme(r,e,t){let[i,n]=LG.rerouteArguments(e,t!=null?t:{}),s=r.split(","),o=new Set(s);return LG.makeCommandOption({definition(a){a.addOption({names:s,allowBinding:!1,arity:0,hidden:n.hidden,description:n.description,required:n.required})},transformer(a,l,c){let u=i;for(let{name:g,value:f}of c.options)!o.has(g)||(u!=null||(u=0),f?u+=1:u=0);return u}})}tx.Counter=Qme});var MG=y(rx=>{"use strict";Object.defineProperty(rx,"__esModule",{value:!0});var Sme=va();function vme(r={}){return Sme.makeCommandOption({definition(e,t){var i;e.addProxy({name:(i=r.name)!==null&&i!==void 0?i:t,required:r.required})},transformer(e,t,i){return i.positionals.map(({value:n})=>n)}})}rx.Proxy=vme});var UG=y(ix=>{"use strict";Object.defineProperty(ix,"__esModule",{value:!0});var xme=va(),Pme=ly();function Dme(r={}){return xme.makeCommandOption({definition(e,t){var i;e.addRest({name:(i=r.name)!==null&&i!==void 0?i:t,required:r.required})},transformer(e,t,i){let n=o=>{let a=i.positionals[o];return a.extra===Pme.NoLimits||a.extra===!1&&oo)}})}ix.Rest=Dme});var KG=y(nx=>{"use strict";Object.defineProperty(nx,"__esModule",{value:!0});var Fd=va(),kme=ly();function Rme(r,e,t){let[i,n]=Fd.rerouteArguments(e,t!=null?t:{}),{arity:s=1}=n,o=r.split(","),a=new Set(o);return Fd.makeCommandOption({definition(l){l.addOption({names:o,arity:n.tolerateBoolean?0:s,hidden:n.hidden,description:n.description,required:n.required})},transformer(l,c,u){let g,f=i;for(let{name:h,value:p}of u.options)!a.has(h)||(g=h,f=p);return typeof f=="string"?Fd.applyValidator(g!=null?g:c,f,n.validator):f}})}function Fme(r={}){let{required:e=!0}=r;return Fd.makeCommandOption({definition(t,i){var n;t.addPositional({name:(n=r.name)!==null&&n!==void 0?n:i,required:r.required})},transformer(t,i,n){var s;for(let o=0;o{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});var lf=va(),Tme=FG(),Lme=TG(),Ome=OG(),Mme=MG(),Ume=UG(),Kme=KG();pn.applyValidator=lf.applyValidator;pn.cleanValidationError=lf.cleanValidationError;pn.formatError=lf.formatError;pn.isOptionSymbol=lf.isOptionSymbol;pn.makeCommandOption=lf.makeCommandOption;pn.rerouteArguments=lf.rerouteArguments;pn.Array=Tme.Array;pn.Boolean=Lme.Boolean;pn.Counter=Ome.Counter;pn.Proxy=Mme.Proxy;pn.Rest=Ume.Rest;pn.String=Kme.String});var Xe=y(MA=>{"use strict";Object.defineProperty(MA,"__esModule",{value:!0});var Hme=iy(),Gme=bc(),Yme=jv(),jme=vG(),qme=kG(),Jme=HG();MA.UsageError=Hme.UsageError;MA.Command=Gme.Command;MA.formatMarkdownish=Yme.formatMarkdownish;MA.Cli=jme.Cli;MA.Builtins=qme;MA.Option=Jme});var YG=y((J$e,GG)=>{"use strict";GG.exports=(r,...e)=>new Promise(t=>{t(r(...e))})});var cf=y((W$e,sx)=>{"use strict";var Wme=YG(),jG=r=>{if(r<1)throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=[],t=0,i=()=>{t--,e.length>0&&e.shift()()},n=(a,l,...c)=>{t++;let u=Wme(a,...c);l(u),u.then(i,i)},s=(a,l,...c)=>{tnew Promise(c=>s(a,c,...l));return Object.defineProperties(o,{activeCount:{get:()=>t},pendingCount:{get:()=>e.length}}),o};sx.exports=jG;sx.exports.default=jG});var Nd=y((V$e,qG)=>{var zme="2.0.0",Vme=Number.MAX_SAFE_INTEGER||9007199254740991,Xme=16;qG.exports={SEMVER_SPEC_VERSION:zme,MAX_LENGTH:256,MAX_SAFE_INTEGER:Vme,MAX_SAFE_COMPONENT_LENGTH:Xme}});var Td=y((X$e,JG)=>{var _me=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};JG.exports=_me});var Sc=y((KA,WG)=>{var{MAX_SAFE_COMPONENT_LENGTH:ox}=Nd(),Zme=Td();KA=WG.exports={};var $me=KA.re=[],_e=KA.src=[],Ze=KA.t={},eEe=0,St=(r,e,t)=>{let i=eEe++;Zme(i,e),Ze[r]=i,_e[i]=e,$me[i]=new RegExp(e,t?"g":void 0)};St("NUMERICIDENTIFIER","0|[1-9]\\d*");St("NUMERICIDENTIFIERLOOSE","[0-9]+");St("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*");St("MAINVERSION",`(${_e[Ze.NUMERICIDENTIFIER]})\\.(${_e[Ze.NUMERICIDENTIFIER]})\\.(${_e[Ze.NUMERICIDENTIFIER]})`);St("MAINVERSIONLOOSE",`(${_e[Ze.NUMERICIDENTIFIERLOOSE]})\\.(${_e[Ze.NUMERICIDENTIFIERLOOSE]})\\.(${_e[Ze.NUMERICIDENTIFIERLOOSE]})`);St("PRERELEASEIDENTIFIER",`(?:${_e[Ze.NUMERICIDENTIFIER]}|${_e[Ze.NONNUMERICIDENTIFIER]})`);St("PRERELEASEIDENTIFIERLOOSE",`(?:${_e[Ze.NUMERICIDENTIFIERLOOSE]}|${_e[Ze.NONNUMERICIDENTIFIER]})`);St("PRERELEASE",`(?:-(${_e[Ze.PRERELEASEIDENTIFIER]}(?:\\.${_e[Ze.PRERELEASEIDENTIFIER]})*))`);St("PRERELEASELOOSE",`(?:-?(${_e[Ze.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${_e[Ze.PRERELEASEIDENTIFIERLOOSE]})*))`);St("BUILDIDENTIFIER","[0-9A-Za-z-]+");St("BUILD",`(?:\\+(${_e[Ze.BUILDIDENTIFIER]}(?:\\.${_e[Ze.BUILDIDENTIFIER]})*))`);St("FULLPLAIN",`v?${_e[Ze.MAINVERSION]}${_e[Ze.PRERELEASE]}?${_e[Ze.BUILD]}?`);St("FULL",`^${_e[Ze.FULLPLAIN]}$`);St("LOOSEPLAIN",`[v=\\s]*${_e[Ze.MAINVERSIONLOOSE]}${_e[Ze.PRERELEASELOOSE]}?${_e[Ze.BUILD]}?`);St("LOOSE",`^${_e[Ze.LOOSEPLAIN]}$`);St("GTLT","((?:<|>)?=?)");St("XRANGEIDENTIFIERLOOSE",`${_e[Ze.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);St("XRANGEIDENTIFIER",`${_e[Ze.NUMERICIDENTIFIER]}|x|X|\\*`);St("XRANGEPLAIN",`[v=\\s]*(${_e[Ze.XRANGEIDENTIFIER]})(?:\\.(${_e[Ze.XRANGEIDENTIFIER]})(?:\\.(${_e[Ze.XRANGEIDENTIFIER]})(?:${_e[Ze.PRERELEASE]})?${_e[Ze.BUILD]}?)?)?`);St("XRANGEPLAINLOOSE",`[v=\\s]*(${_e[Ze.XRANGEIDENTIFIERLOOSE]})(?:\\.(${_e[Ze.XRANGEIDENTIFIERLOOSE]})(?:\\.(${_e[Ze.XRANGEIDENTIFIERLOOSE]})(?:${_e[Ze.PRERELEASELOOSE]})?${_e[Ze.BUILD]}?)?)?`);St("XRANGE",`^${_e[Ze.GTLT]}\\s*${_e[Ze.XRANGEPLAIN]}$`);St("XRANGELOOSE",`^${_e[Ze.GTLT]}\\s*${_e[Ze.XRANGEPLAINLOOSE]}$`);St("COERCE",`(^|[^\\d])(\\d{1,${ox}})(?:\\.(\\d{1,${ox}}))?(?:\\.(\\d{1,${ox}}))?(?:$|[^\\d])`);St("COERCERTL",_e[Ze.COERCE],!0);St("LONETILDE","(?:~>?)");St("TILDETRIM",`(\\s*)${_e[Ze.LONETILDE]}\\s+`,!0);KA.tildeTrimReplace="$1~";St("TILDE",`^${_e[Ze.LONETILDE]}${_e[Ze.XRANGEPLAIN]}$`);St("TILDELOOSE",`^${_e[Ze.LONETILDE]}${_e[Ze.XRANGEPLAINLOOSE]}$`);St("LONECARET","(?:\\^)");St("CARETTRIM",`(\\s*)${_e[Ze.LONECARET]}\\s+`,!0);KA.caretTrimReplace="$1^";St("CARET",`^${_e[Ze.LONECARET]}${_e[Ze.XRANGEPLAIN]}$`);St("CARETLOOSE",`^${_e[Ze.LONECARET]}${_e[Ze.XRANGEPLAINLOOSE]}$`);St("COMPARATORLOOSE",`^${_e[Ze.GTLT]}\\s*(${_e[Ze.LOOSEPLAIN]})$|^$`);St("COMPARATOR",`^${_e[Ze.GTLT]}\\s*(${_e[Ze.FULLPLAIN]})$|^$`);St("COMPARATORTRIM",`(\\s*)${_e[Ze.GTLT]}\\s*(${_e[Ze.LOOSEPLAIN]}|${_e[Ze.XRANGEPLAIN]})`,!0);KA.comparatorTrimReplace="$1$2$3";St("HYPHENRANGE",`^\\s*(${_e[Ze.XRANGEPLAIN]})\\s+-\\s+(${_e[Ze.XRANGEPLAIN]})\\s*$`);St("HYPHENRANGELOOSE",`^\\s*(${_e[Ze.XRANGEPLAINLOOSE]})\\s+-\\s+(${_e[Ze.XRANGEPLAINLOOSE]})\\s*$`);St("STAR","(<|>)?=?\\s*\\*");St("GTE0","^\\s*>=\\s*0.0.0\\s*$");St("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")});var Ld=y((_$e,zG)=>{var tEe=["includePrerelease","loose","rtl"],rEe=r=>r?typeof r!="object"?{loose:!0}:tEe.filter(e=>r[e]).reduce((e,t)=>(e[t]=!0,e),{}):{};zG.exports=rEe});var hy=y((Z$e,_G)=>{var VG=/^[0-9]+$/,XG=(r,e)=>{let t=VG.test(r),i=VG.test(e);return t&&i&&(r=+r,e=+e),r===e?0:t&&!i?-1:i&&!t?1:rXG(e,r);_G.exports={compareIdentifiers:XG,rcompareIdentifiers:iEe}});var Oi=y(($$e,tY)=>{var py=Td(),{MAX_LENGTH:ZG,MAX_SAFE_INTEGER:dy}=Nd(),{re:$G,t:eY}=Sc(),nEe=Ld(),{compareIdentifiers:Od}=hy(),Kn=class{constructor(e,t){if(t=nEe(t),e instanceof Kn){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>ZG)throw new TypeError(`version is longer than ${ZG} characters`);py("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let i=e.trim().match(t.loose?$G[eY.LOOSE]:$G[eY.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>dy||this.major<0)throw new TypeError("Invalid major version");if(this.minor>dy||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>dy||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let s=+n;if(s>=0&&s=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);i===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}};tY.exports=Kn});var vc=y((eet,sY)=>{var{MAX_LENGTH:sEe}=Nd(),{re:rY,t:iY}=Sc(),nY=Oi(),oEe=Ld(),aEe=(r,e)=>{if(e=oEe(e),r instanceof nY)return r;if(typeof r!="string"||r.length>sEe||!(e.loose?rY[iY.LOOSE]:rY[iY.FULL]).test(r))return null;try{return new nY(r,e)}catch{return null}};sY.exports=aEe});var aY=y((tet,oY)=>{var AEe=vc(),lEe=(r,e)=>{let t=AEe(r,e);return t?t.version:null};oY.exports=lEe});var lY=y((ret,AY)=>{var cEe=vc(),uEe=(r,e)=>{let t=cEe(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};AY.exports=uEe});var uY=y((iet,cY)=>{var gEe=Oi(),fEe=(r,e,t,i)=>{typeof t=="string"&&(i=t,t=void 0);try{return new gEe(r,t).inc(e,i).version}catch{return null}};cY.exports=fEe});var os=y((net,fY)=>{var gY=Oi(),hEe=(r,e,t)=>new gY(r,t).compare(new gY(e,t));fY.exports=hEe});var Cy=y((set,hY)=>{var pEe=os(),dEe=(r,e,t)=>pEe(r,e,t)===0;hY.exports=dEe});var CY=y((oet,dY)=>{var pY=vc(),CEe=Cy(),mEe=(r,e)=>{if(CEe(r,e))return null;{let t=pY(r),i=pY(e),n=t.prerelease.length||i.prerelease.length,s=n?"pre":"",o=n?"prerelease":"";for(let a in t)if((a==="major"||a==="minor"||a==="patch")&&t[a]!==i[a])return s+a;return o}};dY.exports=mEe});var EY=y((aet,mY)=>{var EEe=Oi(),IEe=(r,e)=>new EEe(r,e).major;mY.exports=IEe});var yY=y((Aet,IY)=>{var yEe=Oi(),wEe=(r,e)=>new yEe(r,e).minor;IY.exports=wEe});var BY=y((cet,wY)=>{var BEe=Oi(),bEe=(r,e)=>new BEe(r,e).patch;wY.exports=bEe});var QY=y((uet,bY)=>{var QEe=vc(),SEe=(r,e)=>{let t=QEe(r,e);return t&&t.prerelease.length?t.prerelease:null};bY.exports=SEe});var vY=y((get,SY)=>{var vEe=os(),xEe=(r,e,t)=>vEe(e,r,t);SY.exports=xEe});var PY=y((fet,xY)=>{var PEe=os(),DEe=(r,e)=>PEe(r,e,!0);xY.exports=DEe});var my=y((het,kY)=>{var DY=Oi(),kEe=(r,e,t)=>{let i=new DY(r,t),n=new DY(e,t);return i.compare(n)||i.compareBuild(n)};kY.exports=kEe});var FY=y((pet,RY)=>{var REe=my(),FEe=(r,e)=>r.sort((t,i)=>REe(t,i,e));RY.exports=FEe});var TY=y((det,NY)=>{var NEe=my(),TEe=(r,e)=>r.sort((t,i)=>NEe(i,t,e));NY.exports=TEe});var Md=y((Cet,LY)=>{var LEe=os(),OEe=(r,e,t)=>LEe(r,e,t)>0;LY.exports=OEe});var Ey=y((met,OY)=>{var MEe=os(),UEe=(r,e,t)=>MEe(r,e,t)<0;OY.exports=UEe});var ax=y((Eet,MY)=>{var KEe=os(),HEe=(r,e,t)=>KEe(r,e,t)!==0;MY.exports=HEe});var Iy=y((Iet,UY)=>{var GEe=os(),YEe=(r,e,t)=>GEe(r,e,t)>=0;UY.exports=YEe});var yy=y((yet,KY)=>{var jEe=os(),qEe=(r,e,t)=>jEe(r,e,t)<=0;KY.exports=qEe});var Ax=y((wet,HY)=>{var JEe=Cy(),WEe=ax(),zEe=Md(),VEe=Iy(),XEe=Ey(),_Ee=yy(),ZEe=(r,e,t,i)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return JEe(r,t,i);case"!=":return WEe(r,t,i);case">":return zEe(r,t,i);case">=":return VEe(r,t,i);case"<":return XEe(r,t,i);case"<=":return _Ee(r,t,i);default:throw new TypeError(`Invalid operator: ${e}`)}};HY.exports=ZEe});var YY=y((Bet,GY)=>{var $Ee=Oi(),eIe=vc(),{re:wy,t:By}=Sc(),tIe=(r,e)=>{if(r instanceof $Ee)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(wy[By.COERCE]);else{let i;for(;(i=wy[By.COERCERTL].exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||i.index+i[0].length!==t.index+t[0].length)&&(t=i),wy[By.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;wy[By.COERCERTL].lastIndex=-1}return t===null?null:eIe(`${t[2]}.${t[3]||"0"}.${t[4]||"0"}`,e)};GY.exports=tIe});var qY=y((bet,jY)=>{"use strict";jY.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var Ud=y((Qet,JY)=>{"use strict";JY.exports=Ht;Ht.Node=xc;Ht.create=Ht;function Ht(r){var e=this;if(e instanceof Ht||(e=new Ht),e.tail=null,e.head=null,e.length=0,r&&typeof r.forEach=="function")r.forEach(function(n){e.push(n)});else if(arguments.length>0)for(var t=0,i=arguments.length;t1)t=e;else if(this.head)i=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;i!==null;n++)t=r(t,i.value,n),i=i.next;return t};Ht.prototype.reduceReverse=function(r,e){var t,i=this.tail;if(arguments.length>1)t=e;else if(this.tail)i=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=this.length-1;i!==null;n--)t=r(t,i.value,n),i=i.prev;return t};Ht.prototype.toArray=function(){for(var r=new Array(this.length),e=0,t=this.head;t!==null;e++)r[e]=t.value,t=t.next;return r};Ht.prototype.toArrayReverse=function(){for(var r=new Array(this.length),e=0,t=this.tail;t!==null;e++)r[e]=t.value,t=t.prev;return r};Ht.prototype.slice=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new Ht;if(ethis.length&&(e=this.length);for(var i=0,n=this.head;n!==null&&ithis.length&&(e=this.length);for(var i=this.length,n=this.tail;n!==null&&i>e;i--)n=n.prev;for(;n!==null&&i>r;i--,n=n.prev)t.push(n.value);return t};Ht.prototype.splice=function(r,e,...t){r>this.length&&(r=this.length-1),r<0&&(r=this.length+r);for(var i=0,n=this.head;n!==null&&i{"use strict";var sIe=Ud(),Pc=Symbol("max"),Pa=Symbol("length"),uf=Symbol("lengthCalculator"),Hd=Symbol("allowStale"),Dc=Symbol("maxAge"),xa=Symbol("dispose"),WY=Symbol("noDisposeOnSet"),Ii=Symbol("lruList"),zs=Symbol("cache"),VY=Symbol("updateAgeOnGet"),lx=()=>1,ux=class{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");let t=this[Pc]=e.max||1/0,i=e.length||lx;if(this[uf]=typeof i!="function"?lx:i,this[Hd]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[Dc]=e.maxAge||0,this[xa]=e.dispose,this[WY]=e.noDisposeOnSet||!1,this[VY]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[Pc]=e||1/0,Kd(this)}get max(){return this[Pc]}set allowStale(e){this[Hd]=!!e}get allowStale(){return this[Hd]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[Dc]=e,Kd(this)}get maxAge(){return this[Dc]}set lengthCalculator(e){typeof e!="function"&&(e=lx),e!==this[uf]&&(this[uf]=e,this[Pa]=0,this[Ii].forEach(t=>{t.length=this[uf](t.value,t.key),this[Pa]+=t.length})),Kd(this)}get lengthCalculator(){return this[uf]}get length(){return this[Pa]}get itemCount(){return this[Ii].length}rforEach(e,t){t=t||this;for(let i=this[Ii].tail;i!==null;){let n=i.prev;zY(this,e,i,t),i=n}}forEach(e,t){t=t||this;for(let i=this[Ii].head;i!==null;){let n=i.next;zY(this,e,i,t),i=n}}keys(){return this[Ii].toArray().map(e=>e.key)}values(){return this[Ii].toArray().map(e=>e.value)}reset(){this[xa]&&this[Ii]&&this[Ii].length&&this[Ii].forEach(e=>this[xa](e.key,e.value)),this[zs]=new Map,this[Ii]=new sIe,this[Pa]=0}dump(){return this[Ii].map(e=>by(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[Ii]}set(e,t,i){if(i=i||this[Dc],i&&typeof i!="number")throw new TypeError("maxAge must be a number");let n=i?Date.now():0,s=this[uf](t,e);if(this[zs].has(e)){if(s>this[Pc])return gf(this,this[zs].get(e)),!1;let l=this[zs].get(e).value;return this[xa]&&(this[WY]||this[xa](e,l.value)),l.now=n,l.maxAge=i,l.value=t,this[Pa]+=s-l.length,l.length=s,this.get(e),Kd(this),!0}let o=new gx(e,t,s,n,i);return o.length>this[Pc]?(this[xa]&&this[xa](e,t),!1):(this[Pa]+=o.length,this[Ii].unshift(o),this[zs].set(e,this[Ii].head),Kd(this),!0)}has(e){if(!this[zs].has(e))return!1;let t=this[zs].get(e).value;return!by(this,t)}get(e){return cx(this,e,!0)}peek(e){return cx(this,e,!1)}pop(){let e=this[Ii].tail;return e?(gf(this,e),e.value):null}del(e){gf(this,this[zs].get(e))}load(e){this.reset();let t=Date.now();for(let i=e.length-1;i>=0;i--){let n=e[i],s=n.e||0;if(s===0)this.set(n.k,n.v);else{let o=s-t;o>0&&this.set(n.k,n.v,o)}}}prune(){this[zs].forEach((e,t)=>cx(this,t,!1))}},cx=(r,e,t)=>{let i=r[zs].get(e);if(i){let n=i.value;if(by(r,n)){if(gf(r,i),!r[Hd])return}else t&&(r[VY]&&(i.value.now=Date.now()),r[Ii].unshiftNode(i));return n.value}},by=(r,e)=>{if(!e||!e.maxAge&&!r[Dc])return!1;let t=Date.now()-e.now;return e.maxAge?t>e.maxAge:r[Dc]&&t>r[Dc]},Kd=r=>{if(r[Pa]>r[Pc])for(let e=r[Ii].tail;r[Pa]>r[Pc]&&e!==null;){let t=e.prev;gf(r,e),e=t}},gf=(r,e)=>{if(e){let t=e.value;r[xa]&&r[xa](t.key,t.value),r[Pa]-=t.length,r[zs].delete(t.key),r[Ii].removeNode(e)}},gx=class{constructor(e,t,i,n,s){this.key=e,this.value=t,this.length=i,this.now=n,this.maxAge=s||0}},zY=(r,e,t,i)=>{let n=t.value;by(r,n)&&(gf(r,t),r[Hd]||(n=void 0)),n&&e.call(i,n.value,n.key,r)};XY.exports=ux});var as=y((xet,tj)=>{var kc=class{constructor(e,t){if(t=aIe(t),e instanceof kc)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new kc(e.raw,t);if(e instanceof fx)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(n=>!$Y(n[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&gIe(n[0])){this.set=[n];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();let i=`parseRange:${Object.keys(this.options).join(",")}:${e}`,n=ZY.get(i);if(n)return n;let s=this.options.loose,o=s?Mi[Qi.HYPHENRANGELOOSE]:Mi[Qi.HYPHENRANGE];e=e.replace(o,wIe(this.options.includePrerelease)),jr("hyphen replace",e),e=e.replace(Mi[Qi.COMPARATORTRIM],lIe),jr("comparator trim",e,Mi[Qi.COMPARATORTRIM]),e=e.replace(Mi[Qi.TILDETRIM],cIe),e=e.replace(Mi[Qi.CARETTRIM],uIe),e=e.split(/\s+/).join(" ");let a=s?Mi[Qi.COMPARATORLOOSE]:Mi[Qi.COMPARATOR],l=e.split(" ").map(f=>fIe(f,this.options)).join(" ").split(/\s+/).map(f=>yIe(f,this.options)).filter(this.options.loose?f=>!!f.match(a):()=>!0).map(f=>new fx(f,this.options)),c=l.length,u=new Map;for(let f of l){if($Y(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let g=[...u.values()];return ZY.set(i,g),g}intersects(e,t){if(!(e instanceof kc))throw new TypeError("a Range is required");return this.set.some(i=>ej(i,t)&&e.set.some(n=>ej(n,t)&&i.every(s=>n.every(o=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new AIe(e,this.options)}catch{return!1}for(let t=0;tr.value==="<0.0.0-0",gIe=r=>r.value==="",ej=(r,e)=>{let t=!0,i=r.slice(),n=i.pop();for(;t&&i.length;)t=i.every(s=>n.intersects(s,e)),n=i.pop();return t},fIe=(r,e)=>(jr("comp",r,e),r=dIe(r,e),jr("caret",r),r=hIe(r,e),jr("tildes",r),r=mIe(r,e),jr("xrange",r),r=IIe(r,e),jr("stars",r),r),Xi=r=>!r||r.toLowerCase()==="x"||r==="*",hIe=(r,e)=>r.trim().split(/\s+/).map(t=>pIe(t,e)).join(" "),pIe=(r,e)=>{let t=e.loose?Mi[Qi.TILDELOOSE]:Mi[Qi.TILDE];return r.replace(t,(i,n,s,o,a)=>{jr("tilde",r,i,n,s,o,a);let l;return Xi(n)?l="":Xi(s)?l=`>=${n}.0.0 <${+n+1}.0.0-0`:Xi(o)?l=`>=${n}.${s}.0 <${n}.${+s+1}.0-0`:a?(jr("replaceTilde pr",a),l=`>=${n}.${s}.${o}-${a} <${n}.${+s+1}.0-0`):l=`>=${n}.${s}.${o} <${n}.${+s+1}.0-0`,jr("tilde return",l),l})},dIe=(r,e)=>r.trim().split(/\s+/).map(t=>CIe(t,e)).join(" "),CIe=(r,e)=>{jr("caret",r,e);let t=e.loose?Mi[Qi.CARETLOOSE]:Mi[Qi.CARET],i=e.includePrerelease?"-0":"";return r.replace(t,(n,s,o,a,l)=>{jr("caret",r,n,s,o,a,l);let c;return Xi(s)?c="":Xi(o)?c=`>=${s}.0.0${i} <${+s+1}.0.0-0`:Xi(a)?s==="0"?c=`>=${s}.${o}.0${i} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.0${i} <${+s+1}.0.0-0`:l?(jr("replaceCaret pr",l),s==="0"?o==="0"?c=`>=${s}.${o}.${a}-${l} <${s}.${o}.${+a+1}-0`:c=`>=${s}.${o}.${a}-${l} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.${a}-${l} <${+s+1}.0.0-0`):(jr("no pr"),s==="0"?o==="0"?c=`>=${s}.${o}.${a}${i} <${s}.${o}.${+a+1}-0`:c=`>=${s}.${o}.${a}${i} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),jr("caret return",c),c})},mIe=(r,e)=>(jr("replaceXRanges",r,e),r.split(/\s+/).map(t=>EIe(t,e)).join(" ")),EIe=(r,e)=>{r=r.trim();let t=e.loose?Mi[Qi.XRANGELOOSE]:Mi[Qi.XRANGE];return r.replace(t,(i,n,s,o,a,l)=>{jr("xRange",r,i,n,s,o,a,l);let c=Xi(s),u=c||Xi(o),g=u||Xi(a),f=g;return n==="="&&f&&(n=""),l=e.includePrerelease?"-0":"",c?n===">"||n==="<"?i="<0.0.0-0":i="*":n&&f?(u&&(o=0),a=0,n===">"?(n=">=",u?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):n==="<="&&(n="<",u?s=+s+1:o=+o+1),n==="<"&&(l="-0"),i=`${n+s}.${o}.${a}${l}`):u?i=`>=${s}.0.0${l} <${+s+1}.0.0-0`:g&&(i=`>=${s}.${o}.0${l} <${s}.${+o+1}.0-0`),jr("xRange return",i),i})},IIe=(r,e)=>(jr("replaceStars",r,e),r.trim().replace(Mi[Qi.STAR],"")),yIe=(r,e)=>(jr("replaceGTE0",r,e),r.trim().replace(Mi[e.includePrerelease?Qi.GTE0PRE:Qi.GTE0],"")),wIe=r=>(e,t,i,n,s,o,a,l,c,u,g,f,h)=>(Xi(i)?t="":Xi(n)?t=`>=${i}.0.0${r?"-0":""}`:Xi(s)?t=`>=${i}.${n}.0${r?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,Xi(c)?l="":Xi(u)?l=`<${+c+1}.0.0-0`:Xi(g)?l=`<${c}.${+u+1}.0-0`:f?l=`<=${c}.${u}.${g}-${f}`:r?l=`<${c}.${u}.${+g+1}-0`:l=`<=${l}`,`${t} ${l}`.trim()),BIe=(r,e,t)=>{for(let i=0;i0){let n=r[i].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}});var Gd=y((Pet,oj)=>{var Yd=Symbol("SemVer ANY"),ff=class{static get ANY(){return Yd}constructor(e,t){if(t=bIe(t),e instanceof ff){if(e.loose===!!t.loose)return e;e=e.value}px("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Yd?this.value="":this.value=this.operator+this.semver.version,px("comp",this)}parse(e){let t=this.options.loose?rj[ij.COMPARATORLOOSE]:rj[ij.COMPARATOR],i=e.match(t);if(!i)throw new TypeError(`Invalid comparator: ${e}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new nj(i[2],this.options.loose):this.semver=Yd}toString(){return this.value}test(e){if(px("Comparator.test",e,this.options.loose),this.semver===Yd||e===Yd)return!0;if(typeof e=="string")try{e=new nj(e,this.options)}catch{return!1}return hx(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof ff))throw new TypeError("a Comparator is required");if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""?!0:new sj(e.value,t).test(this.value);if(e.operator==="")return e.value===""?!0:new sj(this.value,t).test(e.semver);let i=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">"),n=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<"),s=this.semver.version===e.semver.version,o=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<="),a=hx(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),l=hx(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return i||n||s&&o||a||l}};oj.exports=ff;var bIe=Ld(),{re:rj,t:ij}=Sc(),hx=Ax(),px=Td(),nj=Oi(),sj=as()});var jd=y((Det,aj)=>{var QIe=as(),SIe=(r,e,t)=>{try{e=new QIe(e,t)}catch{return!1}return e.test(r)};aj.exports=SIe});var lj=y((ket,Aj)=>{var vIe=as(),xIe=(r,e)=>new vIe(r,e).set.map(t=>t.map(i=>i.value).join(" ").trim().split(" "));Aj.exports=xIe});var uj=y((Ret,cj)=>{var PIe=Oi(),DIe=as(),kIe=(r,e,t)=>{let i=null,n=null,s=null;try{s=new DIe(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!i||n.compare(o)===-1)&&(i=o,n=new PIe(i,t))}),i};cj.exports=kIe});var fj=y((Fet,gj)=>{var RIe=Oi(),FIe=as(),NIe=(r,e,t)=>{let i=null,n=null,s=null;try{s=new FIe(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!i||n.compare(o)===1)&&(i=o,n=new RIe(i,t))}),i};gj.exports=NIe});var dj=y((Net,pj)=>{var dx=Oi(),TIe=as(),hj=Md(),LIe=(r,e)=>{r=new TIe(r,e);let t=new dx("0.0.0");if(r.test(t)||(t=new dx("0.0.0-0"),r.test(t)))return t;t=null;for(let i=0;i{let a=new dx(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||hj(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!t||hj(t,s))&&(t=s)}return t&&r.test(t)?t:null};pj.exports=LIe});var mj=y((Tet,Cj)=>{var OIe=as(),MIe=(r,e)=>{try{return new OIe(r,e).range||"*"}catch{return null}};Cj.exports=MIe});var Qy=y((Let,wj)=>{var UIe=Oi(),yj=Gd(),{ANY:KIe}=yj,HIe=as(),GIe=jd(),Ej=Md(),Ij=Ey(),YIe=yy(),jIe=Iy(),qIe=(r,e,t,i)=>{r=new UIe(r,i),e=new HIe(e,i);let n,s,o,a,l;switch(t){case">":n=Ej,s=YIe,o=Ij,a=">",l=">=";break;case"<":n=Ij,s=jIe,o=Ej,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(GIe(r,e,i))return!1;for(let c=0;c{h.semver===KIe&&(h=new yj(">=0.0.0")),g=g||h,f=f||h,n(h.semver,g.semver,i)?g=h:o(h.semver,f.semver,i)&&(f=h)}),g.operator===a||g.operator===l||(!f.operator||f.operator===a)&&s(r,f.semver))return!1;if(f.operator===l&&o(r,f.semver))return!1}return!0};wj.exports=qIe});var bj=y((Oet,Bj)=>{var JIe=Qy(),WIe=(r,e,t)=>JIe(r,e,">",t);Bj.exports=WIe});var Sj=y((Met,Qj)=>{var zIe=Qy(),VIe=(r,e,t)=>zIe(r,e,"<",t);Qj.exports=VIe});var Pj=y((Uet,xj)=>{var vj=as(),XIe=(r,e,t)=>(r=new vj(r,t),e=new vj(e,t),r.intersects(e));xj.exports=XIe});var kj=y((Ket,Dj)=>{var _Ie=jd(),ZIe=os();Dj.exports=(r,e,t)=>{let i=[],n=null,s=null,o=r.sort((u,g)=>ZIe(u,g,t));for(let u of o)_Ie(u,e,t)?(s=u,n||(n=u)):(s&&i.push([n,s]),s=null,n=null);n&&i.push([n,null]);let a=[];for(let[u,g]of i)u===g?a.push(u):!g&&u===o[0]?a.push("*"):g?u===o[0]?a.push(`<=${g}`):a.push(`${u} - ${g}`):a.push(`>=${u}`);let l=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return l.length{var Rj=as(),Sy=Gd(),{ANY:Cx}=Sy,qd=jd(),mx=os(),$Ie=(r,e,t={})=>{if(r===e)return!0;r=new Rj(r,t),e=new Rj(e,t);let i=!1;e:for(let n of r.set){for(let s of e.set){let o=eye(n,s,t);if(i=i||o!==null,o)continue e}if(i)return!1}return!0},eye=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===Cx){if(e.length===1&&e[0].semver===Cx)return!0;t.includePrerelease?r=[new Sy(">=0.0.0-0")]:r=[new Sy(">=0.0.0")]}if(e.length===1&&e[0].semver===Cx){if(t.includePrerelease)return!0;e=[new Sy(">=0.0.0")]}let i=new Set,n,s;for(let h of r)h.operator===">"||h.operator===">="?n=Fj(n,h,t):h.operator==="<"||h.operator==="<="?s=Nj(s,h,t):i.add(h.semver);if(i.size>1)return null;let o;if(n&&s){if(o=mx(n.semver,s.semver,t),o>0)return null;if(o===0&&(n.operator!==">="||s.operator!=="<="))return null}for(let h of i){if(n&&!qd(h,String(n),t)||s&&!qd(h,String(s),t))return null;for(let p of e)if(!qd(h,String(p),t))return!1;return!0}let a,l,c,u,g=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1;g&&g.prerelease.length===1&&s.operator==="<"&&g.prerelease[0]===0&&(g=!1);for(let h of e){if(u=u||h.operator===">"||h.operator===">=",c=c||h.operator==="<"||h.operator==="<=",n){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator===">"||h.operator===">="){if(a=Fj(n,h,t),a===h&&a!==n)return!1}else if(n.operator===">="&&!qd(n.semver,String(h),t))return!1}if(s){if(g&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===g.major&&h.semver.minor===g.minor&&h.semver.patch===g.patch&&(g=!1),h.operator==="<"||h.operator==="<="){if(l=Nj(s,h,t),l===h&&l!==s)return!1}else if(s.operator==="<="&&!qd(s.semver,String(h),t))return!1}if(!h.operator&&(s||n)&&o!==0)return!1}return!(n&&c&&!s&&o!==0||s&&u&&!n&&o!==0||f||g)},Fj=(r,e,t)=>{if(!r)return e;let i=mx(r.semver,e.semver,t);return i>0?r:i<0||e.operator===">"&&r.operator===">="?e:r},Nj=(r,e,t)=>{if(!r)return e;let i=mx(r.semver,e.semver,t);return i<0?r:i>0||e.operator==="<"&&r.operator==="<="?e:r};Tj.exports=$Ie});var $r=y((Get,Oj)=>{var Ex=Sc();Oj.exports={re:Ex.re,src:Ex.src,tokens:Ex.t,SEMVER_SPEC_VERSION:Nd().SEMVER_SPEC_VERSION,SemVer:Oi(),compareIdentifiers:hy().compareIdentifiers,rcompareIdentifiers:hy().rcompareIdentifiers,parse:vc(),valid:aY(),clean:lY(),inc:uY(),diff:CY(),major:EY(),minor:yY(),patch:BY(),prerelease:QY(),compare:os(),rcompare:vY(),compareLoose:PY(),compareBuild:my(),sort:FY(),rsort:TY(),gt:Md(),lt:Ey(),eq:Cy(),neq:ax(),gte:Iy(),lte:yy(),cmp:Ax(),coerce:YY(),Comparator:Gd(),Range:as(),satisfies:jd(),toComparators:lj(),maxSatisfying:uj(),minSatisfying:fj(),minVersion:dj(),validRange:mj(),outside:Qy(),gtr:bj(),ltr:Sj(),intersects:Pj(),simplifyRange:kj(),subset:Lj()}});var Ix=y(vy=>{"use strict";Object.defineProperty(vy,"__esModule",{value:!0});vy.VERSION=void 0;vy.VERSION="9.1.0"});var Gt=y((exports,module)=>{"use strict";var __spreadArray=exports&&exports.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var i=0,n=e.length,s;i{(function(r,e){typeof define=="function"&&define.amd?define([],e):typeof xy=="object"&&xy.exports?xy.exports=e():r.regexpToAst=e()})(typeof self<"u"?self:Mj,function(){function r(){}r.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},r.prototype.restoreState=function(p){this.idx=p.idx,this.input=p.input,this.groupIdx=p.groupIdx},r.prototype.pattern=function(p){this.idx=0,this.input=p,this.groupIdx=0,this.consumeChar("/");var C=this.disjunction();this.consumeChar("/");for(var w={type:"Flags",loc:{begin:this.idx,end:p.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":o(w,"global");break;case"i":o(w,"ignoreCase");break;case"m":o(w,"multiLine");break;case"u":o(w,"unicode");break;case"y":o(w,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:w,value:C,loc:this.loc(0)}},r.prototype.disjunction=function(){var p=[],C=this.idx;for(p.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),p.push(this.alternative());return{type:"Disjunction",value:p,loc:this.loc(C)}},r.prototype.alternative=function(){for(var p=[],C=this.idx;this.isTerm();)p.push(this.term());return{type:"Alternative",value:p,loc:this.loc(C)}},r.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},r.prototype.assertion=function(){var p=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(p)};case"$":return{type:"EndAnchor",loc:this.loc(p)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(p)};case"B":return{type:"NonWordBoundary",loc:this.loc(p)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");var C;switch(this.popChar()){case"=":C="Lookahead";break;case"!":C="NegativeLookahead";break}a(C);var w=this.disjunction();return this.consumeChar(")"),{type:C,value:w,loc:this.loc(p)}}l()},r.prototype.quantifier=function(p){var C,w=this.idx;switch(this.popChar()){case"*":C={atLeast:0,atMost:1/0};break;case"+":C={atLeast:1,atMost:1/0};break;case"?":C={atLeast:0,atMost:1};break;case"{":var B=this.integerIncludingZero();switch(this.popChar()){case"}":C={atLeast:B,atMost:B};break;case",":var v;this.isDigit()?(v=this.integerIncludingZero(),C={atLeast:B,atMost:v}):C={atLeast:B,atMost:1/0},this.consumeChar("}");break}if(p===!0&&C===void 0)return;a(C);break}if(!(p===!0&&C===void 0))return a(C),this.peekChar(0)==="?"?(this.consumeChar("?"),C.greedy=!1):C.greedy=!0,C.type="Quantifier",C.loc=this.loc(w),C},r.prototype.atom=function(){var p,C=this.idx;switch(this.peekChar()){case".":p=this.dotAll();break;case"\\":p=this.atomEscape();break;case"[":p=this.characterClass();break;case"(":p=this.group();break}return p===void 0&&this.isPatternCharacter()&&(p=this.patternCharacter()),a(p),p.loc=this.loc(C),this.isQuantifier()&&(p.quantifier=this.quantifier()),p},r.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[n(` -`),n("\r"),n("\u2028"),n("\u2029")]}},r.prototype.atomEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},r.prototype.decimalEscapeAtom=function(){var p=this.positiveInteger();return{type:"GroupBackReference",value:p}},r.prototype.characterClassEscape=function(){var p,C=!1;switch(this.popChar()){case"d":p=u;break;case"D":p=u,C=!0;break;case"s":p=f;break;case"S":p=f,C=!0;break;case"w":p=g;break;case"W":p=g,C=!0;break}return a(p),{type:"Set",value:p,complement:C}},r.prototype.controlEscapeAtom=function(){var p;switch(this.popChar()){case"f":p=n("\f");break;case"n":p=n(` -`);break;case"r":p=n("\r");break;case"t":p=n(" ");break;case"v":p=n("\v");break}return a(p),{type:"Character",value:p}},r.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var p=this.popChar();if(/[a-zA-Z]/.test(p)===!1)throw Error("Invalid ");var C=p.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:C}},r.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:n("\0")}},r.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},r.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},r.prototype.identityEscapeAtom=function(){var p=this.popChar();return{type:"Character",value:n(p)}},r.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case` -`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var p=this.popChar();return{type:"Character",value:n(p)}}},r.prototype.characterClass=function(){var p=[],C=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),C=!0);this.isClassAtom();){var w=this.classAtom(),B=w.type==="Character";if(B&&this.isRangeDash()){this.consumeChar("-");var v=this.classAtom(),D=v.type==="Character";if(D){if(v.value=this.input.length)throw Error("Unexpected end of input");this.idx++},r.prototype.loc=function(p){return{begin:p,end:this.idx}};var e=/[0-9a-fA-F]/,t=/[0-9]/,i=/[1-9]/;function n(p){return p.charCodeAt(0)}function s(p,C){p.length!==void 0?p.forEach(function(w){C.push(w)}):C.push(p)}function o(p,C){if(p[C]===!0)throw"duplicate flag "+C;p[C]=!0}function a(p){if(p===void 0)throw Error("Internal Error - Should never get here!")}function l(){throw Error("Internal Error - Should never get here!")}var c,u=[];for(c=n("0");c<=n("9");c++)u.push(c);var g=[n("_")].concat(u);for(c=n("a");c<=n("z");c++)g.push(c);for(c=n("A");c<=n("Z");c++)g.push(c);var f=[n(" "),n("\f"),n(` -`),n("\r"),n(" "),n("\v"),n(" "),n("\xA0"),n("\u1680"),n("\u2000"),n("\u2001"),n("\u2002"),n("\u2003"),n("\u2004"),n("\u2005"),n("\u2006"),n("\u2007"),n("\u2008"),n("\u2009"),n("\u200A"),n("\u2028"),n("\u2029"),n("\u202F"),n("\u205F"),n("\u3000"),n("\uFEFF")];function h(){}return h.prototype.visitChildren=function(p){for(var C in p){var w=p[C];p.hasOwnProperty(C)&&(w.type!==void 0?this.visit(w):Array.isArray(w)&&w.forEach(function(B){this.visit(B)},this))}},h.prototype.visit=function(p){switch(p.type){case"Pattern":this.visitPattern(p);break;case"Flags":this.visitFlags(p);break;case"Disjunction":this.visitDisjunction(p);break;case"Alternative":this.visitAlternative(p);break;case"StartAnchor":this.visitStartAnchor(p);break;case"EndAnchor":this.visitEndAnchor(p);break;case"WordBoundary":this.visitWordBoundary(p);break;case"NonWordBoundary":this.visitNonWordBoundary(p);break;case"Lookahead":this.visitLookahead(p);break;case"NegativeLookahead":this.visitNegativeLookahead(p);break;case"Character":this.visitCharacter(p);break;case"Set":this.visitSet(p);break;case"Group":this.visitGroup(p);break;case"GroupBackReference":this.visitGroupBackReference(p);break;case"Quantifier":this.visitQuantifier(p);break}this.visitChildren(p)},h.prototype.visitPattern=function(p){},h.prototype.visitFlags=function(p){},h.prototype.visitDisjunction=function(p){},h.prototype.visitAlternative=function(p){},h.prototype.visitStartAnchor=function(p){},h.prototype.visitEndAnchor=function(p){},h.prototype.visitWordBoundary=function(p){},h.prototype.visitNonWordBoundary=function(p){},h.prototype.visitLookahead=function(p){},h.prototype.visitNegativeLookahead=function(p){},h.prototype.visitCharacter=function(p){},h.prototype.visitSet=function(p){},h.prototype.visitGroup=function(p){},h.prototype.visitGroupBackReference=function(p){},h.prototype.visitQuantifier=function(p){},{RegExpParser:r,BaseRegExpVisitor:h,VERSION:"0.5.0"}})});var ky=y(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.clearRegExpParserCache=hf.getRegExpAst=void 0;var tye=Py(),Dy={},rye=new tye.RegExpParser;function iye(r){var e=r.toString();if(Dy.hasOwnProperty(e))return Dy[e];var t=rye.pattern(e);return Dy[e]=t,t}hf.getRegExpAst=iye;function nye(){Dy={}}hf.clearRegExpParserCache=nye});var Yj=y(dn=>{"use strict";var sye=dn&&dn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(dn,"__esModule",{value:!0});dn.canMatchCharCode=dn.firstCharOptimizedIndices=dn.getOptimizedStartCodesIndices=dn.failedOptimizationPrefixMsg=void 0;var Kj=Py(),As=Gt(),Hj=ky(),Da=wx(),Gj="Complement Sets are not supported for first char optimization";dn.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations: -`;function oye(r,e){e===void 0&&(e=!1);try{var t=(0,Hj.getRegExpAst)(r),i=Fy(t.value,{},t.flags.ignoreCase);return i}catch(s){if(s.message===Gj)e&&(0,As.PRINT_WARNING)(""+dn.failedOptimizationPrefixMsg+(" Unable to optimize: < "+r.toString()+` > -`)+` Complement Sets cannot be automatically optimized. - This will disable the lexer's first char optimizations. - See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var n="";e&&(n=` - This will disable the lexer's first char optimizations. - See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),(0,As.PRINT_ERROR)(dn.failedOptimizationPrefixMsg+` -`+(" Failed parsing: < "+r.toString()+` > -`)+(" Using the regexp-to-ast library version: "+Kj.VERSION+` -`)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+n)}}return[]}dn.getOptimizedStartCodesIndices=oye;function Fy(r,e,t){switch(r.type){case"Disjunction":for(var i=0;i=Da.minOptimizationVal)for(var f=u.from>=Da.minOptimizationVal?u.from:Da.minOptimizationVal,h=u.to,p=(0,Da.charCodeToOptimizedIndex)(f),C=(0,Da.charCodeToOptimizedIndex)(h),w=p;w<=C;w++)e[w]=w}}});break;case"Group":Fy(o.value,e,t);break;default:throw Error("Non Exhaustive Match")}var a=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&yx(o)===!1||o.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return(0,As.values)(e)}dn.firstCharOptimizedIndices=Fy;function Ry(r,e,t){var i=(0,Da.charCodeToOptimizedIndex)(r);e[i]=i,t===!0&&aye(r,e)}function aye(r,e){var t=String.fromCharCode(r),i=t.toUpperCase();if(i!==t){var n=(0,Da.charCodeToOptimizedIndex)(i.charCodeAt(0));e[n]=n}else{var s=t.toLowerCase();if(s!==t){var n=(0,Da.charCodeToOptimizedIndex)(s.charCodeAt(0));e[n]=n}}}function Uj(r,e){return(0,As.find)(r.value,function(t){if(typeof t=="number")return(0,As.contains)(e,t);var i=t;return(0,As.find)(e,function(n){return i.from<=n&&n<=i.to})!==void 0})}function yx(r){return r.quantifier&&r.quantifier.atLeast===0?!0:r.value?(0,As.isArray)(r.value)?(0,As.every)(r.value,yx):yx(r.value):!1}var Aye=function(r){sye(e,r);function e(t){var i=r.call(this)||this;return i.targetCharCodes=t,i.found=!1,i}return e.prototype.visitChildren=function(t){if(this.found!==!0){switch(t.type){case"Lookahead":this.visitLookahead(t);return;case"NegativeLookahead":this.visitNegativeLookahead(t);return}r.prototype.visitChildren.call(this,t)}},e.prototype.visitCharacter=function(t){(0,As.contains)(this.targetCharCodes,t.value)&&(this.found=!0)},e.prototype.visitSet=function(t){t.complement?Uj(t,this.targetCharCodes)===void 0&&(this.found=!0):Uj(t,this.targetCharCodes)!==void 0&&(this.found=!0)},e}(Kj.BaseRegExpVisitor);function lye(r,e){if(e instanceof RegExp){var t=(0,Hj.getRegExpAst)(e),i=new Aye(r);return i.visit(t),i.found}else return(0,As.find)(e,function(n){return(0,As.contains)(r,n.charCodeAt(0))})!==void 0}dn.canMatchCharCode=lye});var wx=y(Je=>{"use strict";var jj=Je&&Je.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Je,"__esModule",{value:!0});Je.charCodeToOptimizedIndex=Je.minOptimizationVal=Je.buildLineBreakIssueMessage=Je.LineTerminatorOptimizedTester=Je.isShortPattern=Je.isCustomPattern=Je.cloneEmptyGroups=Je.performWarningRuntimeChecks=Je.performRuntimeChecks=Je.addStickyFlag=Je.addStartOfInput=Je.findUnreachablePatterns=Je.findModesThatDoNotExist=Je.findInvalidGroupType=Je.findDuplicatePatterns=Je.findUnsupportedFlags=Je.findStartOfInputAnchor=Je.findEmptyMatchRegExps=Je.findEndOfInputAnchor=Je.findInvalidPatterns=Je.findMissingPatterns=Je.validatePatterns=Je.analyzeTokenTypes=Je.enableSticky=Je.disableSticky=Je.SUPPORT_STICKY=Je.MODES=Je.DEFAULT_MODE=void 0;var qj=Py(),ir=Jd(),Se=Gt(),pf=Yj(),Jj=ky(),Do="PATTERN";Je.DEFAULT_MODE="defaultMode";Je.MODES="modes";Je.SUPPORT_STICKY=typeof new RegExp("(?:)").sticky=="boolean";function cye(){Je.SUPPORT_STICKY=!1}Je.disableSticky=cye;function uye(){Je.SUPPORT_STICKY=!0}Je.enableSticky=uye;function gye(r,e){e=(0,Se.defaults)(e,{useSticky:Je.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` -`],tracer:function(v,D){return D()}});var t=e.tracer;t("initCharCodeToOptimizedIndexMap",function(){wye()});var i;t("Reject Lexer.NA",function(){i=(0,Se.reject)(r,function(v){return v[Do]===ir.Lexer.NA})});var n=!1,s;t("Transform Patterns",function(){n=!1,s=(0,Se.map)(i,function(v){var D=v[Do];if((0,Se.isRegExp)(D)){var T=D.source;return T.length===1&&T!=="^"&&T!=="$"&&T!=="."&&!D.ignoreCase?T:T.length===2&&T[0]==="\\"&&!(0,Se.contains)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],T[1])?T[1]:e.useSticky?Qx(D):bx(D)}else{if((0,Se.isFunction)(D))return n=!0,{exec:D};if((0,Se.has)(D,"exec"))return n=!0,D;if(typeof D=="string"){if(D.length===1)return D;var H=D.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),j=new RegExp(H);return e.useSticky?Qx(j):bx(j)}else throw Error("non exhaustive match")}})});var o,a,l,c,u;t("misc mapping",function(){o=(0,Se.map)(i,function(v){return v.tokenTypeIdx}),a=(0,Se.map)(i,function(v){var D=v.GROUP;if(D!==ir.Lexer.SKIPPED){if((0,Se.isString)(D))return D;if((0,Se.isUndefined)(D))return!1;throw Error("non exhaustive match")}}),l=(0,Se.map)(i,function(v){var D=v.LONGER_ALT;if(D){var T=(0,Se.isArray)(D)?(0,Se.map)(D,function(H){return(0,Se.indexOf)(i,H)}):[(0,Se.indexOf)(i,D)];return T}}),c=(0,Se.map)(i,function(v){return v.PUSH_MODE}),u=(0,Se.map)(i,function(v){return(0,Se.has)(v,"POP_MODE")})});var g;t("Line Terminator Handling",function(){var v=oq(e.lineTerminatorCharacters);g=(0,Se.map)(i,function(D){return!1}),e.positionTracking!=="onlyOffset"&&(g=(0,Se.map)(i,function(D){if((0,Se.has)(D,"LINE_BREAKS"))return D.LINE_BREAKS;if(nq(D,v)===!1)return(0,pf.canMatchCharCode)(v,D.PATTERN)}))});var f,h,p,C;t("Misc Mapping #2",function(){f=(0,Se.map)(i,vx),h=(0,Se.map)(s,iq),p=(0,Se.reduce)(i,function(v,D){var T=D.GROUP;return(0,Se.isString)(T)&&T!==ir.Lexer.SKIPPED&&(v[T]=[]),v},{}),C=(0,Se.map)(s,function(v,D){return{pattern:s[D],longerAlt:l[D],canLineTerminator:g[D],isCustom:f[D],short:h[D],group:a[D],push:c[D],pop:u[D],tokenTypeIdx:o[D],tokenType:i[D]}})});var w=!0,B=[];return e.safeMode||t("First Char Optimization",function(){B=(0,Se.reduce)(i,function(v,D,T){if(typeof D.PATTERN=="string"){var H=D.PATTERN.charCodeAt(0),j=Sx(H);Bx(v,j,C[T])}else if((0,Se.isArray)(D.START_CHARS_HINT)){var $;(0,Se.forEach)(D.START_CHARS_HINT,function(W){var Z=typeof W=="string"?W.charCodeAt(0):W,A=Sx(Z);$!==A&&($=A,Bx(v,A,C[T]))})}else if((0,Se.isRegExp)(D.PATTERN))if(D.PATTERN.unicode)w=!1,e.ensureOptimizations&&(0,Se.PRINT_ERROR)(""+pf.failedOptimizationPrefixMsg+(" Unable to analyze < "+D.PATTERN.toString()+` > pattern. -`)+` The regexp unicode flag is not currently supported by the regexp-to-ast library. - This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var V=(0,pf.getOptimizedStartCodesIndices)(D.PATTERN,e.ensureOptimizations);(0,Se.isEmpty)(V)&&(w=!1),(0,Se.forEach)(V,function(W){Bx(v,W,C[T])})}else e.ensureOptimizations&&(0,Se.PRINT_ERROR)(""+pf.failedOptimizationPrefixMsg+(" TokenType: <"+D.name+`> is using a custom token pattern without providing parameter. -`)+` This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),w=!1;return v},[])}),t("ArrayPacking",function(){B=(0,Se.packArray)(B)}),{emptyGroups:p,patternIdxToConfig:C,charCodeToPatternIdxToConfig:B,hasCustom:n,canBeOptimized:w}}Je.analyzeTokenTypes=gye;function fye(r,e){var t=[],i=Wj(r);t=t.concat(i.errors);var n=zj(i.valid),s=n.valid;return t=t.concat(n.errors),t=t.concat(hye(s)),t=t.concat(eq(s)),t=t.concat(tq(s,e)),t=t.concat(rq(s)),t}Je.validatePatterns=fye;function hye(r){var e=[],t=(0,Se.filter)(r,function(i){return(0,Se.isRegExp)(i[Do])});return e=e.concat(Vj(t)),e=e.concat(_j(t)),e=e.concat(Zj(t)),e=e.concat($j(t)),e=e.concat(Xj(t)),e}function Wj(r){var e=(0,Se.filter)(r,function(n){return!(0,Se.has)(n,Do)}),t=(0,Se.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- missing static 'PATTERN' property",type:ir.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[n]}}),i=(0,Se.difference)(r,e);return{errors:t,valid:i}}Je.findMissingPatterns=Wj;function zj(r){var e=(0,Se.filter)(r,function(n){var s=n[Do];return!(0,Se.isRegExp)(s)&&!(0,Se.isFunction)(s)&&!(0,Se.has)(s,"exec")&&!(0,Se.isString)(s)}),t=(0,Se.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:ir.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[n]}}),i=(0,Se.difference)(r,e);return{errors:t,valid:i}}Je.findInvalidPatterns=zj;var pye=/[^\\][\$]/;function Vj(r){var e=function(n){jj(s,n);function s(){var o=n!==null&&n.apply(this,arguments)||this;return o.found=!1,o}return s.prototype.visitEndAnchor=function(o){this.found=!0},s}(qj.BaseRegExpVisitor),t=(0,Se.filter)(r,function(n){var s=n[Do];try{var o=(0,Jj.getRegExpAst)(s),a=new e;return a.visit(o),a.found}catch{return pye.test(s.source)}}),i=(0,Se.map)(t,function(n){return{message:`Unexpected RegExp Anchor Error: - Token Type: ->`+n.name+`<- static 'PATTERN' cannot contain end of input anchor '$' - See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:ir.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[n]}});return i}Je.findEndOfInputAnchor=Vj;function Xj(r){var e=(0,Se.filter)(r,function(i){var n=i[Do];return n.test("")}),t=(0,Se.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' must not match an empty string",type:ir.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[i]}});return t}Je.findEmptyMatchRegExps=Xj;var dye=/[^\\[][\^]|^\^/;function _j(r){var e=function(n){jj(s,n);function s(){var o=n!==null&&n.apply(this,arguments)||this;return o.found=!1,o}return s.prototype.visitStartAnchor=function(o){this.found=!0},s}(qj.BaseRegExpVisitor),t=(0,Se.filter)(r,function(n){var s=n[Do];try{var o=(0,Jj.getRegExpAst)(s),a=new e;return a.visit(o),a.found}catch{return dye.test(s.source)}}),i=(0,Se.map)(t,function(n){return{message:`Unexpected RegExp Anchor Error: - Token Type: ->`+n.name+`<- static 'PATTERN' cannot contain start of input anchor '^' - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:ir.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[n]}});return i}Je.findStartOfInputAnchor=_j;function Zj(r){var e=(0,Se.filter)(r,function(i){var n=i[Do];return n instanceof RegExp&&(n.multiline||n.global)}),t=(0,Se.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:ir.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[i]}});return t}Je.findUnsupportedFlags=Zj;function $j(r){var e=[],t=(0,Se.map)(r,function(s){return(0,Se.reduce)(r,function(o,a){return s.PATTERN.source===a.PATTERN.source&&!(0,Se.contains)(e,a)&&a.PATTERN!==ir.Lexer.NA&&(e.push(a),o.push(a)),o},[])});t=(0,Se.compact)(t);var i=(0,Se.filter)(t,function(s){return s.length>1}),n=(0,Se.map)(i,function(s){var o=(0,Se.map)(s,function(l){return l.name}),a=(0,Se.first)(s).PATTERN;return{message:"The same RegExp pattern ->"+a+"<-"+("has been used in all of the following Token Types: "+o.join(", ")+" <-"),type:ir.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}});return n}Je.findDuplicatePatterns=$j;function eq(r){var e=(0,Se.filter)(r,function(i){if(!(0,Se.has)(i,"GROUP"))return!1;var n=i.GROUP;return n!==ir.Lexer.SKIPPED&&n!==ir.Lexer.NA&&!(0,Se.isString)(n)}),t=(0,Se.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:ir.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[i]}});return t}Je.findInvalidGroupType=eq;function tq(r,e){var t=(0,Se.filter)(r,function(n){return n.PUSH_MODE!==void 0&&!(0,Se.contains)(e,n.PUSH_MODE)}),i=(0,Se.map)(t,function(n){var s="Token Type: ->"+n.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+n.PUSH_MODE+"<-which does not exist";return{message:s,type:ir.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[n]}});return i}Je.findModesThatDoNotExist=tq;function rq(r){var e=[],t=(0,Se.reduce)(r,function(i,n,s){var o=n.PATTERN;return o===ir.Lexer.NA||((0,Se.isString)(o)?i.push({str:o,idx:s,tokenType:n}):(0,Se.isRegExp)(o)&&mye(o)&&i.push({str:o.source,idx:s,tokenType:n})),i},[]);return(0,Se.forEach)(r,function(i,n){(0,Se.forEach)(t,function(s){var o=s.str,a=s.idx,l=s.tokenType;if(n"+i.name+"<-")+`in the lexer's definition. -See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:ir.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[i,l]})}})}),e}Je.findUnreachablePatterns=rq;function Cye(r,e){if((0,Se.isRegExp)(e)){var t=e.exec(r);return t!==null&&t.index===0}else{if((0,Se.isFunction)(e))return e(r,0,[],{});if((0,Se.has)(e,"exec"))return e.exec(r,0,[],{});if(typeof e=="string")return e===r;throw Error("non exhaustive match")}}function mye(r){var e=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return(0,Se.find)(e,function(t){return r.source.indexOf(t)!==-1})===void 0}function bx(r){var e=r.ignoreCase?"i":"";return new RegExp("^(?:"+r.source+")",e)}Je.addStartOfInput=bx;function Qx(r){var e=r.ignoreCase?"iy":"y";return new RegExp(""+r.source,e)}Je.addStickyFlag=Qx;function Eye(r,e,t){var i=[];return(0,Se.has)(r,Je.DEFAULT_MODE)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+Je.DEFAULT_MODE+`> property in its definition -`,type:ir.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,Se.has)(r,Je.MODES)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+Je.MODES+`> property in its definition -`,type:ir.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,Se.has)(r,Je.MODES)&&(0,Se.has)(r,Je.DEFAULT_MODE)&&!(0,Se.has)(r.modes,r.defaultMode)&&i.push({message:"A MultiMode Lexer cannot be initialized with a "+Je.DEFAULT_MODE+": <"+r.defaultMode+`>which does not exist -`,type:ir.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,Se.has)(r,Je.MODES)&&(0,Se.forEach)(r.modes,function(n,s){(0,Se.forEach)(n,function(o,a){(0,Se.isUndefined)(o)&&i.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+s+"> at index: <"+a+`> -`),type:ir.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),i}Je.performRuntimeChecks=Eye;function Iye(r,e,t){var i=[],n=!1,s=(0,Se.compact)((0,Se.flatten)((0,Se.mapValues)(r.modes,function(l){return l}))),o=(0,Se.reject)(s,function(l){return l[Do]===ir.Lexer.NA}),a=oq(t);return e&&(0,Se.forEach)(o,function(l){var c=nq(l,a);if(c!==!1){var u=sq(l,c),g={message:u,type:c.issue,tokenType:l};i.push(g)}else(0,Se.has)(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(n=!0):(0,pf.canMatchCharCode)(a,l.PATTERN)&&(n=!0)}),e&&!n&&i.push({message:`Warning: No LINE_BREAKS Found. - This Lexer has been defined to track line and column information, - But none of the Token Types can be identified as matching a line terminator. - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS - for details.`,type:ir.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),i}Je.performWarningRuntimeChecks=Iye;function yye(r){var e={},t=(0,Se.keys)(r);return(0,Se.forEach)(t,function(i){var n=r[i];if((0,Se.isArray)(n))e[i]=[];else throw Error("non exhaustive match")}),e}Je.cloneEmptyGroups=yye;function vx(r){var e=r.PATTERN;if((0,Se.isRegExp)(e))return!1;if((0,Se.isFunction)(e))return!0;if((0,Se.has)(e,"exec"))return!0;if((0,Se.isString)(e))return!1;throw Error("non exhaustive match")}Je.isCustomPattern=vx;function iq(r){return(0,Se.isString)(r)&&r.length===1?r.charCodeAt(0):!1}Je.isShortPattern=iq;Je.LineTerminatorOptimizedTester={test:function(r){for(var e=r.length,t=this.lastIndex;t Token Type -`)+(" Root cause: "+e.errMsg+`. -`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(e.issue===ir.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. -`+(" The problem is in the <"+r.name+`> Token Type -`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}Je.buildLineBreakIssueMessage=sq;function oq(r){var e=(0,Se.map)(r,function(t){return(0,Se.isString)(t)&&t.length>0?t.charCodeAt(0):t});return e}function Bx(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}Je.minOptimizationVal=256;var Ny=[];function Sx(r){return r255?255+~~(r/255):r}}});var df=y(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.isTokenType=Nt.hasExtendingTokensTypesMapProperty=Nt.hasExtendingTokensTypesProperty=Nt.hasCategoriesProperty=Nt.hasShortKeyProperty=Nt.singleAssignCategoriesToksMap=Nt.assignCategoriesMapProp=Nt.assignCategoriesTokensProp=Nt.assignTokenDefaultProps=Nt.expandCategories=Nt.augmentTokenTypes=Nt.tokenIdxToClass=Nt.tokenShortNameIdx=Nt.tokenStructuredMatcherNoCategories=Nt.tokenStructuredMatcher=void 0;var ei=Gt();function Bye(r,e){var t=r.tokenTypeIdx;return t===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[t]===!0}Nt.tokenStructuredMatcher=Bye;function bye(r,e){return r.tokenTypeIdx===e.tokenTypeIdx}Nt.tokenStructuredMatcherNoCategories=bye;Nt.tokenShortNameIdx=1;Nt.tokenIdxToClass={};function Qye(r){var e=aq(r);Aq(e),cq(e),lq(e),(0,ei.forEach)(e,function(t){t.isParent=t.categoryMatches.length>0})}Nt.augmentTokenTypes=Qye;function aq(r){for(var e=(0,ei.cloneArr)(r),t=r,i=!0;i;){t=(0,ei.compact)((0,ei.flatten)((0,ei.map)(t,function(s){return s.CATEGORIES})));var n=(0,ei.difference)(t,e);e=e.concat(n),(0,ei.isEmpty)(n)?i=!1:t=n}return e}Nt.expandCategories=aq;function Aq(r){(0,ei.forEach)(r,function(e){uq(e)||(Nt.tokenIdxToClass[Nt.tokenShortNameIdx]=e,e.tokenTypeIdx=Nt.tokenShortNameIdx++),xx(e)&&!(0,ei.isArray)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),xx(e)||(e.CATEGORIES=[]),gq(e)||(e.categoryMatches=[]),fq(e)||(e.categoryMatchesMap={})})}Nt.assignTokenDefaultProps=Aq;function lq(r){(0,ei.forEach)(r,function(e){e.categoryMatches=[],(0,ei.forEach)(e.categoryMatchesMap,function(t,i){e.categoryMatches.push(Nt.tokenIdxToClass[i].tokenTypeIdx)})})}Nt.assignCategoriesTokensProp=lq;function cq(r){(0,ei.forEach)(r,function(e){Px([],e)})}Nt.assignCategoriesMapProp=cq;function Px(r,e){(0,ei.forEach)(r,function(t){e.categoryMatchesMap[t.tokenTypeIdx]=!0}),(0,ei.forEach)(e.CATEGORIES,function(t){var i=r.concat(e);(0,ei.contains)(i,t)||Px(i,t)})}Nt.singleAssignCategoriesToksMap=Px;function uq(r){return(0,ei.has)(r,"tokenTypeIdx")}Nt.hasShortKeyProperty=uq;function xx(r){return(0,ei.has)(r,"CATEGORIES")}Nt.hasCategoriesProperty=xx;function gq(r){return(0,ei.has)(r,"categoryMatches")}Nt.hasExtendingTokensTypesProperty=gq;function fq(r){return(0,ei.has)(r,"categoryMatchesMap")}Nt.hasExtendingTokensTypesMapProperty=fq;function Sye(r){return(0,ei.has)(r,"tokenTypeIdx")}Nt.isTokenType=Sye});var Dx=y(Ty=>{"use strict";Object.defineProperty(Ty,"__esModule",{value:!0});Ty.defaultLexerErrorProvider=void 0;Ty.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(r){return"Unable to pop Lexer Mode after encountering Token ->"+r.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(r,e,t,i,n){return"unexpected character: ->"+r.charAt(e)+"<- at offset: "+e+","+(" skipped "+t+" characters.")}}});var Jd=y(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.Lexer=Rc.LexerDefinitionErrorType=void 0;var Vs=wx(),nr=Gt(),vye=df(),xye=Dx(),Pye=ky(),Dye;(function(r){r[r.MISSING_PATTERN=0]="MISSING_PATTERN",r[r.INVALID_PATTERN=1]="INVALID_PATTERN",r[r.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",r[r.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",r[r.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",r[r.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",r[r.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",r[r.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",r[r.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",r[r.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",r[r.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",r[r.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",r[r.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",r[r.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",r[r.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",r[r.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",r[r.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"})(Dye=Rc.LexerDefinitionErrorType||(Rc.LexerDefinitionErrorType={}));var Wd={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` -`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:xye.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(Wd);var kye=function(){function r(e,t){var i=this;if(t===void 0&&(t=Wd),this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},typeof t=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. -a boolean 2nd argument is no longer supported`);this.config=(0,nr.merge)(Wd,t);var n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var s,o=!0;i.TRACE_INIT("Lexer Config handling",function(){if(i.config.lineTerminatorsPattern===Wd.lineTerminatorsPattern)i.config.lineTerminatorsPattern=Vs.LineTerminatorOptimizedTester;else if(i.config.lineTerminatorCharacters===Wd.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');i.trackStartLines=/full|onlyStart/i.test(i.config.positionTracking),i.trackEndLines=/full/i.test(i.config.positionTracking),(0,nr.isArray)(e)?(s={modes:{}},s.modes[Vs.DEFAULT_MODE]=(0,nr.cloneArr)(e),s[Vs.DEFAULT_MODE]=Vs.DEFAULT_MODE):(o=!1,s=(0,nr.cloneObj)(e))}),i.config.skipValidations===!1&&(i.TRACE_INIT("performRuntimeChecks",function(){i.lexerDefinitionErrors=i.lexerDefinitionErrors.concat((0,Vs.performRuntimeChecks)(s,i.trackStartLines,i.config.lineTerminatorCharacters))}),i.TRACE_INIT("performWarningRuntimeChecks",function(){i.lexerDefinitionWarning=i.lexerDefinitionWarning.concat((0,Vs.performWarningRuntimeChecks)(s,i.trackStartLines,i.config.lineTerminatorCharacters))})),s.modes=s.modes?s.modes:{},(0,nr.forEach)(s.modes,function(u,g){s.modes[g]=(0,nr.reject)(u,function(f){return(0,nr.isUndefined)(f)})});var a=(0,nr.keys)(s.modes);if((0,nr.forEach)(s.modes,function(u,g){i.TRACE_INIT("Mode: <"+g+"> processing",function(){if(i.modes.push(g),i.config.skipValidations===!1&&i.TRACE_INIT("validatePatterns",function(){i.lexerDefinitionErrors=i.lexerDefinitionErrors.concat((0,Vs.validatePatterns)(u,a))}),(0,nr.isEmpty)(i.lexerDefinitionErrors)){(0,vye.augmentTokenTypes)(u);var f;i.TRACE_INIT("analyzeTokenTypes",function(){f=(0,Vs.analyzeTokenTypes)(u,{lineTerminatorCharacters:i.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:i.TRACE_INIT.bind(i)})}),i.patternIdxToConfig[g]=f.patternIdxToConfig,i.charCodeToPatternIdxToConfig[g]=f.charCodeToPatternIdxToConfig,i.emptyGroups=(0,nr.merge)(i.emptyGroups,f.emptyGroups),i.hasCustom=f.hasCustom||i.hasCustom,i.canModeBeOptimized[g]=f.canBeOptimized}})}),i.defaultMode=s.defaultMode,!(0,nr.isEmpty)(i.lexerDefinitionErrors)&&!i.config.deferDefinitionErrorsHandling){var l=(0,nr.map)(i.lexerDefinitionErrors,function(u){return u.message}),c=l.join(`----------------------- -`);throw new Error(`Errors detected in definition of Lexer: -`+c)}(0,nr.forEach)(i.lexerDefinitionWarning,function(u){(0,nr.PRINT_WARNING)(u.message)}),i.TRACE_INIT("Choosing sub-methods implementations",function(){if(Vs.SUPPORT_STICKY?(i.chopInput=nr.IDENTITY,i.match=i.matchWithTest):(i.updateLastIndex=nr.NOOP,i.match=i.matchWithExec),o&&(i.handleModes=nr.NOOP),i.trackStartLines===!1&&(i.computeNewColumn=nr.IDENTITY),i.trackEndLines===!1&&(i.updateTokenEndLineColumnLocation=nr.NOOP),/full/i.test(i.config.positionTracking))i.createTokenInstance=i.createFullToken;else if(/onlyStart/i.test(i.config.positionTracking))i.createTokenInstance=i.createStartOnlyToken;else if(/onlyOffset/i.test(i.config.positionTracking))i.createTokenInstance=i.createOffsetOnlyToken;else throw Error('Invalid config option: "'+i.config.positionTracking+'"');i.hasCustom?(i.addToken=i.addTokenUsingPush,i.handlePayload=i.handlePayloadWithCustom):(i.addToken=i.addTokenUsingMemberAccess,i.handlePayload=i.handlePayloadNoCustom)}),i.TRACE_INIT("Failed Optimization Warnings",function(){var u=(0,nr.reduce)(i.canModeBeOptimized,function(g,f,h){return f===!1&&g.push(h),g},[]);if(t.ensureOptimizations&&!(0,nr.isEmpty)(u))throw Error("Lexer Modes: < "+u.join(", ")+` > cannot be optimized. - Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. - Or inspect the console log for details on how to resolve these issues.`)}),i.TRACE_INIT("clearRegExpParserCache",function(){(0,Pye.clearRegExpParserCache)()}),i.TRACE_INIT("toFastProperties",function(){(0,nr.toFastProperties)(i)})})}return r.prototype.tokenize=function(e,t){if(t===void 0&&(t=this.defaultMode),!(0,nr.isEmpty)(this.lexerDefinitionErrors)){var i=(0,nr.map)(this.lexerDefinitionErrors,function(o){return o.message}),n=i.join(`----------------------- -`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: -`+n)}var s=this.tokenizeInternal(e,t);return s},r.prototype.tokenizeInternal=function(e,t){var i=this,n,s,o,a,l,c,u,g,f,h,p,C,w,B,v,D,T=e,H=T.length,j=0,$=0,V=this.hasCustom?0:Math.floor(e.length/10),W=new Array(V),Z=[],A=this.trackStartLines?1:void 0,ae=this.trackStartLines?1:void 0,ge=(0,Vs.cloneEmptyGroups)(this.emptyGroups),_=this.trackStartLines,L=this.config.lineTerminatorsPattern,N=0,ue=[],we=[],Te=[],Pe=[];Object.freeze(Pe);var Le=void 0;function se(){return ue}function Ae(dr){var Bi=(0,Vs.charCodeToOptimizedIndex)(dr),_n=we[Bi];return _n===void 0?Pe:_n}var be=function(dr){if(Te.length===1&&dr.tokenType.PUSH_MODE===void 0){var Bi=i.config.errorMessageProvider.buildUnableToPopLexerModeMessage(dr);Z.push({offset:dr.startOffset,line:dr.startLine!==void 0?dr.startLine:void 0,column:dr.startColumn!==void 0?dr.startColumn:void 0,length:dr.image.length,message:Bi})}else{Te.pop();var _n=(0,nr.last)(Te);ue=i.patternIdxToConfig[_n],we=i.charCodeToPatternIdxToConfig[_n],N=ue.length;var pa=i.canModeBeOptimized[_n]&&i.config.safeMode===!1;we&&pa?Le=Ae:Le=se}};function fe(dr){Te.push(dr),we=this.charCodeToPatternIdxToConfig[dr],ue=this.patternIdxToConfig[dr],N=ue.length,N=ue.length;var Bi=this.canModeBeOptimized[dr]&&this.config.safeMode===!1;we&&Bi?Le=Ae:Le=se}fe.call(this,t);for(var le;jc.length){c=a,u=g,le=tt;break}}}break}}if(c!==null){if(f=c.length,h=le.group,h!==void 0&&(p=le.tokenTypeIdx,C=this.createTokenInstance(c,j,p,le.tokenType,A,ae,f),this.handlePayload(C,u),h===!1?$=this.addToken(W,$,C):ge[h].push(C)),e=this.chopInput(e,f),j=j+f,ae=this.computeNewColumn(ae,f),_===!0&&le.canLineTerminator===!0){var It=0,Ur=void 0,oi=void 0;L.lastIndex=0;do Ur=L.test(c),Ur===!0&&(oi=L.lastIndex-1,It++);while(Ur===!0);It!==0&&(A=A+It,ae=f-oi,this.updateTokenEndLineColumnLocation(C,h,oi,It,A,ae,f))}this.handleModes(le,be,fe,C)}else{for(var pi=j,pr=A,di=ae,ai=!1;!ai&&j <"+e+">");var n=(0,nr.timer)(t),s=n.time,o=n.value,a=s>10?console.warn:console.log;return this.traceInitIndent time: "+s+"ms"),this.traceInitIndent--,o}else return t()},r.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",r.NA=/NOT_APPLICABLE/,r}();Rc.Lexer=kye});var HA=y(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.tokenMatcher=Si.createTokenInstance=Si.EOF=Si.createToken=Si.hasTokenLabel=Si.tokenName=Si.tokenLabel=void 0;var Xs=Gt(),Rye=Jd(),kx=df();function Fye(r){return wq(r)?r.LABEL:r.name}Si.tokenLabel=Fye;function Nye(r){return r.name}Si.tokenName=Nye;function wq(r){return(0,Xs.isString)(r.LABEL)&&r.LABEL!==""}Si.hasTokenLabel=wq;var Tye="parent",hq="categories",pq="label",dq="group",Cq="push_mode",mq="pop_mode",Eq="longer_alt",Iq="line_breaks",yq="start_chars_hint";function Bq(r){return Lye(r)}Si.createToken=Bq;function Lye(r){var e=r.pattern,t={};if(t.name=r.name,(0,Xs.isUndefined)(e)||(t.PATTERN=e),(0,Xs.has)(r,Tye))throw`The parent property is no longer supported. -See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return(0,Xs.has)(r,hq)&&(t.CATEGORIES=r[hq]),(0,kx.augmentTokenTypes)([t]),(0,Xs.has)(r,pq)&&(t.LABEL=r[pq]),(0,Xs.has)(r,dq)&&(t.GROUP=r[dq]),(0,Xs.has)(r,mq)&&(t.POP_MODE=r[mq]),(0,Xs.has)(r,Cq)&&(t.PUSH_MODE=r[Cq]),(0,Xs.has)(r,Eq)&&(t.LONGER_ALT=r[Eq]),(0,Xs.has)(r,Iq)&&(t.LINE_BREAKS=r[Iq]),(0,Xs.has)(r,yq)&&(t.START_CHARS_HINT=r[yq]),t}Si.EOF=Bq({name:"EOF",pattern:Rye.Lexer.NA});(0,kx.augmentTokenTypes)([Si.EOF]);function Oye(r,e,t,i,n,s,o,a){return{image:e,startOffset:t,endOffset:i,startLine:n,endLine:s,startColumn:o,endColumn:a,tokenTypeIdx:r.tokenTypeIdx,tokenType:r}}Si.createTokenInstance=Oye;function Mye(r,e){return(0,kx.tokenStructuredMatcher)(r,e)}Si.tokenMatcher=Mye});var Cn=y(Wt=>{"use strict";var ka=Wt&&Wt.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Wt,"__esModule",{value:!0});Wt.serializeProduction=Wt.serializeGrammar=Wt.Terminal=Wt.Alternation=Wt.RepetitionWithSeparator=Wt.Repetition=Wt.RepetitionMandatoryWithSeparator=Wt.RepetitionMandatory=Wt.Option=Wt.Alternative=Wt.Rule=Wt.NonTerminal=Wt.AbstractProduction=void 0;var lr=Gt(),Uye=HA(),ko=function(){function r(e){this._definition=e}return Object.defineProperty(r.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),r.prototype.accept=function(e){e.visit(this),(0,lr.forEach)(this.definition,function(t){t.accept(e)})},r}();Wt.AbstractProduction=ko;var bq=function(r){ka(e,r);function e(t){var i=r.call(this,[])||this;return i.idx=1,(0,lr.assign)(i,(0,lr.pick)(t,function(n){return n!==void 0})),i}return Object.defineProperty(e.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(t){},enumerable:!1,configurable:!0}),e.prototype.accept=function(t){t.visit(this)},e}(ko);Wt.NonTerminal=bq;var Qq=function(r){ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.orgText="",(0,lr.assign)(i,(0,lr.pick)(t,function(n){return n!==void 0})),i}return e}(ko);Wt.Rule=Qq;var Sq=function(r){ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.ignoreAmbiguities=!1,(0,lr.assign)(i,(0,lr.pick)(t,function(n){return n!==void 0})),i}return e}(ko);Wt.Alternative=Sq;var vq=function(r){ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,lr.assign)(i,(0,lr.pick)(t,function(n){return n!==void 0})),i}return e}(ko);Wt.Option=vq;var xq=function(r){ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,lr.assign)(i,(0,lr.pick)(t,function(n){return n!==void 0})),i}return e}(ko);Wt.RepetitionMandatory=xq;var Pq=function(r){ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,lr.assign)(i,(0,lr.pick)(t,function(n){return n!==void 0})),i}return e}(ko);Wt.RepetitionMandatoryWithSeparator=Pq;var Dq=function(r){ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,lr.assign)(i,(0,lr.pick)(t,function(n){return n!==void 0})),i}return e}(ko);Wt.Repetition=Dq;var kq=function(r){ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,lr.assign)(i,(0,lr.pick)(t,function(n){return n!==void 0})),i}return e}(ko);Wt.RepetitionWithSeparator=kq;var Rq=function(r){ka(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,i.ignoreAmbiguities=!1,i.hasPredicates=!1,(0,lr.assign)(i,(0,lr.pick)(t,function(n){return n!==void 0})),i}return Object.defineProperty(e.prototype,"definition",{get:function(){return this._definition},set:function(t){this._definition=t},enumerable:!1,configurable:!0}),e}(ko);Wt.Alternation=Rq;var Ly=function(){function r(e){this.idx=1,(0,lr.assign)(this,(0,lr.pick)(e,function(t){return t!==void 0}))}return r.prototype.accept=function(e){e.visit(this)},r}();Wt.Terminal=Ly;function Kye(r){return(0,lr.map)(r,zd)}Wt.serializeGrammar=Kye;function zd(r){function e(s){return(0,lr.map)(s,zd)}if(r instanceof bq){var t={type:"NonTerminal",name:r.nonTerminalName,idx:r.idx};return(0,lr.isString)(r.label)&&(t.label=r.label),t}else{if(r instanceof Sq)return{type:"Alternative",definition:e(r.definition)};if(r instanceof vq)return{type:"Option",idx:r.idx,definition:e(r.definition)};if(r instanceof xq)return{type:"RepetitionMandatory",idx:r.idx,definition:e(r.definition)};if(r instanceof Pq)return{type:"RepetitionMandatoryWithSeparator",idx:r.idx,separator:zd(new Ly({terminalType:r.separator})),definition:e(r.definition)};if(r instanceof kq)return{type:"RepetitionWithSeparator",idx:r.idx,separator:zd(new Ly({terminalType:r.separator})),definition:e(r.definition)};if(r instanceof Dq)return{type:"Repetition",idx:r.idx,definition:e(r.definition)};if(r instanceof Rq)return{type:"Alternation",idx:r.idx,definition:e(r.definition)};if(r instanceof Ly){var i={type:"Terminal",name:r.terminalType.name,label:(0,Uye.tokenLabel)(r.terminalType),idx:r.idx};(0,lr.isString)(r.label)&&(i.terminalLabel=r.label);var n=r.terminalType.PATTERN;return r.terminalType.PATTERN&&(i.pattern=(0,lr.isRegExp)(n)?n.source:n),i}else{if(r instanceof Qq)return{type:"Rule",name:r.name,orgText:r.orgText,definition:e(r.definition)};throw Error("non exhaustive match")}}}Wt.serializeProduction=zd});var My=y(Oy=>{"use strict";Object.defineProperty(Oy,"__esModule",{value:!0});Oy.RestWalker=void 0;var Rx=Gt(),mn=Cn(),Hye=function(){function r(){}return r.prototype.walk=function(e,t){var i=this;t===void 0&&(t=[]),(0,Rx.forEach)(e.definition,function(n,s){var o=(0,Rx.drop)(e.definition,s+1);if(n instanceof mn.NonTerminal)i.walkProdRef(n,o,t);else if(n instanceof mn.Terminal)i.walkTerminal(n,o,t);else if(n instanceof mn.Alternative)i.walkFlat(n,o,t);else if(n instanceof mn.Option)i.walkOption(n,o,t);else if(n instanceof mn.RepetitionMandatory)i.walkAtLeastOne(n,o,t);else if(n instanceof mn.RepetitionMandatoryWithSeparator)i.walkAtLeastOneSep(n,o,t);else if(n instanceof mn.RepetitionWithSeparator)i.walkManySep(n,o,t);else if(n instanceof mn.Repetition)i.walkMany(n,o,t);else if(n instanceof mn.Alternation)i.walkOr(n,o,t);else throw Error("non exhaustive match")})},r.prototype.walkTerminal=function(e,t,i){},r.prototype.walkProdRef=function(e,t,i){},r.prototype.walkFlat=function(e,t,i){var n=t.concat(i);this.walk(e,n)},r.prototype.walkOption=function(e,t,i){var n=t.concat(i);this.walk(e,n)},r.prototype.walkAtLeastOne=function(e,t,i){var n=[new mn.Option({definition:e.definition})].concat(t,i);this.walk(e,n)},r.prototype.walkAtLeastOneSep=function(e,t,i){var n=Fq(e,t,i);this.walk(e,n)},r.prototype.walkMany=function(e,t,i){var n=[new mn.Option({definition:e.definition})].concat(t,i);this.walk(e,n)},r.prototype.walkManySep=function(e,t,i){var n=Fq(e,t,i);this.walk(e,n)},r.prototype.walkOr=function(e,t,i){var n=this,s=t.concat(i);(0,Rx.forEach)(e.definition,function(o){var a=new mn.Alternative({definition:[o]});n.walk(a,s)})},r}();Oy.RestWalker=Hye;function Fq(r,e,t){var i=[new mn.Option({definition:[new mn.Terminal({terminalType:r.separator})].concat(r.definition)})],n=i.concat(e,t);return n}});var Cf=y(Uy=>{"use strict";Object.defineProperty(Uy,"__esModule",{value:!0});Uy.GAstVisitor=void 0;var Ro=Cn(),Gye=function(){function r(){}return r.prototype.visit=function(e){var t=e;switch(t.constructor){case Ro.NonTerminal:return this.visitNonTerminal(t);case Ro.Alternative:return this.visitAlternative(t);case Ro.Option:return this.visitOption(t);case Ro.RepetitionMandatory:return this.visitRepetitionMandatory(t);case Ro.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(t);case Ro.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(t);case Ro.Repetition:return this.visitRepetition(t);case Ro.Alternation:return this.visitAlternation(t);case Ro.Terminal:return this.visitTerminal(t);case Ro.Rule:return this.visitRule(t);default:throw Error("non exhaustive match")}},r.prototype.visitNonTerminal=function(e){},r.prototype.visitAlternative=function(e){},r.prototype.visitOption=function(e){},r.prototype.visitRepetition=function(e){},r.prototype.visitRepetitionMandatory=function(e){},r.prototype.visitRepetitionMandatoryWithSeparator=function(e){},r.prototype.visitRepetitionWithSeparator=function(e){},r.prototype.visitAlternation=function(e){},r.prototype.visitTerminal=function(e){},r.prototype.visitRule=function(e){},r}();Uy.GAstVisitor=Gye});var Xd=y(Ui=>{"use strict";var Yye=Ui&&Ui.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Ui,"__esModule",{value:!0});Ui.collectMethods=Ui.DslMethodsCollectorVisitor=Ui.getProductionDslName=Ui.isBranchingProd=Ui.isOptionalProd=Ui.isSequenceProd=void 0;var Vd=Gt(),Qr=Cn(),jye=Cf();function qye(r){return r instanceof Qr.Alternative||r instanceof Qr.Option||r instanceof Qr.Repetition||r instanceof Qr.RepetitionMandatory||r instanceof Qr.RepetitionMandatoryWithSeparator||r instanceof Qr.RepetitionWithSeparator||r instanceof Qr.Terminal||r instanceof Qr.Rule}Ui.isSequenceProd=qye;function Fx(r,e){e===void 0&&(e=[]);var t=r instanceof Qr.Option||r instanceof Qr.Repetition||r instanceof Qr.RepetitionWithSeparator;return t?!0:r instanceof Qr.Alternation?(0,Vd.some)(r.definition,function(i){return Fx(i,e)}):r instanceof Qr.NonTerminal&&(0,Vd.contains)(e,r)?!1:r instanceof Qr.AbstractProduction?(r instanceof Qr.NonTerminal&&e.push(r),(0,Vd.every)(r.definition,function(i){return Fx(i,e)})):!1}Ui.isOptionalProd=Fx;function Jye(r){return r instanceof Qr.Alternation}Ui.isBranchingProd=Jye;function Wye(r){if(r instanceof Qr.NonTerminal)return"SUBRULE";if(r instanceof Qr.Option)return"OPTION";if(r instanceof Qr.Alternation)return"OR";if(r instanceof Qr.RepetitionMandatory)return"AT_LEAST_ONE";if(r instanceof Qr.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(r instanceof Qr.RepetitionWithSeparator)return"MANY_SEP";if(r instanceof Qr.Repetition)return"MANY";if(r instanceof Qr.Terminal)return"CONSUME";throw Error("non exhaustive match")}Ui.getProductionDslName=Wye;var Nq=function(r){Yye(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.separator="-",t.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},t}return e.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},e.prototype.visitTerminal=function(t){var i=t.terminalType.name+this.separator+"Terminal";(0,Vd.has)(this.dslMethods,i)||(this.dslMethods[i]=[]),this.dslMethods[i].push(t)},e.prototype.visitNonTerminal=function(t){var i=t.nonTerminalName+this.separator+"Terminal";(0,Vd.has)(this.dslMethods,i)||(this.dslMethods[i]=[]),this.dslMethods[i].push(t)},e.prototype.visitOption=function(t){this.dslMethods.option.push(t)},e.prototype.visitRepetitionWithSeparator=function(t){this.dslMethods.repetitionWithSeparator.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.dslMethods.repetitionMandatory.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.dslMethods.repetitionMandatoryWithSeparator.push(t)},e.prototype.visitRepetition=function(t){this.dslMethods.repetition.push(t)},e.prototype.visitAlternation=function(t){this.dslMethods.alternation.push(t)},e}(jye.GAstVisitor);Ui.DslMethodsCollectorVisitor=Nq;var Ky=new Nq;function zye(r){Ky.reset(),r.accept(Ky);var e=Ky.dslMethods;return Ky.reset(),e}Ui.collectMethods=zye});var Tx=y(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.firstForTerminal=Fo.firstForBranching=Fo.firstForSequence=Fo.first=void 0;var Hy=Gt(),Tq=Cn(),Nx=Xd();function Gy(r){if(r instanceof Tq.NonTerminal)return Gy(r.referencedRule);if(r instanceof Tq.Terminal)return Mq(r);if((0,Nx.isSequenceProd)(r))return Lq(r);if((0,Nx.isBranchingProd)(r))return Oq(r);throw Error("non exhaustive match")}Fo.first=Gy;function Lq(r){for(var e=[],t=r.definition,i=0,n=t.length>i,s,o=!0;n&&o;)s=t[i],o=(0,Nx.isOptionalProd)(s),e=e.concat(Gy(s)),i=i+1,n=t.length>i;return(0,Hy.uniq)(e)}Fo.firstForSequence=Lq;function Oq(r){var e=(0,Hy.map)(r.definition,function(t){return Gy(t)});return(0,Hy.uniq)((0,Hy.flatten)(e))}Fo.firstForBranching=Oq;function Mq(r){return[r.terminalType]}Fo.firstForTerminal=Mq});var Lx=y(Yy=>{"use strict";Object.defineProperty(Yy,"__esModule",{value:!0});Yy.IN=void 0;Yy.IN="_~IN~_"});var Yq=y(ls=>{"use strict";var Vye=ls&&ls.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(ls,"__esModule",{value:!0});ls.buildInProdFollowPrefix=ls.buildBetweenProdsFollowPrefix=ls.computeAllProdsFollows=ls.ResyncFollowsWalker=void 0;var Xye=My(),_ye=Tx(),Uq=Gt(),Kq=Lx(),Zye=Cn(),Hq=function(r){Vye(e,r);function e(t){var i=r.call(this)||this;return i.topProd=t,i.follows={},i}return e.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},e.prototype.walkTerminal=function(t,i,n){},e.prototype.walkProdRef=function(t,i,n){var s=Gq(t.referencedRule,t.idx)+this.topProd.name,o=i.concat(n),a=new Zye.Alternative({definition:o}),l=(0,_ye.first)(a);this.follows[s]=l},e}(Xye.RestWalker);ls.ResyncFollowsWalker=Hq;function $ye(r){var e={};return(0,Uq.forEach)(r,function(t){var i=new Hq(t).startWalking();(0,Uq.assign)(e,i)}),e}ls.computeAllProdsFollows=$ye;function Gq(r,e){return r.name+e+Kq.IN}ls.buildBetweenProdsFollowPrefix=Gq;function ewe(r){var e=r.terminalType.name;return e+r.idx+Kq.IN}ls.buildInProdFollowPrefix=ewe});var _d=y(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.defaultGrammarValidatorErrorProvider=Ra.defaultGrammarResolverErrorProvider=Ra.defaultParserErrorProvider=void 0;var mf=HA(),twe=Gt(),_s=Gt(),Ox=Cn(),jq=Xd();Ra.defaultParserErrorProvider={buildMismatchTokenMessage:function(r){var e=r.expected,t=r.actual,i=r.previous,n=r.ruleName,s=(0,mf.hasTokenLabel)(e),o=s?"--> "+(0,mf.tokenLabel)(e)+" <--":"token of type --> "+e.name+" <--",a="Expecting "+o+" but found --> '"+t.image+"' <--";return a},buildNotAllInputParsedMessage:function(r){var e=r.firstRedundant,t=r.ruleName;return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage:function(r){var e=r.expectedPathsPerAlt,t=r.actual,i=r.previous,n=r.customUserDescription,s=r.ruleName,o="Expecting: ",a=(0,_s.first)(t).image,l=` -but found: '`+a+"'";if(n)return o+n+l;var c=(0,_s.reduce)(e,function(h,p){return h.concat(p)},[]),u=(0,_s.map)(c,function(h){return"["+(0,_s.map)(h,function(p){return(0,mf.tokenLabel)(p)}).join(", ")+"]"}),g=(0,_s.map)(u,function(h,p){return" "+(p+1)+". "+h}),f=`one of these possible Token sequences: -`+g.join(` -`);return o+f+l},buildEarlyExitMessage:function(r){var e=r.expectedIterationPaths,t=r.actual,i=r.customUserDescription,n=r.ruleName,s="Expecting: ",o=(0,_s.first)(t).image,a=` -but found: '`+o+"'";if(i)return s+i+a;var l=(0,_s.map)(e,function(u){return"["+(0,_s.map)(u,function(g){return(0,mf.tokenLabel)(g)}).join(",")+"]"}),c=`expecting at least one iteration which starts with one of these possible Token sequences:: - `+("<"+l.join(" ,")+">");return s+c+a}};Object.freeze(Ra.defaultParserErrorProvider);Ra.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(r,e){var t="Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- -inside top level rule: ->`+r.name+"<-";return t}};Ra.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(r,e){function t(u){return u instanceof Ox.Terminal?u.terminalType.name:u instanceof Ox.NonTerminal?u.nonTerminalName:""}var i=r.name,n=(0,_s.first)(e),s=n.idx,o=(0,jq.getProductionDslName)(n),a=t(n),l=s>0,c="->"+o+(l?s:"")+"<- "+(a?"with argument: ->"+a+"<-":"")+` - appears more than once (`+e.length+" times) in the top level rule: ->"+i+`<-. - For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES - `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,` -`),c},buildNamespaceConflictError:function(r){var e=`Namespace conflict found in grammar. -`+("The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+r.name+`>. -`)+`To resolve this make sure each Terminal and Non-Terminal names are unique -This is easy to accomplish by using the convention that Terminal names start with an uppercase letter -and Non-Terminal names start with a lower case letter.`;return e},buildAlternationPrefixAmbiguityError:function(r){var e=(0,_s.map)(r.prefixPath,function(n){return(0,mf.tokenLabel)(n)}).join(", "),t=r.alternation.idx===0?"":r.alternation.idx,i="Ambiguous alternatives: <"+r.ambiguityIndices.join(" ,")+`> due to common lookahead prefix -`+("in inside <"+r.topLevelRule.name+`> Rule, -`)+("<"+e+`> may appears as a prefix path in all these alternatives. -`)+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX -For Further details.`;return i},buildAlternationAmbiguityError:function(r){var e=(0,_s.map)(r.prefixPath,function(n){return(0,mf.tokenLabel)(n)}).join(", "),t=r.alternation.idx===0?"":r.alternation.idx,i="Ambiguous Alternatives Detected: <"+r.ambiguityIndices.join(" ,")+"> in "+(" inside <"+r.topLevelRule.name+`> Rule, -`)+("<"+e+`> may appears as a prefix path in all these alternatives. -`);return i=i+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES -For Further details.`,i},buildEmptyRepetitionError:function(r){var e=(0,jq.getProductionDslName)(r.repetition);r.repetition.idx!==0&&(e+=r.repetition.idx);var t="The repetition <"+e+"> within Rule <"+r.topLevelRule.name+`> can never consume any tokens. -This could lead to an infinite loop.`;return t},buildTokenNameError:function(r){return"deprecated"},buildEmptyAlternationError:function(r){var e="Ambiguous empty alternative: <"+(r.emptyChoiceIdx+1)+">"+(" in inside <"+r.topLevelRule.name+`> Rule. -`)+"Only the last alternative may be an empty alternative.";return e},buildTooManyAlternativesError:function(r){var e=`An Alternation cannot have more than 256 alternatives: -`+(" inside <"+r.topLevelRule.name+`> Rule. - has `+(r.alternation.definition.length+1)+" alternatives.");return e},buildLeftRecursionError:function(r){var e=r.topLevelRule.name,t=twe.map(r.leftRecursionPath,function(s){return s.name}),i=e+" --> "+t.concat([e]).join(" --> "),n=`Left Recursion found in grammar. -`+("rule: <"+e+`> can be invoked from itself (directly or indirectly) -`)+(`without consuming any Tokens. The grammar path that causes this is: - `+i+` -`)+` To fix this refactor your grammar to remove the left recursion. -see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return n},buildInvalidRuleNameError:function(r){return"deprecated"},buildDuplicateRuleNameError:function(r){var e;r.topLevelRule instanceof Ox.Rule?e=r.topLevelRule.name:e=r.topLevelRule;var t="Duplicate definition, rule: ->"+e+"<- is already defined in the grammar: ->"+r.grammarName+"<-";return t}}});var Wq=y(GA=>{"use strict";var rwe=GA&&GA.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(GA,"__esModule",{value:!0});GA.GastRefResolverVisitor=GA.resolveGrammar=void 0;var iwe=Hn(),qq=Gt(),nwe=Cf();function swe(r,e){var t=new Jq(r,e);return t.resolveRefs(),t.errors}GA.resolveGrammar=swe;var Jq=function(r){rwe(e,r);function e(t,i){var n=r.call(this)||this;return n.nameToTopRule=t,n.errMsgProvider=i,n.errors=[],n}return e.prototype.resolveRefs=function(){var t=this;(0,qq.forEach)((0,qq.values)(this.nameToTopRule),function(i){t.currTopLevel=i,i.accept(t)})},e.prototype.visitNonTerminal=function(t){var i=this.nameToTopRule[t.nonTerminalName];if(i)t.referencedRule=i;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:n,type:iwe.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}},e}(nwe.GAstVisitor);GA.GastRefResolverVisitor=Jq});var $d=y(Lr=>{"use strict";var Fc=Lr&&Lr.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Lr,"__esModule",{value:!0});Lr.nextPossibleTokensAfter=Lr.possiblePathsFrom=Lr.NextTerminalAfterAtLeastOneSepWalker=Lr.NextTerminalAfterAtLeastOneWalker=Lr.NextTerminalAfterManySepWalker=Lr.NextTerminalAfterManyWalker=Lr.AbstractNextTerminalAfterProductionWalker=Lr.NextAfterTokenWalker=Lr.AbstractNextPossibleTokensWalker=void 0;var zq=My(),Ut=Gt(),owe=Tx(),Dt=Cn(),Vq=function(r){Fc(e,r);function e(t,i){var n=r.call(this)||this;return n.topProd=t,n.path=i,n.possibleTokTypes=[],n.nextProductionName="",n.nextProductionOccurrence=0,n.found=!1,n.isAtEndOfPath=!1,n}return e.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=(0,Ut.cloneArr)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,Ut.cloneArr)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},e.prototype.walk=function(t,i){i===void 0&&(i=[]),this.found||r.prototype.walk.call(this,t,i)},e.prototype.walkProdRef=function(t,i,n){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){var s=i.concat(n);this.updateExpectedNext(),this.walk(t.referencedRule,s)}},e.prototype.updateExpectedNext=function(){(0,Ut.isEmpty)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},e}(zq.RestWalker);Lr.AbstractNextPossibleTokensWalker=Vq;var awe=function(r){Fc(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.path=i,n.nextTerminalName="",n.nextTerminalOccurrence=0,n.nextTerminalName=n.path.lastTok.name,n.nextTerminalOccurrence=n.path.lastTokOccurrence,n}return e.prototype.walkTerminal=function(t,i,n){if(this.isAtEndOfPath&&t.terminalType.name===this.nextTerminalName&&t.idx===this.nextTerminalOccurrence&&!this.found){var s=i.concat(n),o=new Dt.Alternative({definition:s});this.possibleTokTypes=(0,owe.first)(o),this.found=!0}},e}(Vq);Lr.NextAfterTokenWalker=awe;var Zd=function(r){Fc(e,r);function e(t,i){var n=r.call(this)||this;return n.topRule=t,n.occurrence=i,n.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},n}return e.prototype.startWalking=function(){return this.walk(this.topRule),this.result},e}(zq.RestWalker);Lr.AbstractNextTerminalAfterProductionWalker=Zd;var Awe=function(r){Fc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkMany=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Ut.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Dt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkMany.call(this,t,i,n)},e}(Zd);Lr.NextTerminalAfterManyWalker=Awe;var lwe=function(r){Fc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkManySep=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Ut.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Dt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkManySep.call(this,t,i,n)},e}(Zd);Lr.NextTerminalAfterManySepWalker=lwe;var cwe=function(r){Fc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkAtLeastOne=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Ut.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Dt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkAtLeastOne.call(this,t,i,n)},e}(Zd);Lr.NextTerminalAfterAtLeastOneWalker=cwe;var uwe=function(r){Fc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkAtLeastOneSep=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Ut.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Dt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkAtLeastOneSep.call(this,t,i,n)},e}(Zd);Lr.NextTerminalAfterAtLeastOneSepWalker=uwe;function Xq(r,e,t){t===void 0&&(t=[]),t=(0,Ut.cloneArr)(t);var i=[],n=0;function s(c){return c.concat((0,Ut.drop)(r,n+1))}function o(c){var u=Xq(s(c),e,t);return i.concat(u)}for(;t.length=0;ge--){var _=B.definition[ge],L={idx:p,def:_.definition.concat((0,Ut.drop)(h)),ruleStack:C,occurrenceStack:w};g.push(L),g.push(o)}else if(B instanceof Dt.Alternative)g.push({idx:p,def:B.definition.concat((0,Ut.drop)(h)),ruleStack:C,occurrenceStack:w});else if(B instanceof Dt.Rule)g.push(fwe(B,p,C,w));else throw Error("non exhaustive match")}}return u}Lr.nextPossibleTokensAfter=gwe;function fwe(r,e,t,i){var n=(0,Ut.cloneArr)(t);n.push(r.name);var s=(0,Ut.cloneArr)(i);return s.push(1),{idx:e,def:r.definition,ruleStack:n,occurrenceStack:s}}});var eC=y(_t=>{"use strict";var $q=_t&&_t.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(_t,"__esModule",{value:!0});_t.areTokenCategoriesNotUsed=_t.isStrictPrefixOfPath=_t.containsPath=_t.getLookaheadPathsForOptionalProd=_t.getLookaheadPathsForOr=_t.lookAheadSequenceFromAlternatives=_t.buildSingleAlternativeLookaheadFunction=_t.buildAlternativesLookAheadFunc=_t.buildLookaheadFuncForOptionalProd=_t.buildLookaheadFuncForOr=_t.getProdType=_t.PROD_TYPE=void 0;var sr=Gt(),_q=$d(),hwe=My(),jy=df(),YA=Cn(),pwe=Cf(),li;(function(r){r[r.OPTION=0]="OPTION",r[r.REPETITION=1]="REPETITION",r[r.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",r[r.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",r[r.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",r[r.ALTERNATION=5]="ALTERNATION"})(li=_t.PROD_TYPE||(_t.PROD_TYPE={}));function dwe(r){if(r instanceof YA.Option)return li.OPTION;if(r instanceof YA.Repetition)return li.REPETITION;if(r instanceof YA.RepetitionMandatory)return li.REPETITION_MANDATORY;if(r instanceof YA.RepetitionMandatoryWithSeparator)return li.REPETITION_MANDATORY_WITH_SEPARATOR;if(r instanceof YA.RepetitionWithSeparator)return li.REPETITION_WITH_SEPARATOR;if(r instanceof YA.Alternation)return li.ALTERNATION;throw Error("non exhaustive match")}_t.getProdType=dwe;function Cwe(r,e,t,i,n,s){var o=tJ(r,e,t),a=Kx(o)?jy.tokenStructuredMatcherNoCategories:jy.tokenStructuredMatcher;return s(o,i,a,n)}_t.buildLookaheadFuncForOr=Cwe;function mwe(r,e,t,i,n,s){var o=rJ(r,e,n,t),a=Kx(o)?jy.tokenStructuredMatcherNoCategories:jy.tokenStructuredMatcher;return s(o[0],a,i)}_t.buildLookaheadFuncForOptionalProd=mwe;function Ewe(r,e,t,i){var n=r.length,s=(0,sr.every)(r,function(l){return(0,sr.every)(l,function(c){return c.length===1})});if(e)return function(l){for(var c=(0,sr.map)(l,function(D){return D.GATE}),u=0;u{"use strict";var Hx=zt&&zt.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(zt,"__esModule",{value:!0});zt.checkPrefixAlternativesAmbiguities=zt.validateSomeNonEmptyLookaheadPath=zt.validateTooManyAlts=zt.RepetionCollector=zt.validateAmbiguousAlternationAlternatives=zt.validateEmptyOrAlternative=zt.getFirstNoneTerminal=zt.validateNoLeftRecursion=zt.validateRuleIsOverridden=zt.validateRuleDoesNotAlreadyExist=zt.OccurrenceValidationCollector=zt.identifyProductionForDuplicates=zt.validateGrammar=void 0;var er=Gt(),Sr=Gt(),No=Hn(),Gx=Xd(),Ef=eC(),bwe=$d(),Zs=Cn(),Yx=Cf();function Qwe(r,e,t,i,n){var s=er.map(r,function(h){return Swe(h,i)}),o=er.map(r,function(h){return jx(h,h,i)}),a=[],l=[],c=[];(0,Sr.every)(o,Sr.isEmpty)&&(a=(0,Sr.map)(r,function(h){return AJ(h,i)}),l=(0,Sr.map)(r,function(h){return lJ(h,e,i)}),c=gJ(r,e,i));var u=Pwe(r,t,i),g=(0,Sr.map)(r,function(h){return uJ(h,i)}),f=(0,Sr.map)(r,function(h){return aJ(h,r,n,i)});return er.flatten(s.concat(c,o,a,l,u,g,f))}zt.validateGrammar=Qwe;function Swe(r,e){var t=new oJ;r.accept(t);var i=t.allProductions,n=er.groupBy(i,nJ),s=er.pick(n,function(a){return a.length>1}),o=er.map(er.values(s),function(a){var l=er.first(a),c=e.buildDuplicateFoundError(r,a),u=(0,Gx.getProductionDslName)(l),g={message:c,type:No.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:r.name,dslName:u,occurrence:l.idx},f=sJ(l);return f&&(g.parameter=f),g});return o}function nJ(r){return(0,Gx.getProductionDslName)(r)+"_#_"+r.idx+"_#_"+sJ(r)}zt.identifyProductionForDuplicates=nJ;function sJ(r){return r instanceof Zs.Terminal?r.terminalType.name:r instanceof Zs.NonTerminal?r.nonTerminalName:""}var oJ=function(r){Hx(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.allProductions=[],t}return e.prototype.visitNonTerminal=function(t){this.allProductions.push(t)},e.prototype.visitOption=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e.prototype.visitAlternation=function(t){this.allProductions.push(t)},e.prototype.visitTerminal=function(t){this.allProductions.push(t)},e}(Yx.GAstVisitor);zt.OccurrenceValidationCollector=oJ;function aJ(r,e,t,i){var n=[],s=(0,Sr.reduce)(e,function(a,l){return l.name===r.name?a+1:a},0);if(s>1){var o=i.buildDuplicateRuleNameError({topLevelRule:r,grammarName:t});n.push({message:o,type:No.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:r.name})}return n}zt.validateRuleDoesNotAlreadyExist=aJ;function vwe(r,e,t){var i=[],n;return er.contains(e,r)||(n="Invalid rule override, rule: ->"+r+"<- cannot be overridden in the grammar: ->"+t+"<-as it is not defined in any of the super grammars ",i.push({message:n,type:No.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:r})),i}zt.validateRuleIsOverridden=vwe;function jx(r,e,t,i){i===void 0&&(i=[]);var n=[],s=tC(e.definition);if(er.isEmpty(s))return[];var o=r.name,a=er.contains(s,r);a&&n.push({message:t.buildLeftRecursionError({topLevelRule:r,leftRecursionPath:i}),type:No.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:o});var l=er.difference(s,i.concat([r])),c=er.map(l,function(u){var g=er.cloneArr(i);return g.push(u),jx(r,u,t,g)});return n.concat(er.flatten(c))}zt.validateNoLeftRecursion=jx;function tC(r){var e=[];if(er.isEmpty(r))return e;var t=er.first(r);if(t instanceof Zs.NonTerminal)e.push(t.referencedRule);else if(t instanceof Zs.Alternative||t instanceof Zs.Option||t instanceof Zs.RepetitionMandatory||t instanceof Zs.RepetitionMandatoryWithSeparator||t instanceof Zs.RepetitionWithSeparator||t instanceof Zs.Repetition)e=e.concat(tC(t.definition));else if(t instanceof Zs.Alternation)e=er.flatten(er.map(t.definition,function(o){return tC(o.definition)}));else if(!(t instanceof Zs.Terminal))throw Error("non exhaustive match");var i=(0,Gx.isOptionalProd)(t),n=r.length>1;if(i&&n){var s=er.drop(r);return e.concat(tC(s))}else return e}zt.getFirstNoneTerminal=tC;var qx=function(r){Hx(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.alternations=[],t}return e.prototype.visitAlternation=function(t){this.alternations.push(t)},e}(Yx.GAstVisitor);function AJ(r,e){var t=new qx;r.accept(t);var i=t.alternations,n=er.reduce(i,function(s,o){var a=er.dropRight(o.definition),l=er.map(a,function(c,u){var g=(0,bwe.nextPossibleTokensAfter)([c],[],null,1);return er.isEmpty(g)?{message:e.buildEmptyAlternationError({topLevelRule:r,alternation:o,emptyChoiceIdx:u}),type:No.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:r.name,occurrence:o.idx,alternative:u+1}:null});return s.concat(er.compact(l))},[]);return n}zt.validateEmptyOrAlternative=AJ;function lJ(r,e,t){var i=new qx;r.accept(i);var n=i.alternations;n=(0,Sr.reject)(n,function(o){return o.ignoreAmbiguities===!0});var s=er.reduce(n,function(o,a){var l=a.idx,c=a.maxLookahead||e,u=(0,Ef.getLookaheadPathsForOr)(l,r,c,a),g=xwe(u,a,r,t),f=fJ(u,a,r,t);return o.concat(g,f)},[]);return s}zt.validateAmbiguousAlternationAlternatives=lJ;var cJ=function(r){Hx(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.allProductions=[],t}return e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e}(Yx.GAstVisitor);zt.RepetionCollector=cJ;function uJ(r,e){var t=new qx;r.accept(t);var i=t.alternations,n=er.reduce(i,function(s,o){return o.definition.length>255&&s.push({message:e.buildTooManyAlternativesError({topLevelRule:r,alternation:o}),type:No.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:r.name,occurrence:o.idx}),s},[]);return n}zt.validateTooManyAlts=uJ;function gJ(r,e,t){var i=[];return(0,Sr.forEach)(r,function(n){var s=new cJ;n.accept(s);var o=s.allProductions;(0,Sr.forEach)(o,function(a){var l=(0,Ef.getProdType)(a),c=a.maxLookahead||e,u=a.idx,g=(0,Ef.getLookaheadPathsForOptionalProd)(u,n,l,c),f=g[0];if((0,Sr.isEmpty)((0,Sr.flatten)(f))){var h=t.buildEmptyRepetitionError({topLevelRule:n,repetition:a});i.push({message:h,type:No.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:n.name})}})}),i}zt.validateSomeNonEmptyLookaheadPath=gJ;function xwe(r,e,t,i){var n=[],s=(0,Sr.reduce)(r,function(a,l,c){return e.definition[c].ignoreAmbiguities===!0||(0,Sr.forEach)(l,function(u){var g=[c];(0,Sr.forEach)(r,function(f,h){c!==h&&(0,Ef.containsPath)(f,u)&&e.definition[h].ignoreAmbiguities!==!0&&g.push(h)}),g.length>1&&!(0,Ef.containsPath)(n,u)&&(n.push(u),a.push({alts:g,path:u}))}),a},[]),o=er.map(s,function(a){var l=(0,Sr.map)(a.alts,function(u){return u+1}),c=i.buildAlternationAmbiguityError({topLevelRule:t,alternation:e,ambiguityIndices:l,prefixPath:a.path});return{message:c,type:No.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:t.name,occurrence:e.idx,alternatives:[a.alts]}});return o}function fJ(r,e,t,i){var n=[],s=(0,Sr.reduce)(r,function(o,a,l){var c=(0,Sr.map)(a,function(u){return{idx:l,path:u}});return o.concat(c)},[]);return(0,Sr.forEach)(s,function(o){var a=e.definition[o.idx];if(a.ignoreAmbiguities!==!0){var l=o.idx,c=o.path,u=(0,Sr.findAll)(s,function(f){return e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{"use strict";Object.defineProperty(If,"__esModule",{value:!0});If.validateGrammar=If.resolveGrammar=void 0;var Wx=Gt(),Dwe=Wq(),kwe=Jx(),hJ=_d();function Rwe(r){r=(0,Wx.defaults)(r,{errMsgProvider:hJ.defaultGrammarResolverErrorProvider});var e={};return(0,Wx.forEach)(r.rules,function(t){e[t.name]=t}),(0,Dwe.resolveGrammar)(e,r.errMsgProvider)}If.resolveGrammar=Rwe;function Fwe(r){return r=(0,Wx.defaults)(r,{errMsgProvider:hJ.defaultGrammarValidatorErrorProvider}),(0,kwe.validateGrammar)(r.rules,r.maxLookahead,r.tokenTypes,r.errMsgProvider,r.grammarName)}If.validateGrammar=Fwe});var yf=y(En=>{"use strict";var rC=En&&En.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(En,"__esModule",{value:!0});En.EarlyExitException=En.NotAllInputParsedException=En.NoViableAltException=En.MismatchedTokenException=En.isRecognitionException=void 0;var Nwe=Gt(),dJ="MismatchedTokenException",CJ="NoViableAltException",mJ="EarlyExitException",EJ="NotAllInputParsedException",IJ=[dJ,CJ,mJ,EJ];Object.freeze(IJ);function Twe(r){return(0,Nwe.contains)(IJ,r.name)}En.isRecognitionException=Twe;var qy=function(r){rC(e,r);function e(t,i){var n=this.constructor,s=r.call(this,t)||this;return s.token=i,s.resyncedTokens=[],Object.setPrototypeOf(s,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(s,s.constructor),s}return e}(Error),Lwe=function(r){rC(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=dJ,s}return e}(qy);En.MismatchedTokenException=Lwe;var Owe=function(r){rC(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=CJ,s}return e}(qy);En.NoViableAltException=Owe;var Mwe=function(r){rC(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.name=EJ,n}return e}(qy);En.NotAllInputParsedException=Mwe;var Uwe=function(r){rC(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=mJ,s}return e}(qy);En.EarlyExitException=Uwe});var Vx=y(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.attemptInRepetitionRecovery=Ki.Recoverable=Ki.InRuleRecoveryException=Ki.IN_RULE_RECOVERY_EXCEPTION=Ki.EOF_FOLLOW_KEY=void 0;var Jy=HA(),cs=Gt(),Kwe=yf(),Hwe=Lx(),Gwe=Hn();Ki.EOF_FOLLOW_KEY={};Ki.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function zx(r){this.name=Ki.IN_RULE_RECOVERY_EXCEPTION,this.message=r}Ki.InRuleRecoveryException=zx;zx.prototype=Error.prototype;var Ywe=function(){function r(){}return r.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,cs.has)(e,"recoveryEnabled")?e.recoveryEnabled:Gwe.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=yJ)},r.prototype.getTokenToInsert=function(e){var t=(0,Jy.createTokenInstance)(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t},r.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},r.prototype.tryInRepetitionRecovery=function(e,t,i,n){for(var s=this,o=this.findReSyncTokenType(),a=this.exportLexerState(),l=[],c=!1,u=this.LA(1),g=this.LA(1),f=function(){var h=s.LA(0),p=s.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:u,previous:h,ruleName:s.getCurrRuleFullName()}),C=new Kwe.MismatchedTokenException(p,u,s.LA(0));C.resyncedTokens=(0,cs.dropRight)(l),s.SAVE_ERROR(C)};!c;)if(this.tokenMatcher(g,n)){f();return}else if(i.call(this)){f(),e.apply(this,t);return}else this.tokenMatcher(g,o)?c=!0:(g=this.SKIP_TOKEN(),this.addToResyncTokens(g,l));this.importLexerState(a)},r.prototype.shouldInRepetitionRecoveryBeTried=function(e,t,i){return!(i===!1||e===void 0||t===void 0||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))},r.prototype.getFollowsForInRuleRecovery=function(e,t){var i=this.getCurrentGrammarPath(e,t),n=this.getNextPossibleTokenTypes(i);return n},r.prototype.tryInRuleRecovery=function(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t)){var i=this.getTokenToInsert(e);return i}if(this.canRecoverWithSingleTokenDeletion(e)){var n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new zx("sad sad panda")},r.prototype.canPerformInRuleRecovery=function(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)},r.prototype.canRecoverWithSingleTokenInsertion=function(e,t){var i=this;if(!this.canTokenTypeBeInsertedInRecovery(e)||(0,cs.isEmpty)(t))return!1;var n=this.LA(1),s=(0,cs.find)(t,function(o){return i.tokenMatcher(n,o)})!==void 0;return s},r.prototype.canRecoverWithSingleTokenDeletion=function(e){var t=this.tokenMatcher(this.LA(2),e);return t},r.prototype.isInCurrentRuleReSyncSet=function(e){var t=this.getCurrFollowKey(),i=this.getFollowSetFromFollowKey(t);return(0,cs.contains)(i,e)},r.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),i=2;;){var n=t.tokenType;if((0,cs.contains)(e,n))return n;t=this.LA(i),i++}},r.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return Ki.EOF_FOLLOW_KEY;var e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),i=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(i)}},r.prototype.buildFullFollowKeyStack=function(){var e=this,t=this.RULE_STACK,i=this.RULE_OCCURRENCE_STACK;return(0,cs.map)(t,function(n,s){return s===0?Ki.EOF_FOLLOW_KEY:{ruleName:e.shortRuleNameToFullName(n),idxInCallingRule:i[s],inRule:e.shortRuleNameToFullName(t[s-1])}})},r.prototype.flattenFollowSet=function(){var e=this,t=(0,cs.map)(this.buildFullFollowKeyStack(),function(i){return e.getFollowSetFromFollowKey(i)});return(0,cs.flatten)(t)},r.prototype.getFollowSetFromFollowKey=function(e){if(e===Ki.EOF_FOLLOW_KEY)return[Jy.EOF];var t=e.ruleName+e.idxInCallingRule+Hwe.IN+e.inRule;return this.resyncFollows[t]},r.prototype.addToResyncTokens=function(e,t){return this.tokenMatcher(e,Jy.EOF)||t.push(e),t},r.prototype.reSyncTo=function(e){for(var t=[],i=this.LA(1);this.tokenMatcher(i,e)===!1;)i=this.SKIP_TOKEN(),this.addToResyncTokens(i,t);return(0,cs.dropRight)(t)},r.prototype.attemptInRepetitionRecovery=function(e,t,i,n,s,o,a){},r.prototype.getCurrentGrammarPath=function(e,t){var i=this.getHumanReadableRuleStack(),n=(0,cs.cloneArr)(this.RULE_OCCURRENCE_STACK),s={ruleStack:i,occurrenceStack:n,lastTok:e,lastTokOccurrence:t};return s},r.prototype.getHumanReadableRuleStack=function(){var e=this;return(0,cs.map)(this.RULE_STACK,function(t){return e.shortRuleNameToFullName(t)})},r}();Ki.Recoverable=Ywe;function yJ(r,e,t,i,n,s,o){var a=this.getKeyForAutomaticLookahead(i,n),l=this.firstAfterRepMap[a];if(l===void 0){var c=this.getCurrRuleFullName(),u=this.getGAstProductions()[c],g=new s(u,n);l=g.startWalking(),this.firstAfterRepMap[a]=l}var f=l.token,h=l.occurrence,p=l.isEndOfRule;this.RULE_STACK.length===1&&p&&f===void 0&&(f=Jy.EOF,h=1),this.shouldInRepetitionRecoveryBeTried(f,h,o)&&this.tryInRepetitionRecovery(r,e,t,f)}Ki.attemptInRepetitionRecovery=yJ});var Wy=y(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.getKeyForAutomaticLookahead=qt.AT_LEAST_ONE_SEP_IDX=qt.MANY_SEP_IDX=qt.AT_LEAST_ONE_IDX=qt.MANY_IDX=qt.OPTION_IDX=qt.OR_IDX=qt.BITS_FOR_ALT_IDX=qt.BITS_FOR_RULE_IDX=qt.BITS_FOR_OCCURRENCE_IDX=qt.BITS_FOR_METHOD_TYPE=void 0;qt.BITS_FOR_METHOD_TYPE=4;qt.BITS_FOR_OCCURRENCE_IDX=8;qt.BITS_FOR_RULE_IDX=12;qt.BITS_FOR_ALT_IDX=8;qt.OR_IDX=1<{"use strict";Object.defineProperty(zy,"__esModule",{value:!0});zy.LooksAhead=void 0;var Fa=eC(),$s=Gt(),wJ=Hn(),Na=Wy(),Nc=Xd(),qwe=function(){function r(){}return r.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=(0,$s.has)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:wJ.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=(0,$s.has)(e,"maxLookahead")?e.maxLookahead:wJ.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=(0,$s.isES2015MapSupported)()?new Map:[],(0,$s.isES2015MapSupported)()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},r.prototype.preComputeLookaheadFunctions=function(e){var t=this;(0,$s.forEach)(e,function(i){t.TRACE_INIT(i.name+" Rule Lookahead",function(){var n=(0,Nc.collectMethods)(i),s=n.alternation,o=n.repetition,a=n.option,l=n.repetitionMandatory,c=n.repetitionMandatoryWithSeparator,u=n.repetitionWithSeparator;(0,$s.forEach)(s,function(g){var f=g.idx===0?"":g.idx;t.TRACE_INIT(""+(0,Nc.getProductionDslName)(g)+f,function(){var h=(0,Fa.buildLookaheadFuncForOr)(g.idx,i,g.maxLookahead||t.maxLookahead,g.hasPredicates,t.dynamicTokensEnabled,t.lookAheadBuilderForAlternatives),p=(0,Na.getKeyForAutomaticLookahead)(t.fullRuleNameToShort[i.name],Na.OR_IDX,g.idx);t.setLaFuncCache(p,h)})}),(0,$s.forEach)(o,function(g){t.computeLookaheadFunc(i,g.idx,Na.MANY_IDX,Fa.PROD_TYPE.REPETITION,g.maxLookahead,(0,Nc.getProductionDslName)(g))}),(0,$s.forEach)(a,function(g){t.computeLookaheadFunc(i,g.idx,Na.OPTION_IDX,Fa.PROD_TYPE.OPTION,g.maxLookahead,(0,Nc.getProductionDslName)(g))}),(0,$s.forEach)(l,function(g){t.computeLookaheadFunc(i,g.idx,Na.AT_LEAST_ONE_IDX,Fa.PROD_TYPE.REPETITION_MANDATORY,g.maxLookahead,(0,Nc.getProductionDslName)(g))}),(0,$s.forEach)(c,function(g){t.computeLookaheadFunc(i,g.idx,Na.AT_LEAST_ONE_SEP_IDX,Fa.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,g.maxLookahead,(0,Nc.getProductionDslName)(g))}),(0,$s.forEach)(u,function(g){t.computeLookaheadFunc(i,g.idx,Na.MANY_SEP_IDX,Fa.PROD_TYPE.REPETITION_WITH_SEPARATOR,g.maxLookahead,(0,Nc.getProductionDslName)(g))})})})},r.prototype.computeLookaheadFunc=function(e,t,i,n,s,o){var a=this;this.TRACE_INIT(""+o+(t===0?"":t),function(){var l=(0,Fa.buildLookaheadFuncForOptionalProd)(t,e,s||a.maxLookahead,a.dynamicTokensEnabled,n,a.lookAheadBuilderForOptional),c=(0,Na.getKeyForAutomaticLookahead)(a.fullRuleNameToShort[e.name],i,t);a.setLaFuncCache(c,l)})},r.prototype.lookAheadBuilderForOptional=function(e,t,i){return(0,Fa.buildSingleAlternativeLookaheadFunction)(e,t,i)},r.prototype.lookAheadBuilderForAlternatives=function(e,t,i,n){return(0,Fa.buildAlternativesLookAheadFunc)(e,t,i,n)},r.prototype.getKeyForAutomaticLookahead=function(e,t){var i=this.getLastExplicitRuleShortName();return(0,Na.getKeyForAutomaticLookahead)(i,e,t)},r.prototype.getLaFuncFromCache=function(e){},r.prototype.getLaFuncFromMap=function(e){return this.lookAheadFuncsCache.get(e)},r.prototype.getLaFuncFromObj=function(e){return this.lookAheadFuncsCache[e]},r.prototype.setLaFuncCache=function(e,t){},r.prototype.setLaFuncCacheUsingMap=function(e,t){this.lookAheadFuncsCache.set(e,t)},r.prototype.setLaFuncUsingObj=function(e,t){this.lookAheadFuncsCache[e]=t},r}();zy.LooksAhead=qwe});var bJ=y(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.addNoneTerminalToCst=To.addTerminalToCst=To.setNodeLocationFull=To.setNodeLocationOnlyOffset=void 0;function Jwe(r,e){isNaN(r.startOffset)===!0?(r.startOffset=e.startOffset,r.endOffset=e.endOffset):r.endOffset{"use strict";Object.defineProperty(jA,"__esModule",{value:!0});jA.defineNameProp=jA.functionName=jA.classNameFromInstance=void 0;var Xwe=Gt();function _we(r){return SJ(r.constructor)}jA.classNameFromInstance=_we;var QJ="name";function SJ(r){var e=r.name;return e||"anonymous"}jA.functionName=SJ;function Zwe(r,e){var t=Object.getOwnPropertyDescriptor(r,QJ);return(0,Xwe.isUndefined)(t)||t.configurable?(Object.defineProperty(r,QJ,{enumerable:!1,configurable:!0,writable:!1,value:e}),!0):!1}jA.defineNameProp=Zwe});var kJ=y(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.validateRedundantMethods=vi.validateMissingCstMethods=vi.validateVisitor=vi.CstVisitorDefinitionError=vi.createBaseVisitorConstructorWithDefaults=vi.createBaseSemanticVisitorConstructor=vi.defaultVisit=void 0;var us=Gt(),iC=Xx();function vJ(r,e){for(var t=(0,us.keys)(r),i=t.length,n=0;n: - `+(""+s.join(` - -`).replace(/\n/g,` - `)))}}};return t.prototype=i,t.prototype.constructor=t,t._RULE_NAMES=e,t}vi.createBaseSemanticVisitorConstructor=$we;function eBe(r,e,t){var i=function(){};(0,iC.defineNameProp)(i,r+"BaseSemanticsWithDefaults");var n=Object.create(t.prototype);return(0,us.forEach)(e,function(s){n[s]=vJ}),i.prototype=n,i.prototype.constructor=i,i}vi.createBaseVisitorConstructorWithDefaults=eBe;var _x;(function(r){r[r.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",r[r.MISSING_METHOD=1]="MISSING_METHOD"})(_x=vi.CstVisitorDefinitionError||(vi.CstVisitorDefinitionError={}));function xJ(r,e){var t=PJ(r,e),i=DJ(r,e);return t.concat(i)}vi.validateVisitor=xJ;function PJ(r,e){var t=(0,us.map)(e,function(i){if(!(0,us.isFunction)(r[i]))return{msg:"Missing visitor method: <"+i+"> on "+(0,iC.functionName)(r.constructor)+" CST Visitor.",type:_x.MISSING_METHOD,methodName:i}});return(0,us.compact)(t)}vi.validateMissingCstMethods=PJ;var tBe=["constructor","visit","validateVisitor"];function DJ(r,e){var t=[];for(var i in r)(0,us.isFunction)(r[i])&&!(0,us.contains)(tBe,i)&&!(0,us.contains)(e,i)&&t.push({msg:"Redundant visitor method: <"+i+"> on "+(0,iC.functionName)(r.constructor)+` CST Visitor -There is no Grammar Rule corresponding to this method's name. -`,type:_x.REDUNDANT_METHOD,methodName:i});return t}vi.validateRedundantMethods=DJ});var FJ=y(Vy=>{"use strict";Object.defineProperty(Vy,"__esModule",{value:!0});Vy.TreeBuilder=void 0;var wf=bJ(),ti=Gt(),RJ=kJ(),rBe=Hn(),iBe=function(){function r(){}return r.prototype.initTreeBuilder=function(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=(0,ti.has)(e,"nodeLocationTracking")?e.nodeLocationTracking:rBe.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ti.NOOP,this.cstFinallyStateUpdate=ti.NOOP,this.cstPostTerminal=ti.NOOP,this.cstPostNonTerminal=ti.NOOP,this.cstPostRule=ti.NOOP;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=wf.setNodeLocationFull,this.setNodeLocationFromNode=wf.setNodeLocationFull,this.cstPostRule=ti.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ti.NOOP,this.setNodeLocationFromNode=ti.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=wf.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=wf.setNodeLocationOnlyOffset,this.cstPostRule=ti.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ti.NOOP,this.setNodeLocationFromNode=ti.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ti.NOOP,this.setNodeLocationFromNode=ti.NOOP,this.cstPostRule=ti.NOOP,this.setInitialNodeLocation=ti.NOOP;else throw Error('Invalid config option: "'+e.nodeLocationTracking+'"')},r.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},r.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},r.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},r.prototype.setInitialNodeLocationFullRegular=function(e){var t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},r.prototype.cstInvocationStateUpdate=function(e,t){var i={name:e,children:{}};this.setInitialNodeLocation(i),this.CST_STACK.push(i)},r.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},r.prototype.cstPostRuleFull=function(e){var t=this.LA(0),i=e.location;i.startOffset<=t.startOffset?(i.endOffset=t.endOffset,i.endLine=t.endLine,i.endColumn=t.endColumn):(i.startOffset=NaN,i.startLine=NaN,i.startColumn=NaN)},r.prototype.cstPostRuleOnlyOffset=function(e){var t=this.LA(0),i=e.location;i.startOffset<=t.startOffset?i.endOffset=t.endOffset:i.startOffset=NaN},r.prototype.cstPostTerminal=function(e,t){var i=this.CST_STACK[this.CST_STACK.length-1];(0,wf.addTerminalToCst)(i,t,e),this.setNodeLocationFromToken(i.location,t)},r.prototype.cstPostNonTerminal=function(e,t){var i=this.CST_STACK[this.CST_STACK.length-1];(0,wf.addNoneTerminalToCst)(i,t,e),this.setNodeLocationFromNode(i.location,e.location)},r.prototype.getBaseCstVisitorConstructor=function(){if((0,ti.isUndefined)(this.baseCstVisitorConstructor)){var e=(0,RJ.createBaseSemanticVisitorConstructor)(this.className,(0,ti.keys)(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},r.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,ti.isUndefined)(this.baseCstVisitorWithDefaultsConstructor)){var e=(0,RJ.createBaseVisitorConstructorWithDefaults)(this.className,(0,ti.keys)(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor},r.prototype.getLastExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-1]},r.prototype.getPreviousExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-2]},r.prototype.getLastExplicitRuleOccurrenceIndex=function(){var e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]},r}();Vy.TreeBuilder=iBe});var TJ=y(Xy=>{"use strict";Object.defineProperty(Xy,"__esModule",{value:!0});Xy.LexerAdapter=void 0;var NJ=Hn(),nBe=function(){function r(){}return r.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(r.prototype,"input",{get:function(){return this.tokVector},set:function(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length},enumerable:!1,configurable:!0}),r.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):NJ.END_OF_FILE},r.prototype.LA=function(e){var t=this.currIdx+e;return t<0||this.tokVectorLength<=t?NJ.END_OF_FILE:this.tokVector[t]},r.prototype.consumeToken=function(){this.currIdx++},r.prototype.exportLexerState=function(){return this.currIdx},r.prototype.importLexerState=function(e){this.currIdx=e},r.prototype.resetLexerState=function(){this.currIdx=-1},r.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},r.prototype.getLexerPosition=function(){return this.exportLexerState()},r}();Xy.LexerAdapter=nBe});var OJ=y(_y=>{"use strict";Object.defineProperty(_y,"__esModule",{value:!0});_y.RecognizerApi=void 0;var LJ=Gt(),sBe=yf(),Zx=Hn(),oBe=_d(),aBe=Jx(),ABe=Cn(),lBe=function(){function r(){}return r.prototype.ACTION=function(e){return e.call(this)},r.prototype.consume=function(e,t,i){return this.consumeInternal(t,e,i)},r.prototype.subrule=function(e,t,i){return this.subruleInternal(t,e,i)},r.prototype.option=function(e,t){return this.optionInternal(t,e)},r.prototype.or=function(e,t){return this.orInternal(t,e)},r.prototype.many=function(e,t){return this.manyInternal(e,t)},r.prototype.atLeastOne=function(e,t){return this.atLeastOneInternal(e,t)},r.prototype.CONSUME=function(e,t){return this.consumeInternal(e,0,t)},r.prototype.CONSUME1=function(e,t){return this.consumeInternal(e,1,t)},r.prototype.CONSUME2=function(e,t){return this.consumeInternal(e,2,t)},r.prototype.CONSUME3=function(e,t){return this.consumeInternal(e,3,t)},r.prototype.CONSUME4=function(e,t){return this.consumeInternal(e,4,t)},r.prototype.CONSUME5=function(e,t){return this.consumeInternal(e,5,t)},r.prototype.CONSUME6=function(e,t){return this.consumeInternal(e,6,t)},r.prototype.CONSUME7=function(e,t){return this.consumeInternal(e,7,t)},r.prototype.CONSUME8=function(e,t){return this.consumeInternal(e,8,t)},r.prototype.CONSUME9=function(e,t){return this.consumeInternal(e,9,t)},r.prototype.SUBRULE=function(e,t){return this.subruleInternal(e,0,t)},r.prototype.SUBRULE1=function(e,t){return this.subruleInternal(e,1,t)},r.prototype.SUBRULE2=function(e,t){return this.subruleInternal(e,2,t)},r.prototype.SUBRULE3=function(e,t){return this.subruleInternal(e,3,t)},r.prototype.SUBRULE4=function(e,t){return this.subruleInternal(e,4,t)},r.prototype.SUBRULE5=function(e,t){return this.subruleInternal(e,5,t)},r.prototype.SUBRULE6=function(e,t){return this.subruleInternal(e,6,t)},r.prototype.SUBRULE7=function(e,t){return this.subruleInternal(e,7,t)},r.prototype.SUBRULE8=function(e,t){return this.subruleInternal(e,8,t)},r.prototype.SUBRULE9=function(e,t){return this.subruleInternal(e,9,t)},r.prototype.OPTION=function(e){return this.optionInternal(e,0)},r.prototype.OPTION1=function(e){return this.optionInternal(e,1)},r.prototype.OPTION2=function(e){return this.optionInternal(e,2)},r.prototype.OPTION3=function(e){return this.optionInternal(e,3)},r.prototype.OPTION4=function(e){return this.optionInternal(e,4)},r.prototype.OPTION5=function(e){return this.optionInternal(e,5)},r.prototype.OPTION6=function(e){return this.optionInternal(e,6)},r.prototype.OPTION7=function(e){return this.optionInternal(e,7)},r.prototype.OPTION8=function(e){return this.optionInternal(e,8)},r.prototype.OPTION9=function(e){return this.optionInternal(e,9)},r.prototype.OR=function(e){return this.orInternal(e,0)},r.prototype.OR1=function(e){return this.orInternal(e,1)},r.prototype.OR2=function(e){return this.orInternal(e,2)},r.prototype.OR3=function(e){return this.orInternal(e,3)},r.prototype.OR4=function(e){return this.orInternal(e,4)},r.prototype.OR5=function(e){return this.orInternal(e,5)},r.prototype.OR6=function(e){return this.orInternal(e,6)},r.prototype.OR7=function(e){return this.orInternal(e,7)},r.prototype.OR8=function(e){return this.orInternal(e,8)},r.prototype.OR9=function(e){return this.orInternal(e,9)},r.prototype.MANY=function(e){this.manyInternal(0,e)},r.prototype.MANY1=function(e){this.manyInternal(1,e)},r.prototype.MANY2=function(e){this.manyInternal(2,e)},r.prototype.MANY3=function(e){this.manyInternal(3,e)},r.prototype.MANY4=function(e){this.manyInternal(4,e)},r.prototype.MANY5=function(e){this.manyInternal(5,e)},r.prototype.MANY6=function(e){this.manyInternal(6,e)},r.prototype.MANY7=function(e){this.manyInternal(7,e)},r.prototype.MANY8=function(e){this.manyInternal(8,e)},r.prototype.MANY9=function(e){this.manyInternal(9,e)},r.prototype.MANY_SEP=function(e){this.manySepFirstInternal(0,e)},r.prototype.MANY_SEP1=function(e){this.manySepFirstInternal(1,e)},r.prototype.MANY_SEP2=function(e){this.manySepFirstInternal(2,e)},r.prototype.MANY_SEP3=function(e){this.manySepFirstInternal(3,e)},r.prototype.MANY_SEP4=function(e){this.manySepFirstInternal(4,e)},r.prototype.MANY_SEP5=function(e){this.manySepFirstInternal(5,e)},r.prototype.MANY_SEP6=function(e){this.manySepFirstInternal(6,e)},r.prototype.MANY_SEP7=function(e){this.manySepFirstInternal(7,e)},r.prototype.MANY_SEP8=function(e){this.manySepFirstInternal(8,e)},r.prototype.MANY_SEP9=function(e){this.manySepFirstInternal(9,e)},r.prototype.AT_LEAST_ONE=function(e){this.atLeastOneInternal(0,e)},r.prototype.AT_LEAST_ONE1=function(e){return this.atLeastOneInternal(1,e)},r.prototype.AT_LEAST_ONE2=function(e){this.atLeastOneInternal(2,e)},r.prototype.AT_LEAST_ONE3=function(e){this.atLeastOneInternal(3,e)},r.prototype.AT_LEAST_ONE4=function(e){this.atLeastOneInternal(4,e)},r.prototype.AT_LEAST_ONE5=function(e){this.atLeastOneInternal(5,e)},r.prototype.AT_LEAST_ONE6=function(e){this.atLeastOneInternal(6,e)},r.prototype.AT_LEAST_ONE7=function(e){this.atLeastOneInternal(7,e)},r.prototype.AT_LEAST_ONE8=function(e){this.atLeastOneInternal(8,e)},r.prototype.AT_LEAST_ONE9=function(e){this.atLeastOneInternal(9,e)},r.prototype.AT_LEAST_ONE_SEP=function(e){this.atLeastOneSepFirstInternal(0,e)},r.prototype.AT_LEAST_ONE_SEP1=function(e){this.atLeastOneSepFirstInternal(1,e)},r.prototype.AT_LEAST_ONE_SEP2=function(e){this.atLeastOneSepFirstInternal(2,e)},r.prototype.AT_LEAST_ONE_SEP3=function(e){this.atLeastOneSepFirstInternal(3,e)},r.prototype.AT_LEAST_ONE_SEP4=function(e){this.atLeastOneSepFirstInternal(4,e)},r.prototype.AT_LEAST_ONE_SEP5=function(e){this.atLeastOneSepFirstInternal(5,e)},r.prototype.AT_LEAST_ONE_SEP6=function(e){this.atLeastOneSepFirstInternal(6,e)},r.prototype.AT_LEAST_ONE_SEP7=function(e){this.atLeastOneSepFirstInternal(7,e)},r.prototype.AT_LEAST_ONE_SEP8=function(e){this.atLeastOneSepFirstInternal(8,e)},r.prototype.AT_LEAST_ONE_SEP9=function(e){this.atLeastOneSepFirstInternal(9,e)},r.prototype.RULE=function(e,t,i){if(i===void 0&&(i=Zx.DEFAULT_RULE_CONFIG),(0,LJ.contains)(this.definedRulesNames,e)){var n=oBe.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),s={message:n,type:Zx.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);var o=this.defineRule(e,t,i);return this[e]=o,o},r.prototype.OVERRIDE_RULE=function(e,t,i){i===void 0&&(i=Zx.DEFAULT_RULE_CONFIG);var n=[];n=n.concat((0,aBe.validateRuleIsOverridden)(e,this.definedRulesNames,this.className)),this.definitionErrors=this.definitionErrors.concat(n);var s=this.defineRule(e,t,i);return this[e]=s,s},r.prototype.BACKTRACK=function(e,t){return function(){this.isBackTrackingStack.push(1);var i=this.saveRecogState();try{return e.apply(this,t),!0}catch(n){if((0,sBe.isRecognitionException)(n))return!1;throw n}finally{this.reloadRecogState(i),this.isBackTrackingStack.pop()}}},r.prototype.getGAstProductions=function(){return this.gastProductionsCache},r.prototype.getSerializedGastProductions=function(){return(0,ABe.serializeGrammar)((0,LJ.values)(this.gastProductionsCache))},r}();_y.RecognizerApi=lBe});var HJ=y($y=>{"use strict";Object.defineProperty($y,"__esModule",{value:!0});$y.RecognizerEngine=void 0;var kr=Gt(),Gn=Wy(),Zy=yf(),MJ=eC(),Bf=$d(),UJ=Hn(),cBe=Vx(),KJ=HA(),nC=df(),uBe=Xx(),gBe=function(){function r(){}return r.prototype.initRecognizerEngine=function(e,t){if(this.className=(0,uBe.classNameFromInstance)(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=nC.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,kr.has)(t,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. - See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 - For Further details.`);if((0,kr.isArray)(e)){if((0,kr.isEmpty)(e))throw Error(`A Token Vocabulary cannot be empty. - Note that the first argument for the parser constructor - is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. - See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 - For Further details.`)}if((0,kr.isArray)(e))this.tokensMap=(0,kr.reduce)(e,function(o,a){return o[a.name]=a,o},{});else if((0,kr.has)(e,"modes")&&(0,kr.every)((0,kr.flatten)((0,kr.values)(e.modes)),nC.isTokenType)){var i=(0,kr.flatten)((0,kr.values)(e.modes)),n=(0,kr.uniq)(i);this.tokensMap=(0,kr.reduce)(n,function(o,a){return o[a.name]=a,o},{})}else if((0,kr.isObject)(e))this.tokensMap=(0,kr.cloneObj)(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=KJ.EOF;var s=(0,kr.every)((0,kr.values)(e),function(o){return(0,kr.isEmpty)(o.categoryMatches)});this.tokenMatcher=s?nC.tokenStructuredMatcherNoCategories:nC.tokenStructuredMatcher,(0,nC.augmentTokenTypes)((0,kr.values)(this.tokensMap))},r.prototype.defineRule=function(e,t,i){if(this.selfAnalysisDone)throw Error("Grammar rule <"+e+`> may not be defined after the 'performSelfAnalysis' method has been called' -Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var n=(0,kr.has)(i,"resyncEnabled")?i.resyncEnabled:UJ.DEFAULT_RULE_CONFIG.resyncEnabled,s=(0,kr.has)(i,"recoveryValueFunc")?i.recoveryValueFunc:UJ.DEFAULT_RULE_CONFIG.recoveryValueFunc,o=this.ruleShortNameIdx<t},r.prototype.orInternal=function(e,t){var i=this.getKeyForAutomaticLookahead(Gn.OR_IDX,t),n=(0,kr.isArray)(e)?e:e.DEF,s=this.getLaFuncFromCache(i),o=s.call(this,n);if(o!==void 0){var a=n[o];return a.ALT.call(this)}this.raiseNoAltException(t,e.ERR_MSG)},r.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){var e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Zy.NotAllInputParsedException(t,e))}},r.prototype.subruleInternal=function(e,t,i){var n;try{var s=i!==void 0?i.ARGS:void 0;return n=e.call(this,t,s),this.cstPostNonTerminal(n,i!==void 0&&i.LABEL!==void 0?i.LABEL:e.ruleName),n}catch(o){this.subruleInternalError(o,i,e.ruleName)}},r.prototype.subruleInternalError=function(e,t,i){throw(0,Zy.isRecognitionException)(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:i),delete e.partialCstResult),e},r.prototype.consumeInternal=function(e,t,i){var n;try{var s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),n=s):this.consumeInternalError(e,s,i)}catch(o){n=this.consumeInternalRecovery(e,t,o)}return this.cstPostTerminal(i!==void 0&&i.LABEL!==void 0?i.LABEL:e.name,n),n},r.prototype.consumeInternalError=function(e,t,i){var n,s=this.LA(0);throw i!==void 0&&i.ERR_MSG?n=i.ERR_MSG:n=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Zy.MismatchedTokenException(n,t,s))},r.prototype.consumeInternalRecovery=function(e,t,i){if(this.recoveryEnabled&&i.name==="MismatchedTokenException"&&!this.isBackTracking()){var n=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,n)}catch(s){throw s.name===cBe.IN_RULE_RECOVERY_EXCEPTION?i:s}}else throw i},r.prototype.saveRecogState=function(){var e=this.errors,t=(0,kr.cloneArr)(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}},r.prototype.reloadRecogState=function(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK},r.prototype.ruleInvocationStateUpdate=function(e,t,i){this.RULE_OCCURRENCE_STACK.push(i),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t,e)},r.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},r.prototype.getCurrRuleFullName=function(){var e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]},r.prototype.shortRuleNameToFullName=function(e){return this.shortRuleNameToFull[e]},r.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),KJ.EOF)},r.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},r}();$y.RecognizerEngine=gBe});var YJ=y(ew=>{"use strict";Object.defineProperty(ew,"__esModule",{value:!0});ew.ErrorHandler=void 0;var $x=yf(),eP=Gt(),GJ=eC(),fBe=Hn(),hBe=function(){function r(){}return r.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=(0,eP.has)(e,"errorMessageProvider")?e.errorMessageProvider:fBe.DEFAULT_PARSER_CONFIG.errorMessageProvider},r.prototype.SAVE_ERROR=function(e){if((0,$x.isRecognitionException)(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,eP.cloneArr)(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(r.prototype,"errors",{get:function(){return(0,eP.cloneArr)(this._errors)},set:function(e){this._errors=e},enumerable:!1,configurable:!0}),r.prototype.raiseEarlyExitException=function(e,t,i){for(var n=this.getCurrRuleFullName(),s=this.getGAstProductions()[n],o=(0,GJ.getLookaheadPathsForOptionalProd)(e,s,t,this.maxLookahead),a=o[0],l=[],c=1;c<=this.maxLookahead;c++)l.push(this.LA(c));var u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:l,previous:this.LA(0),customUserDescription:i,ruleName:n});throw this.SAVE_ERROR(new $x.EarlyExitException(u,this.LA(1),this.LA(0)))},r.prototype.raiseNoAltException=function(e,t){for(var i=this.getCurrRuleFullName(),n=this.getGAstProductions()[i],s=(0,GJ.getLookaheadPathsForOr)(e,n,this.maxLookahead),o=[],a=1;a<=this.maxLookahead;a++)o.push(this.LA(a));var l=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:o,previous:l,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new $x.NoViableAltException(c,this.LA(1),l))},r}();ew.ErrorHandler=hBe});var JJ=y(tw=>{"use strict";Object.defineProperty(tw,"__esModule",{value:!0});tw.ContentAssist=void 0;var jJ=$d(),qJ=Gt(),pBe=function(){function r(){}return r.prototype.initContentAssist=function(){},r.prototype.computeContentAssist=function(e,t){var i=this.gastProductionsCache[e];if((0,qJ.isUndefined)(i))throw Error("Rule ->"+e+"<- does not exist in this grammar.");return(0,jJ.nextPossibleTokensAfter)([i],t,this.tokenMatcher,this.maxLookahead)},r.prototype.getNextPossibleTokenTypes=function(e){var t=(0,qJ.first)(e.ruleStack),i=this.getGAstProductions(),n=i[t],s=new jJ.NextAfterTokenWalker(n,e).startWalking();return s},r}();tw.ContentAssist=pBe});var e3=y(nw=>{"use strict";Object.defineProperty(nw,"__esModule",{value:!0});nw.GastRecorder=void 0;var In=Gt(),Lo=Cn(),dBe=Jd(),XJ=df(),_J=HA(),CBe=Hn(),mBe=Wy(),iw={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(iw);var WJ=!0,zJ=Math.pow(2,mBe.BITS_FOR_OCCURRENCE_IDX)-1,ZJ=(0,_J.createToken)({name:"RECORDING_PHASE_TOKEN",pattern:dBe.Lexer.NA});(0,XJ.augmentTokenTypes)([ZJ]);var $J=(0,_J.createTokenInstance)(ZJ,`This IToken indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze($J);var EBe={name:`This CSTNode indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},IBe=function(){function r(){}return r.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},r.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var t=function(n){var s=n>0?n:"";e["CONSUME"+s]=function(o,a){return this.consumeInternalRecord(o,n,a)},e["SUBRULE"+s]=function(o,a){return this.subruleInternalRecord(o,n,a)},e["OPTION"+s]=function(o){return this.optionInternalRecord(o,n)},e["OR"+s]=function(o){return this.orInternalRecord(o,n)},e["MANY"+s]=function(o){this.manyInternalRecord(n,o)},e["MANY_SEP"+s]=function(o){this.manySepFirstInternalRecord(n,o)},e["AT_LEAST_ONE"+s]=function(o){this.atLeastOneInternalRecord(n,o)},e["AT_LEAST_ONE_SEP"+s]=function(o){this.atLeastOneSepFirstInternalRecord(n,o)}},i=0;i<10;i++)t(i);e.consume=function(n,s,o){return this.consumeInternalRecord(s,n,o)},e.subrule=function(n,s,o){return this.subruleInternalRecord(s,n,o)},e.option=function(n,s){return this.optionInternalRecord(s,n)},e.or=function(n,s){return this.orInternalRecord(s,n)},e.many=function(n,s){this.manyInternalRecord(n,s)},e.atLeastOne=function(n,s){this.atLeastOneInternalRecord(n,s)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD})},r.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var t=0;t<10;t++){var i=t>0?t:"";delete e["CONSUME"+i],delete e["SUBRULE"+i],delete e["OPTION"+i],delete e["OR"+i],delete e["MANY"+i],delete e["MANY_SEP"+i],delete e["AT_LEAST_ONE"+i],delete e["AT_LEAST_ONE_SEP"+i]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})},r.prototype.ACTION_RECORD=function(e){},r.prototype.BACKTRACK_RECORD=function(e,t){return function(){return!0}},r.prototype.LA_RECORD=function(e){return CBe.END_OF_FILE},r.prototype.topLevelRuleRecord=function(e,t){try{var i=new Lo.Rule({definition:[],name:e});return i.name=e,this.recordingProdStack.push(i),t.call(this),this.recordingProdStack.pop(),i}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+` - This error was thrown during the "grammar recording phase" For more info see: - https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}},r.prototype.optionInternalRecord=function(e,t){return sC.call(this,Lo.Option,e,t)},r.prototype.atLeastOneInternalRecord=function(e,t){sC.call(this,Lo.RepetitionMandatory,t,e)},r.prototype.atLeastOneSepFirstInternalRecord=function(e,t){sC.call(this,Lo.RepetitionMandatoryWithSeparator,t,e,WJ)},r.prototype.manyInternalRecord=function(e,t){sC.call(this,Lo.Repetition,t,e)},r.prototype.manySepFirstInternalRecord=function(e,t){sC.call(this,Lo.RepetitionWithSeparator,t,e,WJ)},r.prototype.orInternalRecord=function(e,t){return yBe.call(this,e,t)},r.prototype.subruleInternalRecord=function(e,t,i){if(rw(t),!e||(0,In.has)(e,"ruleName")===!1){var n=new Error(" argument is invalid"+(" expecting a Parser method reference but got: <"+JSON.stringify(e)+">")+(` - inside top level rule: <`+this.recordingProdStack[0].name+">"));throw n.KNOWN_RECORDER_ERROR=!0,n}var s=(0,In.peek)(this.recordingProdStack),o=e.ruleName,a=new Lo.NonTerminal({idx:t,nonTerminalName:o,label:i==null?void 0:i.LABEL,referencedRule:void 0});return s.definition.push(a),this.outputCst?EBe:iw},r.prototype.consumeInternalRecord=function(e,t,i){if(rw(t),!(0,XJ.hasShortKeyProperty)(e)){var n=new Error(" argument is invalid"+(" expecting a TokenType reference but got: <"+JSON.stringify(e)+">")+(` - inside top level rule: <`+this.recordingProdStack[0].name+">"));throw n.KNOWN_RECORDER_ERROR=!0,n}var s=(0,In.peek)(this.recordingProdStack),o=new Lo.Terminal({idx:t,terminalType:e,label:i==null?void 0:i.LABEL});return s.definition.push(o),$J},r}();nw.GastRecorder=IBe;function sC(r,e,t,i){i===void 0&&(i=!1),rw(t);var n=(0,In.peek)(this.recordingProdStack),s=(0,In.isFunction)(e)?e:e.DEF,o=new r({definition:[],idx:t});return i&&(o.separator=e.SEP),(0,In.has)(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),n.definition.push(o),this.recordingProdStack.pop(),iw}function yBe(r,e){var t=this;rw(e);var i=(0,In.peek)(this.recordingProdStack),n=(0,In.isArray)(r)===!1,s=n===!1?r:r.DEF,o=new Lo.Alternation({definition:[],idx:e,ignoreAmbiguities:n&&r.IGNORE_AMBIGUITIES===!0});(0,In.has)(r,"MAX_LOOKAHEAD")&&(o.maxLookahead=r.MAX_LOOKAHEAD);var a=(0,In.some)(s,function(l){return(0,In.isFunction)(l.GATE)});return o.hasPredicates=a,i.definition.push(o),(0,In.forEach)(s,function(l){var c=new Lo.Alternative({definition:[]});o.definition.push(c),(0,In.has)(l,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=l.IGNORE_AMBIGUITIES:(0,In.has)(l,"GATE")&&(c.ignoreAmbiguities=!0),t.recordingProdStack.push(c),l.ALT.call(t),t.recordingProdStack.pop()}),iw}function VJ(r){return r===0?"":""+r}function rw(r){if(r<0||r>zJ){var e=new Error("Invalid DSL Method idx value: <"+r+`> - `+("Idx value must be a none negative value smaller than "+(zJ+1)));throw e.KNOWN_RECORDER_ERROR=!0,e}}});var r3=y(sw=>{"use strict";Object.defineProperty(sw,"__esModule",{value:!0});sw.PerformanceTracer=void 0;var t3=Gt(),wBe=Hn(),BBe=function(){function r(){}return r.prototype.initPerformanceTracer=function(e){if((0,t3.has)(e,"traceInitPerf")){var t=e.traceInitPerf,i=typeof t=="number";this.traceInitMaxIdent=i?t:1/0,this.traceInitPerf=i?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=wBe.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},r.prototype.TRACE_INIT=function(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;var i=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <"+e+">");var n=(0,t3.timer)(t),s=n.time,o=n.value,a=s>10?console.warn:console.log;return this.traceInitIndent time: "+s+"ms"),this.traceInitIndent--,o}else return t()},r}();sw.PerformanceTracer=BBe});var i3=y(ow=>{"use strict";Object.defineProperty(ow,"__esModule",{value:!0});ow.applyMixins=void 0;function bBe(r,e){e.forEach(function(t){var i=t.prototype;Object.getOwnPropertyNames(i).forEach(function(n){if(n!=="constructor"){var s=Object.getOwnPropertyDescriptor(i,n);s&&(s.get||s.set)?Object.defineProperty(r.prototype,n,s):r.prototype[n]=t.prototype[n]}})})}ow.applyMixins=bBe});var Hn=y(Cr=>{"use strict";var o3=Cr&&Cr.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Cr,"__esModule",{value:!0});Cr.EmbeddedActionsParser=Cr.CstParser=Cr.Parser=Cr.EMPTY_ALT=Cr.ParserDefinitionErrorType=Cr.DEFAULT_RULE_CONFIG=Cr.DEFAULT_PARSER_CONFIG=Cr.END_OF_FILE=void 0;var _i=Gt(),QBe=Yq(),n3=HA(),a3=_d(),s3=pJ(),SBe=Vx(),vBe=BJ(),xBe=FJ(),PBe=TJ(),DBe=OJ(),kBe=HJ(),RBe=YJ(),FBe=JJ(),NBe=e3(),TBe=r3(),LBe=i3();Cr.END_OF_FILE=(0,n3.createTokenInstance)(n3.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Cr.END_OF_FILE);Cr.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:a3.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1});Cr.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});var OBe;(function(r){r[r.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",r[r.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",r[r.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",r[r.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",r[r.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",r[r.LEFT_RECURSION=5]="LEFT_RECURSION",r[r.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",r[r.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",r[r.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",r[r.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",r[r.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",r[r.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",r[r.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"})(OBe=Cr.ParserDefinitionErrorType||(Cr.ParserDefinitionErrorType={}));function MBe(r){return r===void 0&&(r=void 0),function(){return r}}Cr.EMPTY_ALT=MBe;var aw=function(){function r(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;var i=this;if(i.initErrorHandler(t),i.initLexerAdapter(),i.initLooksAhead(t),i.initRecognizerEngine(e,t),i.initRecoverable(t),i.initTreeBuilder(t),i.initContentAssist(),i.initGastRecorder(t),i.initPerformanceTracer(t),(0,_i.has)(t,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. - Please use the flag on the relevant DSL method instead. - See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES - For further details.`);this.skipValidations=(0,_i.has)(t,"skipValidations")?t.skipValidations:Cr.DEFAULT_PARSER_CONFIG.skipValidations}return r.performSelfAnalysis=function(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},r.prototype.performSelfAnalysis=function(){var e=this;this.TRACE_INIT("performSelfAnalysis",function(){var t;e.selfAnalysisDone=!0;var i=e.className;e.TRACE_INIT("toFastProps",function(){(0,_i.toFastProperties)(e)}),e.TRACE_INIT("Grammar Recording",function(){try{e.enableRecording(),(0,_i.forEach)(e.definedRulesNames,function(s){var o=e[s],a=o.originalGrammarAction,l=void 0;e.TRACE_INIT(s+" Rule",function(){l=e.topLevelRuleRecord(s,a)}),e.gastProductionsCache[s]=l})}finally{e.disableRecording()}});var n=[];if(e.TRACE_INIT("Grammar Resolving",function(){n=(0,s3.resolveGrammar)({rules:(0,_i.values)(e.gastProductionsCache)}),e.definitionErrors=e.definitionErrors.concat(n)}),e.TRACE_INIT("Grammar Validations",function(){if((0,_i.isEmpty)(n)&&e.skipValidations===!1){var s=(0,s3.validateGrammar)({rules:(0,_i.values)(e.gastProductionsCache),maxLookahead:e.maxLookahead,tokenTypes:(0,_i.values)(e.tokensMap),errMsgProvider:a3.defaultGrammarValidatorErrorProvider,grammarName:i});e.definitionErrors=e.definitionErrors.concat(s)}}),(0,_i.isEmpty)(e.definitionErrors)&&(e.recoveryEnabled&&e.TRACE_INIT("computeAllProdsFollows",function(){var s=(0,QBe.computeAllProdsFollows)((0,_i.values)(e.gastProductionsCache));e.resyncFollows=s}),e.TRACE_INIT("ComputeLookaheadFunctions",function(){e.preComputeLookaheadFunctions((0,_i.values)(e.gastProductionsCache))})),!r.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,_i.isEmpty)(e.definitionErrors))throw t=(0,_i.map)(e.definitionErrors,function(s){return s.message}),new Error(`Parser Definition Errors detected: - `+t.join(` -------------------------------- -`))})},r.DEFER_DEFINITION_ERRORS_HANDLING=!1,r}();Cr.Parser=aw;(0,LBe.applyMixins)(aw,[SBe.Recoverable,vBe.LooksAhead,xBe.TreeBuilder,PBe.LexerAdapter,kBe.RecognizerEngine,DBe.RecognizerApi,RBe.ErrorHandler,FBe.ContentAssist,NBe.GastRecorder,TBe.PerformanceTracer]);var UBe=function(r){o3(e,r);function e(t,i){i===void 0&&(i=Cr.DEFAULT_PARSER_CONFIG);var n=this,s=(0,_i.cloneObj)(i);return s.outputCst=!0,n=r.call(this,t,s)||this,n}return e}(aw);Cr.CstParser=UBe;var KBe=function(r){o3(e,r);function e(t,i){i===void 0&&(i=Cr.DEFAULT_PARSER_CONFIG);var n=this,s=(0,_i.cloneObj)(i);return s.outputCst=!1,n=r.call(this,t,s)||this,n}return e}(aw);Cr.EmbeddedActionsParser=KBe});var l3=y(Aw=>{"use strict";Object.defineProperty(Aw,"__esModule",{value:!0});Aw.createSyntaxDiagramsCode=void 0;var A3=Ix();function HBe(r,e){var t=e===void 0?{}:e,i=t.resourceBase,n=i===void 0?"https://unpkg.com/chevrotain@"+A3.VERSION+"/diagrams/":i,s=t.css,o=s===void 0?"https://unpkg.com/chevrotain@"+A3.VERSION+"/diagrams/diagrams.css":s,a=` - - - - - -`,l=` - -`,c=` -