From ae2a6fda536dac7ef0e0a682f2af337860c9f804 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Thu, 20 Oct 2022 23:36:44 +0100 Subject: [PATCH 01/12] New Metaport architecture - add ERC721 / ERC721Meta / ERC1155 support --- src/Metaport.tsx | 2 +- .../AmountErrorMessage/AmountErrorMessage.tsx | 30 + src/components/AmountErrorMessage/index.ts | 1 + src/components/AmountInput/AmountInput.scss | 3 +- src/components/AmountInput/AmountInput.tsx | 16 +- src/components/ChainsList/ChainsList.tsx | 28 +- .../FullscreenUI/FullscreenUI.stories.tsx | 39 - src/components/FullscreenUI/FullscreenUI.tsx | 124 - src/components/FullscreenUI/Widget.scss | 12 - src/components/FullscreenUI/index.ts | 1 - src/components/FullscreenUI/skale_logo.svg | 17 - .../FullscreenUI/skale_logo_short.svg | 10 - src/components/Stepper/Stepper.tsx | 10 +- src/components/TokenIdInput/TokenIdInput.scss | 39 + src/components/TokenIdInput/TokenIdInput.tsx | 49 + src/components/TokenIdInput/index.ts | 1 + src/components/TokenList/TokenBalance.tsx | 41 + src/components/TokenList/TokenList.tsx | 144 +- .../TokenListSection/TokenListSection.scss | 18 + .../TokenListSection/TokenListSection.tsx | 79 + src/components/TokenListSection/index.ts | 1 + .../WalletConnector/MetamaskConnector.ts | 1 + src/components/Widget/Widget.tsx | 109 +- src/components/WidgetBody/WidgetBody.tsx | 47 +- src/components/WidgetUI/Common.stories.tsx | 118 + src/components/WidgetUI/ERC1155.stories.tsx | 13 + src/components/WidgetUI/ERC20.stories.tsx | 181 + src/components/WidgetUI/ERC721.stories.tsx | 14 + src/components/WidgetUI/Errors.stories.tsx | 61 + src/components/WidgetUI/StoriesHelper.ts | 87 +- src/components/WidgetUI/Themes.stories.tsx | 76 + src/components/WidgetUI/Themes.ts | 1 - src/components/WidgetUI/WidgetUI.scss | 18 +- src/components/WidgetUI/WidgetUI.stories.tsx | 355 - src/components/WidgetUI/WidgetUI.tsx | 19 +- src/core/actions/action.ts | 104 + src/core/{actions.ts => actions/erc20.ts} | 255 +- src/core/actions/erc721.ts | 225 + src/core/actions/eth.ts | 82 + src/core/actions/index.ts | 118 + src/core/constants.ts | 4 +- src/core/core.ts | 21 + src/core/dataclasses/EthTokenData.ts | 44 + src/core/dataclasses/TokenData.ts | 33 +- src/core/dataclasses/TokenType.ts | 10 +- src/core/events.ts | 16 +- src/core/helper.ts | 18 +- src/core/interfaces/TokenDataMap.ts | 14 +- src/core/interfaces/Tokens.ts | 9 +- src/core/interfaces/TransferParams.ts | 34 + src/core/interfaces/index.ts | 1 + src/core/tokens.ts | 466 - src/core/tokens/erc20.ts | 91 + src/core/tokens/eth.ts | 75 + src/core/tokens/helper.ts | 53 + src/core/tokens/index.ts | 114 + src/core/tokens/m2s.ts | 197 + src/core/tokens/s2s.ts | 209 + src/metadata/addresses/staging3.json | 10 + src/metadata/erc1155_abi.json | 620 + src/metadata/erc721_abi.json | 4 +- src/metadata/erc721meta_abi.json | 617 + src/metadata/proxy.json | 1 + src/metadata/schainAbi.json | 18692 ++++++++-------- 64 files changed, 13075 insertions(+), 10827 deletions(-) create mode 100644 src/components/AmountErrorMessage/AmountErrorMessage.tsx create mode 100644 src/components/AmountErrorMessage/index.ts delete mode 100644 src/components/FullscreenUI/FullscreenUI.stories.tsx delete mode 100644 src/components/FullscreenUI/FullscreenUI.tsx delete mode 100644 src/components/FullscreenUI/Widget.scss delete mode 100644 src/components/FullscreenUI/index.ts delete mode 100644 src/components/FullscreenUI/skale_logo.svg delete mode 100644 src/components/FullscreenUI/skale_logo_short.svg create mode 100644 src/components/TokenIdInput/TokenIdInput.scss create mode 100644 src/components/TokenIdInput/TokenIdInput.tsx create mode 100644 src/components/TokenIdInput/index.ts create mode 100644 src/components/TokenList/TokenBalance.tsx create mode 100644 src/components/TokenListSection/TokenListSection.scss create mode 100644 src/components/TokenListSection/TokenListSection.tsx create mode 100644 src/components/TokenListSection/index.ts create mode 100644 src/components/WidgetUI/Common.stories.tsx create mode 100644 src/components/WidgetUI/ERC1155.stories.tsx create mode 100644 src/components/WidgetUI/ERC20.stories.tsx create mode 100644 src/components/WidgetUI/ERC721.stories.tsx create mode 100644 src/components/WidgetUI/Errors.stories.tsx create mode 100644 src/components/WidgetUI/Themes.stories.tsx delete mode 100644 src/components/WidgetUI/WidgetUI.stories.tsx create mode 100644 src/core/actions/action.ts rename src/core/{actions.ts => actions/erc20.ts} (56%) create mode 100644 src/core/actions/erc721.ts create mode 100644 src/core/actions/eth.ts create mode 100644 src/core/actions/index.ts create mode 100644 src/core/dataclasses/EthTokenData.ts create mode 100644 src/core/interfaces/TransferParams.ts delete mode 100644 src/core/tokens.ts create mode 100644 src/core/tokens/erc20.ts create mode 100644 src/core/tokens/eth.ts create mode 100644 src/core/tokens/helper.ts create mode 100644 src/core/tokens/index.ts create mode 100644 src/core/tokens/m2s.ts create mode 100644 src/core/tokens/s2s.ts create mode 100644 src/metadata/addresses/staging3.json create mode 100644 src/metadata/erc1155_abi.json create mode 100644 src/metadata/erc721meta_abi.json diff --git a/src/Metaport.tsx b/src/Metaport.tsx index cd2dd3c..7fe47a0 100644 --- a/src/Metaport.tsx +++ b/src/Metaport.tsx @@ -68,7 +68,7 @@ export class Metaport { ); } - transfer(params) { internalEvents.transfer(params) } + transfer(params: interfaces.TransferParams): void { internalEvents.transfer(params) } wrap(params) { internalEvents.wrap(params) } unwrap(params) { internalEvents.unwrap(params) } swap(params) { internalEvents.swap(params) } diff --git a/src/components/AmountErrorMessage/AmountErrorMessage.tsx b/src/components/AmountErrorMessage/AmountErrorMessage.tsx new file mode 100644 index 0000000..ea2fc98 --- /dev/null +++ b/src/components/AmountErrorMessage/AmountErrorMessage.tsx @@ -0,0 +1,30 @@ +import React from "react"; +import LinearProgress from '@mui/material/LinearProgress'; +import Box from '@mui/material/Box'; + +import { clsNames } from '../../core/helper'; +import styles from "../WidgetUI/WidgetUI.scss"; + + +export default function AmountErrorMessage(props) { + if (props.actionBtnDisabled) { + return ( + + ) + } + if (!props.amountErrorMessage) return + return ( +
+

+ {props.amountErrorMessage} +

+
) +} diff --git a/src/components/AmountErrorMessage/index.ts b/src/components/AmountErrorMessage/index.ts new file mode 100644 index 0000000..adc7ed2 --- /dev/null +++ b/src/components/AmountErrorMessage/index.ts @@ -0,0 +1 @@ +export { default } from "./AmountErrorMessage"; \ No newline at end of file diff --git a/src/components/AmountInput/AmountInput.scss b/src/components/AmountInput/AmountInput.scss index b234b78..cccedb5 100644 --- a/src/components/AmountInput/AmountInput.scss +++ b/src/components/AmountInput/AmountInput.scss @@ -23,7 +23,8 @@ border-radius: 10px; :global .MuiButton-root { - border-radius: 0 10px 10px 0 !important; + border-radius: 0 !important; + margin-right: 10px; } input::-webkit-outer-spin-button, diff --git a/src/components/AmountInput/AmountInput.tsx b/src/components/AmountInput/AmountInput.tsx index f3e198d..adfd68e 100644 --- a/src/components/AmountInput/AmountInput.tsx +++ b/src/components/AmountInput/AmountInput.tsx @@ -1,6 +1,5 @@ import React from "react"; import TextField from '@mui/material/TextField'; -import Button from '@mui/material/Button'; import { clsNames } from '../../core/helper'; import styles from '../WidgetUI/WidgetUI.scss'; @@ -14,32 +13,39 @@ export default function AmountInput(props) { }; const setMaxAmount = () => { - props.setAmount(props.balance); + props.setAmount(props.token.balance); } + if (!props.token) return; return (
-
+ {/*
+
*/} +
+

+ Amount +

+
) } diff --git a/src/components/ChainsList/ChainsList.tsx b/src/components/ChainsList/ChainsList.tsx index 65c1a5b..45ea3e2 100644 --- a/src/components/ChainsList/ChainsList.tsx +++ b/src/components/ChainsList/ChainsList.tsx @@ -16,14 +16,6 @@ import { clsNames } from '../../core/helper'; import styles from "../WidgetUI/WidgetUI.scss"; -function hashCode(str) { - let hash = 0; - for (var i = 0; i < str.length; i++) { - hash = str.charCodeAt(i) + ((hash << 5) - hash); - } - return hash; -} - function stringToColor(str, dark) { if (dark) { // return `hsl(${hashCode(str) % 360}, 100%, 80%)`; @@ -43,7 +35,7 @@ export default function ChainsList(props) { const schainNames = []; for (let chain of props.schains) { - if (chain != props.disabledChain && chain != props.chain){ + if (chain != props.disabledChain && chain != props.chain) { schainNames.push(chain); } } @@ -57,7 +49,7 @@ export default function ChainsList(props) { if (chainName == MAINNET_CHAIN_NAME) { return 'Ethereum Mainnet'; } - if (props.chainsMetadata && props.chainsMetadata[chainName]){ + if (props.chainsMetadata && props.chainsMetadata[chainName]) { return props.chainsMetadata[chainName].alias; } else { return chainName; @@ -66,9 +58,9 @@ export default function ChainsList(props) { function getChainIcon(chainName: string) { if (chainName == MAINNET_CHAIN_NAME) { - return ; + return ; } - return (); + return (); } return ( @@ -102,7 +94,7 @@ export default function ChainsList(props) { ) : (
- +

Select chain @@ -113,7 +105,7 @@ export default function ChainsList(props) {

- {schainNames.map((name) => ( + {schainNames.map((name) => (
- - ))} + + ))}
diff --git a/src/components/FullscreenUI/FullscreenUI.stories.tsx b/src/components/FullscreenUI/FullscreenUI.stories.tsx deleted file mode 100644 index c64770a..0000000 --- a/src/components/FullscreenUI/FullscreenUI.stories.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import React from "react"; -import { WidgetUI } from "./FullscreenUI"; -import { commonProps, defaultTokenData, generateTokenData } from '../WidgetUI/StoriesHelper'; - - -export default { - title: "Fullscreen UI" -}; - - -// export const DefaultTheme = () => ( -// -// ); - - -// export const CustomDarkBlue = () => ( -// -// ); - - -// export const CustomLightViolet = () => ( -// -// ); diff --git a/src/components/FullscreenUI/FullscreenUI.tsx b/src/components/FullscreenUI/FullscreenUI.tsx deleted file mode 100644 index 643ef93..0000000 --- a/src/components/FullscreenUI/FullscreenUI.tsx +++ /dev/null @@ -1,124 +0,0 @@ -import React, { useEffect } from 'react'; - -// import '@fontsource/roboto/300.css'; -// import '@fontsource/roboto/400.css'; -// import '@fontsource/roboto/500.css'; -// import '@fontsource/roboto/700.css'; - -import Fab from '@mui/material/Fab'; -import CloseIcon from '@mui/icons-material/Close'; -import Popper from '@mui/material/Popper'; -import Paper from '@mui/material/Paper'; - -import { createTheme, ThemeProvider } from '@mui/material/styles'; - -import skaleLogo from './skale_logo_short.svg'; -import WidgetBody from '../WidgetBody'; -import { Connector } from '../WalletConnector'; - -import { getWidgetTheme } from '../WidgetUI/Themes' - -import "./Widget.scss"; - - -export function WidgetUI(props) { - const [anchorEl, setAnchorEl] = React.useState(null); - const divRef = React.useRef(); - - const [disabledChains, setDisabledChains] = React.useState(undefined); - - let widgetTheme = getWidgetTheme(props.theme); - let theme = createTheme({ - palette: { - mode: widgetTheme.mode, - background: { - paper: widgetTheme.background - }, - primary: { - main: widgetTheme.primary, - }, - secondary: { - main: widgetTheme.background - }, - }, - }); - - useEffect(() => { - if (props.open) { - setAnchorEl(divRef.current); - } - - if (props.schains.length == 2) { - props.setChain1(props.schains[0]); - props.setChain2(props.schains[1]); - setDisabledChains(true); - } - }, []); - - useEffect(() => { - if (props.tokens == undefined) return; - if (Object.keys(props.tokens['erc20']).length == 1) { - props.setToken(Object.keys(props.tokens['erc20'])[0]); - } - }, [props.tokens]); - - const handleClick = (event: React.MouseEvent) => { - // setAnchorEl(anchorEl ? null : event.currentTarget); - setAnchorEl(anchorEl ? null : divRef.current); - }; - - const open = Boolean(anchorEl); - const id = open ? 'widget-body-popup' : undefined; - - return ( - -
- -
- {props.walletConnected ? ( - - ) : ( - - )} -
-
-
-
- ); -} - - -export default WidgetUI; diff --git a/src/components/FullscreenUI/Widget.scss b/src/components/FullscreenUI/Widget.scss deleted file mode 100644 index a62e21c..0000000 --- a/src/components/FullscreenUI/Widget.scss +++ /dev/null @@ -1,12 +0,0 @@ - -.ima-widget-fullscreen-wrapper{ - // max-width: 400pt; - display: flex; - justify-content: center; - align-items: center; /* <---- NEW */ - height: 90vh; -} - -.ima-widget-fullscreen{ - min-width: 350pt; -} \ No newline at end of file diff --git a/src/components/FullscreenUI/index.ts b/src/components/FullscreenUI/index.ts deleted file mode 100644 index 3b76cef..0000000 --- a/src/components/FullscreenUI/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./FullscreenUI"; diff --git a/src/components/FullscreenUI/skale_logo.svg b/src/components/FullscreenUI/skale_logo.svg deleted file mode 100644 index 017c03e..0000000 --- a/src/components/FullscreenUI/skale_logo.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/src/components/FullscreenUI/skale_logo_short.svg b/src/components/FullscreenUI/skale_logo_short.svg deleted file mode 100644 index d1f2f98..0000000 --- a/src/components/FullscreenUI/skale_logo_short.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - Post - - - - \ No newline at end of file diff --git a/src/components/Stepper/Stepper.tsx b/src/components/Stepper/Stepper.tsx index 8ca6601..ca1f1e8 100644 --- a/src/components/Stepper/Stepper.tsx +++ b/src/components/Stepper/Stepper.tsx @@ -8,6 +8,8 @@ import StepContent from '@mui/material/StepContent'; import Button from '@mui/material/Button'; import LoadingButton from '@mui/lab/LoadingButton'; +import { TokenType } from '../../core/dataclasses/TokenType'; + import { clsNames } from '../../core/helper'; import styles from '../WidgetUI/WidgetUI.scss'; import localStyles from './Stepper.scss'; @@ -21,6 +23,12 @@ export default function ActionsStepper(props) { props.setAmountLocked(false); }; + if (!props.token) return; + + const nextStepDisabledAmount = [TokenType.erc20, TokenType.erc1155].includes(props.token.type) && (props.amount === '' || props.amount === '0'); + const nextStepDisabledTokenId = [TokenType.erc721, TokenType.erc721meta, TokenType.erc1155].includes(props.token.type) && !props.tokenId; + const nextStepDisabled = nextStepDisabledAmount || nextStepDisabledTokenId || props.loading || props.actionBtnDisabled; + return ( @@ -47,7 +55,7 @@ export default function ActionsStepper(props) { variant="contained" color="primary" size="medium" className={clsNames(styles.mp__btnAction, styles.mp__margTop5)} onClick={props.handleNextStep} - disabled={props.amount == '' || (Number(props.amount) > Number(props.balance) && step.label !== 'Unwrap')} // TODO: tmp unwrap fix! + disabled={nextStepDisabled || props.amountErrorMessage || (Number(props.amount) > Number(props.token.balance) && step.label !== 'Unwrap')} // TODO: tmp unwrap fix! > {step.buttonText} diff --git a/src/components/TokenIdInput/TokenIdInput.scss b/src/components/TokenIdInput/TokenIdInput.scss new file mode 100644 index 0000000..b234b78 --- /dev/null +++ b/src/components/TokenIdInput/TokenIdInput.scss @@ -0,0 +1,39 @@ + +.mp__inputAmount { + + :global .MuiInput-root::after { + border-bottom: none !important; + } + + :global .MuiInput-root::before { + border-bottom: none !important; + } + + :global input { + border-radius: 4px 0 0 4px; + padding: 9pt 15pt; + } + + :global .MuiFormControl-root { + width: 100%; + // border-radius: 4px; + } + + background-color: rgb(161 161 161 / 34%); + border-radius: 10px; + + :global .MuiButton-root { + border-radius: 0 10px 10px 0 !important; + } + + input::-webkit-outer-spin-button, + input::-webkit-inner-spin-button { + /* display: none; <- Crashes Chrome on hover */ + -webkit-appearance: none; + margin: 0; /* <-- Apparently some margin are still there even though it's hidden */ + } + + :global input[type=number] { + -moz-appearance:textfield; /* Firefox */ + } +} \ No newline at end of file diff --git a/src/components/TokenIdInput/TokenIdInput.tsx b/src/components/TokenIdInput/TokenIdInput.tsx new file mode 100644 index 0000000..5308c12 --- /dev/null +++ b/src/components/TokenIdInput/TokenIdInput.tsx @@ -0,0 +1,49 @@ +import React from "react"; +import TextField from '@mui/material/TextField'; +import DiamondIcon from '@mui/icons-material/Diamond'; +import { clsNames } from '../../core/helper'; +import styles from '../WidgetUI/WidgetUI.scss'; +import localStyles from './TokenIdInput.scss'; + + + +function stringToColor(str, dark) { + if (dark) { + // return `hsl(${hashCode(str) % 360}, 100%, 80%)`; + return 'hsl(120deg 2% 88%)'; + } + return 'hsl(0deg 0% 15%)'; + // return `hsl(${hashCode(str) % 360}, 55%, 40%)`; +} + +export default function TokenIdInput(props) { + + const handleChange = (event: React.ChangeEvent) => { + props.setTokenId(event.target.value); + }; + + if (!props.token) return; + return ( +
+ +
+ {/*
+ +
*/} + +
+
+

+ Token ID +

+
+
+ ) +} diff --git a/src/components/TokenIdInput/index.ts b/src/components/TokenIdInput/index.ts new file mode 100644 index 0000000..c0cab84 --- /dev/null +++ b/src/components/TokenIdInput/index.ts @@ -0,0 +1 @@ +export { default } from "./TokenIdInput"; diff --git a/src/components/TokenList/TokenBalance.tsx b/src/components/TokenList/TokenBalance.tsx new file mode 100644 index 0000000..6a489ae --- /dev/null +++ b/src/components/TokenList/TokenBalance.tsx @@ -0,0 +1,41 @@ +import React from 'react'; + +import { TokenType } from '../../core/dataclasses/TokenType'; +import { clsNames } from '../../core/helper'; +import styles from "../WidgetUI/WidgetUI.scss"; + + +function roundDown(number, decimals) { + decimals = decimals || 0; + return (Math.floor(number * Math.pow(10, decimals)) / Math.pow(10, decimals)); +} + + +export default function TokenBalance(props) { + if ([TokenType.erc721, TokenType.erc721meta, TokenType.erc1155].includes(props.token.type)) return; + return ( +
+ {props.token.unwrappedBalance ? ( +

+ {roundDown(props.token.unwrappedBalance, 4)} {props.token.unwrappedSymbol} / +

+ ) : null} +

+ {roundDown(props.token.balance, 4)} {props.token.symbol} +

+
+ + ) +} \ No newline at end of file diff --git a/src/components/TokenList/TokenList.tsx b/src/components/TokenList/TokenList.tsx index f284410..f0e2fc7 100644 --- a/src/components/TokenList/TokenList.tsx +++ b/src/components/TokenList/TokenList.tsx @@ -1,14 +1,22 @@ import React, { useEffect } from 'react'; + import Accordion from '@mui/material/Accordion'; import AccordionDetails from '@mui/material/AccordionDetails'; import AccordionSummary from '@mui/material/AccordionSummary'; -import Typography from '@mui/material/Typography'; -import Button from '@mui/material/Button'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; -import ErrorMessage, { NoTokenPairsMessage } from '../ErrorMessage'; +import { getAvailableTokensTotal } from '../../core/tokens/helper'; + +import TokenData from '../../core/dataclasses/TokenData'; + import { clsNames } from '../../core/helper'; + +import ErrorMessage, { NoTokenPairsMessage } from '../ErrorMessage'; + +import TokenListSection from '../TokenListSection'; +import TokenBalance from './TokenBalance'; + import styles from "../WidgetUI/WidgetUI.scss"; import localStyles from "./TokenList.scss"; @@ -23,6 +31,7 @@ const icons = importAll(require.context('../../icons', false, /\.(png|jpe?g|svg) function iconPath(name) { + if (!name) return; const key = name.toLowerCase() + '.svg'; if (icons[key]) { return icons[key]; @@ -32,53 +41,23 @@ function iconPath(name) { } -function roundDown(number, decimals) { - decimals = decimals || 0; - return (Math.floor(number * Math.pow(10, decimals)) / Math.pow(10, decimals)); -} - export default function TokenList(props) { - - let disabled = Object.keys(props.tokens['erc20']).length == 1 && !props.tokens.eth || Object.keys(props.tokens['erc20']).length == 0 && props.tokens.eth; - let noTokens = !props.tokens.eth && Object.keys(props.tokens['erc20']).length == 0; - - useEffect(() => { - // if (disabled) { - // props.setToken(Object.keys(props.tokens['erc20'])[0]) - // } - }, []); + let availableTokensTotal = getAvailableTokensTotal(props.availableTokens); + let disabled = availableTokensTotal === 1; + let noTokens = availableTokensTotal === 0; const handleChange = (panel: string) => (event: React.SyntheticEvent, isExpanded: boolean) => { props.setExpanded(isExpanded ? panel : false); }; - function handle(token) { - props.setExpanded(false); - props.setToken(token); - } - - let allTokens = props.tokens['erc20']; - let tokenInfo; - - if (props.tokens.eth) { - allTokens.eth = props.tokens.eth; - } - - if (props.token == 'eth') { - tokenInfo = props.tokens.eth; - } else { - tokenInfo = props.tokens['erc20'][props.token]; - } - if (noTokens) { return () } - return (

- {tokenInfo.name} -

- {tokenInfo.unwrappedBalance ? ( -

- {roundDown(tokenInfo.unwrappedBalance, 4)} {tokenInfo.unwrappedSymbol} / -

- ) : null} -

- {roundDown(tokenInfo['balance'], 4)} {tokenInfo.symbol} + {props.token.name}

+
) : (
@@ -147,44 +107,36 @@ export default function TokenList(props) { } - {allTokens ? (
- {Object.keys(allTokens).map((key, i) => ( - - - - ))} -
) : (
)} + + + + +
diff --git a/src/components/TokenListSection/TokenListSection.scss b/src/components/TokenListSection/TokenListSection.scss new file mode 100644 index 0000000..2ef91f2 --- /dev/null +++ b/src/components/TokenListSection/TokenListSection.scss @@ -0,0 +1,18 @@ + + +.mp__iconToken { + width: 21px; + height: 21px; + // opacity: 0.85; + margin-left: 2px; + margin-right: 2px; +} + +.default-mp__iconToken { + color: black; + background-color: #dbe106; + padding: 4px; + border-radius: 50%; + width: 22px; + height: 22px; +} \ No newline at end of file diff --git a/src/components/TokenListSection/TokenListSection.tsx b/src/components/TokenListSection/TokenListSection.tsx new file mode 100644 index 0000000..e1f762b --- /dev/null +++ b/src/components/TokenListSection/TokenListSection.tsx @@ -0,0 +1,79 @@ +import React from 'react'; + + +import Typography from '@mui/material/Typography'; +import Button from '@mui/material/Button'; + +import TokenData from '../../core/dataclasses/TokenData'; +import { clsNames } from '../../core/helper'; + +import TokenBalance from '../TokenList/TokenBalance'; + +import styles from "../WidgetUI/WidgetUI.scss"; +import localStyles from "./TokenListSection.scss"; + +function importAll(r) { + let images = {}; + r.keys().map((item, index) => { images[item.replace('./', '')] = r(item); }); + return images; +} + +const icons = importAll(require.context('../../icons', false, /\.(png|jpe?g|svg)$/)); + + +function iconPath(name) { + if (!name) return; + const key = name.toLowerCase() + '.svg'; + if (icons[key]) { + return icons[key]; + } else { + return icons['eth.svg']; + } +} + + +export default function TokenListSection(props) { + + function handle(tokenData: TokenData): void { + props.setExpanded(false); + props.setToken(tokenData); + } + + if (Object.keys(props.tokens).length === 0) return; + + return ( +
+

+ {props.type} +

+ {Object.keys(props.tokens).map((key, i) => ( + + + + ))} +
+ ) +} \ No newline at end of file diff --git a/src/components/TokenListSection/index.ts b/src/components/TokenListSection/index.ts new file mode 100644 index 0000000..e177cb9 --- /dev/null +++ b/src/components/TokenListSection/index.ts @@ -0,0 +1 @@ +export { default } from "./TokenListSection"; diff --git a/src/components/WalletConnector/MetamaskConnector.ts b/src/components/WalletConnector/MetamaskConnector.ts index c6d44e6..cea2003 100644 --- a/src/components/WalletConnector/MetamaskConnector.ts +++ b/src/components/WalletConnector/MetamaskConnector.ts @@ -3,6 +3,7 @@ import Web3 from 'web3'; export const CHAIN_IDS = { 'staging': '0x4', + 'staging3': '0x5', 'qatestnet': '0x4', 'mainnet': '0x1' } diff --git a/src/components/Widget/Widget.tsx b/src/components/Widget/Widget.tsx index 4cbc54d..f250f94 100644 --- a/src/components/Widget/Widget.tsx +++ b/src/components/Widget/Widget.tsx @@ -1,4 +1,5 @@ import React, { useEffect } from 'react'; +import debug from 'debug'; import WidgetUI from '../WidgetUI'; import { WrongNetworkMessage, TransactionErrorMessage } from '../ErrorMessage'; @@ -13,23 +14,32 @@ import { updateWeb3SChainMetamask, getChainId } from '../../core'; -import { getAvailableTokens, getTokenBalances } from '../../core/tokens'; + + +import { getAvailableTokens, getTokenBalances } from '../../core/tokens/index'; +import { getEmptyTokenDataMap, getDefaultToken } from '../../core/tokens/helper'; import { MainnetChain, SChain } from '@skalenetwork/ima-js'; import { connect, addAccountChangedListener, addChainChangedListener } from '../WalletConnector' import { externalEvents } from '../../core/events'; import { MAINNET_CHAIN_NAME, DEFAULT_ERROR_MSG } from '../../core/constants'; import { getActionName, getActionSteps } from '../../core/actions'; +import { ActionType } from '../../core/actions/action'; import { getSFuelData } from '../../core/sfuel'; import * as interfaces from '../../core/interfaces/index'; +import TokenData from '../../core/dataclasses/TokenData'; + + +debug.enable('*'); +const log = debug('metaport:Widget'); export function Widget(props) { - const [extTokens, setExtTokens] = React.useState({ 'erc20': {} }); - // const [availableTokens, setAvailableTokens] = React.useState({ 'erc20': {} }); - const [availableTokens, setAvailableTokens] = React.useState({ 'erc20': {} }); + const [configTokens, setConfigTokens] = React.useState(undefined); + const [availableTokens, setAvailableTokens] = React.useState(getEmptyTokenDataMap()); + const [token, setToken] = React.useState(undefined); const [firstOpen, setFirstOpen] = React.useState(props.open); const [open, setOpen] = React.useState(props.open); @@ -38,6 +48,7 @@ export function Widget(props) { const [address, setAddress] = React.useState(undefined); const [amount, setAmount] = React.useState(''); + const [tokenId, setTokenId] = React.useState(undefined); const [walletConnected, setWalletConnected] = React.useState(undefined); @@ -46,9 +57,9 @@ export function Widget(props) { const [chainId, setChainId] = React.useState(undefined); const [extChainId, setExtChainId] = React.useState(undefined); - const [errorMessage, setErrorMessage] = React.useState(undefined); - const [token, setToken] = React.useState(undefined); + const [errorMessage, setErrorMessage] = React.useState(undefined); + const [amountErrorMessage, setAmountErrorMessage] = React.useState(undefined); const [sChain1, setSChain1] = React.useState(undefined); const [sChain2, setSChain2] = React.useState(undefined); @@ -58,6 +69,7 @@ export function Widget(props) { const [loading, setLoading] = React.useState(false); const [amountLocked, setAmountLocked] = React.useState(false); + const [actionBtnDisabled, setActionBtnDisabled] = React.useState(false); const [activeStep, setActiveStep] = React.useState(0); const [actionSteps, setActionSteps] = React.useState(undefined); @@ -72,7 +84,7 @@ export function Widget(props) { setWalletConnected(false); setSchains(props.chains); setMainnetEndpoint(props.mainnetEndpoint); - setExtTokens(props.tokens); + setConfigTokens(props.tokens); addAccountChangedListener(accountsChangedFallback); addChainChangedListener(chainChangedFallback); addinternalEventsListeners(); @@ -101,18 +113,18 @@ export function Widget(props) { function updateBalanceHandler() { // todo: refactor window.addEventListener("metaport_requestBalance", requestBalanceHandler, false); - console.log("updateBalanceHandler done"); + log("updateBalanceHandler done"); } function closeWidget(e) { setOpen(false); setActiveStep(0); - console.log('closeWidget event processed') + log('closeWidget event processed'); } function openWidget(e) { setOpen(true); - console.log('openWidget event processed') + log('openWidget event processed'); } function resetWidget(e) { @@ -126,11 +138,11 @@ export function Widget(props) { setAmount(''); setLoading(false); - setToken(null); + setToken(undefined); setAmountLocked(false); setActiveStep(0); setActionSteps(undefined); - console.log('resetWidget event processed') + log('resetWidget event processed'); } function requestTransfer(e) { @@ -140,11 +152,11 @@ export function Widget(props) { setAmountLocked(!!e.detail.lockAmount); if (e.detail.tokens) { - setExtTokens(e.detail.tokens); + setConfigTokens(e.detail.tokens); } - console.log("requestTransfer from: " + e.detail.schains[0], ", to: " + e.detail.schains[1]); - console.log("amount inside react " + e.detail.amount); + log("requestTransfer from: " + e.detail.schains[0], ", to: " + e.detail.schains[1]); + log("amount inside react " + e.detail.amount); } function updateParamsHandler(e) { @@ -152,10 +164,10 @@ export function Widget(props) { setSchains(e.detail.chains); } if (e.detail.tokens) { - setExtTokens(e.detail.tokens); + setConfigTokens(e.detail.tokens); } - console.log('params updated'); - console.log(e.detail.chains); + log('params updated'); + log(e.detail.chains); } async function tokenLookup() { @@ -166,7 +178,7 @@ export function Widget(props) { sChain2, chainName1, chainName2, - extTokens, + configTokens, false, props.autoLookup ); @@ -175,8 +187,6 @@ export function Widget(props) { chainName1, mainnet, sChain1, - sChain2, - token, address ); @@ -192,8 +202,6 @@ export function Widget(props) { chainName1, mainnet, sChain1, - sChain2, - token, address ); setAvailableTokens(tokens); @@ -211,12 +219,13 @@ export function Widget(props) { let balance = await sChain2.getERC20Balance(tokenContract, address); return externalEvents.balance(tokenSymbol, chainName2, balance); } - console.log('Error: can request balance only for active chains!'); // TODO: replace with error! + console.error('Error: can request balance only for active chains!'); // TODO: replace with error! } function requestBalanceHandler(e) { if (!sChain1 || !sChain2) { - console.log('chains are not inited yet'); // TODO: replace with error + console.error('chains are not inited yet'); // TODO: replace with error + return } emitBalanceEvent(e.detail.schainName, e.detail.tokenSymbol); } @@ -284,7 +293,7 @@ export function Widget(props) { }, [chainName2, address]); useEffect(() => { - if (((sChain1 && sChain2) || (sChain1 && mainnet) || (mainnet && sChain2)) && extTokens) { + if (((sChain1 && sChain2) || (sChain1 && mainnet) || (mainnet && sChain2)) && configTokens) { externalEvents.connected(); initSFuelData(); setToken(undefined); @@ -292,25 +301,28 @@ export function Widget(props) { setActiveStep(0); tokenLookup(); } - }, [sChain1, sChain2, mainnet, extTokens]); + }, [sChain1, sChain2, mainnet, configTokens]); useEffect(() => { setActiveStep(0); }, [token]); useEffect(() => { + setAmountErrorMessage(undefined); + if (token === undefined) return; let actionName = getActionName(chainName1, chainName2, token); - if (actionName && availableTokens['erc20'] && availableTokens['erc20'][token]) { - setActionSteps(getActionSteps(actionName, availableTokens['erc20'][token])); - } - if (actionName && availableTokens['eth']) { - setActionSteps(getActionSteps(actionName, availableTokens['eth'])); - } + setActionSteps(getActionSteps(actionName, token)); }, [chainName1, chainName2, token, availableTokens]); useEffect(() => { + const defaultToken = getDefaultToken(availableTokens); + if (defaultToken) setToken(defaultToken); + }, [availableTokens]); + + useEffect(() => { + setAmountErrorMessage(undefined); runPreAction(); - }, [actionSteps, activeStep, amount]); + }, [actionSteps, activeStep, amount, tokenId]); useEffect(() => { if (extChainId && chainId && extChainId !== chainId) { @@ -322,7 +334,9 @@ export function Widget(props) { async function runPreAction() { if (actionSteps && actionSteps[activeStep]) { - const ActionClass = actionSteps[activeStep]; + log('Running preAction'); + setActionBtnDisabled(true); + const ActionClass: ActionType = actionSteps[activeStep]; await new ActionClass( mainnet, sChain1, @@ -331,12 +345,15 @@ export function Widget(props) { chainName2, address, amount, + tokenId, token, - availableTokens['erc20'][token], switchMetamaskChain, setActiveStep, - activeStep + activeStep, + setAmountErrorMessage ).preAction(); + setActionBtnDisabled(false); + log('preAction done'); } } @@ -362,7 +379,7 @@ export function Widget(props) { const handleNextStep = async () => { setLoading(true); - const ActionClass = actionSteps[activeStep]; + const ActionClass: ActionType = actionSteps[activeStep]; try { await new ActionClass( @@ -373,9 +390,12 @@ export function Widget(props) { chainName2, address, amount, + tokenId, token, - availableTokens['erc20'][token], - switchMetamaskChain + switchMetamaskChain, + setActiveStep, + activeStep, + setAmountErrorMessage ).execute(); } catch (err) { console.error(err); @@ -428,10 +448,13 @@ export function Widget(props) { return () } \ No newline at end of file diff --git a/src/components/WidgetBody/WidgetBody.tsx b/src/components/WidgetBody/WidgetBody.tsx index 8200458..851896e 100644 --- a/src/components/WidgetBody/WidgetBody.tsx +++ b/src/components/WidgetBody/WidgetBody.tsx @@ -11,10 +11,14 @@ import styles from '../WidgetUI/WidgetUI.scss'; import ChainsList from '../ChainsList'; import TokenList from '../TokenList'; import AmountInput from '../AmountInput'; +import TokenIdInput from '../TokenIdInput'; import Stepper from '../Stepper'; import SFuelBadge from '../SFuelBadge'; import CurrentChain from '../CurrentChain'; import ErrorMessage from '../ErrorMessage'; +import AmountErrorMessage from '../AmountErrorMessage'; + +import { TokenType } from '../../core/dataclasses/TokenType'; import ImportExportIcon from '@mui/icons-material/ImportExport'; @@ -24,17 +28,6 @@ export default function WidgetBody(props) { const [expandedTo, setExpandedTo] = React.useState(false); const [expandedTokens, setExpandedTokens] = React.useState(false); - // let tokensList = Object.keys(props.tokens['erc20']).length != 0; - let currentTokenBalance; - - // todo: optimize - if (props.token && props.tokens['erc20'][props.token]) { - currentTokenBalance = props.tokens['erc20'][props.token]['balance']; - } - if (props.token && props.tokens.eth && props.token == 'eth') { - currentTokenBalance = props.tokens.eth.balance; - } - return (
{ let chain1 = props.chain1; + props.setAmountErrorMessage(undefined); props.setChain1(props.chain2); props.setChain2(chain1); props.setAmount(null); @@ -116,7 +110,7 @@ export default function WidgetBody(props) {
{props.loadingTokens ? () : ()}
- - + +
+ +
+
+
+
@@ -147,13 +157,16 @@ export default function WidgetBody(props) {
{!props.actionSteps ? () : ()}
diff --git a/src/components/WidgetUI/Common.stories.tsx b/src/components/WidgetUI/Common.stories.tsx new file mode 100644 index 0000000..fc2b3c3 --- /dev/null +++ b/src/components/WidgetUI/Common.stories.tsx @@ -0,0 +1,118 @@ +import React from "react"; +import { WidgetUI } from "./WidgetUI"; +import { commonProps, defaultTokenData, generateTokenData } from './StoriesHelper'; +import { getEmptyTokenDataMap } from '../../core/tokens/helper'; + + +export default { + title: "Common elements" +}; + + +export const ConnectScreen = () => ( + +); + + +export const ConnectScreenLight = () => ( + +); + + +export const ClosedLight = () => ( + +); + + +export const ClosedDark = () => ( + +); + + +export const SelectChains = () => ( + +); + +export const SelectChainsLight = () => ( + +); + + +export const LoadingTokens = () => ( + +); + + +export const sFuelIcons = () => ( + +); + +export const NoButton = () => ( + +); + + +export const LoadingError = () => ( + +); + diff --git a/src/components/WidgetUI/ERC1155.stories.tsx b/src/components/WidgetUI/ERC1155.stories.tsx new file mode 100644 index 0000000..35086fa --- /dev/null +++ b/src/components/WidgetUI/ERC1155.stories.tsx @@ -0,0 +1,13 @@ +import React from "react"; +import { WidgetUI } from "./WidgetUI"; +import { commonProps, defaultERC1155TokenData } from './StoriesHelper'; + + +export default { + title: "ERC1155 UI" +}; + +export const TransferNFT = () => ( + +); + \ No newline at end of file diff --git a/src/components/WidgetUI/ERC20.stories.tsx b/src/components/WidgetUI/ERC20.stories.tsx new file mode 100644 index 0000000..75e8da8 --- /dev/null +++ b/src/components/WidgetUI/ERC20.stories.tsx @@ -0,0 +1,181 @@ +import React from "react"; +import { WidgetUI } from "./WidgetUI"; +import { commonProps, defaultTokenData, generateTokenData } from './StoriesHelper'; + +import PublicOffIcon from '@mui/icons-material/PublicOff'; + + +export default { + title: "ERC20 UI" +}; + +export const TransferUIDark = () => ( + +); + +export const TransferUILight = () => ( + +); + + +export const MainnetTransfer = () => ( + { }} + setChain2={() => { }} + setToken={() => { }} + setActiveStep={() => { }} + + chain1='mainnet' + chain2='bbb-chain' + + /> +); + +export const MainnetTransferLight = () => ( + { }} + setChain2={() => { }} + setToken={() => { }} + setActiveStep={() => { }} + + chain1='mainnet' + chain2='bbb-chain' + theme={{ 'mode': 'light' }} + /> +); + +export const LoadingSteps = () => ( + { }} + setChain2={() => { }} + setToken={() => { }} + setActiveStep={() => { }} + + loading={true} + + chain1='aaa-chain' + chain2='bbb-chain' + theme={{ 'mode': 'dark' }} + /> +); + + +export const SelectToken = () => ( + +); + + +export const Approved = () => ( + +); + + +export const Loading = () => ( + +); + + +export const LoadingCustom = () => ( + +); + + +export const LoadingLight = () => ( + +); + + +export const TransferComplete = () => ( + +); + diff --git a/src/components/WidgetUI/ERC721.stories.tsx b/src/components/WidgetUI/ERC721.stories.tsx new file mode 100644 index 0000000..62310be --- /dev/null +++ b/src/components/WidgetUI/ERC721.stories.tsx @@ -0,0 +1,14 @@ +import React from "react"; +import { WidgetUI } from "./WidgetUI"; +import { commonProps, defaultERC721TokenData, generateTokenData } from './StoriesHelper'; + +import PublicOffIcon from '@mui/icons-material/PublicOff'; + + +export default { + title: "ERC721 UI" +}; + +export const TransferNFT = () => ( + +); diff --git a/src/components/WidgetUI/Errors.stories.tsx b/src/components/WidgetUI/Errors.stories.tsx new file mode 100644 index 0000000..e3e14ef --- /dev/null +++ b/src/components/WidgetUI/Errors.stories.tsx @@ -0,0 +1,61 @@ +import React from "react"; +import { WidgetUI } from "./WidgetUI"; +import { commonProps, defaultTokenData, generateTokenData } from './StoriesHelper'; +import { getEmptyTokenDataMap } from '../../core/tokens/helper'; + +import PublicOffIcon from '@mui/icons-material/PublicOff'; + + +export default { + title: "Errors" +}; + + +export const NoTokenPairs = () => (); + + +export const NoTokenPairsLight = () => ( + +); + + +export const WrongNetwork = () => ( + , + text: 'test test test test test test test test test test', + btnText: 'aaaa', + fallback: () => { console.log('test test test') } + }} + /> +); + + +export const WrongNetworkLight = () => ( + , + text: 'test test test test test test test test test test', + btnText: 'aaaa', + fallback: () => { console.log('test test test') } + }} + /> +); + + +export const Error = () => ( + +); + diff --git a/src/components/WidgetUI/StoriesHelper.ts b/src/components/WidgetUI/StoriesHelper.ts index 6446ece..f6d8b13 100644 --- a/src/components/WidgetUI/StoriesHelper.ts +++ b/src/components/WidgetUI/StoriesHelper.ts @@ -1,6 +1,7 @@ import { getActionSteps } from '../../core/actions'; import TokenData from '../../core/dataclasses/TokenData'; - +import { TokenType } from '../../core/dataclasses/TokenType'; +import { getEmptyTokenDataMap } from '../../core/tokens/helper'; function setMock() { return }; @@ -41,33 +42,89 @@ export const commonProps = { null, null, null, + TokenType.erc20, null, null )) } -export function generateTokenData(tokenSymbol, tokenName, wrapped=false) { +export function generateTokenData(tokenSymbol, tokenName, wrapped = false) { const data = { token: tokenSymbol, amount: getRandomInt(1000, 10000), - tokens: { - "erc20": { - } - } + availableTokens: getEmptyTokenDataMap() } - data.tokens.erc20[tokenSymbol] = { - "name": tokenName, - "address": "0x0", - "balance": getRandomInt(10000, 70000), - "symbol": tokenSymbol + data.availableTokens.erc20[tokenSymbol] = new TokenData( + '0x0', + '0x0', + tokenName, + tokenSymbol, + false, + undefined, + '18', + TokenType.erc20, + undefined, + undefined + ); + if (wrapped) { + data.availableTokens.erc20[tokenSymbol].unwrappedBalance = getRandomInt(10000, 70000).toString(); + data.availableTokens.erc20[tokenSymbol].unwrappedSymbol = 'u' + tokenSymbol; + }; + data.availableTokens.erc20[tokenSymbol].balance = getRandomInt(10000, 70000).toString(); + data.token = data.availableTokens.erc20[tokenSymbol]; + return data; +} + +export const defaultTokenData = generateTokenData('usdt', 'Tether'); + + +export function generateERC721TokenData(tokenSymbol, tokenName) { + const data = { + token: tokenSymbol, + amount: getRandomInt(1000, 10000), + availableTokens: getEmptyTokenDataMap() } + data.availableTokens.erc721[tokenSymbol] = new TokenData( + '0x0', + '0x0', + tokenName, + tokenSymbol, + false, + undefined, + undefined, + TokenType.erc721, + undefined, + undefined + ); + data.token = data.availableTokens.erc721[tokenSymbol]; + return data; +} - if (wrapped) { - data.tokens.erc20[tokenSymbol].unwrappedBalance = getRandomInt(10000, 70000); - data.tokens.erc20[tokenSymbol].unwrappedSymbol = 'u' + tokenSymbol; +export const defaultERC721TokenData = generateERC721TokenData('skl', 'SKALE Space'); + + +export function generateERC1155TokenData(tokenSymbol, tokenName) { + const data = { + token: tokenSymbol, + amount: getRandomInt(1000, 10000), + availableTokens: getEmptyTokenDataMap() } + data.availableTokens.erc1155[tokenSymbol] = new TokenData( + '0x0', + '0x0', + tokenName, + tokenSymbol, + false, + undefined, + '18', + TokenType.erc1155, + undefined, + undefined + ); + // data.availableTokens.erc1155[tokenSymbol].balance = getRandomInt(10000, 70000).toString(); + data.token = data.availableTokens.erc1155[tokenSymbol]; return data; } -export const defaultTokenData = generateTokenData('usdt', 'Tether'); +export const defaultERC1155TokenData = generateERC1155TokenData('XEM', 'SKALIENS'); \ No newline at end of file diff --git a/src/components/WidgetUI/Themes.stories.tsx b/src/components/WidgetUI/Themes.stories.tsx new file mode 100644 index 0000000..2a55bdf --- /dev/null +++ b/src/components/WidgetUI/Themes.stories.tsx @@ -0,0 +1,76 @@ +import React from "react"; +import { WidgetUI } from "./WidgetUI"; +import { commonProps, defaultTokenData, generateTokenData } from './StoriesHelper'; + +import PublicOffIcon from '@mui/icons-material/PublicOff'; + + +export default { + title: "Custom Themes" +}; + + +export const CustomThemeRuby = () => ( + +); + + +export const CustomDarkBlue = () => ( + +); + + +export const CustomLightOrange = () => ( + +); + + +export const CustomDarkGreen = () => ( + +); + + +export const CustomLightViolet = () => ( + +); + diff --git a/src/components/WidgetUI/Themes.ts b/src/components/WidgetUI/Themes.ts index 619e37d..4b4196d 100644 --- a/src/components/WidgetUI/Themes.ts +++ b/src/components/WidgetUI/Themes.ts @@ -1,7 +1,6 @@ const defaultThemes = { 'dark': { - // primary: '#8BFCD9', primary: 'rgb(217, 224, 33)', background: '#0e0e0e', mode: 'dark' diff --git a/src/components/WidgetUI/WidgetUI.scss b/src/components/WidgetUI/WidgetUI.scss index 81fa430..1ef4ea9 100644 --- a/src/components/WidgetUI/WidgetUI.scss +++ b/src/components/WidgetUI/WidgetUI.scss @@ -78,15 +78,15 @@ margin-top: 10px !important; } -.marg-left-10 { +.mp__margLeft10 { margin-left: 10px !important; } -.marg-left-20 { +.mp__margLeft20 { margin-left: 20px !important; } -.marg-ri-20 { +.mp__margRi20 { margin-right: 20px !important; } @@ -326,6 +326,10 @@ letter-spacing: 0.03857em !important; } +.mp__errorMessage{ + color: #ff3737 !important; +} + .mp__btnConnect { width: 100%; margin-top: 10pt; @@ -406,4 +410,12 @@ .mp__minContent { width: min-content; +} + +.tokenIdIcon{ + padding: 0 0 0 16px; + + :global(svg) { + //width: 20px; + } } \ No newline at end of file diff --git a/src/components/WidgetUI/WidgetUI.stories.tsx b/src/components/WidgetUI/WidgetUI.stories.tsx deleted file mode 100644 index 202bba7..0000000 --- a/src/components/WidgetUI/WidgetUI.stories.tsx +++ /dev/null @@ -1,355 +0,0 @@ -import React from "react"; -import { WidgetUI } from "./WidgetUI"; -import { commonProps, defaultTokenData, generateTokenData } from './StoriesHelper'; - -import PublicOffIcon from '@mui/icons-material/PublicOff'; - - -export default { - title: "Widget UI" -}; - - -export const ConnectScreen = () => ( - -); - - -export const ConnectScreenLight = () => ( - -); - - -export const ClosedLight = () => ( - -); - - -export const ClosedDark = () => ( - -); - - -export const SelectChains = () => ( - -); - -export const SelectChainsLight = () => ( - -); - - -export const LoadingTokens = () => ( - -); - -export const SelectToken = () => ( - -); - - -export const NoTokenPairs = () => (); - - -export const NoTokenPairsLight = () => ( - -); - - -export const LoadingSteps = () => ( - { }} - setChain2={() => { }} - setToken={() => { }} - setActiveStep={() => { }} - - loading={true} - - chain1='aaa-chain' - chain2='bbb-chain' - theme={{ 'mode': 'dark' }} - /> -); - - -export const TransferUIDark = () => ( - -); - -export const TransferUILight = () => ( - -); - -export const Approved = () => ( - -); - - -export const Loading = () => ( - -); - - -export const LoadingCustom = () => ( - -); - - -export const LoadingLight = () => ( - -); - - -export const TransferComplete = () => ( - -); - - -export const CustomThemeRuby = () => ( - -); - - -export const CustomDarkBlue = () => ( - -); - - -export const CustomLightOrange = () => ( - -); - - -export const CustomDarkGreen = () => ( - -); - - -export const CustomLightViolet = () => ( - -); - - -export const MainnetTransfer = () => ( - { }} - setChain2={() => { }} - setToken={() => { }} - setActiveStep={() => { }} - - chain1='mainnet' - chain2='bbb-chain' - - /> -); - -export const MainnetTransferLight = () => ( - { }} - setChain2={() => { }} - setToken={() => { }} - setActiveStep={() => { }} - - chain1='mainnet' - chain2='bbb-chain' - theme={{ 'mode': 'light' }} - /> -); - - -export const sFuelIcons = () => ( - -); - -export const NoButton = () => ( - -); - -export const WrongNetwork = () => ( - , - text: 'test test test test test test test test test test', - btnText: 'aaaa', - fallback: () => { console.log('test test test') } - }} - /> -); - - -export const WrongNetworkLight = () => ( - , - text: 'test test test test test test test test test test', - btnText: 'aaaa', - fallback: () => { console.log('test test test') } - }} - /> -); \ No newline at end of file diff --git a/src/components/WidgetUI/WidgetUI.tsx b/src/components/WidgetUI/WidgetUI.tsx index 919160a..ee3216d 100644 --- a/src/components/WidgetUI/WidgetUI.tsx +++ b/src/components/WidgetUI/WidgetUI.tsx @@ -62,16 +62,6 @@ export function WidgetUI(props) { } }, [props.schains]); - useEffect(() => { - if (props.tokens == undefined) return; - if (Object.keys(props.tokens['erc20']).length == 1) { - props.setToken(Object.keys(props.tokens['erc20'])[0]); - } - if (Object.keys(props.tokens['erc20']).length == 0 && props.tokens.eth) { - props.setToken('eth'); - } - }, [props.tokens]); - const handleClick = (event: React.MouseEvent) => { props.setOpen(props.open ? false : true); }; @@ -100,7 +90,7 @@ export function WidgetUI(props) { setToken={props.setToken} token={props.token} - tokens={props.tokens} + availableTokens={props.availableTokens} balance={props.balance} allowance={props.allowance} @@ -110,9 +100,14 @@ export function WidgetUI(props) { amount={props.amount} setAmount={props.setAmount} + tokenId={props.tokenId} + setTokenId={props.setTokenId} + loading={props.loading} setLoading={props.setLoading} + actionBtnDisabled={props.actionBtnDisabled} + loadingTokens={props.loadingTokens} activeStep={props.activeStep} @@ -130,6 +125,8 @@ export function WidgetUI(props) { theme={widgetTheme} errorMessage={props.errorMessage} + amountErrorMessage={props.amountErrorMessage} + setAmountErrorMessage={props.setAmountErrorMessage} /> ) : ( . + */ + +/** + * @file action.ts + * @copyright SKALE Labs 2022-Present + */ + +import { MainnetChain, SChain } from '@skalenetwork/ima-js'; +import TokenData from '../dataclasses/TokenData'; + + +export type ActionType = typeof Action; + + +export class Action { + execute(): void { return; }; + preAction(): void { return; }; + + static label: string = ''; + static buttonText: string = ''; + static loadingText: string = ''; + + mainnet: MainnetChain + sChain1: SChain + sChain2: SChain + chainName1: string + chainName2: string + address: string + amount: string + tokenId: number + tokenData: TokenData + + switchMetamaskChain: () => void + setActiveStep: React.Dispatch> + activeStep: number + + setAmountErrorMessage: React.Dispatch> + + wrap: boolean + + constructor( + mainnet: MainnetChain, + sChain1: SChain, + sChain2: SChain, + chainName1: string, + chainName2: string, + address: string, + amount: string, + tokenId: number, + tokenData: TokenData, + switchMetamaskChain: () => void, + setActiveStep: React.Dispatch>, + activeStep: number, + setAmountErrorMessage: React.Dispatch>, + ) { + this.mainnet = mainnet; + this.sChain1 = sChain1; + this.sChain2 = sChain2; + this.chainName1 = chainName1; + this.chainName2 = chainName2; + this.address = address; + this.amount = amount; + this.tokenId = tokenId; + this.tokenData = tokenData; + this.switchMetamaskChain = switchMetamaskChain; + + this.setActiveStep = setActiveStep; + this.activeStep = activeStep; + + this.setAmountErrorMessage = setAmountErrorMessage; + + if (this.tokenData) this.wrap = !!this.tokenData.unwrappedSymbol && !this.tokenData.clone; + } +} + + +export abstract class TransferAction extends Action { + static label = 'Transfer' + static buttonText = 'Transfer' + static loadingText = 'Transferring' +} + + +export abstract class ApproveAction extends Action { + static label = 'Approve transfer' + static buttonText = 'Approve' + static loadingText = 'Approving' +} diff --git a/src/core/actions.ts b/src/core/actions/erc20.ts similarity index 56% rename from src/core/actions.ts rename to src/core/actions/erc20.ts index ea177f6..d8758aa 100644 --- a/src/core/actions.ts +++ b/src/core/actions/erc20.ts @@ -17,177 +17,32 @@ */ /** - * @file actions.ts + * @file erc20.ts * @copyright SKALE Labs 2022-Present */ + import debug from 'debug'; -import { MainnetChain, SChain } from '@skalenetwork/ima-js'; +import { externalEvents } from '../events'; +import { toWei, fromWei } from '../convertation'; +import { MAX_APPROVE_AMOUNT } from '../constants'; -import { externalEvents } from './events'; -import { toWei, fromWei } from './convertation'; -import TokenData from './dataclasses/TokenData'; -import { - MAINNET_CHAIN_NAME, - ETH_TOKEN_NAME, - ETH_PREFIX, - ERC20_PREFIX, - S2S_POSTFIX, - M2S_POSTFIX, - S2M_POSTFIX, - MAX_APPROVE_AMOUNT -} from './constants'; +import { TransferAction, Action } from './action'; debug.enable('*'); -const log = debug('metaport:actions'); - - -export function getActionName(chainName1: string, chainName2: string, tokenSymbol: string): string { - log('Getting action name: ' + chainName1 + ' ' + chainName2 + ' ' + tokenSymbol); - if (!chainName1 || !chainName2 || !tokenSymbol) return; - let prefix = ERC20_PREFIX; - let postfix = S2S_POSTFIX; - if (isChainMainnet(chainName1)) { postfix = M2S_POSTFIX; }; - if (isChainMainnet(chainName2)) { postfix = S2M_POSTFIX; }; - if (isEth(tokenSymbol) && (isChainMainnet(chainName1) || isChainMainnet(chainName2))) { - prefix = ETH_PREFIX; - }; - log('Action name: ' + prefix + postfix); - return prefix + postfix; -} - - -export function isChainMainnet(chainName: string): boolean { - return chainName === MAINNET_CHAIN_NAME; -} - -export function isEth(tokenSymbol: string): boolean { - return tokenSymbol === ETH_TOKEN_NAME; -} - - -abstract class Action { - abstract execute(): void; - preAction(): void { return; }; - - static label: string = ''; - static buttonText: string = ''; - static loadingText: string = ''; - - mainnet: MainnetChain - sChain1: SChain - sChain2: SChain - chainName1: string - chainName2: string - address: string - amount: string - tokenSymbol: string - tokenData: TokenData - - switchMetamaskChain: () => void - setActiveStep: (stepNumber: number) => void - activeStep: number - - wrap: boolean - - constructor( - mainnet: MainnetChain, - sChain1: SChain, - sChain2: SChain, - chainName1: string, - chainName2: string, - address: string, - amount: string, - tokenSymbol: string, - tokenData: TokenData, - switchMetamaskChain: () => void, - setActiveStep: () => void, - activeStep: number - ) { - this.mainnet = mainnet; - this.sChain1 = sChain1; - this.sChain2 = sChain2; - this.chainName1 = chainName1; - this.chainName2 = chainName2; - this.address = address; - this.amount = amount; - this.tokenSymbol = tokenSymbol; - this.tokenData = tokenData; - this.switchMetamaskChain = switchMetamaskChain; - - this.setActiveStep = setActiveStep; - this.activeStep = activeStep; - - this.wrap = !!this.tokenData.unwrappedSymbol && !this.tokenData.clone; - } -} - - -abstract class TransferAction extends Action { - static label = 'Transfer' - static buttonText = 'Transfer' - static loadingText = 'Transferring' -} +const log = debug('metaport:actions:erc20'); -class TransferEthM2S extends TransferAction { - async execute() { - // debug('TransferEthM2S: started'); - const amountWei = toWei(this.mainnet.web3, this.amount, this.tokenData.decimals); - const sChainBalanceBefore = await this.sChain2.ethBalance(this.address); - const tx = await this.mainnet.eth.deposit( - this.chainName2, - { - address: this.address, - value: amountWei - } - ); - await this.sChain2.waitETHBalanceChange(this.address, sChainBalanceBefore); - externalEvents.transferComplete(tx, this.chainName1, this.chainName2, this.tokenSymbol); - } -} - - -class TransferEthS2M extends TransferAction { - async execute() { - // debug('TransferEthS2M: started'); - const amountWei = toWei(this.sChain1.web3, this.amount, this.tokenData.decimals); - const lockedETHAmount = await this.mainnet.eth.lockedETHAmount(this.address); - const tx = await this.sChain1.eth.withdraw( - amountWei, - { address: this.address } - ); - await this.mainnet.eth.waitLockedETHAmountChange(this.address, lockedETHAmount); - externalEvents.transferComplete(tx, this.chainName1, this.chainName2, this.tokenSymbol); - } -} - - -class UnlockEthM extends Action { - static label = 'Unlock ETH' - static buttonText = 'Unlock' - static loadingText = 'Unlocking' - - async execute() { - // debug('UnlockEthM: started'); - const tx = await this.mainnet.eth.getMyEth( - { address: this.address } - ); - externalEvents.ethUnlocked(tx); - } -} - - -class ApproveERC20S extends Action { +export class ApproveERC20S extends Action { static label = 'Approve transfer' static buttonText = 'Approve all' static loadingText = 'Approving' async execute() { await this.sChain1.erc20.approve( - this.tokenSymbol, + this.tokenData.keyname, MAX_APPROVE_AMOUNT, this.sChain1.erc20.address, { address: this.address } @@ -195,7 +50,7 @@ class ApproveERC20S extends Action { } async preAction() { - const tokenContract = this.sChain1.erc20.tokens[this.tokenSymbol]; + const tokenContract = this.sChain1.erc20.tokens[this.tokenData.keyname]; const allowance = await tokenContract.methods.allowance( this.address, this.sChain1.erc20.address @@ -209,10 +64,10 @@ class ApproveERC20S extends Action { } -class TransferERC20S2S extends TransferAction { +export class TransferERC20S2S extends TransferAction { async execute() { const amountWei = toWei(this.sChain1.web3, this.amount, this.tokenData.decimals); - const destTokenContract = this.sChain2.erc20.tokens[this.tokenSymbol]; + const destTokenContract = this.sChain2.erc20.tokens[this.tokenData.keyname]; const balanceOnDestination = await this.sChain2.getERC20Balance(destTokenContract, this.address); const tx = await this.sChain1.erc20.transferToSchain( @@ -221,22 +76,23 @@ class TransferERC20S2S extends TransferAction { amountWei, { address: this.address } ); - // debug console.log('Transfer transaction done, waiting for money to be received'); + log('Transfer transaction done, waiting for tokens to be received'); + log(tx); await this.sChain2.waitERC20BalanceChange(destTokenContract, this.address, balanceOnDestination); - // debug console.log('Money to be received to destination chain'); + log('Tokens received to destination chain'); const unwrap = !!this.tokenData.unwrappedSymbol && this.tokenData.clone; externalEvents.transferComplete( tx, this.chainName1, this.chainName2, - this.tokenSymbol, + this.tokenData.keyname, unwrap ); } async preAction() { - const tokenContract = this.sChain1.erc20.tokens[this.tokenSymbol]; + const tokenContract = this.sChain1.erc20.tokens[this.tokenData.keyname]; const allowance = await tokenContract.methods.allowance( this.address, this.sChain1.erc20.address @@ -250,7 +106,7 @@ class TransferERC20S2S extends TransferAction { } -class ApproveWrapERC20S extends Action { +export class ApproveWrapERC20S extends Action { static label = 'Approve wrap' static buttonText = 'Approve all' static loadingText = 'Approving' @@ -278,7 +134,7 @@ class ApproveWrapERC20S extends Action { } -class WrapERC20S extends Action { +export class WrapERC20S extends Action { static label = 'Wrap' static buttonText = 'Wrap' static loadingText = 'Wrapping' @@ -286,7 +142,7 @@ class WrapERC20S extends Action { async execute() { const amountWei = toWei(this.sChain1.web3, this.amount, this.tokenData.decimals); await this.sChain1.erc20.wrap( - this.tokenSymbol, + this.tokenData.keyname, amountWei, { address: this.address } ); @@ -306,7 +162,7 @@ class WrapERC20S extends Action { } -class UnWrapERC20S extends Action { +export class UnWrapERC20S extends Action { static label = 'Unwrap' static buttonText = 'Unwrap' static loadingText = 'Unwrapping' @@ -315,31 +171,31 @@ class UnWrapERC20S extends Action { await this.switchMetamaskChain(); const amountWei = toWei(this.sChain2.web3, this.amount, this.tokenData.decimals); const tx = await this.sChain2.erc20.unwrap( - this.tokenSymbol, + this.tokenData.keyname, amountWei, { address: this.address } ); - externalEvents.unwrapComplete(tx, this.chainName2, this.tokenSymbol); + externalEvents.unwrapComplete(tx, this.chainName2, this.tokenData.keyname); } } -class ApproveERC20M extends Action { +export class ApproveERC20M extends Action { static label = 'Approve transfer' static buttonText = 'Approve all' static loadingText = 'Approving' async execute() { await this.mainnet.erc20.approve( - this.tokenSymbol, + this.tokenData.keyname, MAX_APPROVE_AMOUNT, { address: this.address } ); } async preAction() { - const tokenContract = this.mainnet.erc20.tokens[this.tokenSymbol]; + const tokenContract = this.mainnet.erc20.tokens[this.tokenData.keyname]; const allowance = await tokenContract.methods.allowance( this.address, this.mainnet.erc20.address @@ -352,36 +208,37 @@ class ApproveERC20M extends Action { } -class TransferERC20M2S extends TransferAction { +export class TransferERC20M2S extends TransferAction { async execute() { const amountWei = toWei(this.mainnet.web3, this.amount, this.tokenData.decimals); - const destTokenContract = this.sChain2.erc20.tokens[this.tokenSymbol]; + const destTokenContract = this.sChain2.erc20.tokens[this.tokenData.keyname]; const balanceOnDestination = await this.sChain2.getERC20Balance( destTokenContract, this.address ); const tx = await await this.mainnet.erc20.deposit( this.chainName2, - this.tokenSymbol, + this.tokenData.keyname, amountWei, { address: this.address } ); - log('Transfer transaction done, waiting for money to be received'); + log('Transfer transaction done, waiting for tokens to be received'); + log(tx); await this.sChain2.waitERC20BalanceChange(destTokenContract, this.address, balanceOnDestination); - log('Money to be received to destination chain'); + log('Tokens received to destination chain'); externalEvents.transferComplete( tx, this.chainName1, this.chainName2, - this.tokenSymbol, + this.tokenData.keyname, false ); } async preAction() { - const tokenContract = this.mainnet.erc20.tokens[this.tokenSymbol]; + const tokenContract = this.mainnet.erc20.tokens[this.tokenData.keyname]; const allowance = await tokenContract.methods.allowance( this.address, this.mainnet.erc20.address @@ -394,10 +251,10 @@ class TransferERC20M2S extends TransferAction { } -class TransferERC20S2M extends TransferAction { +export class TransferERC20S2M extends TransferAction { async execute() { const amountWei = toWei(this.sChain1.web3, this.amount, this.tokenData.decimals); - const destTokenContract = this.mainnet.erc20.tokens[this.tokenSymbol]; + const destTokenContract = this.mainnet.erc20.tokens[this.tokenData.keyname]; const balanceOnDestination = await this.mainnet.getERC20Balance(destTokenContract, this.address); const tx = await this.sChain1.erc20.withdraw( @@ -405,20 +262,21 @@ class TransferERC20S2M extends TransferAction { amountWei, { address: this.address } ); - log('Transfer transaction done, waiting for money to be received'); + log('Transfer transaction done, waiting for tokens to be received'); + log(tx); this.mainnet.waitERC20BalanceChange(destTokenContract, this.address, balanceOnDestination); - log('Money received on destination chain'); + log('Tokens received on destination chain'); externalEvents.transferComplete( tx, this.chainName1, this.chainName2, - this.tokenSymbol, + this.tokenData.keyname, false ); } async preAction() { - const tokenContract = this.sChain1.erc20.tokens[this.tokenSymbol]; + const tokenContract = this.sChain1.erc20.tokens[this.tokenData.keyname]; const allowance = await tokenContract.methods.allowance( this.address, this.sChain1.erc20.address @@ -429,34 +287,3 @@ class TransferERC20S2M extends TransferAction { } } } - - - -const wrapActions = [ApproveWrapERC20S, WrapERC20S]; -const unwrapActions = [UnWrapERC20S]; - - -export const actions = { - eth_m2s: [TransferEthM2S], - eth_s2m: [TransferEthS2M, UnlockEthM], - erc20_s2s: [ApproveERC20S, TransferERC20S2S], - erc20_m2s: [ApproveERC20M, TransferERC20M2S], - erc20_s2m: [ApproveERC20S, TransferERC20S2M], -} - - -export function getActionSteps( - actionName: string, - tokenData: TokenData -) { - const actionsList = []; - if (tokenData.unwrappedSymbol && !tokenData.clone) { - actionsList.push(...wrapActions); - } - actionsList.push(...actions[actionName]); - if (tokenData.unwrappedSymbol && tokenData.clone) { - actionsList.push(...unwrapActions); - } - return actionsList; -} - diff --git a/src/core/actions/erc721.ts b/src/core/actions/erc721.ts new file mode 100644 index 0000000..a605f54 --- /dev/null +++ b/src/core/actions/erc721.ts @@ -0,0 +1,225 @@ +/** + * @license + * SKALE Metaport + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/** + * @file erc721.ts + * @copyright SKALE Labs 2022-Present + */ + + +import debug from 'debug'; + +import { TokenType } from '../dataclasses/TokenType'; +import { externalEvents } from '../events'; +import { toWei, fromWei } from '../convertation'; +import { MAX_APPROVE_AMOUNT, ZERO_ADDRESS } from '../constants'; + +import { TransferAction, ApproveAction } from './action'; + + +debug.enable('*'); +const log = debug('metaport:actions:erc721'); + + +export class ApproveERC721M extends ApproveAction { + + isMeta(): boolean { + return this.tokenData.type === TokenType.erc721meta; + } + + async execute() { + this.isMeta() ? await this.mainnet.erc721meta.approve( + this.tokenData.keyname, + this.tokenId, + { address: this.address } + ) : await this.mainnet.erc721.approve( + this.tokenData.keyname, + this.tokenId, + { address: this.address } + ) + } + async preAction() { // TODO: optimize! - reuse this code + const tokenContract = this.isMeta() ? this.mainnet.erc721meta.tokens[this.tokenData.keyname] : this.mainnet.erc721.tokens[this.tokenData.keyname]; + if (!this.tokenId) { + this.setAmountErrorMessage(undefined); + return; + } + let approvedAddress: string; + try { + approvedAddress = await tokenContract.methods.getApproved(this.tokenId).call(); + log(`approvedAddress: ${approvedAddress}, address: ${this.address}`); + } catch (err) { + console.error(err); + this.setAmountErrorMessage('tokenId does not exist, try again'); + return + } + try { + const currentOwner = await this.mainnet.getERC721OwnerOf(tokenContract, this.tokenId); + if (currentOwner !== this.address) { + this.setAmountErrorMessage('This account is not an owner of this tokenId'); + return; + } + } catch (err) { + this.setAmountErrorMessage(err); + return; + } + this.setAmountErrorMessage(undefined); + if (approvedAddress === this.address) this.setActiveStep(1); + } +} + + +export class TransferERC721M2S extends TransferAction { + + isMeta(): boolean { return this.tokenData.type === TokenType.erc721meta; } + + async execute() { + const destTokenContract = this.isMeta() ? this.sChain2.erc721meta.tokens[this.tokenData.keyname] : this.sChain2.erc721.tokens[this.tokenData.keyname]; + const ownerOnDestination = await this.sChain2.getERC721OwnerOf( + destTokenContract, + this.tokenId + ); + const tx = this.isMeta() ? await this.mainnet.erc721meta.deposit( + this.chainName2, + this.tokenData.keyname, + this.tokenId, + { address: this.address } + ) : await this.mainnet.erc721.deposit( + this.chainName2, + this.tokenData.keyname, + this.tokenId, + { address: this.address } + ); + log('Transfer transaction done, waiting for token to be received'); + await this.sChain2.waitERC721OwnerChange( + destTokenContract, this.tokenId, ownerOnDestination); + log('Token received to destination chain'); + externalEvents.transferComplete( + tx, + this.chainName1, + this.chainName2, + this.tokenData.keyname, + false + ); + } + + async preAction() { + // const tokenContract = this.mainnet.erc20.tokens[this.tokenData.keyname]; + // const allowance = await tokenContract.methods.allowance( + // this.address, + // this.mainnet.erc20.address + // ).call(); + // const allowanceEther = fromWei(this.mainnet.web3, allowance, this.tokenData.decimals); + // if (Number(allowanceEther) < Number(this.amount) && this.amount !== '') { + // this.setActiveStep(0); + // } + } +} + + + +export class ApproveERC721S extends ApproveAction { + + isMeta(): boolean { return this.tokenData.type === TokenType.erc721meta; } + + async execute() { + this.isMeta() ? await this.sChain1.erc721meta.approve( + this.tokenData.keyname, + this.tokenId, + { address: this.address } + ) : await this.sChain1.erc721.approve( + this.tokenData.keyname, + this.tokenId, + { address: this.address } + ) + } + + async preAction() { // TODO: optimize! - reuse this code + const tokenContract = this.isMeta() ? this.sChain1.erc721meta.tokens[this.tokenData.keyname] : this.sChain1.erc721.tokens[this.tokenData.keyname]; + if (!this.tokenId) { + this.setAmountErrorMessage(undefined); + return; + } + let approvedAddress: string; + try { + approvedAddress = await tokenContract.methods.getApproved(this.tokenId).call(); + log(`approvedAddress: ${approvedAddress}, address: ${this.address}`); + } catch (err) { + console.error(err); + this.setAmountErrorMessage('tokenId does not exist, try again'); + return + } + try { + const currentOwner = await this.sChain1.getERC721OwnerOf(tokenContract, this.tokenId); + if (currentOwner !== this.address) { + this.setAmountErrorMessage('This account is not an owner of this tokenId'); + return; + } + } catch (err) { + this.setAmountErrorMessage(err); + return; + } + this.setAmountErrorMessage(undefined); + if (approvedAddress === this.address) this.setActiveStep(1); + } +} + + +export class TransferERC721S2M extends TransferAction { + isMeta(): boolean { return this.tokenData.type === TokenType.erc721meta; } + + async execute() { + const destTokenContract = this.isMeta() ? this.mainnet.erc721meta.tokens[this.tokenData.keyname] : this.mainnet.erc721.tokens[this.tokenData.keyname]; + const ownerOnDestination = await this.mainnet.getERC721OwnerOf( + destTokenContract, + this.tokenId + ); + const tx = this.isMeta() ? await this.sChain1.erc721meta.withdraw( + this.tokenData.cloneAddress, + this.tokenId, + { address: this.address } + ) : await this.sChain1.erc721.withdraw( + this.tokenData.cloneAddress, + this.tokenId, + { address: this.address } + ); + log('Transfer transaction done, waiting for token to be received'); + await this.mainnet.waitERC721OwnerChange( + destTokenContract, this.tokenId, ownerOnDestination); + log('Token received to destination chain'); + externalEvents.transferComplete( + tx, + this.chainName1, + this.chainName2, + this.tokenData.keyname, + false + ); + } + + async preAction() { + // const tokenContract = this.mainnet.erc20.tokens[this.tokenData.keyname]; + // const allowance = await tokenContract.methods.allowance( + // this.address, + // this.mainnet.erc20.address + // ).call(); + // const allowanceEther = fromWei(this.mainnet.web3, allowance, this.tokenData.decimals); + // if (Number(allowanceEther) < Number(this.amount) && this.amount !== '') { + // this.setActiveStep(0); + // } + } +} diff --git a/src/core/actions/eth.ts b/src/core/actions/eth.ts new file mode 100644 index 0000000..ea332ea --- /dev/null +++ b/src/core/actions/eth.ts @@ -0,0 +1,82 @@ +/** + * @license + * SKALE Metaport + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/** + * @file eth.ts + * @copyright SKALE Labs 2022-Present + */ + + +import debug from 'debug'; + +import { externalEvents } from '../events'; +import { toWei } from '../convertation'; +import { TransferAction, Action } from './action'; + + +debug.enable('*'); +const log = debug('metaport:actions:eth'); + + +export class TransferEthM2S extends TransferAction { + async execute() { + log('TransferEthM2S: started'); + const amountWei = toWei(this.mainnet.web3, this.amount, this.tokenData.decimals); + const sChainBalanceBefore = await this.sChain2.ethBalance(this.address); + const tx = await this.mainnet.eth.deposit( + this.chainName2, + { + address: this.address, + value: amountWei + } + ); + await this.sChain2.waitETHBalanceChange(this.address, sChainBalanceBefore); + externalEvents.transferComplete(tx, this.chainName1, this.chainName2, this.tokenData.keyname); + } +} + + +export class TransferEthS2M extends TransferAction { + async execute() { + log('TransferEthS2M: started'); + const amountWei = toWei(this.sChain1.web3, this.amount, this.tokenData.decimals); + const lockedETHAmount = await this.mainnet.eth.lockedETHAmount(this.address); + const tx = await this.sChain1.eth.withdraw( + amountWei, + { address: this.address } + ); + await this.mainnet.eth.waitLockedETHAmountChange(this.address, lockedETHAmount); + externalEvents.transferComplete(tx, this.chainName1, this.chainName2, this.tokenData.keyname); + } +} + + +export class UnlockEthM extends Action { + static label = 'Unlock ETH' + static buttonText = 'Unlock' + static loadingText = 'Unlocking' + + async execute() { + log('UnlockEthM: started'); + const tx = await this.mainnet.eth.getMyEth( + { address: this.address } + ); + externalEvents.ethUnlocked(tx); + } +} + diff --git a/src/core/actions/index.ts b/src/core/actions/index.ts new file mode 100644 index 0000000..df8b39f --- /dev/null +++ b/src/core/actions/index.ts @@ -0,0 +1,118 @@ +/** + * @license + * SKALE Metaport + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/** + * @file index.ts + * @copyright SKALE Labs 2022-Present + */ + +import debug from 'debug'; +import { + TransferEthM2S, + TransferEthS2M, + UnlockEthM +} from './eth'; +import { + ApproveERC20S, + TransferERC20S2S, + ApproveWrapERC20S, + WrapERC20S, + UnWrapERC20S, + ApproveERC20M, + TransferERC20M2S, + TransferERC20S2M +} from './erc20'; +import { + ApproveERC721M, + TransferERC721M2S, + ApproveERC721S, + TransferERC721S2M +} from './erc721'; +// import { } from './erc1155'; + +import { isMainnet } from '../helper'; +import TokenData from '../dataclasses/TokenData'; +import { + S2S_POSTFIX, + M2S_POSTFIX, + S2M_POSTFIX, +} from '../constants'; + + +debug.enable('*'); +const log = debug('metaport:actions'); + + +export function getActionName( + chainName1: string, + chainName2: string, + tokenData: TokenData +): string { + if (!chainName1 || !chainName2 || !tokenData) return; + log('Getting action name: ' + chainName1 + ' ' + chainName2 + ' ' + tokenData.symbol + ' (' + tokenData.type + ')'); + let prefix = tokenData.type; + let postfix = S2S_POSTFIX; + if (isMainnet(chainName1)) { postfix = M2S_POSTFIX; }; + if (isMainnet(chainName2)) { postfix = S2M_POSTFIX; }; + const actionName = prefix + '_' + postfix; + log('Action name: ' + actionName); + return actionName; +} + + +const wrapActions = [ApproveWrapERC20S, WrapERC20S]; +const unwrapActions = [UnWrapERC20S]; + + +export const ACTIONS = { + eth_m2s: [TransferEthM2S], + eth_s2m: [TransferEthS2M, UnlockEthM], + + erc20_s2s: [ApproveERC20S, TransferERC20S2S], + erc20_m2s: [ApproveERC20M, TransferERC20M2S], + erc20_s2m: [ApproveERC20S, TransferERC20S2M], + + erc721_m2s: [ApproveERC721M, TransferERC721M2S], + erc721_s2m: [ApproveERC721S, TransferERC721S2M], + erc721_s2s: [], + + erc721meta_m2s: [ApproveERC721M, TransferERC721M2S], + erc721meta_s2m: [ApproveERC721S, TransferERC721S2M], + erc721meta_s2s: [], + + erc1155_m2s: [], + erc1155_s2m: [], + erc1155_s2s: [] +} + + +export function getActionSteps( + actionName: string, + tokenData: TokenData +) { + log(`Getting action steps ${actionName}, ${tokenData.keyname}`); + const actionsList = []; + if (tokenData.unwrappedSymbol && !tokenData.clone) { + actionsList.push(...wrapActions); + } + actionsList.push(...ACTIONS[actionName]); + if (tokenData.unwrappedSymbol && tokenData.clone) { + actionsList.push(...unwrapActions); + } + return actionsList; +} diff --git a/src/core/constants.ts b/src/core/constants.ts index 8d0418a..129a611 100644 --- a/src/core/constants.ts +++ b/src/core/constants.ts @@ -22,12 +22,10 @@ */ export const MAINNET_CHAIN_NAME = 'mainnet'; -export const ETH_TOKEN_NAME = 'eth'; + export const ETH_ERC20_ADDRESS = '0xD2Aaa00700000000000000000000000000000000'; export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; -export const ETH_PREFIX = 'eth_'; -export const ERC20_PREFIX = 'erc20_'; export const M2S_POSTFIX = 'm2s'; export const S2M_POSTFIX = 's2m'; export const S2S_POSTFIX = 's2s'; diff --git a/src/core/core.ts b/src/core/core.ts index 920517f..1ece858 100644 --- a/src/core/core.ts +++ b/src/core/core.ts @@ -15,14 +15,32 @@ import { import erc20Abi from '../metadata/erc20_abi.json'; +import erc721Abi from '../metadata/erc721_abi.json'; +import erc721MetaAbi from '../metadata/erc721meta_abi.json'; +import erc1155Abi from '../metadata/erc1155_abi.json'; import erc20WrapperAbi from '../metadata/erc20_wrapper_abi.json'; import mainnetAddresses from '../metadata/addresses/mainnet.json'; import stagingAddresses from '../metadata/addresses/staging.json'; +import staging3Addresses from '../metadata/addresses/staging3.json'; import { MAINNET_CHAIN_NAME } from './constants'; +const ERC_ABIS = { + 'erc20': erc20Abi, + 'erc20wrap': erc20WrapperAbi, + 'erc721': erc721Abi, + 'erc721meta': erc721MetaAbi, + 'erc1155': erc1155Abi +} + + +export function initContract(tokenType: string, tokenAddress: string, web3: Web3) { + return new web3.eth.Contract(ERC_ABIS[tokenType].abi as AbiItem[], tokenAddress); +} + + export function initERC20(tokenAddress: string, web3: Web3) { return new web3.eth.Contract(erc20Abi.abi as AbiItem[], tokenAddress); } @@ -88,6 +106,9 @@ function getMainnetAbi(network: string) { if (network === 'staging') { return { ...mainnetAbi, ...stagingAddresses } } + if (network === 'staging3') { + return { ...mainnetAbi, ...staging3Addresses } + } return { ...mainnetAbi, ...mainnetAddresses } } diff --git a/src/core/dataclasses/EthTokenData.ts b/src/core/dataclasses/EthTokenData.ts new file mode 100644 index 0000000..bf0e191 --- /dev/null +++ b/src/core/dataclasses/EthTokenData.ts @@ -0,0 +1,44 @@ +/** + * @license + * SKALE Metaport + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/** + * @file EthTokenData.ts + * @copyright SKALE Labs 2022-Present + */ + +import { ETH_ERC20_ADDRESS } from '../constants'; +import { TokenType } from './TokenType'; +import TokenData from './TokenData'; + + +export default class EthTokenData extends TokenData { + constructor(clone: boolean) { + super( + ETH_ERC20_ADDRESS, + null, + TokenType.eth, + TokenType.eth, + clone, + null, + null, + TokenType.eth, + null, + null + ); + } +} \ No newline at end of file diff --git a/src/core/dataclasses/TokenData.ts b/src/core/dataclasses/TokenData.ts index fdcdf56..4112c39 100644 --- a/src/core/dataclasses/TokenData.ts +++ b/src/core/dataclasses/TokenData.ts @@ -21,7 +21,8 @@ * @copyright SKALE Labs 2022-Present */ -import { ETH_TOKEN_NAME, DEFAULT_ERC20_DECIMALS } from '../constants'; +import { DEFAULT_ERC20_DECIMALS } from '../constants'; +import { TokenType } from './TokenType'; export default class TokenData { @@ -30,18 +31,19 @@ export default class TokenData { name: string symbol: string + keyname: string clone: boolean - type: string - balance: number + type: TokenType + + balance: string iconUrl: string + decimals: string unwrappedSymbol: string unwrappedAddress: string - unwrappedBalance: number - - decimals: string + unwrappedBalance: string constructor( cloneAddress: string, @@ -50,23 +52,28 @@ export default class TokenData { symbol: string, clone: boolean, iconUrl: string, + decimals: string, + type: TokenType, unwrappedSymbol: string, unwrappedAddress: string, - decimals: string ) { this.cloneAddress = cloneAddress; this.originAddress = originAddress; - - this.unwrappedAddress = unwrappedAddress; - this.unwrappedSymbol = unwrappedSymbol; - this.name = name; this.symbol = symbol; this.clone = clone; this.iconUrl = iconUrl; - this.decimals = decimals ? decimals : DEFAULT_ERC20_DECIMALS; - this.type = (name === ETH_TOKEN_NAME) ? 'eth' : 'erc20' + this.type = type; + + this.keyname = getTokenKeyname(symbol, originAddress); + + this.unwrappedSymbol = unwrappedSymbol; + this.unwrappedAddress = unwrappedAddress; } } + +export function getTokenKeyname(symbol: string, originAddress: string): string { + return `_${symbol}_${originAddress}`; +} diff --git a/src/core/dataclasses/TokenType.ts b/src/core/dataclasses/TokenType.ts index c076eaf..9920285 100644 --- a/src/core/dataclasses/TokenType.ts +++ b/src/core/dataclasses/TokenType.ts @@ -23,9 +23,9 @@ export enum TokenType { - eth, - erc20, - erc721, - erc721meta, - erc1155 + eth = 'eth', + erc20 = 'erc20', + erc721 = 'erc721', + erc721meta = 'erc721meta', + erc1155 = 'erc1155' } \ No newline at end of file diff --git a/src/core/events.ts b/src/core/events.ts index 4dcbc96..a426473 100644 --- a/src/core/events.ts +++ b/src/core/events.ts @@ -21,10 +21,10 @@ * @copyright SKALE Labs 2022-Present */ - +import * as interfaces from './interfaces/index'; function dispatchEvent(name: string, data = {}) { - window.dispatchEvent(new CustomEvent(name, {detail: data})); + window.dispatchEvent(new CustomEvent(name, { detail: data })); // debug('event sent: ' + name); } @@ -85,12 +85,14 @@ export namespace internalEvents { }); } - export function transfer(params) { + export function transfer(transferParams: interfaces.TransferParams): void { dispatchEvent('_metaport_transfer', { - 'amount': params.amount, - 'schains': params.schains, - 'tokens': params.tokens, - 'lockAmount': params.lockAmount + 'amount': transferParams.amount, + 'tokenId': transferParams.tokenId, + 'chains': transferParams.chains, + 'tokenKeyname': transferParams.tokenKeyname, + 'tokenType': transferParams.tokenType, + 'lockAmount': transferParams.lockAmount }); } diff --git a/src/core/helper.ts b/src/core/helper.ts index 36865cd..a69fc76 100644 --- a/src/core/helper.ts +++ b/src/core/helper.ts @@ -21,6 +21,20 @@ * @copyright SKALE Labs 2022-Present */ + +import { MAINNET_CHAIN_NAME } from './constants'; + + export function clsNames(...args) { - return args.join(' '); -} \ No newline at end of file + return args.join(' '); +} + + +export function eqArrays(arr1, arr2) { + return JSON.stringify(arr1) === JSON.stringify(arr2); +} + + +export function isMainnet(chainName: string): boolean { + return chainName === MAINNET_CHAIN_NAME; +} diff --git a/src/core/interfaces/TokenDataMap.ts b/src/core/interfaces/TokenDataMap.ts index 7b79fe4..3abcb56 100644 --- a/src/core/interfaces/TokenDataMap.ts +++ b/src/core/interfaces/TokenDataMap.ts @@ -22,6 +22,18 @@ */ import TokenData from '../../core/dataclasses/TokenData'; +import EthTokenData from '../../core/dataclasses/EthTokenData'; +import { TokenType } from '../../core/dataclasses/TokenType'; + export interface TokenDataMap { [tokenSymbol: string]: TokenData; } -export interface TokenDataTypesMap { [tokenType: string]: TokenDataMap; } +export interface EthTokenDataMap { [tokenSymbol: string]: EthTokenData; } + + +export type TokenDataTypesMap = { + [TokenType.eth]: EthTokenDataMap + [TokenType.erc20]: TokenDataMap + [TokenType.erc721]: TokenDataMap + [TokenType.erc721meta]: TokenDataMap + [TokenType.erc1155]: TokenDataMap +} diff --git a/src/core/interfaces/Tokens.ts b/src/core/interfaces/Tokens.ts index 27d7211..ab89d2e 100644 --- a/src/core/interfaces/Tokens.ts +++ b/src/core/interfaces/Tokens.ts @@ -23,10 +23,17 @@ export interface Token { + symbol: string, + address: string, name?: string, - address?: string, iconUrl?: string, decimals?: string, + wraps?: WrapsData +} + +interface WrapsData { + symbol: string, + address: string } diff --git a/src/core/interfaces/TransferParams.ts b/src/core/interfaces/TransferParams.ts new file mode 100644 index 0000000..6f760b9 --- /dev/null +++ b/src/core/interfaces/TransferParams.ts @@ -0,0 +1,34 @@ +/** + * @license + * SKALE Metaport + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/** + * @file TransferParams.ts + * @copyright SKALE Labs 2022-Present + */ + +import { TokenType } from '../dataclasses/TokenType'; + + +export interface TransferParams { + tokenKeyname: string; + tokenType: TokenType; + amount?: string; + tokenId?: string; + chains?: string[]; + lockAmount?: boolean; +} \ No newline at end of file diff --git a/src/core/interfaces/index.ts b/src/core/interfaces/index.ts index 9443a11..3d6fc53 100644 --- a/src/core/interfaces/index.ts +++ b/src/core/interfaces/index.ts @@ -26,3 +26,4 @@ export * from "./ChainsMetadata"; export * from "./Theme"; export * from "./Tokens"; export * from "./TokenDataMap"; +export * from "./TransferParams"; diff --git a/src/core/tokens.ts b/src/core/tokens.ts deleted file mode 100644 index 84fd853..0000000 --- a/src/core/tokens.ts +++ /dev/null @@ -1,466 +0,0 @@ -/** - * @license - * SKALE Metaport - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -/** - * @file tokens.ts - * @copyright SKALE Labs 2022-Present - */ - -import debug from 'debug'; - -import { SChain, MainnetChain } from '@skalenetwork/ima-js'; - -import { ZERO_ADDRESS, ETH_TOKEN_NAME, MAINNET_CHAIN_NAME, ETH_ERC20_ADDRESS } from './constants'; -import { externalEvents } from './events'; -import { initERC20, initERC20Wrapper } from './core'; -import { isChainMainnet } from './actions'; -import TokenData from './dataclasses/TokenData'; -import { toWei, fromWei } from './convertation'; - - -debug.enable('*'); -const log = debug('metaport:tokens'); - - -export async function getAvailableTokens( - mainnet: MainnetChain, - sChain1: SChain, - sChain2: SChain, - chainName1: string, - chainName2: string, - tokens: object, - force: boolean, - autoLookup: boolean -) { - log('Collecting available tokens for ' + chainName1 + ' -> ' + chainName2); - const availableTokens = { 'erc20': {} }; - if (mainnet) { - const sChain = (chainName1 === MAINNET_CHAIN_NAME) ? sChain2 : sChain1; - const schainName = (chainName1 === MAINNET_CHAIN_NAME) ? chainName2 : chainName1; - if (autoLookup) { - log('Starting automatic lookup for M2S tokens...'); - await getM2STokensAutomatic( - mainnet, - sChain, - schainName, - availableTokens, - tokens - ); - } else { - log('Starting manual lookup for M2S tokens...'); - await getM2STokensManual( - mainnet, - sChain, - schainName, - availableTokens, - tokens - ); - } - } else { - log('Starting manual lookup for S2S tokens...'); - await getERC20Tokens( - sChain1, - sChain2, - chainName1, - chainName2, - tokens, - availableTokens, - force - ); - } - log('Adding ETH token...'); - await getETHToken( - mainnet, - sChain1, - sChain2, - chainName1, - chainName2, - tokens, - availableTokens - ); - return availableTokens; -} - - -async function getETHToken( - mainnet: MainnetChain, - sChain1: SChain, - sChain2: SChain, - chainName1: string, - chainName2: string, - tokens: object, - availableTokens: object -) { - if (tokens[MAINNET_CHAIN_NAME] && tokens[MAINNET_CHAIN_NAME][ETH_TOKEN_NAME]) { - if (chainName1 === MAINNET_CHAIN_NAME) { - availableTokens[ETH_TOKEN_NAME] = new TokenData( - ETH_ERC20_ADDRESS, - null, - ETH_TOKEN_NAME, - ETH_TOKEN_NAME, - false, - null, - null, - null, - null - ); - } - if (chainName2 === MAINNET_CHAIN_NAME) { - availableTokens[ETH_TOKEN_NAME] = new TokenData( - ETH_ERC20_ADDRESS, - null, - ETH_TOKEN_NAME, - ETH_TOKEN_NAME, - true, - null, - null, - null, - null - ); - } - } -} - - -async function getERC20Tokens( - sChain1: SChain, - sChain2: SChain, - chainName1: string, - chainName2: string, - tokens: object, - availableTokens: object, - force: boolean -) { - if (tokens[chainName1] && tokens[chainName1].erc20) { - for (const tokenSymbol in tokens[chainName1].erc20) { - if (tokens[chainName1].erc20.hasOwnProperty(tokenSymbol)) { - await addTokenData( - sChain1, - sChain2, - chainName1, - tokens[chainName1].erc20[tokenSymbol], - tokenSymbol, - availableTokens, - false, - force - ); - } - } - } - if (tokens[chainName2] && tokens[chainName2].erc20) { - for (const tokenSymbol in tokens[chainName2].erc20) { - if (tokens[chainName2].erc20.hasOwnProperty(tokenSymbol)) { - await addTokenData( - sChain1, - sChain2, - chainName2, - tokens[chainName2].erc20[tokenSymbol], - tokenSymbol, - availableTokens, - true, - force - ); - } - } - } -} - - -async function getM2STokensManual( - mainnet: MainnetChain, - sChain: SChain, - chainName: string, - availableTokens: any, - tokens: any -) { - if (tokens[MAINNET_CHAIN_NAME] && tokens[MAINNET_CHAIN_NAME].erc20) { - for (const tokenSymbol in tokens[MAINNET_CHAIN_NAME].erc20) { - if (tokens[MAINNET_CHAIN_NAME].erc20.hasOwnProperty(tokenSymbol)) { - const tokenInfo = tokens[MAINNET_CHAIN_NAME].erc20[tokenSymbol]; - const cloneAddress = await sChain.erc20.getTokenCloneAddress(tokenInfo.address); - if (cloneAddress === ZERO_ADDRESS) { continue; } - availableTokens.erc20[tokenSymbol] = new TokenData( - cloneAddress, - tokenInfo.address, - tokenInfo.name, - tokenSymbol, - false, - tokenInfo.iconUrl, - null, - null, - tokenInfo.decimals - ); - mainnet.erc20.addToken(tokenSymbol, initERC20(tokenInfo.address, mainnet.web3)); - sChain.erc20.addToken(tokenSymbol, initERC20(cloneAddress, sChain.web3)); - } - } - } -} - - - -async function getM2STokensAutomatic( - mainnet: MainnetChain, - sChain: SChain, - chainName: string, - availableTokens: any, - tokens: any -) { - log('Getting token pairs...'); - const erc20Len = await mainnet.erc20.getTokenMappingsLength(chainName); - - if (erc20Len === '0') { - log('No linked tokens, exiting.') - return; - } - - const erc20Tokens = await mainnet.erc20.getTokenMappings(chainName, 0, erc20Len); // todo: opt - log('Number of token pairs: ' + erc20Len); - for (const address of erc20Tokens) { - log('Adding contract: ' + address); - const tokenContract = initERC20(address, mainnet.web3); - log('Added contract: ' + address); - const symbol = await tokenContract.methods.symbol().call(); - let name = await tokenContract.methods.name().call(); - let decimals = await tokenContract.methods.decimals().call(); - const cloneAddress = await sChain.erc20.getTokenCloneAddress(address); - let tokenIcon: string; - - const key = '_' + symbol + '_' + address; - log('Adding token: ' + key); - - if (tokens[MAINNET_CHAIN_NAME] && tokens[MAINNET_CHAIN_NAME].erc20 && tokens[MAINNET_CHAIN_NAME].erc20[key]) { - tokenIcon = tokens[MAINNET_CHAIN_NAME].erc20[key].iconUrl; - decimals = tokens[MAINNET_CHAIN_NAME].erc20[key].decimals; - if (tokens[MAINNET_CHAIN_NAME].erc20[key].name) { - name = tokens[MAINNET_CHAIN_NAME].erc20[key].name - } - } - - if (chainName === MAINNET_CHAIN_NAME) { - availableTokens.erc20[key] = new TokenData( - cloneAddress, - address, - name, - symbol, - true, - tokenIcon, - null, - null, - decimals - ); - } else { - availableTokens.erc20[key] = new TokenData( - cloneAddress, - address, - name, - symbol, - false, - tokenIcon, - null, - null, - decimals - ); - } - mainnet.erc20.addToken(key, initERC20(address, mainnet.web3)); - sChain.erc20.addToken(key, initERC20(cloneAddress, sChain.web3)); - } -} - - -async function addTokenData( - sChain1: SChain, - sChain2: SChain, - sChainName: string, - token: any, - tokenSymbol: string, - availableTokens: any, - isClone: boolean, - force: boolean -) { - let cloneAddress; - if (sChain1 && isClone) { - cloneAddress = await getCloneAddress(sChain1, token.address, sChainName); - } - - if (sChain2 && !isClone) { - cloneAddress = await getCloneAddress(sChain2, token.address, sChainName);; - } - - if (!cloneAddress) return; - let unwrappedSymbol; - let unwrappedAddress; - if (token.wraps) { - unwrappedSymbol = token.wraps.symbol; - unwrappedAddress = token.wraps.address; - } - - availableTokens.erc20[tokenSymbol] = new TokenData( - cloneAddress, - token.address, - token.name, - tokenSymbol, - isClone, - token.iconUrl, - unwrappedSymbol, - unwrappedAddress, - token.decimals - ); - - addERC20TokenContracts( - sChain1, - sChain2, - tokenSymbol, - availableTokens.erc20[tokenSymbol], - force - ); -} - - -async function getCloneAddress( - sChain: SChain, - originTokenAddress: string, - originChainName: string -) { - const tokenCloneAddress = await sChain.erc20.getTokenCloneAddress( - originTokenAddress, - originChainName - ); - if (tokenCloneAddress === ZERO_ADDRESS) return; - return tokenCloneAddress; -} - - -function addERC20TokenContracts( - sChain1: SChain, - sChain2: SChain, - tokenSymbol: string, - tokenData: TokenData, - force: boolean -) { - const chain1Address = tokenData.clone ? tokenData.cloneAddress : tokenData.originAddress; - const chain2Address = tokenData.clone ? tokenData.originAddress : tokenData.cloneAddress; - - if (sChain1) { addERC20Token(sChain1, chain1Address, tokenSymbol, tokenData, force); }; - if (sChain2) { addERC20Token(sChain2, chain2Address, tokenSymbol, tokenData, force); }; -} - - -function addERC20Token( - sChain: SChain, - address: string, - tokenSymbol: string, - tokenData: TokenData, - force: boolean -) { - if (!sChain.erc20.tokens[tokenSymbol] && !force) { - if (tokenData.unwrappedSymbol) { - sChain.erc20.addToken( - tokenSymbol, - initERC20Wrapper(address, sChain.web3) - ); - sChain.erc20.addToken( - tokenData.unwrappedSymbol, - initERC20(tokenData.unwrappedAddress, sChain.web3) - ); - } else { - sChain.erc20.addToken(tokenSymbol, initERC20(address, sChain.web3)); - } - } -} - - -export async function getTokenBalance( - chainName: string, - chain: any, - tokenSymbol: string, - decimals: string, - address: string -): Promise { - const tokenContract = chain.erc20.tokens[tokenSymbol]; - const balance = await chain.getERC20Balance(tokenContract, address); - externalEvents.balance(tokenSymbol, chainName, balance); - return fromWei(chain.web3, balance, decimals); -} - - -export async function getEthBalance( - mainnet: MainnetChain, - sChain: SChain, - chainName: string, - address: string -) { - const ethBalance = isChainMainnet(chainName) ? await mainnet.ethBalance(address) : await sChain.ethBalance(address); - externalEvents.balance('eth', chainName, ethBalance); - return mainnet ? mainnet.web3.utils.fromWei(ethBalance) : sChain.web3.utils.fromWei(ethBalance); -} - - -export async function getTokenBalances( - tokens: any, - chainName: string, - mainnet: MainnetChain, - sChain1: SChain, - sChain2: SChain, - tokenSymbol: string, - address: string -) { - log('Getting token balances...'); - for (const [symbol, tokenData] of Object.entries(tokens.erc20)) { - const td = (tokenData as TokenData); - if (chainName === MAINNET_CHAIN_NAME) { - const balance = await getTokenBalance( - chainName, - mainnet, - symbol, - td.decimals, - address - ); - tokens.erc20[symbol].balance = balance; - } else { - const balance = await getTokenBalance( - chainName, - sChain1, - symbol, - td.decimals, - address - ); - tokens.erc20[symbol].balance = balance; - if (tokens.erc20[symbol].unwrappedSymbol && !tokens.erc20[symbol].clone) { - const wBalance = await getTokenBalance( - chainName, - sChain1, - tokens.erc20[symbol].unwrappedSymbol, - td.decimals, - address - ); - tokens.erc20[symbol].unwrappedBalance = wBalance; - } - } - } - if (tokens.eth) { - tokens.eth.balance = await getEthBalance( - mainnet, - sChain1, - chainName, - address - ); - }; - log('tokens with balances:'); - log(tokens); -} diff --git a/src/core/tokens/erc20.ts b/src/core/tokens/erc20.ts new file mode 100644 index 0000000..c4d0c61 --- /dev/null +++ b/src/core/tokens/erc20.ts @@ -0,0 +1,91 @@ +/** + * @license + * SKALE Metaport + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/** + * @file erc20.ts + * @copyright SKALE Labs 2022-Present + */ + +import debug from 'debug'; + +import { SChain, MainnetChain } from '@skalenetwork/ima-js'; + +import { externalEvents } from '../events'; +import { MAINNET_CHAIN_NAME } from '../constants'; +import * as interfaces from '../interfaces/index'; +import { fromWei } from '../convertation'; + + +debug.enable('*'); +const log = debug('metaport:tokens:erc20'); + + +export async function updateERC20TokenBalances( + availableTokens: interfaces.TokenDataTypesMap, + chainName: string, + mainnet: MainnetChain, + sChain1: SChain, + address: string +): Promise { + log('Getting ERC20 token balances...'); + for (const [symbol, tokenData] of Object.entries(availableTokens.erc20)) { + if (chainName === MAINNET_CHAIN_NAME) { + const balance = await getTokenBalance( + chainName, + mainnet, + symbol, + tokenData.decimals, + address + ); + availableTokens.erc20[symbol].balance = balance; + } else { + const balance = await getTokenBalance( + chainName, + sChain1, + symbol, + tokenData.decimals, + address + ); + availableTokens.erc20[symbol].balance = balance; + if (availableTokens.erc20[symbol].unwrappedSymbol && !availableTokens.erc20[symbol].clone) { + const wBalance = await getTokenBalance( + chainName, + sChain1, + availableTokens.erc20[symbol].unwrappedSymbol, + tokenData.decimals, + address + ); + availableTokens.erc20[symbol].unwrappedBalance = wBalance; + } + } + } +} + + +export async function getTokenBalance( + chainName: string, + chain: any, + tokenSymbol: string, + decimals: string, + address: string +): Promise { + const tokenContract = chain.erc20.tokens[tokenSymbol]; + const balance = await chain.getERC20Balance(tokenContract, address); + externalEvents.balance(tokenSymbol, chainName, balance); + return fromWei(chain.web3, balance, decimals); +} diff --git a/src/core/tokens/eth.ts b/src/core/tokens/eth.ts new file mode 100644 index 0000000..1d403c4 --- /dev/null +++ b/src/core/tokens/eth.ts @@ -0,0 +1,75 @@ +/** + * @license + * SKALE Metaport + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/** + * @file eth.ts + * @copyright SKALE Labs 2022-Present + */ + + +import debug from 'debug'; + +import { SChain, MainnetChain } from '@skalenetwork/ima-js'; + +import { isMainnet } from '../helper'; +import { externalEvents } from '../events'; + +import EthTokenData from '../dataclasses/EthTokenData'; +import { TokenType } from '../dataclasses/TokenType'; +import * as interfaces from '../interfaces/index'; +import { MAINNET_CHAIN_NAME } from '../constants'; + + +debug.enable('*'); +const log = debug('metaport:tokens:eth'); + + +function ethInConfig(configTokens: interfaces.TokensMap): boolean { + return configTokens[MAINNET_CHAIN_NAME] !== undefined && configTokens[MAINNET_CHAIN_NAME].eth !== undefined; +} + + +export async function addETHToken( + chainName1: string, + chainName2: string, + configTokens: interfaces.TokensMap, + availableTokens: interfaces.TokenDataTypesMap +): Promise { + log('Checking ETH in the configTokens'); + if (!ethInConfig(configTokens)) return; + log('Adding ETH to token list'); + if (chainName1 === MAINNET_CHAIN_NAME) { + availableTokens[TokenType.eth][TokenType.eth] = new EthTokenData(false); + } + if (chainName2 === MAINNET_CHAIN_NAME) { + availableTokens[TokenType.eth][TokenType.eth] = new EthTokenData(true); + } +} + + +export async function getEthBalance( + mainnet: MainnetChain, + sChain: SChain, + chainName: string, + address: string +) { + const ethBalance = isMainnet(chainName) ? await mainnet.ethBalance(address) : await sChain.ethBalance(address); + log('ETH balance for ' + address + ': ' + ethBalance + ' wei'); + externalEvents.balance('eth', chainName, ethBalance); + return mainnet ? mainnet.web3.utils.fromWei(ethBalance) : sChain.web3.utils.fromWei(ethBalance); +} \ No newline at end of file diff --git a/src/core/tokens/helper.ts b/src/core/tokens/helper.ts new file mode 100644 index 0000000..c445e06 --- /dev/null +++ b/src/core/tokens/helper.ts @@ -0,0 +1,53 @@ +/** + * @license + * SKALE Metaport + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/** + * @file helper.ts + * @copyright SKALE Labs 2022-Present + */ + +import TokenData from '../dataclasses/TokenData'; +import * as interfaces from '../interfaces/index'; + +import { eqArrays } from '../helper'; + + +export function getEmptyTokenDataMap(): interfaces.TokenDataTypesMap { + return { eth: {}, erc20: {}, erc721: {}, erc721meta: {}, erc1155: {} }; +} + + +export function getAvailableTokenNumers(availableTokens): number[] { + return Object.entries(availableTokens).map(([key, value]) => Object.entries(value).length); +} + + +export function getAvailableTokensTotal(availableTokens): number { + return getAvailableTokenNumers(availableTokens).reduce((a, b) => a + b, 0); +} + + +export function getDefaultToken(availableTokens: interfaces.TokenDataTypesMap): TokenData { + if (availableTokens === undefined) return; + const availableTokenNumers = getAvailableTokenNumers(availableTokens); + if (eqArrays(availableTokenNumers, [1, 0, 0, 0, 0])) return availableTokens.eth.eth; + if (eqArrays(availableTokenNumers, [0, 1, 0, 0, 0])) return Object.values(availableTokens.erc20)[0]; + if (eqArrays(availableTokenNumers, [0, 0, 1, 0, 0])) return Object.values(availableTokens.erc721)[0]; + if (eqArrays(availableTokenNumers, [0, 0, 0, 1, 0])) return Object.values(availableTokens.erc721meta)[0]; + if (eqArrays(availableTokenNumers, [0, 0, 0, 0, 1])) return Object.values(availableTokens.erc1155)[0]; +} diff --git a/src/core/tokens/index.ts b/src/core/tokens/index.ts new file mode 100644 index 0000000..2ad12a9 --- /dev/null +++ b/src/core/tokens/index.ts @@ -0,0 +1,114 @@ +/** + * @license + * SKALE Metaport + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/** + * @file index.ts + * @copyright SKALE Labs 2022-Present + */ + +import debug from 'debug'; + +import { SChain, MainnetChain } from '@skalenetwork/ima-js'; + +import { addETHToken, getEthBalance } from './eth'; +import { updateERC20TokenBalances } from './erc20'; +import { addM2STokens } from './m2s'; +import { addS2STokens } from './s2s'; + +import { isMainnet } from '../helper'; +import { getEmptyTokenDataMap } from './helper'; + +import * as interfaces from '../interfaces/index'; + + +debug.enable('*'); +const log = debug('metaport:tokens'); + + +export async function getAvailableTokens( + mainnet: MainnetChain, + sChain1: SChain, + sChain2: SChain, + chainName1: string, + chainName2: string, + configTokens: interfaces.TokensMap, + force: boolean, + autoLookup: boolean +): Promise { + log('Collecting available tokens for ' + chainName1 + ' → ' + chainName2); + const availableTokens = getEmptyTokenDataMap(); + log('Adding ETH to availableTokens'); + await addETHToken( + chainName1, + chainName2, + configTokens, + availableTokens + ); + if (isMainnet(chainName1) || isMainnet(chainName2)) { + log('Going to add M2S ERC20 tokens') + const sChain = isMainnet(chainName1) ? sChain2 : sChain1; + const schainName = isMainnet(chainName1) ? chainName2 : chainName1; + await addM2STokens( + mainnet, + sChain, + schainName, + configTokens, + availableTokens, + autoLookup + ); + } else { + await addS2STokens( + sChain1, + sChain2, + chainName1, + chainName2, + configTokens, + availableTokens, + force + ); + } + log('availableTokens'); + log(availableTokens); + return availableTokens; +} + + +export async function getTokenBalances( + availableTokens: interfaces.TokenDataTypesMap, + chainName: string, + mainnet: MainnetChain, + sChain1: SChain, + address: string +) { + log('Getting token balances...'); + if (availableTokens.eth && availableTokens.eth.eth) { + availableTokens.eth.eth.balance = await getEthBalance( + mainnet, + sChain1, + chainName, + address + ); + }; + await updateERC20TokenBalances( + availableTokens, + chainName, + mainnet, + sChain1, + address + ); +} \ No newline at end of file diff --git a/src/core/tokens/m2s.ts b/src/core/tokens/m2s.ts new file mode 100644 index 0000000..768508c --- /dev/null +++ b/src/core/tokens/m2s.ts @@ -0,0 +1,197 @@ +/** + * @license + * SKALE Metaport + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/** + * @file m2s.ts + * @copyright SKALE Labs 2022-Present + */ + + +import debug from 'debug'; + +import { SChain, MainnetChain } from '@skalenetwork/ima-js'; + +import { initContract } from '../core'; + +import * as interfaces from '../interfaces/index'; +import { TokenType } from '../dataclasses/TokenType'; +import TokenData, { getTokenKeyname } from '../dataclasses/TokenData'; +import { MAINNET_CHAIN_NAME, ZERO_ADDRESS } from '../constants'; +import { isMainnet } from '../helper'; + + +debug.enable('*'); +const log = debug('metaport:tokens:m2s'); + + +export async function addM2STokens( + mainnet: MainnetChain, + sChain: SChain, + schainName: string, + configTokens: interfaces.TokensMap, + availableTokens: interfaces.TokenDataTypesMap, + autoLookup: boolean +): Promise { + autoLookup ? await getM2STokensAutomatic( + mainnet, + sChain, + schainName, + configTokens, + availableTokens + ) : await getM2STokensManual( + mainnet, + sChain, + configTokens, + availableTokens + ); +} + + +async function getM2STokensAutomatic( + mainnet: MainnetChain, + sChain: SChain, + schainName: string, + configTokens: interfaces.TokensMap, + availableTokens: interfaces.TokenDataTypesMap +): Promise { + log('Starting automatic lookup for M2S tokens...'); + for (let tokenType in TokenType) { + await addM2STokensAutomatic( + tokenType, + mainnet, + sChain, + schainName, + configTokens, + availableTokens + ) + } +} + + +async function addM2STokensAutomatic( + tokenType: string, + mainnet: MainnetChain, + sChain: SChain, + destChainName: string, + configTokens: interfaces.TokensMap, + availableTokens: interfaces.TokenDataTypesMap +): Promise { + if (tokenType === TokenType.eth) return; + log(`Getting token pairs: ${tokenType}`); + const len = await mainnet[tokenType].getTokenMappingsLength(destChainName); + log(`Number of ${tokenType} token pairs: ${len}`); + if (len === '0') { + log('No linked tokens, exiting.') + return; + } + const tokenAddresses = await mainnet[tokenType].getTokenMappings( + destChainName, + 0, + len + ); // todo: optimize + for (const address of tokenAddresses) { + log(`Adding contract: ${address}`); + const contract = initContract(tokenType, address, mainnet.web3); + + const symbol = await contract.methods.symbol().call(); + const isClone = isMainnet(destChainName); + let name = await contract.methods.name().call(); + + let decimals: string; + let tokenIcon: string; + + if (tokenType === TokenType.erc20) { + decimals = await contract.methods.decimals().call(); + } + + const cloneAddress = await sChain[tokenType].getTokenCloneAddress(address); + + const key = getTokenKeyname(symbol, address); + log('Adding token: ' + key); + + const tokenData = new TokenData( + cloneAddress, + address, + name, + symbol, + isClone, + tokenIcon, + decimals, + tokenType as TokenType, + null, + null + ); + availableTokens[tokenType][key] = overrideTokenDataFromConfig(configTokens, tokenData, tokenType); + mainnet[tokenType].addToken(key, contract); + sChain[tokenType].addToken(key, initContract(tokenType, cloneAddress, sChain.web3)); + } +} + +function overrideTokenDataFromConfig( + configTokens: interfaces.TokensMap, + tokenData: TokenData, + tokenType: string +): TokenData { + if (!configTokens[MAINNET_CHAIN_NAME] || !configTokens[MAINNET_CHAIN_NAME][tokenType] || !configTokens[MAINNET_CHAIN_NAME][tokenType][tokenData.keyname]) return tokenData; + const configTokenData = configTokens[MAINNET_CHAIN_NAME][tokenType][tokenData.keyname]; + log(`Overriding token data from config ${tokenData.keyname}: ${configTokenData}`); + tokenData.iconUrl = configTokenData.iconUrl ? configTokenData.iconUrl : tokenData.iconUrl; + tokenData.decimals = configTokenData.decimals ? configTokenData.decimals : tokenData.decimals; + tokenData.name = configTokenData.name ? configTokenData.name : tokenData.name; + tokenData.symbol = configTokenData.symbol ? configTokenData.symbol : tokenData.symbol; + return tokenData; +} + + +async function getM2STokensManual( + mainnet: MainnetChain, + sChain: SChain, + configTokens: interfaces.TokensMap, + availableTokens: interfaces.TokenDataTypesMap +): Promise { + log('Starting manual lookup for M2S tokens...'); + if (!configTokens[MAINNET_CHAIN_NAME]) return; + for (const tokenType in configTokens[MAINNET_CHAIN_NAME]) { + log(`Adding tokens for tokenType ${tokenType}`); + for (const tokenSymbol in configTokens[MAINNET_CHAIN_NAME][tokenType]) { + const tokenInfo = configTokens[MAINNET_CHAIN_NAME][tokenType][tokenSymbol]; + const cloneAddress = await sChain[tokenType].getTokenCloneAddress(tokenInfo.address); + const tokenKeyname = getTokenKeyname(tokenInfo.symbol, tokenInfo.address); + if (cloneAddress === ZERO_ADDRESS) { + log(`No token clone for ${tokenInfo.address}, skipping`); + continue; + } + + log(`Adding token: ${tokenKeyname}`); + availableTokens[tokenType][tokenKeyname] = new TokenData( + cloneAddress, + tokenInfo.address, + tokenInfo.name, + tokenInfo.symbol, + false, + tokenInfo.iconUrl, + tokenInfo.decimals, + tokenType as TokenType, + null, + null + ); + mainnet[tokenType].addToken(tokenKeyname, initContract(tokenType, tokenInfo.address, mainnet.web3)); + sChain[tokenType].addToken(tokenKeyname, initContract(tokenType, cloneAddress, sChain.web3)); + } + } +} \ No newline at end of file diff --git a/src/core/tokens/s2s.ts b/src/core/tokens/s2s.ts new file mode 100644 index 0000000..2e49bf1 --- /dev/null +++ b/src/core/tokens/s2s.ts @@ -0,0 +1,209 @@ +/** + * @license + * SKALE Metaport + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/** + * @file s2s.ts + * @copyright SKALE Labs 2022-Present + */ + + +import debug from 'debug'; + +import { SChain, MainnetChain } from '@skalenetwork/ima-js'; + + +import { initContract } from '../core'; + +import { addETHToken, getEthBalance } from './eth'; + +import * as interfaces from '../interfaces/index'; +import { TokenType } from '../dataclasses/TokenType'; +import TokenData, { getTokenKeyname } from '../dataclasses/TokenData'; +import { MAINNET_CHAIN_NAME, ZERO_ADDRESS } from '../constants'; +import { eqArrays, isMainnet } from '../helper'; + + +debug.enable('*'); +const log = debug('metaport:tokens:s2s'); + + +export async function addS2STokens( + sChain1: SChain, + sChain2: SChain, + chainName1: string, + chainName2: string, + configTokens: interfaces.TokensMap, + availableTokens: interfaces.TokenDataTypesMap, + force: boolean +): Promise { + log('Add S2S Tokens'); + await collectS2STokens( + sChain1, + sChain2, + chainName1, + configTokens, + availableTokens, + force, + false + ); + await collectS2STokens( + sChain1, + sChain2, + chainName2, + configTokens, + availableTokens, + force, + true + ); +} + + +async function collectS2STokens( + sChain1: SChain, + sChain2: SChain, + chainName: string, + configTokens: interfaces.TokensMap, + availableTokens: interfaces.TokenDataTypesMap, + force: boolean, + isClone: boolean +): Promise { + if (!configTokens[chainName]) return; + for (const tokenType in configTokens[chainName]) { + log(`Adding tokens for tokenType ${tokenType}`); + for (const tokenKeyname in configTokens[chainName][tokenType]) { + await addTokenData( + sChain1, + sChain2, + chainName, + configTokens[chainName][tokenType][tokenKeyname], + availableTokens, + isClone, + force, + tokenType as TokenType + ); + } + } +} + + +async function addTokenData( + sChain1: SChain, + sChain2: SChain, + sChainName: string, + configToken: interfaces.Token, + availableTokens: interfaces.TokenDataTypesMap, + isClone: boolean, + force: boolean, + tokenType: TokenType +): Promise { + let cloneAddress = await getCloneAddress( + isClone ? sChain1 : sChain2, + configToken.address, + sChainName, + tokenType + ); + if (!cloneAddress) { + log(`No token clone for ${configToken.address}, skipping`); + return; + } + let unwrappedSymbol; + let unwrappedAddress; + if (configToken.wraps) { + unwrappedSymbol = configToken.wraps.symbol; + unwrappedAddress = configToken.wraps.address; + } + + const tokenKeyname = getTokenKeyname(configToken.symbol, configToken.address); + availableTokens[tokenType][tokenKeyname] = new TokenData( + cloneAddress, + configToken.address, + configToken.name, + configToken.symbol, + isClone, + configToken.iconUrl, + configToken.decimals, + tokenType, + unwrappedSymbol, + unwrappedAddress + ); + + addTokenContracts( + sChain1, + sChain2, + tokenKeyname, + availableTokens[tokenType][tokenKeyname], + force, + tokenType + ); +} + + +async function getCloneAddress( + sChain: SChain, + originTokenAddress: string, + originChainName: string, + tokenType: TokenType +): Promise { + const tokenCloneAddress = await sChain[tokenType].getTokenCloneAddress( + originTokenAddress, + originChainName + ); + if (tokenCloneAddress === ZERO_ADDRESS) return; + return tokenCloneAddress; +} + + +function addTokenContracts( + sChain1: SChain, + sChain2: SChain, + tokenKeyname: string, + tokenData: TokenData, + force: boolean, + tokenType: TokenType +) { + const chain1Address = tokenData.clone ? tokenData.cloneAddress : tokenData.originAddress; + const chain2Address = tokenData.clone ? tokenData.originAddress : tokenData.cloneAddress; + + if (sChain1) { addToken(sChain1, chain1Address, tokenKeyname, tokenData, force, tokenType); }; + if (sChain2) { addToken(sChain2, chain2Address, tokenKeyname, tokenData, force, tokenType); }; +} + + +function addToken( + sChain: SChain, + address: string, + tokenSymbol: string, + tokenData: TokenData, + force: boolean, + tokenType: TokenType +) { + if (!sChain[tokenType].tokens[tokenSymbol] && !force) { + if (tokenData.unwrappedSymbol) { + sChain[tokenType].addToken( + tokenSymbol, + initContract('erc20wrap', address, sChain.web3) + ); + sChain[tokenType].addToken( + tokenData.unwrappedSymbol, + initContract(tokenType, tokenData.unwrappedAddress, sChain.web3) + ); + } else { + sChain[tokenType].addToken(tokenSymbol, initContract(tokenType, address, sChain.web3)); + } + } +} diff --git a/src/metadata/addresses/staging3.json b/src/metadata/addresses/staging3.json new file mode 100644 index 0000000..ef115e5 --- /dev/null +++ b/src/metadata/addresses/staging3.json @@ -0,0 +1,10 @@ +{ + "message_proxy_mainnet_address": "0x08913E0DC2BA60A1626655581f701bCa84f42324", + "linker_address": "0xd081AC47D26baE9c07320AdB83867da28678959E", + "community_pool_address": "0x4957cF98336C0911E42100C8839dCd65DdDe88C9", + "deposit_box_eth_address": "0xD0C9019c517A6CEbb86527fd52F2bDD4Dc6A94Dd", + "deposit_box_erc20_address": "0x2F4B31e661955d41bd6ab5530b117758C26C8159", + "deposit_box_erc721_address": "0x3B1425c6EfD383BAA53F607DD43e5593c4DeBf8f", + "deposit_box_erc1155_address": "0x29DF2117459Dd2c692A1E86DE90371fBc0E3EC76", + "deposit_box_erc721_with_metadata_address": "0x01dd5b9a147c03336F37b7857248d9CDF27661e8" +} \ No newline at end of file diff --git a/src/metadata/erc1155_abi.json b/src/metadata/erc1155_abi.json new file mode 100644 index 0000000..a678e7d --- /dev/null +++ b/src/metadata/erc1155_abi.json @@ -0,0 +1,620 @@ +{ + "abi": [ + { + "type": "constructor", + "payable": false, + "inputs": [ + { + "type": "string", + "name": "uri" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "ApprovalForAll", + "inputs": [ + { + "type": "address", + "name": "account", + "indexed": true + }, + { + "type": "address", + "name": "operator", + "indexed": true + }, + { + "type": "bool", + "name": "approved", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "RoleAdminChanged", + "inputs": [ + { + "type": "bytes32", + "name": "role", + "indexed": true + }, + { + "type": "bytes32", + "name": "previousAdminRole", + "indexed": true + }, + { + "type": "bytes32", + "name": "newAdminRole", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "RoleGranted", + "inputs": [ + { + "type": "bytes32", + "name": "role", + "indexed": true + }, + { + "type": "address", + "name": "account", + "indexed": true + }, + { + "type": "address", + "name": "sender", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "RoleRevoked", + "inputs": [ + { + "type": "bytes32", + "name": "role", + "indexed": true + }, + { + "type": "address", + "name": "account", + "indexed": true + }, + { + "type": "address", + "name": "sender", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "TransferBatch", + "inputs": [ + { + "type": "address", + "name": "operator", + "indexed": true + }, + { + "type": "address", + "name": "from", + "indexed": true + }, + { + "type": "address", + "name": "to", + "indexed": true + }, + { + "type": "uint256[]", + "name": "ids", + "indexed": false + }, + { + "type": "uint256[]", + "name": "values", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "TransferSingle", + "inputs": [ + { + "type": "address", + "name": "operator", + "indexed": true + }, + { + "type": "address", + "name": "from", + "indexed": true + }, + { + "type": "address", + "name": "to", + "indexed": true + }, + { + "type": "uint256", + "name": "id", + "indexed": false + }, + { + "type": "uint256", + "name": "value", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "URI", + "inputs": [ + { + "type": "string", + "name": "value", + "indexed": false + }, + { + "type": "uint256", + "name": "id", + "indexed": true + } + ] + }, + { + "type": "function", + "name": "DEFAULT_ADMIN_ROLE", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bytes32", + "name": "" + } + ] + }, + { + "type": "function", + "name": "MINTER_ROLE", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bytes32", + "name": "" + } + ] + }, + { + "type": "function", + "name": "balanceOf", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "account" + }, + { + "type": "uint256", + "name": "id" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "balanceOfBatch", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address[]", + "name": "accounts" + }, + { + "type": "uint256[]", + "name": "ids" + } + ], + "outputs": [ + { + "type": "uint256[]", + "name": "" + } + ] + }, + { + "type": "function", + "name": "burn", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "account" + }, + { + "type": "uint256", + "name": "id" + }, + { + "type": "uint256", + "name": "value" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "burnBatch", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "account" + }, + { + "type": "uint256[]", + "name": "ids" + }, + { + "type": "uint256[]", + "name": "values" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "getRoleAdmin", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "role" + } + ], + "outputs": [ + { + "type": "bytes32", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getRoleMember", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "role" + }, + { + "type": "uint256", + "name": "index" + } + ], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getRoleMemberCount", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "role" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "grantRole", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "role" + }, + { + "type": "address", + "name": "account" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "hasRole", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "role" + }, + { + "type": "address", + "name": "account" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "isApprovedForAll", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "account" + }, + { + "type": "address", + "name": "operator" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "mint", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "account" + }, + { + "type": "uint256", + "name": "id" + }, + { + "type": "uint256", + "name": "amount" + }, + { + "type": "bytes", + "name": "data" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "mintBatch", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "account" + }, + { + "type": "uint256[]", + "name": "ids" + }, + { + "type": "uint256[]", + "name": "amounts" + }, + { + "type": "bytes", + "name": "data" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "renounceRole", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "role" + }, + { + "type": "address", + "name": "account" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "revokeRole", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "role" + }, + { + "type": "address", + "name": "account" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "safeBatchTransferFrom", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "from" + }, + { + "type": "address", + "name": "to" + }, + { + "type": "uint256[]", + "name": "ids" + }, + { + "type": "uint256[]", + "name": "amounts" + }, + { + "type": "bytes", + "name": "data" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "safeTransferFrom", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "from" + }, + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "id" + }, + { + "type": "uint256", + "name": "amount" + }, + { + "type": "bytes", + "name": "data" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setApprovalForAll", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "operator" + }, + { + "type": "bool", + "name": "approved" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "supportsInterface", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes4", + "name": "interfaceId" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "uri", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "" + } + ], + "outputs": [ + { + "type": "string", + "name": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/metadata/erc721_abi.json b/src/metadata/erc721_abi.json index 132e5cd..869ac20 100644 --- a/src/metadata/erc721_abi.json +++ b/src/metadata/erc721_abi.json @@ -591,5 +591,5 @@ ], "outputs": [] } - ] -} + ] +} \ No newline at end of file diff --git a/src/metadata/erc721meta_abi.json b/src/metadata/erc721meta_abi.json new file mode 100644 index 0000000..b96ad73 --- /dev/null +++ b/src/metadata/erc721meta_abi.json @@ -0,0 +1,617 @@ +{ + "abi": [ + { + "type": "constructor", + "payable": false, + "inputs": [ + { + "type": "string", + "name": "contractName" + }, + { + "type": "string", + "name": "contractSymbol" + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "Approval", + "inputs": [ + { + "type": "address", + "name": "owner", + "indexed": true + }, + { + "type": "address", + "name": "approved", + "indexed": true + }, + { + "type": "uint256", + "name": "tokenId", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "ApprovalForAll", + "inputs": [ + { + "type": "address", + "name": "owner", + "indexed": true + }, + { + "type": "address", + "name": "operator", + "indexed": true + }, + { + "type": "bool", + "name": "approved", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "RoleAdminChanged", + "inputs": [ + { + "type": "bytes32", + "name": "role", + "indexed": true + }, + { + "type": "bytes32", + "name": "previousAdminRole", + "indexed": true + }, + { + "type": "bytes32", + "name": "newAdminRole", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "RoleGranted", + "inputs": [ + { + "type": "bytes32", + "name": "role", + "indexed": true + }, + { + "type": "address", + "name": "account", + "indexed": true + }, + { + "type": "address", + "name": "sender", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "RoleRevoked", + "inputs": [ + { + "type": "bytes32", + "name": "role", + "indexed": true + }, + { + "type": "address", + "name": "account", + "indexed": true + }, + { + "type": "address", + "name": "sender", + "indexed": true + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "Transfer", + "inputs": [ + { + "type": "address", + "name": "from", + "indexed": true + }, + { + "type": "address", + "name": "to", + "indexed": true + }, + { + "type": "uint256", + "name": "tokenId", + "indexed": true + } + ] + }, + { + "type": "function", + "name": "DEFAULT_ADMIN_ROLE", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bytes32", + "name": "" + } + ] + }, + { + "type": "function", + "name": "MINTER_ROLE", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bytes32", + "name": "" + } + ] + }, + { + "type": "function", + "name": "approve", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "balanceOf", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "owner" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "burn", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "getApproved", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getRoleAdmin", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "role" + } + ], + "outputs": [ + { + "type": "bytes32", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getRoleMember", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "role" + }, + { + "type": "uint256", + "name": "index" + } + ], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getRoleMemberCount", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "role" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "grantRole", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "role" + }, + { + "type": "address", + "name": "account" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "hasRole", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "role" + }, + { + "type": "address", + "name": "account" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "isApprovedForAll", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "owner" + }, + { + "type": "address", + "name": "operator" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "mint", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "name", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "string", + "name": "" + } + ] + }, + { + "type": "function", + "name": "ownerOf", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "renounceRole", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "role" + }, + { + "type": "address", + "name": "account" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "revokeRole", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "bytes32", + "name": "role" + }, + { + "type": "address", + "name": "account" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "safeTransferFrom", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "from" + }, + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "safeTransferFrom", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "from" + }, + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "tokenId" + }, + { + "type": "bytes", + "name": "_data" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setApprovalForAll", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "operator" + }, + { + "type": "bool", + "name": "approved" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "setTokenURI", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "tokenId" + }, + { + "type": "string", + "name": "tokenUri" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "supportsInterface", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes4", + "name": "interfaceId" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "symbol", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "string", + "name": "" + } + ] + }, + { + "type": "function", + "name": "tokenURI", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [ + { + "type": "string", + "name": "" + } + ] + }, + { + "type": "function", + "name": "transferFrom", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "from" + }, + { + "type": "address", + "name": "to" + }, + { + "type": "uint256", + "name": "tokenId" + } + ], + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/src/metadata/proxy.json b/src/metadata/proxy.json index 4d264d6..202e468 100644 --- a/src/metadata/proxy.json +++ b/src/metadata/proxy.json @@ -1,5 +1,6 @@ { "mainnet": "https://mainnet.skalenodes.com", "staging": "https://staging-v2.skalenodes.com", + "staging3": "https://staging-v3.skalenodes.com", "qatestnet": "https://new-testnet-proxy.skalenodes.com" } \ No newline at end of file diff --git a/src/metadata/schainAbi.json b/src/metadata/schainAbi.json index d538410..71bb522 100644 --- a/src/metadata/schainAbi.json +++ b/src/metadata/schainAbi.json @@ -1,9348 +1,9348 @@ { - "proxy_admin_address": "0xd2aAa00000000000000000000000000000000000", - "proxy_admin_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - }, - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - } - ], - "name": "getProxyImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - }, - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "upgrade", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - }, - { - "internalType": "address", - "name": "implementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - } - ], - "message_proxy_chain_address": "0xd2AAa00100000000000000000000000000000000", - "message_proxy_chain_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "contractAddress", - "type": "address" - } - ], - "name": "ExtraContractRegistered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "contractAddress", - "type": "address" - } - ], - "name": "ExtraContractRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "oldValue", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newValue", - "type": "uint256" - } - ], - "name": "GasLimitWasChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "dstChainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "msgCounter", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "srcContract", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "dstContract", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "OutgoingMessage", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "msgCounter", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "message", - "type": "bytes" - } - ], - "name": "PostMessageError", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "oldVersion", - "type": "string" - }, - { - "indexed": false, - "internalType": "string", - "name": "newVersion", - "type": "string" - } - ], - "name": "VersionUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "CHAIN_CONNECTOR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "CONSTANT_SETTER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "ETHERBASE", - "outputs": [ - { - "internalType": "contract IEtherbaseUpgradeable", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "EXTRA_CONTRACT_REGISTRAR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_HASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MESSAGES_LENGTH", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MINIMUM_BALANCE", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "REVERT_REASON_LENGTH", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "chainName", - "type": "string" - } - ], - "name": "addConnectedChain", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "connectedChains", - "outputs": [ - { - "internalType": "uint256", - "name": "incomingMessageCounter", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "outgoingMessageCounter", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "inited", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gasLimit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "schainHash", - "type": "bytes32" - } - ], - "name": "getContractRegisteredLength", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "schainHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "from", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "to", - "type": "uint256" - } - ], - "name": "getContractRegisteredRange", - "outputs": [ - { - "internalType": "address[]", - "name": "contractsInRange", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "fromSchainName", - "type": "string" - } - ], - "name": "getIncomingMessagesCounter", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetSchainName", - "type": "string" - } - ], - "name": "getOutgoingMessagesCounter", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IKeyStorage", - "name": "blsKeyStorage", - "type": "address" - }, - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "internalType": "address[]", - "name": "contracts", - "type": "address[]" - } - ], - "name": "initializeAllRegisteredContracts", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newGasLimit", - "type": "uint256" - } - ], - "name": "initializeMessageProxy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "isConnectedChain", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "schainHash", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "contractAddress", - "type": "address" - } - ], - "name": "isContractRegistered", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "keyStorage", - "outputs": [ - { - "internalType": "contract IKeyStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "messageInProgress", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "fromChainName", - "type": "string" - }, - { - "internalType": "uint256", - "name": "startingCounter", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "destinationContract", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct IMessageProxy.Message[]", - "name": "messages", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "uint256[2]", - "name": "blsSignature", - "type": "uint256[2]" - }, - { - "internalType": "uint256", - "name": "hashA", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "hashB", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "counter", - "type": "uint256" - } - ], - "internalType": "struct IMessageProxy.Signature", - "name": "signature", - "type": "tuple" - } - ], - "name": "postIncomingMessages", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "targetChainHash", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "targetContract", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "postOutgoingMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "chainName", - "type": "string" - }, - { - "internalType": "address", - "name": "extraContract", - "type": "address" - } - ], - "name": "registerExtraContract", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "extraContract", - "type": "address" - } - ], - "name": "registerExtraContractForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "chainName", - "type": "string" - } - ], - "name": "removeConnectedChain", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "chainName", - "type": "string" - }, - { - "internalType": "address", - "name": "extraContract", - "type": "address" - } - ], - "name": "removeExtraContract", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "extraContract", - "type": "address" - } - ], - "name": "removeExtraContractForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "schainHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newGasLimit", - "type": "uint256" - } - ], - "name": "setNewGasLimit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newVersion", - "type": "string" - } - ], - "name": "setVersion", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "dstChainHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "msgCounter", - "type": "uint256" - }, - { - "internalType": "address", - "name": "srcContract", - "type": "address" - }, - { - "internalType": "address", - "name": "dstContract", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct IMessageProxyForSchain.OutgoingMessageData", - "name": "message", - "type": "tuple" - } - ], - "name": "verifyOutgoingMessageData", - "outputs": [ - { - "internalType": "bool", - "name": "isValidMessage", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "hashedMessage", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256[2]", - "name": "blsSignature", - "type": "uint256[2]" - }, - { - "internalType": "uint256", - "name": "hashA", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "hashB", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "counter", - "type": "uint256" - } - ], - "internalType": "struct IMessageProxy.Signature", - "name": "signature", - "type": "tuple" - } - ], - "name": "verifySignature", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "key_storage_address": "0xd2aaa00200000000000000000000000000000000", - "key_storage_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "FN_NUM_GET_CONFIG_VARIABLE_UINT256", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "FN_NUM_GET_CURRENT_BLS_PUBLIC_KEY", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "FREE_MEM_PTR", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getBlsCommonPublicKey", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "a", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "b", - "type": "uint256" - } - ], - "internalType": "struct IFieldOperations.Fp2Point", - "name": "x", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "a", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "b", - "type": "uint256" - } - ], - "internalType": "struct IFieldOperations.Fp2Point", - "name": "y", - "type": "tuple" - } - ], - "internalType": "struct IFieldOperations.G2Point", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "community_locker_address": "0xD2aaa00300000000000000000000000000000000", - "community_locker_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "schainHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "ActivateUser", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "constantHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "previousValue", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newValue", - "type": "uint256" - } - ], - "name": "ConstantUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "schainHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "LockUser", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "CONSTANT_SETTER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_HASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_NAME", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "activeUsers", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "checkAllowedToSendMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "communityPool", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gasPriceTimestamp", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newSchainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newTokenManagerLinker", - "type": "address" - }, - { - "internalType": "address", - "name": "newCommunityPool", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "lastMessageTimeStamp", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "mainnetGasPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "messageProxy", - "outputs": [ - { - "internalType": "contract IMessageProxyForSchain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "fromChainHash", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "postMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "schainHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "gasPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256[2]", - "name": "blsSignature", - "type": "uint256[2]" - }, - { - "internalType": "uint256", - "name": "hashA", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "hashB", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "counter", - "type": "uint256" - } - ], - "internalType": "struct IMessageProxy.Signature", - "name": "", - "type": "tuple" - } - ], - "name": "setGasPrice", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newTimeLimitPerMessage", - "type": "uint256" - } - ], - "name": "setTimeLimitPerMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "timeLimitPerMessage", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tokenManagerLinker", - "outputs": [ - { - "internalType": "contract ITokenManagerLinker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "token_manager_linker_address": "0xD2aAA00800000000000000000000000000000000", - "token_manager_linker_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_HASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_NAME", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "REGISTRAR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "connectSchain", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "disconnectSchain", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "hasSchain", - "outputs": [ - { - "internalType": "bool", - "name": "connected", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ITokenManager", - "name": "tokenManager", - "type": "address" - } - ], - "name": "hasTokenManager", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxyAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "linker", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "linkerAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "messageProxy", - "outputs": [ - { - "internalType": "contract IMessageProxyForSchain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ITokenManager", - "name": "newTokenManager", - "type": "address" - } - ], - "name": "registerTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ITokenManager", - "name": "tokenManagerAddress", - "type": "address" - } - ], - "name": "removeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "tokenManagers", - "outputs": [ - { - "internalType": "contract ITokenManager", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "token_manager_eth_address": "0xd2AaA00400000000000000000000000000000000", - "token_manager_eth_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldValue", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newValue", - "type": "address" - } - ], - "name": "DepositBoxWasChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "AUTOMATIC_DEPLOY_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_HASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_NAME", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "TOKEN_REGISTRAR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - }, - { - "internalType": "address", - "name": "newTokenManager", - "type": "address" - } - ], - "name": "addTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "automaticDeploy", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "changeDepositBoxAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "communityLocker", - "outputs": [ - { - "internalType": "contract ICommunityLocker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "depositBox", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "disableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "enableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "ethErc20", - "outputs": [ - { - "internalType": "contract IEthErc20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "exitToMain", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "hasTokenManager", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newChainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - }, - { - "internalType": "contract IEthErc20", - "name": "ethErc20Address", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newSchainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "initializeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "messageProxy", - "outputs": [ - { - "internalType": "contract IMessageProxyForSchain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "fromChainHash", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "postMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "removeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "schainHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IEthErc20", - "name": "newEthErc20Address", - "type": "address" - } - ], - "name": "setEthErc20Address", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tokenManagerLinker", - "outputs": [ - { - "internalType": "contract ITokenManagerLinker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "tokenManagers", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "token_manager_erc20_address": "0xD2aAA00500000000000000000000000000000000", - "token_manager_erc20_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldValue", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newValue", - "type": "address" - } - ], - "name": "DepositBoxWasChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc20OnMainChain", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc20OnSchain", - "type": "address" - } - ], - "name": "ERC20TokenAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc20OnMainChain", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc20OnSchain", - "type": "address" - } - ], - "name": "ERC20TokenCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "ERC20TokenReady", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc20OnMainChain", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc20OnSchain", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "ERC20TokenReceived", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "AUTOMATIC_DEPLOY_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_HASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_NAME", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "TOKEN_REGISTRAR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetChainName", - "type": "string" - }, - { - "internalType": "address", - "name": "erc20OnMainChain", - "type": "address" - }, - { - "internalType": "address", - "name": "erc20OnSchain", - "type": "address" - } - ], - "name": "addERC20TokenByOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - }, - { - "internalType": "address", - "name": "newTokenManager", - "type": "address" - } - ], - "name": "addTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ERC20OnChain", - "name": "", - "type": "address" - } - ], - "name": "addedClones", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "automaticDeploy", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "changeDepositBoxAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "clonesErc20", - "outputs": [ - { - "internalType": "contract ERC20OnChain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "communityLocker", - "outputs": [ - { - "internalType": "contract ICommunityLocker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "depositBox", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "deprecatedClonesErc20", - "outputs": [ - { - "internalType": "contract ERC20OnChain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "disableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "enableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "exitToMainERC20", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "hasTokenManager", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newChainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "contracts", - "type": "address[]" - } - ], - "name": "initializeAllClonesERC20", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newSchainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "initializeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "messageProxy", - "outputs": [ - { - "internalType": "contract IMessageProxyForSchain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "fromChainHash", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "postMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "removeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "schainHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tokenManagerLinker", - "outputs": [ - { - "internalType": "contract ITokenManagerLinker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "tokenManagers", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20Upgradeable", - "name": "", - "type": "address" - } - ], - "name": "totalSupplyOnMainnet", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetSchainName", - "type": "string" - }, - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferToSchainERC20", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "transferredAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "token_manager_erc721_address": "0xD2aaa00600000000000000000000000000000000", - "token_manager_erc721_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldValue", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newValue", - "type": "address" - } - ], - "name": "DepositBoxWasChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnMainChain", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnSchain", - "type": "address" - } - ], - "name": "ERC721TokenAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnMainChain", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnSchain", - "type": "address" - } - ], - "name": "ERC721TokenCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ERC721TokenReady", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnMainChain", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnSchain", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ERC721TokenReceived", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "AUTOMATIC_DEPLOY_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_HASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_NAME", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "TOKEN_REGISTRAR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetChainName", - "type": "string" - }, - { - "internalType": "address", - "name": "erc721OnMainChain", - "type": "address" - }, - { - "internalType": "address", - "name": "erc721OnSchain", - "type": "address" - } - ], - "name": "addERC721TokenByOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - }, - { - "internalType": "address", - "name": "newTokenManager", - "type": "address" - } - ], - "name": "addTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ERC721OnChain", - "name": "", - "type": "address" - } - ], - "name": "addedClones", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "automaticDeploy", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "changeDepositBoxAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "clonesErc721", - "outputs": [ - { - "internalType": "contract ERC721OnChain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "communityLocker", - "outputs": [ - { - "internalType": "contract ICommunityLocker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "depositBox", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "deprecatedClonesErc721", - "outputs": [ - { - "internalType": "contract ERC721OnChain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "disableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "enableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "exitToMainERC721", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "hasTokenManager", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newChainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "contracts", - "type": "address[]" - } - ], - "name": "initializeAllClonesERC721", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newSchainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "initializeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "messageProxy", - "outputs": [ - { - "internalType": "contract IMessageProxyForSchain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "fromChainHash", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "postMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "removeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "schainHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tokenManagerLinker", - "outputs": [ - { - "internalType": "contract ITokenManagerLinker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "tokenManagers", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetSchainName", - "type": "string" - }, - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "transferToSchainERC721", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "transferredAmount", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "token_manager_erc1155_address": "0xD2aaA00900000000000000000000000000000000", - "token_manager_erc1155_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldValue", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newValue", - "type": "address" - } - ], - "name": "DepositBoxWasChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc1155OnMainnet", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc1155OnSchain", - "type": "address" - } - ], - "name": "ERC1155TokenAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc1155OnMainnet", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc1155OnSchain", - "type": "address" - } - ], - "name": "ERC1155TokenCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - } - ], - "name": "ERC1155TokenReady", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc1155OnMainnet", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc1155OnSchain", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - } - ], - "name": "ERC1155TokenReceived", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "AUTOMATIC_DEPLOY_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_HASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_NAME", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "TOKEN_REGISTRAR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetChainName", - "type": "string" - }, - { - "internalType": "address", - "name": "erc1155OnMainnet", - "type": "address" - }, - { - "internalType": "address", - "name": "erc1155OnSchain", - "type": "address" - } - ], - "name": "addERC1155TokenByOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - }, - { - "internalType": "address", - "name": "newTokenManager", - "type": "address" - } - ], - "name": "addTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ERC1155OnChain", - "name": "", - "type": "address" - } - ], - "name": "addedClones", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "automaticDeploy", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "changeDepositBoxAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "clonesErc1155", - "outputs": [ - { - "internalType": "contract ERC1155OnChain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "communityLocker", - "outputs": [ - { - "internalType": "contract ICommunityLocker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "depositBox", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "deprecatedClonesErc1155", - "outputs": [ - { - "internalType": "contract ERC1155OnChain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "disableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "enableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "exitToMainERC1155", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - } - ], - "name": "exitToMainERC1155Batch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "hasTokenManager", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newChainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "contracts", - "type": "address[]" - } - ], - "name": "initializeAllClonesERC1155", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newSchainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "initializeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "messageProxy", - "outputs": [ - { - "internalType": "contract IMessageProxyForSchain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "onERC1155BatchReceived", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "onERC1155Received", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "fromChainHash", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "postMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "removeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "schainHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tokenManagerLinker", - "outputs": [ - { - "internalType": "contract ITokenManagerLinker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "tokenManagers", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetSchainName", - "type": "string" - }, - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferToSchainERC1155", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetSchainName", - "type": "string" - }, - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - } - ], - "name": "transferToSchainERC1155Batch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "transferredAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "token_manager_erc721_with_metadata_address": "0xd2AaA00a00000000000000000000000000000000", - "token_manager_erc721_with_metadata_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldValue", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newValue", - "type": "address" - } - ], - "name": "DepositBoxWasChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnMainChain", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnSchain", - "type": "address" - } - ], - "name": "ERC721TokenAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnMainChain", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnSchain", - "type": "address" - } - ], - "name": "ERC721TokenCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ERC721TokenReady", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnMainChain", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnSchain", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ERC721TokenReceived", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "AUTOMATIC_DEPLOY_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_HASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_NAME", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "TOKEN_REGISTRAR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetChainName", - "type": "string" - }, - { - "internalType": "address", - "name": "erc721OnMainChain", - "type": "address" - }, - { - "internalType": "address", - "name": "erc721OnSchain", - "type": "address" - } - ], - "name": "addERC721TokenByOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - }, - { - "internalType": "address", - "name": "newTokenManager", - "type": "address" - } - ], - "name": "addTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ERC721OnChain", - "name": "", - "type": "address" - } - ], - "name": "addedClones", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "automaticDeploy", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "changeDepositBoxAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "clonesErc721", - "outputs": [ - { - "internalType": "contract ERC721OnChain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "communityLocker", - "outputs": [ - { - "internalType": "contract ICommunityLocker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "depositBox", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "deprecatedClonesErc721", - "outputs": [ - { - "internalType": "contract ERC721OnChain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "disableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "enableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "exitToMainERC721", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "hasTokenManager", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newChainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "contracts", - "type": "address[]" - } - ], - "name": "initializeAllClonesERC721", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newSchainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "initializeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "messageProxy", - "outputs": [ - { - "internalType": "contract IMessageProxyForSchain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "fromChainHash", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "postMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "removeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "schainHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tokenManagerLinker", - "outputs": [ - { - "internalType": "contract ITokenManagerLinker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "tokenManagers", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetSchainName", - "type": "string" - }, - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "transferToSchainERC721", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "transferredAmount", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "eth_erc20_address": "0xD2Aaa00700000000000000000000000000000000", - "eth_erc20_abi": [ - { - "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": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "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": [], - "name": "BURNER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MINTER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "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": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "forceBurn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "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": "tokenManagerEthAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "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": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "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": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "ERC20OnChain_abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "contractName", - "type": "string" - }, - { - "internalType": "string", - "name": "contractSymbol", - "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": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "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": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MINTER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "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": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "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": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "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": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "ERC721OnChain_abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "contractName", - "type": "string" - }, - { - "internalType": "string", - "name": "contractSymbol", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "approved", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MINTER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "getApproved", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ownerOf", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "string", - "name": "tokenUri", - "type": "string" - } - ], - "name": "setTokenURI", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "tokenURI", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "ERC1155OnChain_abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - } - ], - "name": "TransferBatch", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "TransferSingle", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "value", - "type": "string" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "URI", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MINTER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "accounts", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - } - ], - "name": "balanceOfBatch", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - } - ], - "name": "burnBatch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "mintBatch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeBatchTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "uri", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ] + "ERC1155OnChain_abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "uri", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + } + ], + "name": "TransferBatch", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "TransferSingle", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "value", + "type": "string" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "URI", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MINTER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "accounts", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + } + ], + "name": "balanceOfBatch", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + } + ], + "name": "burnBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRoleMember", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleMemberCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "mintBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeBatchTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "uri", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "ERC20OnChain_abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "contractName", + "type": "string" + }, + { + "internalType": "string", + "name": "contractSymbol", + "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": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "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": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MINTER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "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": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRoleMember", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleMemberCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "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": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "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": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "ERC721OnChain_abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "contractName", + "type": "string" + }, + { + "internalType": "string", + "name": "contractSymbol", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "approved", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MINTER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "getApproved", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRoleMember", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleMemberCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ownerOf", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "tokenUri", + "type": "string" + } + ], + "name": "setTokenURI", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "tokenURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "community_locker_abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "schainHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "ActivateUser", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "constantHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousValue", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newValue", + "type": "uint256" + } + ], + "name": "ConstantUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "schainHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "LockUser", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "CONSTANT_SETTER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAINNET_HASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAINNET_NAME", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "activeUsers", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "checkAllowedToSendMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "communityPool", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gasPriceTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRoleMember", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleMemberCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newSchainName", + "type": "string" + }, + { + "internalType": "contract IMessageProxyForSchain", + "name": "newMessageProxy", + "type": "address" + }, + { + "internalType": "contract ITokenManagerLinker", + "name": "newTokenManagerLinker", + "type": "address" + }, + { + "internalType": "address", + "name": "newCommunityPool", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "lastMessageTimeStamp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "mainnetGasPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "messageProxy", + "outputs": [ + { + "internalType": "contract IMessageProxyForSchain", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "fromChainHash", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "postMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "schainHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "gasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "blsSignature", + "type": "uint256[2]" + }, + { + "internalType": "uint256", + "name": "hashA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "hashB", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "counter", + "type": "uint256" + } + ], + "internalType": "struct IMessageProxy.Signature", + "name": "", + "type": "tuple" + } + ], + "name": "setGasPrice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newTimeLimitPerMessage", + "type": "uint256" + } + ], + "name": "setTimeLimitPerMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "timeLimitPerMessage", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tokenManagerLinker", + "outputs": [ + { + "internalType": "contract ITokenManagerLinker", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "community_locker_address": "0xD2aaa00300000000000000000000000000000000", + "eth_erc20_abi": [ + { + "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": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "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": [], + "name": "BURNER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MINTER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "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": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "forceBurn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRoleMember", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleMemberCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "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": "tokenManagerEthAddress", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "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": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "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": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "eth_erc20_address": "0xD2Aaa00700000000000000000000000000000000", + "key_storage_abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "FN_NUM_GET_CONFIG_VARIABLE_UINT256", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "FN_NUM_GET_CURRENT_BLS_PUBLIC_KEY", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "FREE_MEM_PTR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBlsCommonPublicKey", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "internalType": "struct IFieldOperations.Fp2Point", + "name": "x", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "internalType": "struct IFieldOperations.Fp2Point", + "name": "y", + "type": "tuple" + } + ], + "internalType": "struct IFieldOperations.G2Point", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRoleMember", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleMemberCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "key_storage_address": "0xd2aaa00200000000000000000000000000000000", + "message_proxy_chain_abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "chainHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "ExtraContractRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "chainHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "ExtraContractRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldValue", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newValue", + "type": "uint256" + } + ], + "name": "GasLimitWasChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "dstChainHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "msgCounter", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "srcContract", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "dstContract", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "OutgoingMessage", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "msgCounter", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "message", + "type": "bytes" + } + ], + "name": "PostMessageError", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "oldVersion", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "newVersion", + "type": "string" + } + ], + "name": "VersionUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "CHAIN_CONNECTOR_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "CONSTANT_SETTER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ETHERBASE", + "outputs": [ + { + "internalType": "contract IEtherbaseUpgradeable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "EXTRA_CONTRACT_REGISTRAR_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAINNET_HASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MESSAGES_LENGTH", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MINIMUM_BALANCE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "REVERT_REASON_LENGTH", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "chainName", + "type": "string" + } + ], + "name": "addConnectedChain", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "connectedChains", + "outputs": [ + { + "internalType": "uint256", + "name": "incomingMessageCounter", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "outgoingMessageCounter", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "inited", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gasLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "schainHash", + "type": "bytes32" + } + ], + "name": "getContractRegisteredLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "schainHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "from", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "to", + "type": "uint256" + } + ], + "name": "getContractRegisteredRange", + "outputs": [ + { + "internalType": "address[]", + "name": "contractsInRange", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "fromSchainName", + "type": "string" + } + ], + "name": "getIncomingMessagesCounter", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "targetSchainName", + "type": "string" + } + ], + "name": "getOutgoingMessagesCounter", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRoleMember", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleMemberCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IKeyStorage", + "name": "blsKeyStorage", + "type": "address" + }, + { + "internalType": "string", + "name": "schainName", + "type": "string" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "chainHash", + "type": "bytes32" + }, + { + "internalType": "address[]", + "name": "contracts", + "type": "address[]" + } + ], + "name": "initializeAllRegisteredContracts", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newGasLimit", + "type": "uint256" + } + ], + "name": "initializeMessageProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "schainName", + "type": "string" + } + ], + "name": "isConnectedChain", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "schainHash", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "isContractRegistered", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "keyStorage", + "outputs": [ + { + "internalType": "contract IKeyStorage", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "messageInProgress", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "fromChainName", + "type": "string" + }, + { + "internalType": "uint256", + "name": "startingCounter", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "destinationContract", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IMessageProxy.Message[]", + "name": "messages", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "blsSignature", + "type": "uint256[2]" + }, + { + "internalType": "uint256", + "name": "hashA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "hashB", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "counter", + "type": "uint256" + } + ], + "internalType": "struct IMessageProxy.Signature", + "name": "signature", + "type": "tuple" + } + ], + "name": "postIncomingMessages", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "targetChainHash", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "targetContract", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "postOutgoingMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "chainName", + "type": "string" + }, + { + "internalType": "address", + "name": "extraContract", + "type": "address" + } + ], + "name": "registerExtraContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "extraContract", + "type": "address" + } + ], + "name": "registerExtraContractForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "chainName", + "type": "string" + } + ], + "name": "removeConnectedChain", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "chainName", + "type": "string" + }, + { + "internalType": "address", + "name": "extraContract", + "type": "address" + } + ], + "name": "removeExtraContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "extraContract", + "type": "address" + } + ], + "name": "removeExtraContractForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "schainHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newGasLimit", + "type": "uint256" + } + ], + "name": "setNewGasLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newVersion", + "type": "string" + } + ], + "name": "setVersion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "dstChainHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "msgCounter", + "type": "uint256" + }, + { + "internalType": "address", + "name": "srcContract", + "type": "address" + }, + { + "internalType": "address", + "name": "dstContract", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IMessageProxyForSchain.OutgoingMessageData", + "name": "message", + "type": "tuple" + } + ], + "name": "verifyOutgoingMessageData", + "outputs": [ + { + "internalType": "bool", + "name": "isValidMessage", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "hashedMessage", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "blsSignature", + "type": "uint256[2]" + }, + { + "internalType": "uint256", + "name": "hashA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "hashB", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "counter", + "type": "uint256" + } + ], + "internalType": "struct IMessageProxy.Signature", + "name": "signature", + "type": "tuple" + } + ], + "name": "verifySignature", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "message_proxy_chain_address": "0xd2AAa00100000000000000000000000000000000", + "proxy_admin_abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeProxyAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + } + ], + "name": "getProxyAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + } + ], + "name": "getProxyImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "upgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "proxy_admin_address": "0xd2aAa00000000000000000000000000000000000", + "token_manager_erc1155_abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldValue", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newValue", + "type": "address" + } + ], + "name": "DepositBoxWasChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "chainHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc1155OnMainnet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc1155OnSchain", + "type": "address" + } + ], + "name": "ERC1155TokenAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "chainHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc1155OnMainnet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc1155OnSchain", + "type": "address" + } + ], + "name": "ERC1155TokenCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "chainHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "contractOnMainnet", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "name": "ERC1155TokenReady", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "chainHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc1155OnMainnet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc1155OnSchain", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "name": "ERC1155TokenReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "AUTOMATIC_DEPLOY_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAINNET_HASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAINNET_NAME", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "TOKEN_REGISTRAR_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "targetChainName", + "type": "string" + }, + { + "internalType": "address", + "name": "erc1155OnMainnet", + "type": "address" + }, + { + "internalType": "address", + "name": "erc1155OnSchain", + "type": "address" + } + ], + "name": "addERC1155TokenByOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "schainName", + "type": "string" + }, + { + "internalType": "address", + "name": "newTokenManager", + "type": "address" + } + ], + "name": "addTokenManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC1155OnChain", + "name": "", + "type": "address" + } + ], + "name": "addedClones", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "automaticDeploy", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newDepositBox", + "type": "address" + } + ], + "name": "changeDepositBoxAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "clonesErc1155", + "outputs": [ + { + "internalType": "contract ERC1155OnChain", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "communityLocker", + "outputs": [ + { + "internalType": "contract ICommunityLocker", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositBox", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "deprecatedClonesErc1155", + "outputs": [ + { + "internalType": "contract ERC1155OnChain", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disableAutomaticDeploy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "enableAutomaticDeploy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractOnMainnet", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "exitToMainERC1155", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractOnMainnet", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "name": "exitToMainERC1155Batch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRoleMember", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleMemberCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "schainName", + "type": "string" + } + ], + "name": "hasTokenManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newChainName", + "type": "string" + }, + { + "internalType": "contract IMessageProxyForSchain", + "name": "newMessageProxy", + "type": "address" + }, + { + "internalType": "contract ITokenManagerLinker", + "name": "newIMALinker", + "type": "address" + }, + { + "internalType": "contract ICommunityLocker", + "name": "newCommunityLocker", + "type": "address" + }, + { + "internalType": "address", + "name": "newDepositBox", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "contracts", + "type": "address[]" + } + ], + "name": "initializeAllClonesERC1155", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newSchainName", + "type": "string" + }, + { + "internalType": "contract IMessageProxyForSchain", + "name": "newMessageProxy", + "type": "address" + }, + { + "internalType": "contract ITokenManagerLinker", + "name": "newIMALinker", + "type": "address" + }, + { + "internalType": "contract ICommunityLocker", + "name": "newCommunityLocker", + "type": "address" + }, + { + "internalType": "address", + "name": "newDepositBox", + "type": "address" + } + ], + "name": "initializeTokenManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "messageProxy", + "outputs": [ + { + "internalType": "contract IMessageProxyForSchain", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC1155BatchReceived", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC1155Received", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "fromChainHash", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "postMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "schainName", + "type": "string" + } + ], + "name": "removeTokenManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "schainHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tokenManagerLinker", + "outputs": [ + { + "internalType": "contract ITokenManagerLinker", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "tokenManagers", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "targetSchainName", + "type": "string" + }, + { + "internalType": "address", + "name": "contractOnMainnet", + "type": "address" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferToSchainERC1155", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "targetSchainName", + "type": "string" + }, + { + "internalType": "address", + "name": "contractOnMainnet", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "name": "transferToSchainERC1155Batch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "transferredAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "token_manager_erc1155_address": "0xD2aaA00900000000000000000000000000000000", + "token_manager_erc20_abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldValue", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newValue", + "type": "address" + } + ], + "name": "DepositBoxWasChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "chainHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc20OnMainChain", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc20OnSchain", + "type": "address" + } + ], + "name": "ERC20TokenAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "chainHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc20OnMainChain", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc20OnSchain", + "type": "address" + } + ], + "name": "ERC20TokenCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "chainHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "contractOnMainnet", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ERC20TokenReady", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "chainHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc20OnMainChain", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc20OnSchain", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ERC20TokenReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "AUTOMATIC_DEPLOY_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAINNET_HASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAINNET_NAME", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "TOKEN_REGISTRAR_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "targetChainName", + "type": "string" + }, + { + "internalType": "address", + "name": "erc20OnMainChain", + "type": "address" + }, + { + "internalType": "address", + "name": "erc20OnSchain", + "type": "address" + } + ], + "name": "addERC20TokenByOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "schainName", + "type": "string" + }, + { + "internalType": "address", + "name": "newTokenManager", + "type": "address" + } + ], + "name": "addTokenManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20OnChain", + "name": "", + "type": "address" + } + ], + "name": "addedClones", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "automaticDeploy", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newDepositBox", + "type": "address" + } + ], + "name": "changeDepositBoxAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "clonesErc20", + "outputs": [ + { + "internalType": "contract ERC20OnChain", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "communityLocker", + "outputs": [ + { + "internalType": "contract ICommunityLocker", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositBox", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "deprecatedClonesErc20", + "outputs": [ + { + "internalType": "contract ERC20OnChain", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disableAutomaticDeploy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "enableAutomaticDeploy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractOnMainnet", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "exitToMainERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRoleMember", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleMemberCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "schainName", + "type": "string" + } + ], + "name": "hasTokenManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newChainName", + "type": "string" + }, + { + "internalType": "contract IMessageProxyForSchain", + "name": "newMessageProxy", + "type": "address" + }, + { + "internalType": "contract ITokenManagerLinker", + "name": "newIMALinker", + "type": "address" + }, + { + "internalType": "contract ICommunityLocker", + "name": "newCommunityLocker", + "type": "address" + }, + { + "internalType": "address", + "name": "newDepositBox", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "contracts", + "type": "address[]" + } + ], + "name": "initializeAllClonesERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newSchainName", + "type": "string" + }, + { + "internalType": "contract IMessageProxyForSchain", + "name": "newMessageProxy", + "type": "address" + }, + { + "internalType": "contract ITokenManagerLinker", + "name": "newIMALinker", + "type": "address" + }, + { + "internalType": "contract ICommunityLocker", + "name": "newCommunityLocker", + "type": "address" + }, + { + "internalType": "address", + "name": "newDepositBox", + "type": "address" + } + ], + "name": "initializeTokenManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "messageProxy", + "outputs": [ + { + "internalType": "contract IMessageProxyForSchain", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "fromChainHash", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "postMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "schainName", + "type": "string" + } + ], + "name": "removeTokenManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "schainHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tokenManagerLinker", + "outputs": [ + { + "internalType": "contract ITokenManagerLinker", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "tokenManagers", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20Upgradeable", + "name": "", + "type": "address" + } + ], + "name": "totalSupplyOnMainnet", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "targetSchainName", + "type": "string" + }, + { + "internalType": "address", + "name": "contractOnMainnet", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferToSchainERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "transferredAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "token_manager_erc20_address": "0xD2aAA00500000000000000000000000000000000", + "token_manager_erc721_abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldValue", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newValue", + "type": "address" + } + ], + "name": "DepositBoxWasChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "chainHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc721OnMainChain", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc721OnSchain", + "type": "address" + } + ], + "name": "ERC721TokenAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "chainHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc721OnMainChain", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc721OnSchain", + "type": "address" + } + ], + "name": "ERC721TokenCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "chainHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "contractOnMainnet", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ERC721TokenReady", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "chainHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc721OnMainChain", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc721OnSchain", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ERC721TokenReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "AUTOMATIC_DEPLOY_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAINNET_HASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAINNET_NAME", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "TOKEN_REGISTRAR_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "targetChainName", + "type": "string" + }, + { + "internalType": "address", + "name": "erc721OnMainChain", + "type": "address" + }, + { + "internalType": "address", + "name": "erc721OnSchain", + "type": "address" + } + ], + "name": "addERC721TokenByOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "schainName", + "type": "string" + }, + { + "internalType": "address", + "name": "newTokenManager", + "type": "address" + } + ], + "name": "addTokenManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC721OnChain", + "name": "", + "type": "address" + } + ], + "name": "addedClones", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "automaticDeploy", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newDepositBox", + "type": "address" + } + ], + "name": "changeDepositBoxAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "clonesErc721", + "outputs": [ + { + "internalType": "contract ERC721OnChain", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "communityLocker", + "outputs": [ + { + "internalType": "contract ICommunityLocker", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositBox", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "deprecatedClonesErc721", + "outputs": [ + { + "internalType": "contract ERC721OnChain", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disableAutomaticDeploy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "enableAutomaticDeploy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractOnMainnet", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "exitToMainERC721", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRoleMember", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleMemberCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "schainName", + "type": "string" + } + ], + "name": "hasTokenManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newChainName", + "type": "string" + }, + { + "internalType": "contract IMessageProxyForSchain", + "name": "newMessageProxy", + "type": "address" + }, + { + "internalType": "contract ITokenManagerLinker", + "name": "newIMALinker", + "type": "address" + }, + { + "internalType": "contract ICommunityLocker", + "name": "newCommunityLocker", + "type": "address" + }, + { + "internalType": "address", + "name": "newDepositBox", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "contracts", + "type": "address[]" + } + ], + "name": "initializeAllClonesERC721", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newSchainName", + "type": "string" + }, + { + "internalType": "contract IMessageProxyForSchain", + "name": "newMessageProxy", + "type": "address" + }, + { + "internalType": "contract ITokenManagerLinker", + "name": "newIMALinker", + "type": "address" + }, + { + "internalType": "contract ICommunityLocker", + "name": "newCommunityLocker", + "type": "address" + }, + { + "internalType": "address", + "name": "newDepositBox", + "type": "address" + } + ], + "name": "initializeTokenManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "messageProxy", + "outputs": [ + { + "internalType": "contract IMessageProxyForSchain", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "fromChainHash", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "postMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "schainName", + "type": "string" + } + ], + "name": "removeTokenManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "schainHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tokenManagerLinker", + "outputs": [ + { + "internalType": "contract ITokenManagerLinker", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "tokenManagers", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "targetSchainName", + "type": "string" + }, + { + "internalType": "address", + "name": "contractOnMainnet", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "transferToSchainERC721", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "transferredAmount", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "token_manager_erc721_address": "0xD2aaa00600000000000000000000000000000000", + "token_manager_erc721_with_metadata_abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldValue", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newValue", + "type": "address" + } + ], + "name": "DepositBoxWasChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "chainHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc721OnMainChain", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc721OnSchain", + "type": "address" + } + ], + "name": "ERC721TokenAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "chainHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc721OnMainChain", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc721OnSchain", + "type": "address" + } + ], + "name": "ERC721TokenCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "chainHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "contractOnMainnet", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ERC721TokenReady", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "chainHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc721OnMainChain", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "erc721OnSchain", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ERC721TokenReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "AUTOMATIC_DEPLOY_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAINNET_HASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAINNET_NAME", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "TOKEN_REGISTRAR_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "targetChainName", + "type": "string" + }, + { + "internalType": "address", + "name": "erc721OnMainChain", + "type": "address" + }, + { + "internalType": "address", + "name": "erc721OnSchain", + "type": "address" + } + ], + "name": "addERC721TokenByOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "schainName", + "type": "string" + }, + { + "internalType": "address", + "name": "newTokenManager", + "type": "address" + } + ], + "name": "addTokenManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC721OnChain", + "name": "", + "type": "address" + } + ], + "name": "addedClones", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "automaticDeploy", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newDepositBox", + "type": "address" + } + ], + "name": "changeDepositBoxAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "clonesErc721", + "outputs": [ + { + "internalType": "contract ERC721OnChain", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "communityLocker", + "outputs": [ + { + "internalType": "contract ICommunityLocker", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositBox", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "deprecatedClonesErc721", + "outputs": [ + { + "internalType": "contract ERC721OnChain", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disableAutomaticDeploy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "enableAutomaticDeploy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractOnMainnet", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "exitToMainERC721", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRoleMember", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleMemberCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "schainName", + "type": "string" + } + ], + "name": "hasTokenManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newChainName", + "type": "string" + }, + { + "internalType": "contract IMessageProxyForSchain", + "name": "newMessageProxy", + "type": "address" + }, + { + "internalType": "contract ITokenManagerLinker", + "name": "newIMALinker", + "type": "address" + }, + { + "internalType": "contract ICommunityLocker", + "name": "newCommunityLocker", + "type": "address" + }, + { + "internalType": "address", + "name": "newDepositBox", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "contracts", + "type": "address[]" + } + ], + "name": "initializeAllClonesERC721", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newSchainName", + "type": "string" + }, + { + "internalType": "contract IMessageProxyForSchain", + "name": "newMessageProxy", + "type": "address" + }, + { + "internalType": "contract ITokenManagerLinker", + "name": "newIMALinker", + "type": "address" + }, + { + "internalType": "contract ICommunityLocker", + "name": "newCommunityLocker", + "type": "address" + }, + { + "internalType": "address", + "name": "newDepositBox", + "type": "address" + } + ], + "name": "initializeTokenManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "messageProxy", + "outputs": [ + { + "internalType": "contract IMessageProxyForSchain", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "fromChainHash", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "postMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "schainName", + "type": "string" + } + ], + "name": "removeTokenManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "schainHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tokenManagerLinker", + "outputs": [ + { + "internalType": "contract ITokenManagerLinker", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "tokenManagers", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "targetSchainName", + "type": "string" + }, + { + "internalType": "address", + "name": "contractOnMainnet", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "transferToSchainERC721", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "transferredAmount", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "token_manager_erc721_with_metadata_address": "0xd2AaA00a00000000000000000000000000000000", + "token_manager_eth_abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldValue", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newValue", + "type": "address" + } + ], + "name": "DepositBoxWasChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "AUTOMATIC_DEPLOY_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAINNET_HASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAINNET_NAME", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "TOKEN_REGISTRAR_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "schainName", + "type": "string" + }, + { + "internalType": "address", + "name": "newTokenManager", + "type": "address" + } + ], + "name": "addTokenManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "automaticDeploy", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newDepositBox", + "type": "address" + } + ], + "name": "changeDepositBoxAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "communityLocker", + "outputs": [ + { + "internalType": "contract ICommunityLocker", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositBox", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "disableAutomaticDeploy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "enableAutomaticDeploy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "ethErc20", + "outputs": [ + { + "internalType": "contract IEthErc20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "exitToMain", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRoleMember", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleMemberCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "schainName", + "type": "string" + } + ], + "name": "hasTokenManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newChainName", + "type": "string" + }, + { + "internalType": "contract IMessageProxyForSchain", + "name": "newMessageProxy", + "type": "address" + }, + { + "internalType": "contract ITokenManagerLinker", + "name": "newIMALinker", + "type": "address" + }, + { + "internalType": "contract ICommunityLocker", + "name": "newCommunityLocker", + "type": "address" + }, + { + "internalType": "address", + "name": "newDepositBox", + "type": "address" + }, + { + "internalType": "contract IEthErc20", + "name": "ethErc20Address", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newSchainName", + "type": "string" + }, + { + "internalType": "contract IMessageProxyForSchain", + "name": "newMessageProxy", + "type": "address" + }, + { + "internalType": "contract ITokenManagerLinker", + "name": "newIMALinker", + "type": "address" + }, + { + "internalType": "contract ICommunityLocker", + "name": "newCommunityLocker", + "type": "address" + }, + { + "internalType": "address", + "name": "newDepositBox", + "type": "address" + } + ], + "name": "initializeTokenManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "messageProxy", + "outputs": [ + { + "internalType": "contract IMessageProxyForSchain", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "fromChainHash", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "postMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "schainName", + "type": "string" + } + ], + "name": "removeTokenManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "schainHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IEthErc20", + "name": "newEthErc20Address", + "type": "address" + } + ], + "name": "setEthErc20Address", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tokenManagerLinker", + "outputs": [ + { + "internalType": "contract ITokenManagerLinker", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "tokenManagers", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "token_manager_eth_address": "0xd2AaA00400000000000000000000000000000000", + "token_manager_linker_abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAINNET_HASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAINNET_NAME", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "REGISTRAR_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "schainName", + "type": "string" + } + ], + "name": "connectSchain", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "schainName", + "type": "string" + } + ], + "name": "disconnectSchain", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRoleMember", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleMemberCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "schainName", + "type": "string" + } + ], + "name": "hasSchain", + "outputs": [ + { + "internalType": "bool", + "name": "connected", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ITokenManager", + "name": "tokenManager", + "type": "address" + } + ], + "name": "hasTokenManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IMessageProxyForSchain", + "name": "newMessageProxyAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "linker", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "linkerAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "messageProxy", + "outputs": [ + { + "internalType": "contract IMessageProxyForSchain", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ITokenManager", + "name": "newTokenManager", + "type": "address" + } + ], + "name": "registerTokenManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ITokenManager", + "name": "tokenManagerAddress", + "type": "address" + } + ], + "name": "removeTokenManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "tokenManagers", + "outputs": [ + { + "internalType": "contract ITokenManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "token_manager_linker_address": "0xD2aAA00800000000000000000000000000000000" } \ No newline at end of file From 32df2d29454bd8076861a240efc557f9448da9f5 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Thu, 20 Oct 2022 23:42:54 +0100 Subject: [PATCH 02/12] Minify token ABIs --- src/core/tokens/s2s.ts | 7 +- src/metadata/erc1155_abi.json | 621 +- src/metadata/erc20_abi.json | 570 +- src/metadata/erc20_wrapper_abi.json | 337 +- src/metadata/erc721_abi.json | 596 +- src/metadata/erc721meta_abi.json | 618 +- src/metadata/mainnetAbi.json | 5994 +---------------- src/metadata/schainAbi.json | 9349 +-------------------------- 8 files changed, 8 insertions(+), 18084 deletions(-) diff --git a/src/core/tokens/s2s.ts b/src/core/tokens/s2s.ts index 2e49bf1..4c8db6d 100644 --- a/src/core/tokens/s2s.ts +++ b/src/core/tokens/s2s.ts @@ -26,16 +26,11 @@ import debug from 'debug'; import { SChain, MainnetChain } from '@skalenetwork/ima-js'; - import { initContract } from '../core'; - -import { addETHToken, getEthBalance } from './eth'; - import * as interfaces from '../interfaces/index'; import { TokenType } from '../dataclasses/TokenType'; import TokenData, { getTokenKeyname } from '../dataclasses/TokenData'; -import { MAINNET_CHAIN_NAME, ZERO_ADDRESS } from '../constants'; -import { eqArrays, isMainnet } from '../helper'; +import { ZERO_ADDRESS } from '../constants'; debug.enable('*'); diff --git a/src/metadata/erc1155_abi.json b/src/metadata/erc1155_abi.json index a678e7d..bd94d1a 100644 --- a/src/metadata/erc1155_abi.json +++ b/src/metadata/erc1155_abi.json @@ -1,620 +1 @@ -{ - "abi": [ - { - "type": "constructor", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "uri" - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "ApprovalForAll", - "inputs": [ - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "operator", - "indexed": true - }, - { - "type": "bool", - "name": "approved", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleAdminChanged", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "bytes32", - "name": "previousAdminRole", - "indexed": true - }, - { - "type": "bytes32", - "name": "newAdminRole", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleGranted", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleRevoked", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "TransferBatch", - "inputs": [ - { - "type": "address", - "name": "operator", - "indexed": true - }, - { - "type": "address", - "name": "from", - "indexed": true - }, - { - "type": "address", - "name": "to", - "indexed": true - }, - { - "type": "uint256[]", - "name": "ids", - "indexed": false - }, - { - "type": "uint256[]", - "name": "values", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "TransferSingle", - "inputs": [ - { - "type": "address", - "name": "operator", - "indexed": true - }, - { - "type": "address", - "name": "from", - "indexed": true - }, - { - "type": "address", - "name": "to", - "indexed": true - }, - { - "type": "uint256", - "name": "id", - "indexed": false - }, - { - "type": "uint256", - "name": "value", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "URI", - "inputs": [ - { - "type": "string", - "name": "value", - "indexed": false - }, - { - "type": "uint256", - "name": "id", - "indexed": true - } - ] - }, - { - "type": "function", - "name": "DEFAULT_ADMIN_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "MINTER_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "balanceOf", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "account" - }, - { - "type": "uint256", - "name": "id" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "balanceOfBatch", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address[]", - "name": "accounts" - }, - { - "type": "uint256[]", - "name": "ids" - } - ], - "outputs": [ - { - "type": "uint256[]", - "name": "" - } - ] - }, - { - "type": "function", - "name": "burn", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "account" - }, - { - "type": "uint256", - "name": "id" - }, - { - "type": "uint256", - "name": "value" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "burnBatch", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "account" - }, - { - "type": "uint256[]", - "name": "ids" - }, - { - "type": "uint256[]", - "name": "values" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "getRoleAdmin", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMember", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "uint256", - "name": "index" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMemberCount", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "grantRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "hasRole", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "isApprovedForAll", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "account" - }, - { - "type": "address", - "name": "operator" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "mint", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "account" - }, - { - "type": "uint256", - "name": "id" - }, - { - "type": "uint256", - "name": "amount" - }, - { - "type": "bytes", - "name": "data" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "mintBatch", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "account" - }, - { - "type": "uint256[]", - "name": "ids" - }, - { - "type": "uint256[]", - "name": "amounts" - }, - { - "type": "bytes", - "name": "data" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "renounceRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "revokeRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "safeBatchTransferFrom", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "from" - }, - { - "type": "address", - "name": "to" - }, - { - "type": "uint256[]", - "name": "ids" - }, - { - "type": "uint256[]", - "name": "amounts" - }, - { - "type": "bytes", - "name": "data" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "safeTransferFrom", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "from" - }, - { - "type": "address", - "name": "to" - }, - { - "type": "uint256", - "name": "id" - }, - { - "type": "uint256", - "name": "amount" - }, - { - "type": "bytes", - "name": "data" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "setApprovalForAll", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "operator" - }, - { - "type": "bool", - "name": "approved" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "supportsInterface", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes4", - "name": "interfaceId" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "uri", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "uint256", - "name": "" - } - ], - "outputs": [ - { - "type": "string", - "name": "" - } - ] - } - ] -} \ No newline at end of file +{"abi":[{"type":"constructor","payable":false,"inputs":[{"type":"string","name":"uri"}]},{"type":"event","anonymous":false,"name":"ApprovalForAll","inputs":[{"type":"address","name":"account","indexed":true},{"type":"address","name":"operator","indexed":true},{"type":"bool","name":"approved","indexed":false}]},{"type":"event","anonymous":false,"name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"bytes32","name":"previousAdminRole","indexed":true},{"type":"bytes32","name":"newAdminRole","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"event","anonymous":false,"name":"TransferBatch","inputs":[{"type":"address","name":"operator","indexed":true},{"type":"address","name":"from","indexed":true},{"type":"address","name":"to","indexed":true},{"type":"uint256[]","name":"ids","indexed":false},{"type":"uint256[]","name":"values","indexed":false}]},{"type":"event","anonymous":false,"name":"TransferSingle","inputs":[{"type":"address","name":"operator","indexed":true},{"type":"address","name":"from","indexed":true},{"type":"address","name":"to","indexed":true},{"type":"uint256","name":"id","indexed":false},{"type":"uint256","name":"value","indexed":false}]},{"type":"event","anonymous":false,"name":"URI","inputs":[{"type":"string","name":"value","indexed":false},{"type":"uint256","name":"id","indexed":true}]},{"type":"function","name":"DEFAULT_ADMIN_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"MINTER_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"balanceOf","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"account"},{"type":"uint256","name":"id"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"balanceOfBatch","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address[]","name":"accounts"},{"type":"uint256[]","name":"ids"}],"outputs":[{"type":"uint256[]","name":""}]},{"type":"function","name":"burn","constant":false,"payable":false,"inputs":[{"type":"address","name":"account"},{"type":"uint256","name":"id"},{"type":"uint256","name":"value"}],"outputs":[]},{"type":"function","name":"burnBatch","constant":false,"payable":false,"inputs":[{"type":"address","name":"account"},{"type":"uint256[]","name":"ids"},{"type":"uint256[]","name":"values"}],"outputs":[]},{"type":"function","name":"getRoleAdmin","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"getRoleMember","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"uint256","name":"index"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getRoleMemberCount","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"grantRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"hasRole","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"isApprovedForAll","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"account"},{"type":"address","name":"operator"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"mint","constant":false,"payable":false,"inputs":[{"type":"address","name":"account"},{"type":"uint256","name":"id"},{"type":"uint256","name":"amount"},{"type":"bytes","name":"data"}],"outputs":[]},{"type":"function","name":"mintBatch","constant":false,"payable":false,"inputs":[{"type":"address","name":"account"},{"type":"uint256[]","name":"ids"},{"type":"uint256[]","name":"amounts"},{"type":"bytes","name":"data"}],"outputs":[]},{"type":"function","name":"renounceRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"revokeRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"safeBatchTransferFrom","constant":false,"payable":false,"inputs":[{"type":"address","name":"from"},{"type":"address","name":"to"},{"type":"uint256[]","name":"ids"},{"type":"uint256[]","name":"amounts"},{"type":"bytes","name":"data"}],"outputs":[]},{"type":"function","name":"safeTransferFrom","constant":false,"payable":false,"inputs":[{"type":"address","name":"from"},{"type":"address","name":"to"},{"type":"uint256","name":"id"},{"type":"uint256","name":"amount"},{"type":"bytes","name":"data"}],"outputs":[]},{"type":"function","name":"setApprovalForAll","constant":false,"payable":false,"inputs":[{"type":"address","name":"operator"},{"type":"bool","name":"approved"}],"outputs":[]},{"type":"function","name":"supportsInterface","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes4","name":"interfaceId"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"uri","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"uint256","name":""}],"outputs":[{"type":"string","name":""}]}]} \ No newline at end of file diff --git a/src/metadata/erc20_abi.json b/src/metadata/erc20_abi.json index 8911db7..b9595a7 100644 --- a/src/metadata/erc20_abi.json +++ b/src/metadata/erc20_abi.json @@ -1,569 +1 @@ -{ - "abi": [ - { - "type": "constructor", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "contractName" - }, - { - "type": "string", - "name": "contractSymbol" - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "Approval", - "inputs": [ - { - "type": "address", - "name": "owner", - "indexed": true - }, - { - "type": "address", - "name": "spender", - "indexed": true - }, - { - "type": "uint256", - "name": "value", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleAdminChanged", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "bytes32", - "name": "previousAdminRole", - "indexed": true - }, - { - "type": "bytes32", - "name": "newAdminRole", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleGranted", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleRevoked", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "Transfer", - "inputs": [ - { - "type": "address", - "name": "from", - "indexed": true - }, - { - "type": "address", - "name": "to", - "indexed": true - }, - { - "type": "uint256", - "name": "value", - "indexed": false - } - ] - }, - { - "type": "function", - "name": "DEFAULT_ADMIN_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "MINTER_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "allowance", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "owner" - }, - { - "type": "address", - "name": "spender" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "approve", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "spender" - }, - { - "type": "uint256", - "name": "amount" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "balanceOf", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "account" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "burn", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "uint256", - "name": "amount" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "burnFrom", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "account" - }, - { - "type": "uint256", - "name": "amount" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "decimals", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "uint8", - "name": "" - } - ] - }, - { - "type": "function", - "name": "decreaseAllowance", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "spender" - }, - { - "type": "uint256", - "name": "subtractedValue" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleAdmin", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMember", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "uint256", - "name": "index" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMemberCount", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "grantRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "hasRole", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "increaseAllowance", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "spender" - }, - { - "type": "uint256", - "name": "addedValue" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "mint", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "account" - }, - { - "type": "uint256", - "name": "value" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "name", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "string", - "name": "" - } - ] - }, - { - "type": "function", - "name": "renounceRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "revokeRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "supportsInterface", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes4", - "name": "interfaceId" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "symbol", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "string", - "name": "" - } - ] - }, - { - "type": "function", - "name": "totalSupply", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "transfer", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "to" - }, - { - "type": "uint256", - "name": "amount" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "transferFrom", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "from" - }, - { - "type": "address", - "name": "to" - }, - { - "type": "uint256", - "name": "amount" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - } - ] -} \ No newline at end of file +{"abi":[{"type":"constructor","payable":false,"inputs":[{"type":"string","name":"contractName"},{"type":"string","name":"contractSymbol"}]},{"type":"event","anonymous":false,"name":"Approval","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"address","name":"spender","indexed":true},{"type":"uint256","name":"value","indexed":false}]},{"type":"event","anonymous":false,"name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"bytes32","name":"previousAdminRole","indexed":true},{"type":"bytes32","name":"newAdminRole","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"event","anonymous":false,"name":"Transfer","inputs":[{"type":"address","name":"from","indexed":true},{"type":"address","name":"to","indexed":true},{"type":"uint256","name":"value","indexed":false}]},{"type":"function","name":"DEFAULT_ADMIN_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"MINTER_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"allowance","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"owner"},{"type":"address","name":"spender"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"approve","constant":false,"payable":false,"inputs":[{"type":"address","name":"spender"},{"type":"uint256","name":"amount"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"balanceOf","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"account"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"burn","constant":false,"payable":false,"inputs":[{"type":"uint256","name":"amount"}],"outputs":[]},{"type":"function","name":"burnFrom","constant":false,"payable":false,"inputs":[{"type":"address","name":"account"},{"type":"uint256","name":"amount"}],"outputs":[]},{"type":"function","name":"decimals","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"uint8","name":""}]},{"type":"function","name":"decreaseAllowance","constant":false,"payable":false,"inputs":[{"type":"address","name":"spender"},{"type":"uint256","name":"subtractedValue"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"getRoleAdmin","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"getRoleMember","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"uint256","name":"index"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getRoleMemberCount","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"grantRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"hasRole","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"increaseAllowance","constant":false,"payable":false,"inputs":[{"type":"address","name":"spender"},{"type":"uint256","name":"addedValue"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"mint","constant":false,"payable":false,"inputs":[{"type":"address","name":"account"},{"type":"uint256","name":"value"}],"outputs":[]},{"type":"function","name":"name","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"string","name":""}]},{"type":"function","name":"renounceRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"revokeRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"supportsInterface","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes4","name":"interfaceId"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"symbol","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"string","name":""}]},{"type":"function","name":"totalSupply","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"transfer","constant":false,"payable":false,"inputs":[{"type":"address","name":"to"},{"type":"uint256","name":"amount"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"transferFrom","constant":false,"payable":false,"inputs":[{"type":"address","name":"from"},{"type":"address","name":"to"},{"type":"uint256","name":"amount"}],"outputs":[{"type":"bool","name":""}]}]} \ No newline at end of file diff --git a/src/metadata/erc20_wrapper_abi.json b/src/metadata/erc20_wrapper_abi.json index 67c490f..2306df6 100644 --- a/src/metadata/erc20_wrapper_abi.json +++ b/src/metadata/erc20_wrapper_abi.json @@ -1,336 +1 @@ -{ - "abi": [ - { - "type": "constructor", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "contractName" - }, - { - "type": "string", - "name": "contractSymbol" - }, - { - "type": "address", - "name": "originToken" - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "Approval", - "inputs": [ - { - "type": "address", - "name": "owner", - "indexed": true - }, - { - "type": "address", - "name": "spender", - "indexed": true - }, - { - "type": "uint256", - "name": "value", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "Transfer", - "inputs": [ - { - "type": "address", - "name": "from", - "indexed": true - }, - { - "type": "address", - "name": "to", - "indexed": true - }, - { - "type": "uint256", - "name": "value", - "indexed": false - } - ] - }, - { - "type": "function", - "name": "allowance", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "owner" - }, - { - "type": "address", - "name": "spender" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "approve", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "spender" - }, - { - "type": "uint256", - "name": "amount" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "balanceOf", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "account" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "decimals", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "uint8", - "name": "" - } - ] - }, - { - "type": "function", - "name": "decreaseAllowance", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "spender" - }, - { - "type": "uint256", - "name": "subtractedValue" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "depositFor", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "account" - }, - { - "type": "uint256", - "name": "amount" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "increaseAllowance", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "spender" - }, - { - "type": "uint256", - "name": "addedValue" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "name", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "string", - "name": "" - } - ] - }, - { - "type": "function", - "name": "symbol", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "string", - "name": "" - } - ] - }, - { - "type": "function", - "name": "totalSupply", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "transfer", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "to" - }, - { - "type": "uint256", - "name": "amount" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "transferFrom", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "from" - }, - { - "type": "address", - "name": "to" - }, - { - "type": "uint256", - "name": "amount" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "underlying", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "withdrawTo", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "account" - }, - { - "type": "uint256", - "name": "amount" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - } - ] -} \ No newline at end of file +{"abi":[{"type":"constructor","payable":false,"inputs":[{"type":"string","name":"contractName"},{"type":"string","name":"contractSymbol"},{"type":"address","name":"originToken"}]},{"type":"event","anonymous":false,"name":"Approval","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"address","name":"spender","indexed":true},{"type":"uint256","name":"value","indexed":false}]},{"type":"event","anonymous":false,"name":"Transfer","inputs":[{"type":"address","name":"from","indexed":true},{"type":"address","name":"to","indexed":true},{"type":"uint256","name":"value","indexed":false}]},{"type":"function","name":"allowance","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"owner"},{"type":"address","name":"spender"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"approve","constant":false,"payable":false,"inputs":[{"type":"address","name":"spender"},{"type":"uint256","name":"amount"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"balanceOf","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"account"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"decimals","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"uint8","name":""}]},{"type":"function","name":"decreaseAllowance","constant":false,"payable":false,"inputs":[{"type":"address","name":"spender"},{"type":"uint256","name":"subtractedValue"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"depositFor","constant":false,"payable":false,"inputs":[{"type":"address","name":"account"},{"type":"uint256","name":"amount"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"increaseAllowance","constant":false,"payable":false,"inputs":[{"type":"address","name":"spender"},{"type":"uint256","name":"addedValue"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"name","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"string","name":""}]},{"type":"function","name":"symbol","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"string","name":""}]},{"type":"function","name":"totalSupply","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"transfer","constant":false,"payable":false,"inputs":[{"type":"address","name":"to"},{"type":"uint256","name":"amount"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"transferFrom","constant":false,"payable":false,"inputs":[{"type":"address","name":"from"},{"type":"address","name":"to"},{"type":"uint256","name":"amount"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"underlying","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"withdrawTo","constant":false,"payable":false,"inputs":[{"type":"address","name":"account"},{"type":"uint256","name":"amount"}],"outputs":[{"type":"bool","name":""}]}]} \ No newline at end of file diff --git a/src/metadata/erc721_abi.json b/src/metadata/erc721_abi.json index 869ac20..338bb64 100644 --- a/src/metadata/erc721_abi.json +++ b/src/metadata/erc721_abi.json @@ -1,595 +1 @@ -{ - "abi": [ - { - "type": "constructor", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "contractName" - }, - { - "type": "string", - "name": "contractSymbol" - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "Approval", - "inputs": [ - { - "type": "address", - "name": "owner", - "indexed": true - }, - { - "type": "address", - "name": "approved", - "indexed": true - }, - { - "type": "uint256", - "name": "tokenId", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "ApprovalForAll", - "inputs": [ - { - "type": "address", - "name": "owner", - "indexed": true - }, - { - "type": "address", - "name": "operator", - "indexed": true - }, - { - "type": "bool", - "name": "approved", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleAdminChanged", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "bytes32", - "name": "previousAdminRole", - "indexed": true - }, - { - "type": "bytes32", - "name": "newAdminRole", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleGranted", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleRevoked", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "Transfer", - "inputs": [ - { - "type": "address", - "name": "from", - "indexed": true - }, - { - "type": "address", - "name": "to", - "indexed": true - }, - { - "type": "uint256", - "name": "tokenId", - "indexed": true - } - ] - }, - { - "type": "function", - "name": "DEFAULT_ADMIN_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "MINTER_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "approve", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "to" - }, - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "balanceOf", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "owner" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "burn", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "getApproved", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleAdmin", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMember", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "uint256", - "name": "index" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMemberCount", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "grantRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "hasRole", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "isApprovedForAll", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "owner" - }, - { - "type": "address", - "name": "operator" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "mint", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "to" - }, - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "name", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "string", - "name": "" - } - ] - }, - { - "type": "function", - "name": "ownerOf", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "renounceRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "revokeRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "safeTransferFrom", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "from" - }, - { - "type": "address", - "name": "to" - }, - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "safeTransferFrom", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "from" - }, - { - "type": "address", - "name": "to" - }, - { - "type": "uint256", - "name": "tokenId" - }, - { - "type": "bytes", - "name": "_data" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "setApprovalForAll", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "operator" - }, - { - "type": "bool", - "name": "approved" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "supportsInterface", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes4", - "name": "interfaceId" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "symbol", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "string", - "name": "" - } - ] - }, - { - "type": "function", - "name": "tokenURI", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [ - { - "type": "string", - "name": "" - } - ] - }, - { - "type": "function", - "name": "transferFrom", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "from" - }, - { - "type": "address", - "name": "to" - }, - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [] - } - ] -} \ No newline at end of file +{"abi":[{"type":"constructor","payable":false,"inputs":[{"type":"string","name":"contractName"},{"type":"string","name":"contractSymbol"}]},{"type":"event","anonymous":false,"name":"Approval","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"address","name":"approved","indexed":true},{"type":"uint256","name":"tokenId","indexed":true}]},{"type":"event","anonymous":false,"name":"ApprovalForAll","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"address","name":"operator","indexed":true},{"type":"bool","name":"approved","indexed":false}]},{"type":"event","anonymous":false,"name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"bytes32","name":"previousAdminRole","indexed":true},{"type":"bytes32","name":"newAdminRole","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"event","anonymous":false,"name":"Transfer","inputs":[{"type":"address","name":"from","indexed":true},{"type":"address","name":"to","indexed":true},{"type":"uint256","name":"tokenId","indexed":true}]},{"type":"function","name":"DEFAULT_ADMIN_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"MINTER_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"approve","constant":false,"payable":false,"inputs":[{"type":"address","name":"to"},{"type":"uint256","name":"tokenId"}],"outputs":[]},{"type":"function","name":"balanceOf","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"owner"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"burn","constant":false,"payable":false,"inputs":[{"type":"uint256","name":"tokenId"}],"outputs":[]},{"type":"function","name":"getApproved","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"uint256","name":"tokenId"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getRoleAdmin","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"getRoleMember","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"uint256","name":"index"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getRoleMemberCount","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"grantRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"hasRole","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"isApprovedForAll","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"owner"},{"type":"address","name":"operator"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"mint","constant":false,"payable":false,"inputs":[{"type":"address","name":"to"},{"type":"uint256","name":"tokenId"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"name","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"string","name":""}]},{"type":"function","name":"ownerOf","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"uint256","name":"tokenId"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"renounceRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"revokeRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"safeTransferFrom","constant":false,"payable":false,"inputs":[{"type":"address","name":"from"},{"type":"address","name":"to"},{"type":"uint256","name":"tokenId"}],"outputs":[]},{"type":"function","name":"safeTransferFrom","constant":false,"payable":false,"inputs":[{"type":"address","name":"from"},{"type":"address","name":"to"},{"type":"uint256","name":"tokenId"},{"type":"bytes","name":"_data"}],"outputs":[]},{"type":"function","name":"setApprovalForAll","constant":false,"payable":false,"inputs":[{"type":"address","name":"operator"},{"type":"bool","name":"approved"}],"outputs":[]},{"type":"function","name":"supportsInterface","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes4","name":"interfaceId"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"symbol","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"string","name":""}]},{"type":"function","name":"tokenURI","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"uint256","name":"tokenId"}],"outputs":[{"type":"string","name":""}]},{"type":"function","name":"transferFrom","constant":false,"payable":false,"inputs":[{"type":"address","name":"from"},{"type":"address","name":"to"},{"type":"uint256","name":"tokenId"}],"outputs":[]}]} \ No newline at end of file diff --git a/src/metadata/erc721meta_abi.json b/src/metadata/erc721meta_abi.json index b96ad73..cc073c6 100644 --- a/src/metadata/erc721meta_abi.json +++ b/src/metadata/erc721meta_abi.json @@ -1,617 +1 @@ -{ - "abi": [ - { - "type": "constructor", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "contractName" - }, - { - "type": "string", - "name": "contractSymbol" - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "Approval", - "inputs": [ - { - "type": "address", - "name": "owner", - "indexed": true - }, - { - "type": "address", - "name": "approved", - "indexed": true - }, - { - "type": "uint256", - "name": "tokenId", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "ApprovalForAll", - "inputs": [ - { - "type": "address", - "name": "owner", - "indexed": true - }, - { - "type": "address", - "name": "operator", - "indexed": true - }, - { - "type": "bool", - "name": "approved", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleAdminChanged", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "bytes32", - "name": "previousAdminRole", - "indexed": true - }, - { - "type": "bytes32", - "name": "newAdminRole", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleGranted", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleRevoked", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "Transfer", - "inputs": [ - { - "type": "address", - "name": "from", - "indexed": true - }, - { - "type": "address", - "name": "to", - "indexed": true - }, - { - "type": "uint256", - "name": "tokenId", - "indexed": true - } - ] - }, - { - "type": "function", - "name": "DEFAULT_ADMIN_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "MINTER_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "approve", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "to" - }, - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "balanceOf", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "owner" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "burn", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "getApproved", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleAdmin", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMember", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "uint256", - "name": "index" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMemberCount", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "grantRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "hasRole", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "isApprovedForAll", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "owner" - }, - { - "type": "address", - "name": "operator" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "mint", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "to" - }, - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "name", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "string", - "name": "" - } - ] - }, - { - "type": "function", - "name": "ownerOf", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "renounceRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "revokeRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "safeTransferFrom", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "from" - }, - { - "type": "address", - "name": "to" - }, - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "safeTransferFrom", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "from" - }, - { - "type": "address", - "name": "to" - }, - { - "type": "uint256", - "name": "tokenId" - }, - { - "type": "bytes", - "name": "_data" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "setApprovalForAll", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "operator" - }, - { - "type": "bool", - "name": "approved" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "setTokenURI", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "uint256", - "name": "tokenId" - }, - { - "type": "string", - "name": "tokenUri" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "supportsInterface", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes4", - "name": "interfaceId" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "symbol", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "string", - "name": "" - } - ] - }, - { - "type": "function", - "name": "tokenURI", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [ - { - "type": "string", - "name": "" - } - ] - }, - { - "type": "function", - "name": "transferFrom", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "from" - }, - { - "type": "address", - "name": "to" - }, - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [] - } - ] -} \ No newline at end of file +{"abi":[{"type":"constructor","payable":false,"inputs":[{"type":"string","name":"contractName"},{"type":"string","name":"contractSymbol"}]},{"type":"event","anonymous":false,"name":"Approval","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"address","name":"approved","indexed":true},{"type":"uint256","name":"tokenId","indexed":true}]},{"type":"event","anonymous":false,"name":"ApprovalForAll","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"address","name":"operator","indexed":true},{"type":"bool","name":"approved","indexed":false}]},{"type":"event","anonymous":false,"name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"bytes32","name":"previousAdminRole","indexed":true},{"type":"bytes32","name":"newAdminRole","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"event","anonymous":false,"name":"Transfer","inputs":[{"type":"address","name":"from","indexed":true},{"type":"address","name":"to","indexed":true},{"type":"uint256","name":"tokenId","indexed":true}]},{"type":"function","name":"DEFAULT_ADMIN_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"MINTER_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"approve","constant":false,"payable":false,"inputs":[{"type":"address","name":"to"},{"type":"uint256","name":"tokenId"}],"outputs":[]},{"type":"function","name":"balanceOf","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"owner"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"burn","constant":false,"payable":false,"inputs":[{"type":"uint256","name":"tokenId"}],"outputs":[]},{"type":"function","name":"getApproved","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"uint256","name":"tokenId"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getRoleAdmin","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"getRoleMember","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"uint256","name":"index"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getRoleMemberCount","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"grantRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"hasRole","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"isApprovedForAll","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"owner"},{"type":"address","name":"operator"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"mint","constant":false,"payable":false,"inputs":[{"type":"address","name":"to"},{"type":"uint256","name":"tokenId"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"name","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"string","name":""}]},{"type":"function","name":"ownerOf","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"uint256","name":"tokenId"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"renounceRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"revokeRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"safeTransferFrom","constant":false,"payable":false,"inputs":[{"type":"address","name":"from"},{"type":"address","name":"to"},{"type":"uint256","name":"tokenId"}],"outputs":[]},{"type":"function","name":"safeTransferFrom","constant":false,"payable":false,"inputs":[{"type":"address","name":"from"},{"type":"address","name":"to"},{"type":"uint256","name":"tokenId"},{"type":"bytes","name":"_data"}],"outputs":[]},{"type":"function","name":"setApprovalForAll","constant":false,"payable":false,"inputs":[{"type":"address","name":"operator"},{"type":"bool","name":"approved"}],"outputs":[]},{"type":"function","name":"setTokenURI","constant":false,"payable":false,"inputs":[{"type":"uint256","name":"tokenId"},{"type":"string","name":"tokenUri"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"supportsInterface","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes4","name":"interfaceId"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"symbol","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"string","name":""}]},{"type":"function","name":"tokenURI","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"uint256","name":"tokenId"}],"outputs":[{"type":"string","name":""}]},{"type":"function","name":"transferFrom","constant":false,"payable":false,"inputs":[{"type":"address","name":"from"},{"type":"address","name":"to"},{"type":"uint256","name":"tokenId"}],"outputs":[]}]} \ No newline at end of file diff --git a/src/metadata/mainnetAbi.json b/src/metadata/mainnetAbi.json index 1f0e705..d39c29b 100644 --- a/src/metadata/mainnetAbi.json +++ b/src/metadata/mainnetAbi.json @@ -1,5993 +1 @@ -{ - "message_proxy_mainnet_address": "0x656fb12abab353FB1875a4e3Dc4D70179CB85BA4", - "message_proxy_mainnet_abi": [ - { - "type": "event", - "anonymous": false, - "name": "ExtraContractRegistered", - "inputs": [ - { - "type": "bytes32", - "name": "chainHash", - "indexed": true - }, - { - "type": "address", - "name": "contractAddress", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "ExtraContractRemoved", - "inputs": [ - { - "type": "bytes32", - "name": "chainHash", - "indexed": true - }, - { - "type": "address", - "name": "contractAddress", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "GasCostMessageHeaderWasChanged", - "inputs": [ - { - "type": "uint256", - "name": "oldValue", - "indexed": false - }, - { - "type": "uint256", - "name": "newValue", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "GasCostMessageWasChanged", - "inputs": [ - { - "type": "uint256", - "name": "oldValue", - "indexed": false - }, - { - "type": "uint256", - "name": "newValue", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "GasLimitWasChanged", - "inputs": [ - { - "type": "uint256", - "name": "oldValue", - "indexed": false - }, - { - "type": "uint256", - "name": "newValue", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "OutgoingMessage", - "inputs": [ - { - "type": "bytes32", - "name": "dstChainHash", - "indexed": true - }, - { - "type": "uint256", - "name": "msgCounter", - "indexed": true - }, - { - "type": "address", - "name": "srcContract", - "indexed": true - }, - { - "type": "address", - "name": "dstContract", - "indexed": false - }, - { - "type": "bytes", - "name": "data", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "PostMessageError", - "inputs": [ - { - "type": "uint256", - "name": "msgCounter", - "indexed": true - }, - { - "type": "bytes", - "name": "message", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleAdminChanged", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "bytes32", - "name": "previousAdminRole", - "indexed": true - }, - { - "type": "bytes32", - "name": "newAdminRole", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleGranted", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleRevoked", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "VersionUpdated", - "inputs": [ - { - "type": "string", - "name": "oldVersion", - "indexed": false - }, - { - "type": "string", - "name": "newVersion", - "indexed": false - } - ] - }, - { - "type": "function", - "name": "CHAIN_CONNECTOR_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "CONSTANT_SETTER_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "DEFAULT_ADMIN_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "EXTRA_CONTRACT_REGISTRAR_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "MAINNET_HASH", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "MESSAGES_LENGTH", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "REVERT_REASON_LENGTH", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "addConnectedChain", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "communityPool", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "connectedChains", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "incomingMessageCounter" - }, - { - "type": "uint256", - "name": "outgoingMessageCounter" - }, - { - "type": "bool", - "name": "inited" - } - ] - }, - { - "type": "function", - "name": "contractManagerOfSkaleManager", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "gasLimit", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getContractRegisteredLength", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "schainHash" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getContractRegisteredRange", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "schainHash" - }, - { - "type": "uint256", - "name": "from" - }, - { - "type": "uint256", - "name": "to" - } - ], - "outputs": [ - { - "type": "address[]", - "name": "contractsInRange" - } - ] - }, - { - "type": "function", - "name": "getIncomingMessagesCounter", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "fromSchainName" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getOutgoingMessagesCounter", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "targetSchainName" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleAdmin", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMember", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "uint256", - "name": "index" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMemberCount", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "grantRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "hasRole", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "headerMessageGasCost", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "contractManagerOfSkaleManagerValue" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "initializeAllRegisteredContracts", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "schainHash" - }, - { - "type": "address[]", - "name": "contracts" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "initializeMessageProxy", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "uint256", - "name": "newGasLimit" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "isConnectedChain", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "isContractRegistered", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "schainHash" - }, - { - "type": "address", - "name": "contractAddress" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "isSchainOwner", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "sender" - }, - { - "type": "bytes32", - "name": "schainHash" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "messageGasCost", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "messageInProgress", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "postIncomingMessages", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "fromSchainName" - }, - { - "type": "uint256", - "name": "startingCounter" - }, - { - "type": "tuple[]", - "name": "messages", - "components": [ - { - "type": "address", - "name": "sender" - }, - { - "type": "address", - "name": "destinationContract" - }, - { - "type": "bytes", - "name": "data" - } - ] - }, - { - "type": "tuple", - "name": "sign", - "components": [ - { - "type": "uint256[2]", - "name": "blsSignature" - }, - { - "type": "uint256", - "name": "hashA" - }, - { - "type": "uint256", - "name": "hashB" - }, - { - "type": "uint256", - "name": "counter" - } - ] - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "postOutgoingMessage", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "targetChainHash" - }, - { - "type": "address", - "name": "targetContract" - }, - { - "type": "bytes", - "name": "data" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "registerExtraContract", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "extraContract" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "registerExtraContractForAll", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "extraContract" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "removeConnectedChain", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "removeExtraContract", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "extraContract" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "removeExtraContractForAll", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "extraContract" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "renounceRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "revokeRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "setCommunityPool", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "newCommunityPoolAddress" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "setNewGasLimit", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "uint256", - "name": "newGasLimit" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "setNewHeaderMessageGasCost", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "uint256", - "name": "newHeaderMessageGasCost" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "setNewMessageGasCost", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "uint256", - "name": "newMessageGasCost" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "setVersion", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "newVersion" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "supportsInterface", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes4", - "name": "interfaceId" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "version", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "string", - "name": "" - } - ] - } - ], - "linker_address": "0xEa870bEF8cc1Ca6871AE960266ea0fDbCF06371d", - "linker_abi": [ - { - "type": "event", - "anonymous": false, - "name": "RoleAdminChanged", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "bytes32", - "name": "previousAdminRole", - "indexed": true - }, - { - "type": "bytes32", - "name": "newAdminRole", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleGranted", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleRevoked", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "function", - "name": "DEFAULT_ADMIN_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "LINKER_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "addSchainContract", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "contractReceiver" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "connectSchain", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address[]", - "name": "schainContracts" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "contractManagerOfSkaleManager", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "disconnectSchain", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "getRoleAdmin", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMember", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "uint256", - "name": "index" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMemberCount", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "grantRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "hasMainnetContract", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "mainnetContract" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "hasRole", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "hasSchain", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [ - { - "type": "bool", - "name": "connected" - } - ] - }, - { - "type": "function", - "name": "hasSchainContract", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "contractManagerOfSkaleManagerValue" - }, - { - "type": "address", - "name": "messageProxyValue" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "newContractManagerOfSkaleManager" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "isNotKilled", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "schainHash" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "isSchainOwner", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "sender" - }, - { - "type": "bytes32", - "name": "schainHash" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "kill", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "messageProxy", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "registerMainnetContract", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "newMainnetContract" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "removeMainnetContract", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "mainnetContract" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "removeSchainContract", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "renounceRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "revokeRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "schainLinks", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "statuses", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "" - } - ], - "outputs": [ - { - "type": "uint8", - "name": "" - } - ] - }, - { - "type": "function", - "name": "supportsInterface", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes4", - "name": "interfaceId" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - } - ], - "community_pool_address": "0xb2BadB7f28075CB2C8BDBd730204750Db4C03f98", - "community_pool_abi": [ - { - "type": "event", - "anonymous": false, - "name": "MinTransactionGasWasChanged", - "inputs": [ - { - "type": "uint256", - "name": "oldValue", - "indexed": false - }, - { - "type": "uint256", - "name": "newValue", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleAdminChanged", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "bytes32", - "name": "previousAdminRole", - "indexed": true - }, - { - "type": "bytes32", - "name": "newAdminRole", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleGranted", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleRevoked", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "function", - "name": "CONSTANT_SETTER_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "DEFAULT_ADMIN_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "LINKER_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "activeUsers", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "" - }, - { - "type": "bytes32", - "name": "" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "addSchainContract", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "contractReceiver" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "checkUserBalance", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "schainHash" - }, - { - "type": "address", - "name": "receiver" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "contractManagerOfSkaleManager", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getBalance", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "user" - }, - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleAdmin", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMember", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "uint256", - "name": "index" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMemberCount", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "grantRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "hasRole", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "hasSchainContract", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "contractManagerOfSkaleManagerValue" - }, - { - "type": "address", - "name": "newMessageProxy" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "contractManagerOfSkaleManagerValue" - }, - { - "type": "address", - "name": "linker" - }, - { - "type": "address", - "name": "messageProxyValue" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "newContractManagerOfSkaleManager" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "isSchainOwner", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "sender" - }, - { - "type": "bytes32", - "name": "schainHash" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "messageProxy", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "minTransactionGas", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "rechargeUserWallet", - "constant": false, - "stateMutability": "payable", - "payable": true, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "user" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "refundGasBySchainWallet", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "schainHash" - }, - { - "type": "address", - "name": "node" - }, - { - "type": "uint256", - "name": "gas" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "refundGasByUser", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "schainHash" - }, - { - "type": "address", - "name": "node" - }, - { - "type": "address", - "name": "user" - }, - { - "type": "uint256", - "name": "gas" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "removeSchainContract", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "renounceRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "revokeRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "schainLinks", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "setMinTransactionGas", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "uint256", - "name": "newMinTransactionGas" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "supportsInterface", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes4", - "name": "interfaceId" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "withdrawFunds", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "uint256", - "name": "amount" - } - ], - "outputs": [] - } - ], - "deposit_box_eth_address": "0x9910cF6ba22915C5afCe8b682f7c09d1c001FA59", - "deposit_box_eth_abi": [ - { - "type": "event", - "anonymous": false, - "name": "ActiveEthTransfers", - "inputs": [ - { - "type": "bytes32", - "name": "schainHash", - "indexed": true - }, - { - "type": "bool", - "name": "active", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleAdminChanged", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "bytes32", - "name": "previousAdminRole", - "indexed": true - }, - { - "type": "bytes32", - "name": "newAdminRole", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleGranted", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleRevoked", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "function", - "name": "DEFAULT_ADMIN_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "DEPOSIT_BOX_MANAGER_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "LINKER_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "activeEthTransfers", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "addSchainContract", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "contractReceiver" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "approveTransfers", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "contractManagerOfSkaleManager", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "deposit", - "constant": false, - "stateMutability": "payable", - "payable": true, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "disableActiveEthTransfers", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "disableWhitelist", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "enableActiveEthTransfers", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "enableWhitelist", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "gasPayer", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "schainHash" - }, - { - "type": "address", - "name": "sender" - }, - { - "type": "bytes", - "name": "data" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getFunds", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "receiver" - }, - { - "type": "uint256", - "name": "amount" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "getMyEth", - "constant": false, - "payable": false, - "inputs": [], - "outputs": [] - }, - { - "type": "function", - "name": "getRoleAdmin", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMember", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "uint256", - "name": "index" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMemberCount", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "grantRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "hasRole", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "hasSchainContract", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "contractManagerOfSkaleManagerValue" - }, - { - "type": "address", - "name": "newMessageProxy" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "contractManagerOfSkaleManagerValue" - }, - { - "type": "address", - "name": "linkerValue" - }, - { - "type": "address", - "name": "messageProxyValue" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "newContractManagerOfSkaleManager" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "isSchainOwner", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "sender" - }, - { - "type": "bytes32", - "name": "schainHash" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "isWhitelisted", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "linker", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "messageProxy", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "postMessage", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "schainHash" - }, - { - "type": "address", - "name": "sender" - }, - { - "type": "bytes", - "name": "data" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "removeSchainContract", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "renounceRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "revokeRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "schainLinks", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "supportsInterface", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes4", - "name": "interfaceId" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "transferredAmount", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - } - ], - "deposit_box_erc20_address": "0xb3bf0c62f0924e5C8fdae9815355eA98Fba33C8E", - "deposit_box_erc20_abi": [ - { - "type": "event", - "anonymous": false, - "name": "ERC20TokenAdded", - "inputs": [ - { - "type": "string", - "name": "schainName", - "indexed": false - }, - { - "type": "address", - "name": "contractOnMainnet", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "ERC20TokenReady", - "inputs": [ - { - "type": "address", - "name": "contractOnMainnet", - "indexed": true - }, - { - "type": "uint256", - "name": "amount", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleAdminChanged", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "bytes32", - "name": "previousAdminRole", - "indexed": true - }, - { - "type": "bytes32", - "name": "newAdminRole", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleGranted", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleRevoked", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "function", - "name": "DEFAULT_ADMIN_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "DEPOSIT_BOX_MANAGER_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "LINKER_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "addERC20TokenByOwner", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "erc20OnMainnet" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "addSchainContract", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "contractReceiver" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "contractManagerOfSkaleManager", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "depositERC20", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "erc20OnMainnet" - }, - { - "type": "uint256", - "name": "amount" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "disableWhitelist", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "enableWhitelist", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "gasPayer", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "schainHash" - }, - { - "type": "address", - "name": "sender" - }, - { - "type": "bytes", - "name": "data" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getFunds", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "erc20OnMainnet" - }, - { - "type": "address", - "name": "receiver" - }, - { - "type": "uint256", - "name": "amount" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "getRoleAdmin", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMember", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "uint256", - "name": "index" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMemberCount", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getSchainToAllERC20", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "uint256", - "name": "from" - }, - { - "type": "uint256", - "name": "to" - } - ], - "outputs": [ - { - "type": "address[]", - "name": "tokensInRange" - } - ] - }, - { - "type": "function", - "name": "getSchainToAllERC20Length", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getSchainToERC20", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "erc20OnMainnet" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "grantRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "hasRole", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "hasSchainContract", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "contractManagerOfSkaleManagerValue" - }, - { - "type": "address", - "name": "newMessageProxy" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "contractManagerOfSkaleManagerValue" - }, - { - "type": "address", - "name": "linkerValue" - }, - { - "type": "address", - "name": "messageProxyValue" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "newContractManagerOfSkaleManager" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "initializeAllTokensForSchain", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address[]", - "name": "tokens" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "isSchainOwner", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "sender" - }, - { - "type": "bytes32", - "name": "schainHash" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "isWhitelisted", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "linker", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "messageProxy", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "postMessage", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "schainHash" - }, - { - "type": "address", - "name": "sender" - }, - { - "type": "bytes", - "name": "data" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "removeSchainContract", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "renounceRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "revokeRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "schainLinks", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "supportsInterface", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes4", - "name": "interfaceId" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "transferredAmount", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "" - }, - { - "type": "address", - "name": "" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - } - ], - "deposit_box_erc721_address": "0x98937f91885dcCfF8082623a157296AA161a9917", - "deposit_box_erc721_abi": [ - { - "type": "event", - "anonymous": false, - "name": "ERC721TokenAdded", - "inputs": [ - { - "type": "string", - "name": "schainName", - "indexed": false - }, - { - "type": "address", - "name": "contractOnMainnet", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "ERC721TokenReady", - "inputs": [ - { - "type": "address", - "name": "contractOnMainnet", - "indexed": true - }, - { - "type": "uint256", - "name": "tokenId", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleAdminChanged", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "bytes32", - "name": "previousAdminRole", - "indexed": true - }, - { - "type": "bytes32", - "name": "newAdminRole", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleGranted", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleRevoked", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "function", - "name": "DEFAULT_ADMIN_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "DEPOSIT_BOX_MANAGER_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "LINKER_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "addERC721TokenByOwner", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "erc721OnMainnet" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "addSchainContract", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "contractReceiver" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "contractManagerOfSkaleManager", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "depositERC721", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "erc721OnMainnet" - }, - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "disableWhitelist", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "enableWhitelist", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "gasPayer", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "schainHash" - }, - { - "type": "address", - "name": "sender" - }, - { - "type": "bytes", - "name": "data" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getFunds", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "erc721OnMainnet" - }, - { - "type": "address", - "name": "receiver" - }, - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "getRoleAdmin", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMember", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "uint256", - "name": "index" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMemberCount", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getSchainToAllERC721", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "uint256", - "name": "from" - }, - { - "type": "uint256", - "name": "to" - } - ], - "outputs": [ - { - "type": "address[]", - "name": "tokensInRange" - } - ] - }, - { - "type": "function", - "name": "getSchainToAllERC721Length", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getSchainToERC721", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "erc721OnMainnet" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "grantRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "hasRole", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "hasSchainContract", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "contractManagerOfSkaleManagerValue" - }, - { - "type": "address", - "name": "newMessageProxy" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "contractManagerOfSkaleManagerValue" - }, - { - "type": "address", - "name": "linkerValue" - }, - { - "type": "address", - "name": "messageProxyValue" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "newContractManagerOfSkaleManager" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "initializeAllTokensForSchain", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address[]", - "name": "tokens" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "isSchainOwner", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "sender" - }, - { - "type": "bytes32", - "name": "schainHash" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "isWhitelisted", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "linker", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "messageProxy", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "postMessage", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "schainHash" - }, - { - "type": "address", - "name": "sender" - }, - { - "type": "bytes", - "name": "data" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "removeSchainContract", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "renounceRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "revokeRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "schainLinks", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "supportsInterface", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes4", - "name": "interfaceId" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "transferredAmount", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "" - }, - { - "type": "uint256", - "name": "" - } - ], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - } - ], - "deposit_box_erc1155_address": "0xa0EF1521f56641F9E0E43c46E0F6B20715E454c8", - "deposit_box_erc1155_abi": [ - { - "type": "event", - "anonymous": false, - "name": "ERC1155TokenAdded", - "inputs": [ - { - "type": "string", - "name": "schainName", - "indexed": false - }, - { - "type": "address", - "name": "contractOnMainnet", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "ERC1155TokenReady", - "inputs": [ - { - "type": "address", - "name": "contractOnMainnet", - "indexed": true - }, - { - "type": "uint256[]", - "name": "ids", - "indexed": false - }, - { - "type": "uint256[]", - "name": "amounts", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleAdminChanged", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "bytes32", - "name": "previousAdminRole", - "indexed": true - }, - { - "type": "bytes32", - "name": "newAdminRole", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleGranted", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleRevoked", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "function", - "name": "DEFAULT_ADMIN_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "DEPOSIT_BOX_MANAGER_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "LINKER_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "addERC1155TokenByOwner", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "erc1155OnMainnet" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "addSchainContract", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "contractReceiver" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "contractManagerOfSkaleManager", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "depositERC1155", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "erc1155OnMainnet" - }, - { - "type": "uint256", - "name": "id" - }, - { - "type": "uint256", - "name": "amount" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "depositERC1155Batch", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "erc1155OnMainnet" - }, - { - "type": "uint256[]", - "name": "ids" - }, - { - "type": "uint256[]", - "name": "amounts" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "disableWhitelist", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "enableWhitelist", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "gasPayer", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "schainHash" - }, - { - "type": "address", - "name": "sender" - }, - { - "type": "bytes", - "name": "data" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getFunds", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "erc1155OnMainnet" - }, - { - "type": "address", - "name": "receiver" - }, - { - "type": "uint256[]", - "name": "ids" - }, - { - "type": "uint256[]", - "name": "amounts" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "getRoleAdmin", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMember", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "uint256", - "name": "index" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMemberCount", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getSchainToAllERC1155", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "uint256", - "name": "from" - }, - { - "type": "uint256", - "name": "to" - } - ], - "outputs": [ - { - "type": "address[]", - "name": "tokensInRange" - } - ] - }, - { - "type": "function", - "name": "getSchainToAllERC1155Length", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getSchainToERC1155", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "erc1155OnMainnet" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "grantRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "hasRole", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "hasSchainContract", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "contractManagerOfSkaleManagerValue" - }, - { - "type": "address", - "name": "newMessageProxy" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "contractManagerOfSkaleManagerValue" - }, - { - "type": "address", - "name": "linkerValue" - }, - { - "type": "address", - "name": "messageProxyValue" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "newContractManagerOfSkaleManager" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "initializeAllTokensForSchain", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address[]", - "name": "tokens" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "isSchainOwner", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "sender" - }, - { - "type": "bytes32", - "name": "schainHash" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "isWhitelisted", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "linker", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "messageProxy", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "onERC1155BatchReceived", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "operator" - }, - { - "type": "address", - "name": "" - }, - { - "type": "uint256[]", - "name": "" - }, - { - "type": "uint256[]", - "name": "" - }, - { - "type": "bytes", - "name": "" - } - ], - "outputs": [ - { - "type": "bytes4", - "name": "" - } - ] - }, - { - "type": "function", - "name": "onERC1155Received", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "operator" - }, - { - "type": "address", - "name": "" - }, - { - "type": "uint256", - "name": "" - }, - { - "type": "uint256", - "name": "" - }, - { - "type": "bytes", - "name": "" - } - ], - "outputs": [ - { - "type": "bytes4", - "name": "" - } - ] - }, - { - "type": "function", - "name": "postMessage", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "schainHash" - }, - { - "type": "address", - "name": "sender" - }, - { - "type": "bytes", - "name": "data" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "removeSchainContract", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "renounceRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "revokeRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "schainLinks", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "supportsInterface", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes4", - "name": "interfaceId" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "transferredAmount", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "" - }, - { - "type": "address", - "name": "" - }, - { - "type": "uint256", - "name": "" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - } - ], - "deposit_box_erc721_with_metadata_abi": [ - { - "type": "event", - "anonymous": false, - "name": "ERC721TokenAdded", - "inputs": [ - { - "type": "string", - "name": "schainName", - "indexed": false - }, - { - "type": "address", - "name": "contractOnMainnet", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "ERC721TokenReady", - "inputs": [ - { - "type": "address", - "name": "contractOnMainnet", - "indexed": true - }, - { - "type": "uint256", - "name": "tokenId", - "indexed": false - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleAdminChanged", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "bytes32", - "name": "previousAdminRole", - "indexed": true - }, - { - "type": "bytes32", - "name": "newAdminRole", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleGranted", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "event", - "anonymous": false, - "name": "RoleRevoked", - "inputs": [ - { - "type": "bytes32", - "name": "role", - "indexed": true - }, - { - "type": "address", - "name": "account", - "indexed": true - }, - { - "type": "address", - "name": "sender", - "indexed": true - } - ] - }, - { - "type": "function", - "name": "DEFAULT_ADMIN_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "DEPOSIT_BOX_MANAGER_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "LINKER_ROLE", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "addERC721TokenByOwner", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "erc721OnMainnet" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "addSchainContract", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "contractReceiver" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "contractManagerOfSkaleManager", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "depositERC721", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "erc721OnMainnet" - }, - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "disableWhitelist", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "enableWhitelist", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "gasPayer", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "schainHash" - }, - { - "type": "address", - "name": "sender" - }, - { - "type": "bytes", - "name": "data" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getFunds", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "erc721OnMainnet" - }, - { - "type": "address", - "name": "receiver" - }, - { - "type": "uint256", - "name": "tokenId" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "getRoleAdmin", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMember", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "uint256", - "name": "index" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getRoleMemberCount", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getSchainToAllERC721", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "uint256", - "name": "from" - }, - { - "type": "uint256", - "name": "to" - } - ], - "outputs": [ - { - "type": "address[]", - "name": "tokensInRange" - } - ] - }, - { - "type": "function", - "name": "getSchainToAllERC721Length", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [ - { - "type": "uint256", - "name": "" - } - ] - }, - { - "type": "function", - "name": "getSchainToERC721", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address", - "name": "erc721OnMainnet" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "grantRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "hasRole", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "hasSchainContract", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "contractManagerOfSkaleManagerValue" - }, - { - "type": "address", - "name": "newMessageProxy" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "contractManagerOfSkaleManagerValue" - }, - { - "type": "address", - "name": "linkerValue" - }, - { - "type": "address", - "name": "messageProxyValue" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "initialize", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "address", - "name": "newContractManagerOfSkaleManager" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "initializeAllTokensForSchain", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - }, - { - "type": "address[]", - "name": "tokens" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "isSchainOwner", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "sender" - }, - { - "type": "bytes32", - "name": "schainHash" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "isWhitelisted", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "linker", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "messageProxy", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "postMessage", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "schainHash" - }, - { - "type": "address", - "name": "sender" - }, - { - "type": "bytes", - "name": "data" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "removeSchainContract", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "string", - "name": "schainName" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "renounceRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "revokeRole", - "constant": false, - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "role" - }, - { - "type": "address", - "name": "account" - } - ], - "outputs": [] - }, - { - "type": "function", - "name": "schainLinks", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes32", - "name": "" - } - ], - "outputs": [ - { - "type": "address", - "name": "" - } - ] - }, - { - "type": "function", - "name": "supportsInterface", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "bytes4", - "name": "interfaceId" - } - ], - "outputs": [ - { - "type": "bool", - "name": "" - } - ] - }, - { - "type": "function", - "name": "transferredAmount", - "constant": true, - "stateMutability": "view", - "payable": false, - "inputs": [ - { - "type": "address", - "name": "" - }, - { - "type": "uint256", - "name": "" - } - ], - "outputs": [ - { - "type": "bytes32", - "name": "" - } - ] - } - ], - "deposit_box_erc721_with_metadata_address": "0x4B85DD7d995D6ae445292939d7ebfabD7Cd088dA" -} \ No newline at end of file +{"message_proxy_mainnet_address":"0x656fb12abab353FB1875a4e3Dc4D70179CB85BA4","message_proxy_mainnet_abi":[{"type":"event","anonymous":false,"name":"ExtraContractRegistered","inputs":[{"type":"bytes32","name":"chainHash","indexed":true},{"type":"address","name":"contractAddress","indexed":false}]},{"type":"event","anonymous":false,"name":"ExtraContractRemoved","inputs":[{"type":"bytes32","name":"chainHash","indexed":true},{"type":"address","name":"contractAddress","indexed":false}]},{"type":"event","anonymous":false,"name":"GasCostMessageHeaderWasChanged","inputs":[{"type":"uint256","name":"oldValue","indexed":false},{"type":"uint256","name":"newValue","indexed":false}]},{"type":"event","anonymous":false,"name":"GasCostMessageWasChanged","inputs":[{"type":"uint256","name":"oldValue","indexed":false},{"type":"uint256","name":"newValue","indexed":false}]},{"type":"event","anonymous":false,"name":"GasLimitWasChanged","inputs":[{"type":"uint256","name":"oldValue","indexed":false},{"type":"uint256","name":"newValue","indexed":false}]},{"type":"event","anonymous":false,"name":"OutgoingMessage","inputs":[{"type":"bytes32","name":"dstChainHash","indexed":true},{"type":"uint256","name":"msgCounter","indexed":true},{"type":"address","name":"srcContract","indexed":true},{"type":"address","name":"dstContract","indexed":false},{"type":"bytes","name":"data","indexed":false}]},{"type":"event","anonymous":false,"name":"PostMessageError","inputs":[{"type":"uint256","name":"msgCounter","indexed":true},{"type":"bytes","name":"message","indexed":false}]},{"type":"event","anonymous":false,"name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"bytes32","name":"previousAdminRole","indexed":true},{"type":"bytes32","name":"newAdminRole","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"event","anonymous":false,"name":"VersionUpdated","inputs":[{"type":"string","name":"oldVersion","indexed":false},{"type":"string","name":"newVersion","indexed":false}]},{"type":"function","name":"CHAIN_CONNECTOR_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"CONSTANT_SETTER_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"DEFAULT_ADMIN_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"EXTRA_CONTRACT_REGISTRAR_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"MAINNET_HASH","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"MESSAGES_LENGTH","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"REVERT_REASON_LENGTH","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"addConnectedChain","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"communityPool","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"connectedChains","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":""}],"outputs":[{"type":"uint256","name":"incomingMessageCounter"},{"type":"uint256","name":"outgoingMessageCounter"},{"type":"bool","name":"inited"}]},{"type":"function","name":"contractManagerOfSkaleManager","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"gasLimit","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"getContractRegisteredLength","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"schainHash"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"getContractRegisteredRange","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"schainHash"},{"type":"uint256","name":"from"},{"type":"uint256","name":"to"}],"outputs":[{"type":"address[]","name":"contractsInRange"}]},{"type":"function","name":"getIncomingMessagesCounter","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"fromSchainName"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"getOutgoingMessagesCounter","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"targetSchainName"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"getRoleAdmin","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"getRoleMember","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"uint256","name":"index"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getRoleMemberCount","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"grantRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"hasRole","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"headerMessageGasCost","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"contractManagerOfSkaleManagerValue"}],"outputs":[]},{"type":"function","name":"initializeAllRegisteredContracts","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"schainHash"},{"type":"address[]","name":"contracts"}],"outputs":[]},{"type":"function","name":"initializeMessageProxy","constant":false,"payable":false,"inputs":[{"type":"uint256","name":"newGasLimit"}],"outputs":[]},{"type":"function","name":"isConnectedChain","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"isContractRegistered","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"schainHash"},{"type":"address","name":"contractAddress"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"isSchainOwner","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"sender"},{"type":"bytes32","name":"schainHash"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"messageGasCost","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"messageInProgress","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"postIncomingMessages","constant":false,"payable":false,"inputs":[{"type":"string","name":"fromSchainName"},{"type":"uint256","name":"startingCounter"},{"type":"tuple[]","name":"messages","components":[{"type":"address","name":"sender"},{"type":"address","name":"destinationContract"},{"type":"bytes","name":"data"}]},{"type":"tuple","name":"sign","components":[{"type":"uint256[2]","name":"blsSignature"},{"type":"uint256","name":"hashA"},{"type":"uint256","name":"hashB"},{"type":"uint256","name":"counter"}]}],"outputs":[]},{"type":"function","name":"postOutgoingMessage","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"targetChainHash"},{"type":"address","name":"targetContract"},{"type":"bytes","name":"data"}],"outputs":[]},{"type":"function","name":"registerExtraContract","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"extraContract"}],"outputs":[]},{"type":"function","name":"registerExtraContractForAll","constant":false,"payable":false,"inputs":[{"type":"address","name":"extraContract"}],"outputs":[]},{"type":"function","name":"removeConnectedChain","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"removeExtraContract","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"extraContract"}],"outputs":[]},{"type":"function","name":"removeExtraContractForAll","constant":false,"payable":false,"inputs":[{"type":"address","name":"extraContract"}],"outputs":[]},{"type":"function","name":"renounceRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"revokeRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"setCommunityPool","constant":false,"payable":false,"inputs":[{"type":"address","name":"newCommunityPoolAddress"}],"outputs":[]},{"type":"function","name":"setNewGasLimit","constant":false,"payable":false,"inputs":[{"type":"uint256","name":"newGasLimit"}],"outputs":[]},{"type":"function","name":"setNewHeaderMessageGasCost","constant":false,"payable":false,"inputs":[{"type":"uint256","name":"newHeaderMessageGasCost"}],"outputs":[]},{"type":"function","name":"setNewMessageGasCost","constant":false,"payable":false,"inputs":[{"type":"uint256","name":"newMessageGasCost"}],"outputs":[]},{"type":"function","name":"setVersion","constant":false,"payable":false,"inputs":[{"type":"string","name":"newVersion"}],"outputs":[]},{"type":"function","name":"supportsInterface","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes4","name":"interfaceId"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"version","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"string","name":""}]}],"linker_address":"0xEa870bEF8cc1Ca6871AE960266ea0fDbCF06371d","linker_abi":[{"type":"event","anonymous":false,"name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"bytes32","name":"previousAdminRole","indexed":true},{"type":"bytes32","name":"newAdminRole","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"function","name":"DEFAULT_ADMIN_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"LINKER_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"addSchainContract","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"contractReceiver"}],"outputs":[]},{"type":"function","name":"connectSchain","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address[]","name":"schainContracts"}],"outputs":[]},{"type":"function","name":"contractManagerOfSkaleManager","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"disconnectSchain","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"getRoleAdmin","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"getRoleMember","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"uint256","name":"index"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getRoleMemberCount","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"grantRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"hasMainnetContract","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"mainnetContract"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"hasRole","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"hasSchain","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[{"type":"bool","name":"connected"}]},{"type":"function","name":"hasSchainContract","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"contractManagerOfSkaleManagerValue"},{"type":"address","name":"messageProxyValue"}],"outputs":[]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"newContractManagerOfSkaleManager"}],"outputs":[]},{"type":"function","name":"isNotKilled","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"schainHash"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"isSchainOwner","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"sender"},{"type":"bytes32","name":"schainHash"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"kill","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"messageProxy","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"registerMainnetContract","constant":false,"payable":false,"inputs":[{"type":"address","name":"newMainnetContract"}],"outputs":[]},{"type":"function","name":"removeMainnetContract","constant":false,"payable":false,"inputs":[{"type":"address","name":"mainnetContract"}],"outputs":[]},{"type":"function","name":"removeSchainContract","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"renounceRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"revokeRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"schainLinks","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":""}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"statuses","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":""}],"outputs":[{"type":"uint8","name":""}]},{"type":"function","name":"supportsInterface","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes4","name":"interfaceId"}],"outputs":[{"type":"bool","name":""}]}],"community_pool_address":"0xb2BadB7f28075CB2C8BDBd730204750Db4C03f98","community_pool_abi":[{"type":"event","anonymous":false,"name":"MinTransactionGasWasChanged","inputs":[{"type":"uint256","name":"oldValue","indexed":false},{"type":"uint256","name":"newValue","indexed":false}]},{"type":"event","anonymous":false,"name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"bytes32","name":"previousAdminRole","indexed":true},{"type":"bytes32","name":"newAdminRole","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"function","name":"CONSTANT_SETTER_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"DEFAULT_ADMIN_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"LINKER_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"activeUsers","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":""},{"type":"bytes32","name":""}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"addSchainContract","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"contractReceiver"}],"outputs":[]},{"type":"function","name":"checkUserBalance","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"schainHash"},{"type":"address","name":"receiver"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"contractManagerOfSkaleManager","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getBalance","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"user"},{"type":"string","name":"schainName"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"getRoleAdmin","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"getRoleMember","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"uint256","name":"index"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getRoleMemberCount","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"grantRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"hasRole","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"hasSchainContract","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"contractManagerOfSkaleManagerValue"},{"type":"address","name":"newMessageProxy"}],"outputs":[]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"contractManagerOfSkaleManagerValue"},{"type":"address","name":"linker"},{"type":"address","name":"messageProxyValue"}],"outputs":[]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"newContractManagerOfSkaleManager"}],"outputs":[]},{"type":"function","name":"isSchainOwner","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"sender"},{"type":"bytes32","name":"schainHash"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"messageProxy","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"minTransactionGas","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"rechargeUserWallet","constant":false,"stateMutability":"payable","payable":true,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"user"}],"outputs":[]},{"type":"function","name":"refundGasBySchainWallet","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"schainHash"},{"type":"address","name":"node"},{"type":"uint256","name":"gas"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"refundGasByUser","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"schainHash"},{"type":"address","name":"node"},{"type":"address","name":"user"},{"type":"uint256","name":"gas"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"removeSchainContract","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"renounceRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"revokeRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"schainLinks","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":""}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"setMinTransactionGas","constant":false,"payable":false,"inputs":[{"type":"uint256","name":"newMinTransactionGas"}],"outputs":[]},{"type":"function","name":"supportsInterface","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes4","name":"interfaceId"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"withdrawFunds","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"uint256","name":"amount"}],"outputs":[]}],"deposit_box_eth_address":"0x9910cF6ba22915C5afCe8b682f7c09d1c001FA59","deposit_box_eth_abi":[{"type":"event","anonymous":false,"name":"ActiveEthTransfers","inputs":[{"type":"bytes32","name":"schainHash","indexed":true},{"type":"bool","name":"active","indexed":false}]},{"type":"event","anonymous":false,"name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"bytes32","name":"previousAdminRole","indexed":true},{"type":"bytes32","name":"newAdminRole","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"function","name":"DEFAULT_ADMIN_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"DEPOSIT_BOX_MANAGER_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"LINKER_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"activeEthTransfers","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":""}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"addSchainContract","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"contractReceiver"}],"outputs":[]},{"type":"function","name":"approveTransfers","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":""}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"contractManagerOfSkaleManager","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"deposit","constant":false,"stateMutability":"payable","payable":true,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"disableActiveEthTransfers","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"disableWhitelist","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"enableActiveEthTransfers","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"enableWhitelist","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"gasPayer","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"schainHash"},{"type":"address","name":"sender"},{"type":"bytes","name":"data"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getFunds","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"receiver"},{"type":"uint256","name":"amount"}],"outputs":[]},{"type":"function","name":"getMyEth","constant":false,"payable":false,"inputs":[],"outputs":[]},{"type":"function","name":"getRoleAdmin","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"getRoleMember","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"uint256","name":"index"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getRoleMemberCount","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"grantRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"hasRole","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"hasSchainContract","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"contractManagerOfSkaleManagerValue"},{"type":"address","name":"newMessageProxy"}],"outputs":[]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"contractManagerOfSkaleManagerValue"},{"type":"address","name":"linkerValue"},{"type":"address","name":"messageProxyValue"}],"outputs":[]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"newContractManagerOfSkaleManager"}],"outputs":[]},{"type":"function","name":"isSchainOwner","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"sender"},{"type":"bytes32","name":"schainHash"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"isWhitelisted","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"linker","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"messageProxy","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"postMessage","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"schainHash"},{"type":"address","name":"sender"},{"type":"bytes","name":"data"}],"outputs":[]},{"type":"function","name":"removeSchainContract","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"renounceRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"revokeRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"schainLinks","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":""}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"supportsInterface","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes4","name":"interfaceId"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"transferredAmount","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":""}],"outputs":[{"type":"uint256","name":""}]}],"deposit_box_erc20_address":"0xb3bf0c62f0924e5C8fdae9815355eA98Fba33C8E","deposit_box_erc20_abi":[{"type":"event","anonymous":false,"name":"ERC20TokenAdded","inputs":[{"type":"string","name":"schainName","indexed":false},{"type":"address","name":"contractOnMainnet","indexed":true}]},{"type":"event","anonymous":false,"name":"ERC20TokenReady","inputs":[{"type":"address","name":"contractOnMainnet","indexed":true},{"type":"uint256","name":"amount","indexed":false}]},{"type":"event","anonymous":false,"name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"bytes32","name":"previousAdminRole","indexed":true},{"type":"bytes32","name":"newAdminRole","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"function","name":"DEFAULT_ADMIN_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"DEPOSIT_BOX_MANAGER_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"LINKER_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"addERC20TokenByOwner","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"erc20OnMainnet"}],"outputs":[]},{"type":"function","name":"addSchainContract","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"contractReceiver"}],"outputs":[]},{"type":"function","name":"contractManagerOfSkaleManager","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"depositERC20","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"erc20OnMainnet"},{"type":"uint256","name":"amount"}],"outputs":[]},{"type":"function","name":"disableWhitelist","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"enableWhitelist","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"gasPayer","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"schainHash"},{"type":"address","name":"sender"},{"type":"bytes","name":"data"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getFunds","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"erc20OnMainnet"},{"type":"address","name":"receiver"},{"type":"uint256","name":"amount"}],"outputs":[]},{"type":"function","name":"getRoleAdmin","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"getRoleMember","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"uint256","name":"index"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getRoleMemberCount","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"getSchainToAllERC20","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"uint256","name":"from"},{"type":"uint256","name":"to"}],"outputs":[{"type":"address[]","name":"tokensInRange"}]},{"type":"function","name":"getSchainToAllERC20Length","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"getSchainToERC20","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"erc20OnMainnet"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"grantRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"hasRole","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"hasSchainContract","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"contractManagerOfSkaleManagerValue"},{"type":"address","name":"newMessageProxy"}],"outputs":[]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"contractManagerOfSkaleManagerValue"},{"type":"address","name":"linkerValue"},{"type":"address","name":"messageProxyValue"}],"outputs":[]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"newContractManagerOfSkaleManager"}],"outputs":[]},{"type":"function","name":"initializeAllTokensForSchain","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address[]","name":"tokens"}],"outputs":[]},{"type":"function","name":"isSchainOwner","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"sender"},{"type":"bytes32","name":"schainHash"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"isWhitelisted","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"linker","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"messageProxy","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"postMessage","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"schainHash"},{"type":"address","name":"sender"},{"type":"bytes","name":"data"}],"outputs":[]},{"type":"function","name":"removeSchainContract","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"renounceRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"revokeRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"schainLinks","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":""}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"supportsInterface","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes4","name":"interfaceId"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"transferredAmount","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":""},{"type":"address","name":""}],"outputs":[{"type":"uint256","name":""}]}],"deposit_box_erc721_address":"0x98937f91885dcCfF8082623a157296AA161a9917","deposit_box_erc721_abi":[{"type":"event","anonymous":false,"name":"ERC721TokenAdded","inputs":[{"type":"string","name":"schainName","indexed":false},{"type":"address","name":"contractOnMainnet","indexed":true}]},{"type":"event","anonymous":false,"name":"ERC721TokenReady","inputs":[{"type":"address","name":"contractOnMainnet","indexed":true},{"type":"uint256","name":"tokenId","indexed":false}]},{"type":"event","anonymous":false,"name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"bytes32","name":"previousAdminRole","indexed":true},{"type":"bytes32","name":"newAdminRole","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"function","name":"DEFAULT_ADMIN_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"DEPOSIT_BOX_MANAGER_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"LINKER_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"addERC721TokenByOwner","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"erc721OnMainnet"}],"outputs":[]},{"type":"function","name":"addSchainContract","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"contractReceiver"}],"outputs":[]},{"type":"function","name":"contractManagerOfSkaleManager","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"depositERC721","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"erc721OnMainnet"},{"type":"uint256","name":"tokenId"}],"outputs":[]},{"type":"function","name":"disableWhitelist","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"enableWhitelist","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"gasPayer","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"schainHash"},{"type":"address","name":"sender"},{"type":"bytes","name":"data"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getFunds","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"erc721OnMainnet"},{"type":"address","name":"receiver"},{"type":"uint256","name":"tokenId"}],"outputs":[]},{"type":"function","name":"getRoleAdmin","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"getRoleMember","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"uint256","name":"index"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getRoleMemberCount","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"getSchainToAllERC721","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"uint256","name":"from"},{"type":"uint256","name":"to"}],"outputs":[{"type":"address[]","name":"tokensInRange"}]},{"type":"function","name":"getSchainToAllERC721Length","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"getSchainToERC721","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"erc721OnMainnet"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"grantRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"hasRole","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"hasSchainContract","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"contractManagerOfSkaleManagerValue"},{"type":"address","name":"newMessageProxy"}],"outputs":[]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"contractManagerOfSkaleManagerValue"},{"type":"address","name":"linkerValue"},{"type":"address","name":"messageProxyValue"}],"outputs":[]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"newContractManagerOfSkaleManager"}],"outputs":[]},{"type":"function","name":"initializeAllTokensForSchain","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address[]","name":"tokens"}],"outputs":[]},{"type":"function","name":"isSchainOwner","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"sender"},{"type":"bytes32","name":"schainHash"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"isWhitelisted","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"linker","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"messageProxy","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"postMessage","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"schainHash"},{"type":"address","name":"sender"},{"type":"bytes","name":"data"}],"outputs":[]},{"type":"function","name":"removeSchainContract","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"renounceRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"revokeRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"schainLinks","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":""}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"supportsInterface","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes4","name":"interfaceId"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"transferredAmount","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":""},{"type":"uint256","name":""}],"outputs":[{"type":"bytes32","name":""}]}],"deposit_box_erc1155_address":"0xa0EF1521f56641F9E0E43c46E0F6B20715E454c8","deposit_box_erc1155_abi":[{"type":"event","anonymous":false,"name":"ERC1155TokenAdded","inputs":[{"type":"string","name":"schainName","indexed":false},{"type":"address","name":"contractOnMainnet","indexed":true}]},{"type":"event","anonymous":false,"name":"ERC1155TokenReady","inputs":[{"type":"address","name":"contractOnMainnet","indexed":true},{"type":"uint256[]","name":"ids","indexed":false},{"type":"uint256[]","name":"amounts","indexed":false}]},{"type":"event","anonymous":false,"name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"bytes32","name":"previousAdminRole","indexed":true},{"type":"bytes32","name":"newAdminRole","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"function","name":"DEFAULT_ADMIN_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"DEPOSIT_BOX_MANAGER_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"LINKER_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"addERC1155TokenByOwner","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"erc1155OnMainnet"}],"outputs":[]},{"type":"function","name":"addSchainContract","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"contractReceiver"}],"outputs":[]},{"type":"function","name":"contractManagerOfSkaleManager","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"depositERC1155","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"erc1155OnMainnet"},{"type":"uint256","name":"id"},{"type":"uint256","name":"amount"}],"outputs":[]},{"type":"function","name":"depositERC1155Batch","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"erc1155OnMainnet"},{"type":"uint256[]","name":"ids"},{"type":"uint256[]","name":"amounts"}],"outputs":[]},{"type":"function","name":"disableWhitelist","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"enableWhitelist","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"gasPayer","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"schainHash"},{"type":"address","name":"sender"},{"type":"bytes","name":"data"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getFunds","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"erc1155OnMainnet"},{"type":"address","name":"receiver"},{"type":"uint256[]","name":"ids"},{"type":"uint256[]","name":"amounts"}],"outputs":[]},{"type":"function","name":"getRoleAdmin","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"getRoleMember","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"uint256","name":"index"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getRoleMemberCount","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"getSchainToAllERC1155","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"uint256","name":"from"},{"type":"uint256","name":"to"}],"outputs":[{"type":"address[]","name":"tokensInRange"}]},{"type":"function","name":"getSchainToAllERC1155Length","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"getSchainToERC1155","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"erc1155OnMainnet"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"grantRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"hasRole","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"hasSchainContract","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"contractManagerOfSkaleManagerValue"},{"type":"address","name":"newMessageProxy"}],"outputs":[]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"contractManagerOfSkaleManagerValue"},{"type":"address","name":"linkerValue"},{"type":"address","name":"messageProxyValue"}],"outputs":[]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"newContractManagerOfSkaleManager"}],"outputs":[]},{"type":"function","name":"initializeAllTokensForSchain","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address[]","name":"tokens"}],"outputs":[]},{"type":"function","name":"isSchainOwner","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"sender"},{"type":"bytes32","name":"schainHash"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"isWhitelisted","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"linker","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"messageProxy","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"onERC1155BatchReceived","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"operator"},{"type":"address","name":""},{"type":"uint256[]","name":""},{"type":"uint256[]","name":""},{"type":"bytes","name":""}],"outputs":[{"type":"bytes4","name":""}]},{"type":"function","name":"onERC1155Received","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"operator"},{"type":"address","name":""},{"type":"uint256","name":""},{"type":"uint256","name":""},{"type":"bytes","name":""}],"outputs":[{"type":"bytes4","name":""}]},{"type":"function","name":"postMessage","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"schainHash"},{"type":"address","name":"sender"},{"type":"bytes","name":"data"}],"outputs":[]},{"type":"function","name":"removeSchainContract","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"renounceRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"revokeRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"schainLinks","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":""}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"supportsInterface","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes4","name":"interfaceId"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"transferredAmount","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":""},{"type":"address","name":""},{"type":"uint256","name":""}],"outputs":[{"type":"uint256","name":""}]}],"deposit_box_erc721_with_metadata_abi":[{"type":"event","anonymous":false,"name":"ERC721TokenAdded","inputs":[{"type":"string","name":"schainName","indexed":false},{"type":"address","name":"contractOnMainnet","indexed":true}]},{"type":"event","anonymous":false,"name":"ERC721TokenReady","inputs":[{"type":"address","name":"contractOnMainnet","indexed":true},{"type":"uint256","name":"tokenId","indexed":false}]},{"type":"event","anonymous":false,"name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"bytes32","name":"previousAdminRole","indexed":true},{"type":"bytes32","name":"newAdminRole","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"event","anonymous":false,"name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}]},{"type":"function","name":"DEFAULT_ADMIN_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"DEPOSIT_BOX_MANAGER_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"LINKER_ROLE","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"addERC721TokenByOwner","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"erc721OnMainnet"}],"outputs":[]},{"type":"function","name":"addSchainContract","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"contractReceiver"}],"outputs":[]},{"type":"function","name":"contractManagerOfSkaleManager","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"depositERC721","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"erc721OnMainnet"},{"type":"uint256","name":"tokenId"}],"outputs":[]},{"type":"function","name":"disableWhitelist","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"enableWhitelist","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"gasPayer","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"schainHash"},{"type":"address","name":"sender"},{"type":"bytes","name":"data"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getFunds","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"erc721OnMainnet"},{"type":"address","name":"receiver"},{"type":"uint256","name":"tokenId"}],"outputs":[]},{"type":"function","name":"getRoleAdmin","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"bytes32","name":""}]},{"type":"function","name":"getRoleMember","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"uint256","name":"index"}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"getRoleMemberCount","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"getSchainToAllERC721","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"uint256","name":"from"},{"type":"uint256","name":"to"}],"outputs":[{"type":"address[]","name":"tokensInRange"}]},{"type":"function","name":"getSchainToAllERC721Length","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[{"type":"uint256","name":""}]},{"type":"function","name":"getSchainToERC721","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address","name":"erc721OnMainnet"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"grantRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"hasRole","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"hasSchainContract","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"contractManagerOfSkaleManagerValue"},{"type":"address","name":"newMessageProxy"}],"outputs":[]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"contractManagerOfSkaleManagerValue"},{"type":"address","name":"linkerValue"},{"type":"address","name":"messageProxyValue"}],"outputs":[]},{"type":"function","name":"initialize","constant":false,"payable":false,"inputs":[{"type":"address","name":"newContractManagerOfSkaleManager"}],"outputs":[]},{"type":"function","name":"initializeAllTokensForSchain","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"},{"type":"address[]","name":"tokens"}],"outputs":[]},{"type":"function","name":"isSchainOwner","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"sender"},{"type":"bytes32","name":"schainHash"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"isWhitelisted","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"linker","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"messageProxy","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"postMessage","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"schainHash"},{"type":"address","name":"sender"},{"type":"bytes","name":"data"}],"outputs":[]},{"type":"function","name":"removeSchainContract","constant":false,"payable":false,"inputs":[{"type":"string","name":"schainName"}],"outputs":[]},{"type":"function","name":"renounceRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"revokeRole","constant":false,"payable":false,"inputs":[{"type":"bytes32","name":"role"},{"type":"address","name":"account"}],"outputs":[]},{"type":"function","name":"schainLinks","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes32","name":""}],"outputs":[{"type":"address","name":""}]},{"type":"function","name":"supportsInterface","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"bytes4","name":"interfaceId"}],"outputs":[{"type":"bool","name":""}]},{"type":"function","name":"transferredAmount","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":""},{"type":"uint256","name":""}],"outputs":[{"type":"bytes32","name":""}]}],"deposit_box_erc721_with_metadata_address":"0x4B85DD7d995D6ae445292939d7ebfabD7Cd088dA"} \ No newline at end of file diff --git a/src/metadata/schainAbi.json b/src/metadata/schainAbi.json index 71bb522..9e18540 100644 --- a/src/metadata/schainAbi.json +++ b/src/metadata/schainAbi.json @@ -1,9348 +1 @@ -{ - "ERC1155OnChain_abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - } - ], - "name": "TransferBatch", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "TransferSingle", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "value", - "type": "string" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "URI", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MINTER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "accounts", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - } - ], - "name": "balanceOfBatch", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - } - ], - "name": "burnBatch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "mintBatch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeBatchTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "uri", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "ERC20OnChain_abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "contractName", - "type": "string" - }, - { - "internalType": "string", - "name": "contractSymbol", - "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": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "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": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MINTER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "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": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "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": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "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": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "ERC721OnChain_abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "contractName", - "type": "string" - }, - { - "internalType": "string", - "name": "contractSymbol", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "approved", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MINTER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "getApproved", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ownerOf", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "string", - "name": "tokenUri", - "type": "string" - } - ], - "name": "setTokenURI", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "tokenURI", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "community_locker_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "schainHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "ActivateUser", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "constantHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "previousValue", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newValue", - "type": "uint256" - } - ], - "name": "ConstantUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "schainHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "LockUser", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "CONSTANT_SETTER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_HASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_NAME", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "activeUsers", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "checkAllowedToSendMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "communityPool", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gasPriceTimestamp", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newSchainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newTokenManagerLinker", - "type": "address" - }, - { - "internalType": "address", - "name": "newCommunityPool", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "lastMessageTimeStamp", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "mainnetGasPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "messageProxy", - "outputs": [ - { - "internalType": "contract IMessageProxyForSchain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "fromChainHash", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "postMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "schainHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "gasPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256[2]", - "name": "blsSignature", - "type": "uint256[2]" - }, - { - "internalType": "uint256", - "name": "hashA", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "hashB", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "counter", - "type": "uint256" - } - ], - "internalType": "struct IMessageProxy.Signature", - "name": "", - "type": "tuple" - } - ], - "name": "setGasPrice", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newTimeLimitPerMessage", - "type": "uint256" - } - ], - "name": "setTimeLimitPerMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "timeLimitPerMessage", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tokenManagerLinker", - "outputs": [ - { - "internalType": "contract ITokenManagerLinker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "community_locker_address": "0xD2aaa00300000000000000000000000000000000", - "eth_erc20_abi": [ - { - "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": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "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": [], - "name": "BURNER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MINTER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "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": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "forceBurn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "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": "tokenManagerEthAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "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": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "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": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "eth_erc20_address": "0xD2Aaa00700000000000000000000000000000000", - "key_storage_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "FN_NUM_GET_CONFIG_VARIABLE_UINT256", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "FN_NUM_GET_CURRENT_BLS_PUBLIC_KEY", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "FREE_MEM_PTR", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getBlsCommonPublicKey", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "a", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "b", - "type": "uint256" - } - ], - "internalType": "struct IFieldOperations.Fp2Point", - "name": "x", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "a", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "b", - "type": "uint256" - } - ], - "internalType": "struct IFieldOperations.Fp2Point", - "name": "y", - "type": "tuple" - } - ], - "internalType": "struct IFieldOperations.G2Point", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "key_storage_address": "0xd2aaa00200000000000000000000000000000000", - "message_proxy_chain_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "contractAddress", - "type": "address" - } - ], - "name": "ExtraContractRegistered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "contractAddress", - "type": "address" - } - ], - "name": "ExtraContractRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "oldValue", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newValue", - "type": "uint256" - } - ], - "name": "GasLimitWasChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "dstChainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "msgCounter", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "srcContract", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "dstContract", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "OutgoingMessage", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "msgCounter", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "message", - "type": "bytes" - } - ], - "name": "PostMessageError", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "oldVersion", - "type": "string" - }, - { - "indexed": false, - "internalType": "string", - "name": "newVersion", - "type": "string" - } - ], - "name": "VersionUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "CHAIN_CONNECTOR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "CONSTANT_SETTER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "ETHERBASE", - "outputs": [ - { - "internalType": "contract IEtherbaseUpgradeable", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "EXTRA_CONTRACT_REGISTRAR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_HASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MESSAGES_LENGTH", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MINIMUM_BALANCE", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "REVERT_REASON_LENGTH", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "chainName", - "type": "string" - } - ], - "name": "addConnectedChain", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "connectedChains", - "outputs": [ - { - "internalType": "uint256", - "name": "incomingMessageCounter", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "outgoingMessageCounter", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "inited", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gasLimit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "schainHash", - "type": "bytes32" - } - ], - "name": "getContractRegisteredLength", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "schainHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "from", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "to", - "type": "uint256" - } - ], - "name": "getContractRegisteredRange", - "outputs": [ - { - "internalType": "address[]", - "name": "contractsInRange", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "fromSchainName", - "type": "string" - } - ], - "name": "getIncomingMessagesCounter", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetSchainName", - "type": "string" - } - ], - "name": "getOutgoingMessagesCounter", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IKeyStorage", - "name": "blsKeyStorage", - "type": "address" - }, - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "internalType": "address[]", - "name": "contracts", - "type": "address[]" - } - ], - "name": "initializeAllRegisteredContracts", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newGasLimit", - "type": "uint256" - } - ], - "name": "initializeMessageProxy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "isConnectedChain", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "schainHash", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "contractAddress", - "type": "address" - } - ], - "name": "isContractRegistered", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "keyStorage", - "outputs": [ - { - "internalType": "contract IKeyStorage", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "messageInProgress", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "fromChainName", - "type": "string" - }, - { - "internalType": "uint256", - "name": "startingCounter", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "destinationContract", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct IMessageProxy.Message[]", - "name": "messages", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "uint256[2]", - "name": "blsSignature", - "type": "uint256[2]" - }, - { - "internalType": "uint256", - "name": "hashA", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "hashB", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "counter", - "type": "uint256" - } - ], - "internalType": "struct IMessageProxy.Signature", - "name": "signature", - "type": "tuple" - } - ], - "name": "postIncomingMessages", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "targetChainHash", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "targetContract", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "postOutgoingMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "chainName", - "type": "string" - }, - { - "internalType": "address", - "name": "extraContract", - "type": "address" - } - ], - "name": "registerExtraContract", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "extraContract", - "type": "address" - } - ], - "name": "registerExtraContractForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "chainName", - "type": "string" - } - ], - "name": "removeConnectedChain", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "chainName", - "type": "string" - }, - { - "internalType": "address", - "name": "extraContract", - "type": "address" - } - ], - "name": "removeExtraContract", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "extraContract", - "type": "address" - } - ], - "name": "removeExtraContractForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "schainHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newGasLimit", - "type": "uint256" - } - ], - "name": "setNewGasLimit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newVersion", - "type": "string" - } - ], - "name": "setVersion", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "dstChainHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "msgCounter", - "type": "uint256" - }, - { - "internalType": "address", - "name": "srcContract", - "type": "address" - }, - { - "internalType": "address", - "name": "dstContract", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct IMessageProxyForSchain.OutgoingMessageData", - "name": "message", - "type": "tuple" - } - ], - "name": "verifyOutgoingMessageData", - "outputs": [ - { - "internalType": "bool", - "name": "isValidMessage", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "hashedMessage", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256[2]", - "name": "blsSignature", - "type": "uint256[2]" - }, - { - "internalType": "uint256", - "name": "hashA", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "hashB", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "counter", - "type": "uint256" - } - ], - "internalType": "struct IMessageProxy.Signature", - "name": "signature", - "type": "tuple" - } - ], - "name": "verifySignature", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "message_proxy_chain_address": "0xd2AAa00100000000000000000000000000000000", - "proxy_admin_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - }, - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - } - ], - "name": "getProxyImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - }, - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "upgrade", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - }, - { - "internalType": "address", - "name": "implementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - } - ], - "proxy_admin_address": "0xd2aAa00000000000000000000000000000000000", - "token_manager_erc1155_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldValue", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newValue", - "type": "address" - } - ], - "name": "DepositBoxWasChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc1155OnMainnet", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc1155OnSchain", - "type": "address" - } - ], - "name": "ERC1155TokenAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc1155OnMainnet", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc1155OnSchain", - "type": "address" - } - ], - "name": "ERC1155TokenCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - } - ], - "name": "ERC1155TokenReady", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc1155OnMainnet", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc1155OnSchain", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - } - ], - "name": "ERC1155TokenReceived", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "AUTOMATIC_DEPLOY_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_HASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_NAME", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "TOKEN_REGISTRAR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetChainName", - "type": "string" - }, - { - "internalType": "address", - "name": "erc1155OnMainnet", - "type": "address" - }, - { - "internalType": "address", - "name": "erc1155OnSchain", - "type": "address" - } - ], - "name": "addERC1155TokenByOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - }, - { - "internalType": "address", - "name": "newTokenManager", - "type": "address" - } - ], - "name": "addTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ERC1155OnChain", - "name": "", - "type": "address" - } - ], - "name": "addedClones", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "automaticDeploy", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "changeDepositBoxAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "clonesErc1155", - "outputs": [ - { - "internalType": "contract ERC1155OnChain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "communityLocker", - "outputs": [ - { - "internalType": "contract ICommunityLocker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "depositBox", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "deprecatedClonesErc1155", - "outputs": [ - { - "internalType": "contract ERC1155OnChain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "disableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "enableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "exitToMainERC1155", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - } - ], - "name": "exitToMainERC1155Batch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "hasTokenManager", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newChainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "contracts", - "type": "address[]" - } - ], - "name": "initializeAllClonesERC1155", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newSchainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "initializeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "messageProxy", - "outputs": [ - { - "internalType": "contract IMessageProxyForSchain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "onERC1155BatchReceived", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "onERC1155Received", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "fromChainHash", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "postMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "removeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "schainHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tokenManagerLinker", - "outputs": [ - { - "internalType": "contract ITokenManagerLinker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "tokenManagers", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetSchainName", - "type": "string" - }, - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferToSchainERC1155", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetSchainName", - "type": "string" - }, - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - } - ], - "name": "transferToSchainERC1155Batch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "transferredAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "token_manager_erc1155_address": "0xD2aaA00900000000000000000000000000000000", - "token_manager_erc20_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldValue", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newValue", - "type": "address" - } - ], - "name": "DepositBoxWasChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc20OnMainChain", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc20OnSchain", - "type": "address" - } - ], - "name": "ERC20TokenAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc20OnMainChain", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc20OnSchain", - "type": "address" - } - ], - "name": "ERC20TokenCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "ERC20TokenReady", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc20OnMainChain", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc20OnSchain", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "ERC20TokenReceived", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "AUTOMATIC_DEPLOY_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_HASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_NAME", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "TOKEN_REGISTRAR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetChainName", - "type": "string" - }, - { - "internalType": "address", - "name": "erc20OnMainChain", - "type": "address" - }, - { - "internalType": "address", - "name": "erc20OnSchain", - "type": "address" - } - ], - "name": "addERC20TokenByOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - }, - { - "internalType": "address", - "name": "newTokenManager", - "type": "address" - } - ], - "name": "addTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ERC20OnChain", - "name": "", - "type": "address" - } - ], - "name": "addedClones", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "automaticDeploy", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "changeDepositBoxAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "clonesErc20", - "outputs": [ - { - "internalType": "contract ERC20OnChain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "communityLocker", - "outputs": [ - { - "internalType": "contract ICommunityLocker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "depositBox", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "deprecatedClonesErc20", - "outputs": [ - { - "internalType": "contract ERC20OnChain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "disableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "enableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "exitToMainERC20", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "hasTokenManager", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newChainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "contracts", - "type": "address[]" - } - ], - "name": "initializeAllClonesERC20", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newSchainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "initializeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "messageProxy", - "outputs": [ - { - "internalType": "contract IMessageProxyForSchain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "fromChainHash", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "postMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "removeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "schainHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tokenManagerLinker", - "outputs": [ - { - "internalType": "contract ITokenManagerLinker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "tokenManagers", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20Upgradeable", - "name": "", - "type": "address" - } - ], - "name": "totalSupplyOnMainnet", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetSchainName", - "type": "string" - }, - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferToSchainERC20", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "transferredAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "token_manager_erc20_address": "0xD2aAA00500000000000000000000000000000000", - "token_manager_erc721_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldValue", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newValue", - "type": "address" - } - ], - "name": "DepositBoxWasChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnMainChain", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnSchain", - "type": "address" - } - ], - "name": "ERC721TokenAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnMainChain", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnSchain", - "type": "address" - } - ], - "name": "ERC721TokenCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ERC721TokenReady", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnMainChain", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnSchain", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ERC721TokenReceived", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "AUTOMATIC_DEPLOY_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_HASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_NAME", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "TOKEN_REGISTRAR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetChainName", - "type": "string" - }, - { - "internalType": "address", - "name": "erc721OnMainChain", - "type": "address" - }, - { - "internalType": "address", - "name": "erc721OnSchain", - "type": "address" - } - ], - "name": "addERC721TokenByOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - }, - { - "internalType": "address", - "name": "newTokenManager", - "type": "address" - } - ], - "name": "addTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ERC721OnChain", - "name": "", - "type": "address" - } - ], - "name": "addedClones", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "automaticDeploy", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "changeDepositBoxAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "clonesErc721", - "outputs": [ - { - "internalType": "contract ERC721OnChain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "communityLocker", - "outputs": [ - { - "internalType": "contract ICommunityLocker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "depositBox", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "deprecatedClonesErc721", - "outputs": [ - { - "internalType": "contract ERC721OnChain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "disableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "enableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "exitToMainERC721", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "hasTokenManager", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newChainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "contracts", - "type": "address[]" - } - ], - "name": "initializeAllClonesERC721", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newSchainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "initializeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "messageProxy", - "outputs": [ - { - "internalType": "contract IMessageProxyForSchain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "fromChainHash", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "postMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "removeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "schainHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tokenManagerLinker", - "outputs": [ - { - "internalType": "contract ITokenManagerLinker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "tokenManagers", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetSchainName", - "type": "string" - }, - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "transferToSchainERC721", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "transferredAmount", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "token_manager_erc721_address": "0xD2aaa00600000000000000000000000000000000", - "token_manager_erc721_with_metadata_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldValue", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newValue", - "type": "address" - } - ], - "name": "DepositBoxWasChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnMainChain", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnSchain", - "type": "address" - } - ], - "name": "ERC721TokenAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnMainChain", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnSchain", - "type": "address" - } - ], - "name": "ERC721TokenCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ERC721TokenReady", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "chainHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnMainChain", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "erc721OnSchain", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ERC721TokenReceived", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "AUTOMATIC_DEPLOY_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_HASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_NAME", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "TOKEN_REGISTRAR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetChainName", - "type": "string" - }, - { - "internalType": "address", - "name": "erc721OnMainChain", - "type": "address" - }, - { - "internalType": "address", - "name": "erc721OnSchain", - "type": "address" - } - ], - "name": "addERC721TokenByOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - }, - { - "internalType": "address", - "name": "newTokenManager", - "type": "address" - } - ], - "name": "addTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ERC721OnChain", - "name": "", - "type": "address" - } - ], - "name": "addedClones", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "automaticDeploy", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "changeDepositBoxAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "clonesErc721", - "outputs": [ - { - "internalType": "contract ERC721OnChain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "communityLocker", - "outputs": [ - { - "internalType": "contract ICommunityLocker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "depositBox", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "deprecatedClonesErc721", - "outputs": [ - { - "internalType": "contract ERC721OnChain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "disableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "enableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "exitToMainERC721", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "hasTokenManager", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newChainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "contracts", - "type": "address[]" - } - ], - "name": "initializeAllClonesERC721", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newSchainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "initializeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "messageProxy", - "outputs": [ - { - "internalType": "contract IMessageProxyForSchain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "fromChainHash", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "postMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "removeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "schainHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tokenManagerLinker", - "outputs": [ - { - "internalType": "contract ITokenManagerLinker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "tokenManagers", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "targetSchainName", - "type": "string" - }, - { - "internalType": "address", - "name": "contractOnMainnet", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "transferToSchainERC721", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "transferredAmount", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "token_manager_erc721_with_metadata_address": "0xd2AaA00a00000000000000000000000000000000", - "token_manager_eth_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldValue", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newValue", - "type": "address" - } - ], - "name": "DepositBoxWasChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "AUTOMATIC_DEPLOY_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_HASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_NAME", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "TOKEN_REGISTRAR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - }, - { - "internalType": "address", - "name": "newTokenManager", - "type": "address" - } - ], - "name": "addTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "automaticDeploy", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "changeDepositBoxAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "communityLocker", - "outputs": [ - { - "internalType": "contract ICommunityLocker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "depositBox", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "disableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "enableAutomaticDeploy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "ethErc20", - "outputs": [ - { - "internalType": "contract IEthErc20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "exitToMain", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "hasTokenManager", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newChainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - }, - { - "internalType": "contract IEthErc20", - "name": "ethErc20Address", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newSchainName", - "type": "string" - }, - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxy", - "type": "address" - }, - { - "internalType": "contract ITokenManagerLinker", - "name": "newIMALinker", - "type": "address" - }, - { - "internalType": "contract ICommunityLocker", - "name": "newCommunityLocker", - "type": "address" - }, - { - "internalType": "address", - "name": "newDepositBox", - "type": "address" - } - ], - "name": "initializeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "messageProxy", - "outputs": [ - { - "internalType": "contract IMessageProxyForSchain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "fromChainHash", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "postMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "removeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "schainHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IEthErc20", - "name": "newEthErc20Address", - "type": "address" - } - ], - "name": "setEthErc20Address", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tokenManagerLinker", - "outputs": [ - { - "internalType": "contract ITokenManagerLinker", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "tokenManagers", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "token_manager_eth_address": "0xd2AaA00400000000000000000000000000000000", - "token_manager_linker_abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_HASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAINNET_NAME", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "REGISTRAR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "connectSchain", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "disconnectSchain", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "schainName", - "type": "string" - } - ], - "name": "hasSchain", - "outputs": [ - { - "internalType": "bool", - "name": "connected", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ITokenManager", - "name": "tokenManager", - "type": "address" - } - ], - "name": "hasTokenManager", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IMessageProxyForSchain", - "name": "newMessageProxyAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "linker", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "linkerAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "messageProxy", - "outputs": [ - { - "internalType": "contract IMessageProxyForSchain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ITokenManager", - "name": "newTokenManager", - "type": "address" - } - ], - "name": "registerTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ITokenManager", - "name": "tokenManagerAddress", - "type": "address" - } - ], - "name": "removeTokenManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "tokenManagers", - "outputs": [ - { - "internalType": "contract ITokenManager", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "token_manager_linker_address": "0xD2aAA00800000000000000000000000000000000" -} \ No newline at end of file +{"ERC1155OnChain_abi":[{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mintBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}],"ERC20OnChain_abi":[{"inputs":[{"internalType":"string","name":"contractName","type":"string"},{"internalType":"string","name":"contractSymbol","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":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","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":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"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":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":"account","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"ERC721OnChain_abi":[{"inputs":[{"internalType":"string","name":"contractName","type":"string"},{"internalType":"string","name":"contractSymbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"tokenUri","type":"string"}],"name":"setTokenURI","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"}],"community_locker_abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"schainHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"ActivateUser","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"constantHash","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"previousValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"ConstantUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"schainHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"LockUser","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"CONSTANT_SETTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINNET_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINNET_NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"activeUsers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"checkAllowedToSendMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"communityPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gasPriceTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"newSchainName","type":"string"},{"internalType":"contract IMessageProxyForSchain","name":"newMessageProxy","type":"address"},{"internalType":"contract ITokenManagerLinker","name":"newTokenManagerLinker","type":"address"},{"internalType":"address","name":"newCommunityPool","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastMessageTimeStamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mainnetGasPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"messageProxy","outputs":[{"internalType":"contract IMessageProxyForSchain","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"fromChainHash","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"postMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"schainHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"gasPrice","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"components":[{"internalType":"uint256[2]","name":"blsSignature","type":"uint256[2]"},{"internalType":"uint256","name":"hashA","type":"uint256"},{"internalType":"uint256","name":"hashB","type":"uint256"},{"internalType":"uint256","name":"counter","type":"uint256"}],"internalType":"struct IMessageProxy.Signature","name":"","type":"tuple"}],"name":"setGasPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newTimeLimitPerMessage","type":"uint256"}],"name":"setTimeLimitPerMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timeLimitPerMessage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenManagerLinker","outputs":[{"internalType":"contract ITokenManagerLinker","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"community_locker_address":"0xD2aaa00300000000000000000000000000000000","eth_erc20_abi":[{"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":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","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":[],"name":"BURNER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"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":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"forceBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":"tokenManagerEthAddress","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","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":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"eth_erc20_address":"0xD2Aaa00700000000000000000000000000000000","key_storage_abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FN_NUM_GET_CONFIG_VARIABLE_UINT256","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FN_NUM_GET_CURRENT_BLS_PUBLIC_KEY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FREE_MEM_PTR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBlsCommonPublicKey","outputs":[{"components":[{"components":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"}],"internalType":"struct IFieldOperations.Fp2Point","name":"x","type":"tuple"},{"components":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"}],"internalType":"struct IFieldOperations.Fp2Point","name":"y","type":"tuple"}],"internalType":"struct IFieldOperations.G2Point","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}],"key_storage_address":"0xd2aaa00200000000000000000000000000000000","message_proxy_chain_abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"chainHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"contractAddress","type":"address"}],"name":"ExtraContractRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"chainHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"contractAddress","type":"address"}],"name":"ExtraContractRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"GasLimitWasChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"dstChainHash","type":"bytes32"},{"indexed":true,"internalType":"uint256","name":"msgCounter","type":"uint256"},{"indexed":true,"internalType":"address","name":"srcContract","type":"address"},{"indexed":false,"internalType":"address","name":"dstContract","type":"address"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"OutgoingMessage","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"msgCounter","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"message","type":"bytes"}],"name":"PostMessageError","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"oldVersion","type":"string"},{"indexed":false,"internalType":"string","name":"newVersion","type":"string"}],"name":"VersionUpdated","type":"event"},{"inputs":[],"name":"CHAIN_CONNECTOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CONSTANT_SETTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ETHERBASE","outputs":[{"internalType":"contract IEtherbaseUpgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EXTRA_CONTRACT_REGISTRAR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINNET_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MESSAGES_LENGTH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINIMUM_BALANCE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REVERT_REASON_LENGTH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"chainName","type":"string"}],"name":"addConnectedChain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"connectedChains","outputs":[{"internalType":"uint256","name":"incomingMessageCounter","type":"uint256"},{"internalType":"uint256","name":"outgoingMessageCounter","type":"uint256"},{"internalType":"bool","name":"inited","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gasLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"schainHash","type":"bytes32"}],"name":"getContractRegisteredLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"schainHash","type":"bytes32"},{"internalType":"uint256","name":"from","type":"uint256"},{"internalType":"uint256","name":"to","type":"uint256"}],"name":"getContractRegisteredRange","outputs":[{"internalType":"address[]","name":"contractsInRange","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"fromSchainName","type":"string"}],"name":"getIncomingMessagesCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"targetSchainName","type":"string"}],"name":"getOutgoingMessagesCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IKeyStorage","name":"blsKeyStorage","type":"address"},{"internalType":"string","name":"schainName","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"chainHash","type":"bytes32"},{"internalType":"address[]","name":"contracts","type":"address[]"}],"name":"initializeAllRegisteredContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newGasLimit","type":"uint256"}],"name":"initializeMessageProxy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"schainName","type":"string"}],"name":"isConnectedChain","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"schainHash","type":"bytes32"},{"internalType":"address","name":"contractAddress","type":"address"}],"name":"isContractRegistered","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"keyStorage","outputs":[{"internalType":"contract IKeyStorage","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"messageInProgress","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"fromChainName","type":"string"},{"internalType":"uint256","name":"startingCounter","type":"uint256"},{"components":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"destinationContract","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct IMessageProxy.Message[]","name":"messages","type":"tuple[]"},{"components":[{"internalType":"uint256[2]","name":"blsSignature","type":"uint256[2]"},{"internalType":"uint256","name":"hashA","type":"uint256"},{"internalType":"uint256","name":"hashB","type":"uint256"},{"internalType":"uint256","name":"counter","type":"uint256"}],"internalType":"struct IMessageProxy.Signature","name":"signature","type":"tuple"}],"name":"postIncomingMessages","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"targetChainHash","type":"bytes32"},{"internalType":"address","name":"targetContract","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"postOutgoingMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"chainName","type":"string"},{"internalType":"address","name":"extraContract","type":"address"}],"name":"registerExtraContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"extraContract","type":"address"}],"name":"registerExtraContractForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"chainName","type":"string"}],"name":"removeConnectedChain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"chainName","type":"string"},{"internalType":"address","name":"extraContract","type":"address"}],"name":"removeExtraContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"extraContract","type":"address"}],"name":"removeExtraContractForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"schainHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newGasLimit","type":"uint256"}],"name":"setNewGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newVersion","type":"string"}],"name":"setVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"dstChainHash","type":"bytes32"},{"internalType":"uint256","name":"msgCounter","type":"uint256"},{"internalType":"address","name":"srcContract","type":"address"},{"internalType":"address","name":"dstContract","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct IMessageProxyForSchain.OutgoingMessageData","name":"message","type":"tuple"}],"name":"verifyOutgoingMessageData","outputs":[{"internalType":"bool","name":"isValidMessage","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"hashedMessage","type":"bytes32"},{"components":[{"internalType":"uint256[2]","name":"blsSignature","type":"uint256[2]"},{"internalType":"uint256","name":"hashA","type":"uint256"},{"internalType":"uint256","name":"hashB","type":"uint256"},{"internalType":"uint256","name":"counter","type":"uint256"}],"internalType":"struct IMessageProxy.Signature","name":"signature","type":"tuple"}],"name":"verifySignature","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}],"message_proxy_chain_address":"0xd2AAa00100000000000000000000000000000000","proxy_admin_abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"contract TransparentUpgradeableProxy","name":"proxy","type":"address"},{"internalType":"address","name":"newAdmin","type":"address"}],"name":"changeProxyAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract TransparentUpgradeableProxy","name":"proxy","type":"address"}],"name":"getProxyAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract TransparentUpgradeableProxy","name":"proxy","type":"address"}],"name":"getProxyImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract TransparentUpgradeableProxy","name":"proxy","type":"address"},{"internalType":"address","name":"implementation","type":"address"}],"name":"upgrade","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract TransparentUpgradeableProxy","name":"proxy","type":"address"},{"internalType":"address","name":"implementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeAndCall","outputs":[],"stateMutability":"payable","type":"function"}],"proxy_admin_address":"0xd2aAa00000000000000000000000000000000000","token_manager_erc1155_abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldValue","type":"address"},{"indexed":false,"internalType":"address","name":"newValue","type":"address"}],"name":"DepositBoxWasChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"chainHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"erc1155OnMainnet","type":"address"},{"indexed":true,"internalType":"address","name":"erc1155OnSchain","type":"address"}],"name":"ERC1155TokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"chainHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"erc1155OnMainnet","type":"address"},{"indexed":true,"internalType":"address","name":"erc1155OnSchain","type":"address"}],"name":"ERC1155TokenCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"chainHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"contractOnMainnet","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"ERC1155TokenReady","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"chainHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"erc1155OnMainnet","type":"address"},{"indexed":true,"internalType":"address","name":"erc1155OnSchain","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"ERC1155TokenReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"AUTOMATIC_DEPLOY_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINNET_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINNET_NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_REGISTRAR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"targetChainName","type":"string"},{"internalType":"address","name":"erc1155OnMainnet","type":"address"},{"internalType":"address","name":"erc1155OnSchain","type":"address"}],"name":"addERC1155TokenByOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"schainName","type":"string"},{"internalType":"address","name":"newTokenManager","type":"address"}],"name":"addTokenManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC1155OnChain","name":"","type":"address"}],"name":"addedClones","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"automaticDeploy","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newDepositBox","type":"address"}],"name":"changeDepositBoxAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"address","name":"","type":"address"}],"name":"clonesErc1155","outputs":[{"internalType":"contract ERC1155OnChain","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"communityLocker","outputs":[{"internalType":"contract ICommunityLocker","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositBox","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"deprecatedClonesErc1155","outputs":[{"internalType":"contract ERC1155OnChain","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"disableAutomaticDeploy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableAutomaticDeploy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractOnMainnet","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"exitToMainERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractOnMainnet","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"exitToMainERC1155Batch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"schainName","type":"string"}],"name":"hasTokenManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"newChainName","type":"string"},{"internalType":"contract IMessageProxyForSchain","name":"newMessageProxy","type":"address"},{"internalType":"contract ITokenManagerLinker","name":"newIMALinker","type":"address"},{"internalType":"contract ICommunityLocker","name":"newCommunityLocker","type":"address"},{"internalType":"address","name":"newDepositBox","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"contracts","type":"address[]"}],"name":"initializeAllClonesERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newSchainName","type":"string"},{"internalType":"contract IMessageProxyForSchain","name":"newMessageProxy","type":"address"},{"internalType":"contract ITokenManagerLinker","name":"newIMALinker","type":"address"},{"internalType":"contract ICommunityLocker","name":"newCommunityLocker","type":"address"},{"internalType":"address","name":"newDepositBox","type":"address"}],"name":"initializeTokenManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"messageProxy","outputs":[{"internalType":"contract IMessageProxyForSchain","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"fromChainHash","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"postMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"schainName","type":"string"}],"name":"removeTokenManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"schainHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenManagerLinker","outputs":[{"internalType":"contract ITokenManagerLinker","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"tokenManagers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"targetSchainName","type":"string"},{"internalType":"address","name":"contractOnMainnet","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferToSchainERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"targetSchainName","type":"string"},{"internalType":"address","name":"contractOnMainnet","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"transferToSchainERC1155Batch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"transferredAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}],"token_manager_erc1155_address":"0xD2aaA00900000000000000000000000000000000","token_manager_erc20_abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldValue","type":"address"},{"indexed":false,"internalType":"address","name":"newValue","type":"address"}],"name":"DepositBoxWasChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"chainHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"erc20OnMainChain","type":"address"},{"indexed":true,"internalType":"address","name":"erc20OnSchain","type":"address"}],"name":"ERC20TokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"chainHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"erc20OnMainChain","type":"address"},{"indexed":true,"internalType":"address","name":"erc20OnSchain","type":"address"}],"name":"ERC20TokenCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"chainHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"contractOnMainnet","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20TokenReady","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"chainHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"erc20OnMainChain","type":"address"},{"indexed":true,"internalType":"address","name":"erc20OnSchain","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20TokenReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"AUTOMATIC_DEPLOY_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINNET_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINNET_NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_REGISTRAR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"targetChainName","type":"string"},{"internalType":"address","name":"erc20OnMainChain","type":"address"},{"internalType":"address","name":"erc20OnSchain","type":"address"}],"name":"addERC20TokenByOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"schainName","type":"string"},{"internalType":"address","name":"newTokenManager","type":"address"}],"name":"addTokenManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20OnChain","name":"","type":"address"}],"name":"addedClones","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"automaticDeploy","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newDepositBox","type":"address"}],"name":"changeDepositBoxAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"address","name":"","type":"address"}],"name":"clonesErc20","outputs":[{"internalType":"contract ERC20OnChain","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"communityLocker","outputs":[{"internalType":"contract ICommunityLocker","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositBox","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"deprecatedClonesErc20","outputs":[{"internalType":"contract ERC20OnChain","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"disableAutomaticDeploy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableAutomaticDeploy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractOnMainnet","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"exitToMainERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"schainName","type":"string"}],"name":"hasTokenManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"newChainName","type":"string"},{"internalType":"contract IMessageProxyForSchain","name":"newMessageProxy","type":"address"},{"internalType":"contract ITokenManagerLinker","name":"newIMALinker","type":"address"},{"internalType":"contract ICommunityLocker","name":"newCommunityLocker","type":"address"},{"internalType":"address","name":"newDepositBox","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"contracts","type":"address[]"}],"name":"initializeAllClonesERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newSchainName","type":"string"},{"internalType":"contract IMessageProxyForSchain","name":"newMessageProxy","type":"address"},{"internalType":"contract ITokenManagerLinker","name":"newIMALinker","type":"address"},{"internalType":"contract ICommunityLocker","name":"newCommunityLocker","type":"address"},{"internalType":"address","name":"newDepositBox","type":"address"}],"name":"initializeTokenManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"messageProxy","outputs":[{"internalType":"contract IMessageProxyForSchain","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"fromChainHash","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"postMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"schainName","type":"string"}],"name":"removeTokenManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"schainHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenManagerLinker","outputs":[{"internalType":"contract ITokenManagerLinker","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"tokenManagers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"name":"totalSupplyOnMainnet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"targetSchainName","type":"string"},{"internalType":"address","name":"contractOnMainnet","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferToSchainERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"address","name":"","type":"address"}],"name":"transferredAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}],"token_manager_erc20_address":"0xD2aAA00500000000000000000000000000000000","token_manager_erc721_abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldValue","type":"address"},{"indexed":false,"internalType":"address","name":"newValue","type":"address"}],"name":"DepositBoxWasChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"chainHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"erc721OnMainChain","type":"address"},{"indexed":true,"internalType":"address","name":"erc721OnSchain","type":"address"}],"name":"ERC721TokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"chainHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"erc721OnMainChain","type":"address"},{"indexed":true,"internalType":"address","name":"erc721OnSchain","type":"address"}],"name":"ERC721TokenCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"chainHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"contractOnMainnet","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721TokenReady","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"chainHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"erc721OnMainChain","type":"address"},{"indexed":true,"internalType":"address","name":"erc721OnSchain","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721TokenReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"AUTOMATIC_DEPLOY_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINNET_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINNET_NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_REGISTRAR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"targetChainName","type":"string"},{"internalType":"address","name":"erc721OnMainChain","type":"address"},{"internalType":"address","name":"erc721OnSchain","type":"address"}],"name":"addERC721TokenByOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"schainName","type":"string"},{"internalType":"address","name":"newTokenManager","type":"address"}],"name":"addTokenManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC721OnChain","name":"","type":"address"}],"name":"addedClones","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"automaticDeploy","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newDepositBox","type":"address"}],"name":"changeDepositBoxAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"address","name":"","type":"address"}],"name":"clonesErc721","outputs":[{"internalType":"contract ERC721OnChain","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"communityLocker","outputs":[{"internalType":"contract ICommunityLocker","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositBox","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"deprecatedClonesErc721","outputs":[{"internalType":"contract ERC721OnChain","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"disableAutomaticDeploy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableAutomaticDeploy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractOnMainnet","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"exitToMainERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"schainName","type":"string"}],"name":"hasTokenManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"newChainName","type":"string"},{"internalType":"contract IMessageProxyForSchain","name":"newMessageProxy","type":"address"},{"internalType":"contract ITokenManagerLinker","name":"newIMALinker","type":"address"},{"internalType":"contract ICommunityLocker","name":"newCommunityLocker","type":"address"},{"internalType":"address","name":"newDepositBox","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"contracts","type":"address[]"}],"name":"initializeAllClonesERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newSchainName","type":"string"},{"internalType":"contract IMessageProxyForSchain","name":"newMessageProxy","type":"address"},{"internalType":"contract ITokenManagerLinker","name":"newIMALinker","type":"address"},{"internalType":"contract ICommunityLocker","name":"newCommunityLocker","type":"address"},{"internalType":"address","name":"newDepositBox","type":"address"}],"name":"initializeTokenManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"messageProxy","outputs":[{"internalType":"contract IMessageProxyForSchain","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"fromChainHash","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"postMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"schainName","type":"string"}],"name":"removeTokenManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"schainHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenManagerLinker","outputs":[{"internalType":"contract ITokenManagerLinker","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"tokenManagers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"targetSchainName","type":"string"},{"internalType":"address","name":"contractOnMainnet","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferToSchainERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"transferredAmount","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"}],"token_manager_erc721_address":"0xD2aaa00600000000000000000000000000000000","token_manager_erc721_with_metadata_abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldValue","type":"address"},{"indexed":false,"internalType":"address","name":"newValue","type":"address"}],"name":"DepositBoxWasChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"chainHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"erc721OnMainChain","type":"address"},{"indexed":true,"internalType":"address","name":"erc721OnSchain","type":"address"}],"name":"ERC721TokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"chainHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"erc721OnMainChain","type":"address"},{"indexed":true,"internalType":"address","name":"erc721OnSchain","type":"address"}],"name":"ERC721TokenCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"chainHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"contractOnMainnet","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721TokenReady","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"chainHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"erc721OnMainChain","type":"address"},{"indexed":true,"internalType":"address","name":"erc721OnSchain","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721TokenReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"AUTOMATIC_DEPLOY_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINNET_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINNET_NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_REGISTRAR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"targetChainName","type":"string"},{"internalType":"address","name":"erc721OnMainChain","type":"address"},{"internalType":"address","name":"erc721OnSchain","type":"address"}],"name":"addERC721TokenByOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"schainName","type":"string"},{"internalType":"address","name":"newTokenManager","type":"address"}],"name":"addTokenManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC721OnChain","name":"","type":"address"}],"name":"addedClones","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"automaticDeploy","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newDepositBox","type":"address"}],"name":"changeDepositBoxAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"address","name":"","type":"address"}],"name":"clonesErc721","outputs":[{"internalType":"contract ERC721OnChain","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"communityLocker","outputs":[{"internalType":"contract ICommunityLocker","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositBox","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"deprecatedClonesErc721","outputs":[{"internalType":"contract ERC721OnChain","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"disableAutomaticDeploy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableAutomaticDeploy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractOnMainnet","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"exitToMainERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"schainName","type":"string"}],"name":"hasTokenManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"newChainName","type":"string"},{"internalType":"contract IMessageProxyForSchain","name":"newMessageProxy","type":"address"},{"internalType":"contract ITokenManagerLinker","name":"newIMALinker","type":"address"},{"internalType":"contract ICommunityLocker","name":"newCommunityLocker","type":"address"},{"internalType":"address","name":"newDepositBox","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"contracts","type":"address[]"}],"name":"initializeAllClonesERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newSchainName","type":"string"},{"internalType":"contract IMessageProxyForSchain","name":"newMessageProxy","type":"address"},{"internalType":"contract ITokenManagerLinker","name":"newIMALinker","type":"address"},{"internalType":"contract ICommunityLocker","name":"newCommunityLocker","type":"address"},{"internalType":"address","name":"newDepositBox","type":"address"}],"name":"initializeTokenManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"messageProxy","outputs":[{"internalType":"contract IMessageProxyForSchain","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"fromChainHash","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"postMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"schainName","type":"string"}],"name":"removeTokenManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"schainHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenManagerLinker","outputs":[{"internalType":"contract ITokenManagerLinker","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"tokenManagers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"targetSchainName","type":"string"},{"internalType":"address","name":"contractOnMainnet","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferToSchainERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"transferredAmount","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"}],"token_manager_erc721_with_metadata_address":"0xd2AaA00a00000000000000000000000000000000","token_manager_eth_abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldValue","type":"address"},{"indexed":false,"internalType":"address","name":"newValue","type":"address"}],"name":"DepositBoxWasChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"AUTOMATIC_DEPLOY_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINNET_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINNET_NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_REGISTRAR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"schainName","type":"string"},{"internalType":"address","name":"newTokenManager","type":"address"}],"name":"addTokenManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"automaticDeploy","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newDepositBox","type":"address"}],"name":"changeDepositBoxAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"communityLocker","outputs":[{"internalType":"contract ICommunityLocker","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositBox","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"disableAutomaticDeploy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableAutomaticDeploy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ethErc20","outputs":[{"internalType":"contract IEthErc20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"exitToMain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"schainName","type":"string"}],"name":"hasTokenManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"newChainName","type":"string"},{"internalType":"contract IMessageProxyForSchain","name":"newMessageProxy","type":"address"},{"internalType":"contract ITokenManagerLinker","name":"newIMALinker","type":"address"},{"internalType":"contract ICommunityLocker","name":"newCommunityLocker","type":"address"},{"internalType":"address","name":"newDepositBox","type":"address"},{"internalType":"contract IEthErc20","name":"ethErc20Address","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newSchainName","type":"string"},{"internalType":"contract IMessageProxyForSchain","name":"newMessageProxy","type":"address"},{"internalType":"contract ITokenManagerLinker","name":"newIMALinker","type":"address"},{"internalType":"contract ICommunityLocker","name":"newCommunityLocker","type":"address"},{"internalType":"address","name":"newDepositBox","type":"address"}],"name":"initializeTokenManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"messageProxy","outputs":[{"internalType":"contract IMessageProxyForSchain","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"fromChainHash","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"postMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"schainName","type":"string"}],"name":"removeTokenManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"schainHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IEthErc20","name":"newEthErc20Address","type":"address"}],"name":"setEthErc20Address","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenManagerLinker","outputs":[{"internalType":"contract ITokenManagerLinker","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"tokenManagers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"token_manager_eth_address":"0xd2AaA00400000000000000000000000000000000","token_manager_linker_abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINNET_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINNET_NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REGISTRAR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"schainName","type":"string"}],"name":"connectSchain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"schainName","type":"string"}],"name":"disconnectSchain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"schainName","type":"string"}],"name":"hasSchain","outputs":[{"internalType":"bool","name":"connected","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ITokenManager","name":"tokenManager","type":"address"}],"name":"hasTokenManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IMessageProxyForSchain","name":"newMessageProxyAddress","type":"address"},{"internalType":"address","name":"linker","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"linkerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"messageProxy","outputs":[{"internalType":"contract IMessageProxyForSchain","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ITokenManager","name":"newTokenManager","type":"address"}],"name":"registerTokenManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITokenManager","name":"tokenManagerAddress","type":"address"}],"name":"removeTokenManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenManagers","outputs":[{"internalType":"contract ITokenManager","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"token_manager_linker_address":"0xD2aAA00800000000000000000000000000000000"} \ No newline at end of file From 9336d6d014d3692cc5c612e695f62449d3761567 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Tue, 25 Oct 2022 22:33:27 +0100 Subject: [PATCH 03/12] Finish ERC721 and ERC1155 transfers --- src/Metaport.tsx | 2 + .../AmountErrorMessage/AmountErrorMessage.tsx | 15 +- src/components/AmountInput/AmountInput.tsx | 1 - src/components/ErrorMessage/ErrorMessages.tsx | 13 +- src/components/Stepper/Stepper.tsx | 6 +- src/components/Widget/Widget.tsx | 127 ++++++-- src/components/WidgetBody/WidgetBody.tsx | 11 +- src/components/WidgetUI/WidgetUI.scss | 20 +- src/components/WidgetUI/WidgetUI.tsx | 2 + src/core/actions/action.ts | 16 +- src/core/actions/erc1155.ts | 231 +++++++++++++++ src/core/actions/erc20.ts | 24 +- src/core/actions/erc721.ts | 280 ++++++++++-------- src/core/actions/eth.ts | 4 +- src/core/actions/index.ts | 24 +- src/core/convertation.ts | 15 +- src/core/dataclasses/index.ts | 24 ++ src/core/events.ts | 2 +- src/core/helper.ts | 6 + src/core/interfaces/TransferParams.ts | 4 +- src/core/tokens/erc20.ts | 2 +- src/index.ts | 2 +- 22 files changed, 614 insertions(+), 217 deletions(-) create mode 100644 src/core/actions/erc1155.ts create mode 100644 src/core/dataclasses/index.ts diff --git a/src/Metaport.tsx b/src/Metaport.tsx index 7fe47a0..ffddf9c 100644 --- a/src/Metaport.tsx +++ b/src/Metaport.tsx @@ -34,6 +34,8 @@ import defaultTokens from './metadata/tokens.json'; import * as interfaces from './core/interfaces/index'; export * as interfaces from './core/interfaces/index'; +export * as dataclasses from './core/dataclasses/index'; + export class Metaport { constructor(config: interfaces.MetaportConfig) { diff --git a/src/components/AmountErrorMessage/AmountErrorMessage.tsx b/src/components/AmountErrorMessage/AmountErrorMessage.tsx index ea2fc98..387ad45 100644 --- a/src/components/AmountErrorMessage/AmountErrorMessage.tsx +++ b/src/components/AmountErrorMessage/AmountErrorMessage.tsx @@ -8,19 +8,22 @@ import styles from "../WidgetUI/WidgetUI.scss"; export default function AmountErrorMessage(props) { if (props.actionBtnDisabled) { - return ( - - ) + return (
+
+ +
+
) } - if (!props.amountErrorMessage) return + if (!props.amountErrorMessage) return (
) return ( -
+

diff --git a/src/components/AmountInput/AmountInput.tsx b/src/components/AmountInput/AmountInput.tsx index adfd68e..12bac07 100644 --- a/src/components/AmountInput/AmountInput.tsx +++ b/src/components/AmountInput/AmountInput.tsx @@ -45,7 +45,6 @@ export default function AmountInput(props) { Amount

-
) } diff --git a/src/components/ErrorMessage/ErrorMessages.tsx b/src/components/ErrorMessage/ErrorMessages.tsx index 3cc9ed7..070299f 100644 --- a/src/components/ErrorMessage/ErrorMessages.tsx +++ b/src/components/ErrorMessage/ErrorMessages.tsx @@ -26,6 +26,8 @@ import React from 'react'; import LinkOffIcon from '@mui/icons-material/LinkOff'; import PublicOffIcon from '@mui/icons-material/PublicOff'; import SentimentVeryDissatisfiedIcon from '@mui/icons-material/SentimentVeryDissatisfied'; +import ErrorIcon from '@mui/icons-material/Error'; + export class BaseErrorMessage { @@ -66,4 +68,13 @@ export class TransactionErrorMessage extends BaseErrorMessage { this.text = text; this.btnText = 'Start over'; } -} \ No newline at end of file +} + + +export class CustomErrorMessage extends BaseErrorMessage { + constructor(text: string) { + super(undefined); + this.icon = ; + this.text = text; + } +} diff --git a/src/components/Stepper/Stepper.tsx b/src/components/Stepper/Stepper.tsx index ca1f1e8..ca69f5d 100644 --- a/src/components/Stepper/Stepper.tsx +++ b/src/components/Stepper/Stepper.tsx @@ -17,18 +17,16 @@ import localStyles from './Stepper.scss'; export default function ActionsStepper(props) { const handleReset = () => { - props.setActiveStep(0); props.setAmount(''); + props.setTokenId(''); props.setLoading(false); props.setAmountLocked(false); + props.setActiveStep(0); }; - if (!props.token) return; - const nextStepDisabledAmount = [TokenType.erc20, TokenType.erc1155].includes(props.token.type) && (props.amount === '' || props.amount === '0'); const nextStepDisabledTokenId = [TokenType.erc721, TokenType.erc721meta, TokenType.erc1155].includes(props.token.type) && !props.tokenId; const nextStepDisabled = nextStepDisabledAmount || nextStepDisabledTokenId || props.loading || props.actionBtnDisabled; - return ( diff --git a/src/components/Widget/Widget.tsx b/src/components/Widget/Widget.tsx index f250f94..a769f77 100644 --- a/src/components/Widget/Widget.tsx +++ b/src/components/Widget/Widget.tsx @@ -2,14 +2,13 @@ import React, { useEffect } from 'react'; import debug from 'debug'; import WidgetUI from '../WidgetUI'; -import { WrongNetworkMessage, TransactionErrorMessage } from '../ErrorMessage'; +import { WrongNetworkMessage, TransactionErrorMessage, CustomErrorMessage } from '../ErrorMessage'; import { initSChain, initSChainMetamask, initMainnet, initMainnetMetamask, - initERC20, updateWeb3SChain, updateWeb3SChainMetamask, getChainId @@ -48,7 +47,7 @@ export function Widget(props) { const [address, setAddress] = React.useState(undefined); const [amount, setAmount] = React.useState(''); - const [tokenId, setTokenId] = React.useState(undefined); + const [tokenId, setTokenId] = React.useState(undefined); const [walletConnected, setWalletConnected] = React.useState(undefined); @@ -80,6 +79,8 @@ export function Widget(props) { const [sFuelData1, setSFuelData1] = React.useState(undefined); const [sFuelData2, setSFuelData2] = React.useState(undefined); + const [transferRequest, setTransferRequest] = React.useState(undefined); + useEffect(() => { setWalletConnected(false); setSchains(props.chains); @@ -91,7 +92,7 @@ export function Widget(props) { }, []); function addinternalEventsListeners() { - window.addEventListener("_metaport_transfer", requestTransfer, false); + window.addEventListener("_metaport_transfer", transferHandler, false); window.addEventListener("_metaport_unwrap", unwrap, false); window.addEventListener("_metaport_updateParams", updateParamsHandler, false); @@ -142,21 +143,38 @@ export function Widget(props) { setAmountLocked(false); setActiveStep(0); setActionSteps(undefined); + setAmountErrorMessage(undefined); + setActionBtnDisabled(false); log('resetWidget event processed'); } - function requestTransfer(e) { - setOpen(true); - setAmount(e.detail.amount); - setSchains(e.detail.schains); - setAmountLocked(!!e.detail.lockAmount); + function transferHandler(e) { + const params: interfaces.TransferParams = e.detail; + setTransferRequest(params); + } - if (e.detail.tokens) { - setConfigTokens(e.detail.tokens); + function transfer(params: interfaces.TransferParams): void { + log('Transfer request'); + log(params); + setOpen(true); + setAmountLocked(!!params.lockValue); + if (params.chains) { + if (params.chains.length != 2) { + log(`Incorrect number of chains: ${params.chains.length} (must be 2)`); + setErrorMessage(new CustomErrorMessage('Incorrect number of chains')); + return + } + if (!schains.includes(params.chains[0]) || !schains.includes(params.chains[1])) { + setErrorMessage(new CustomErrorMessage(`Reqested chains are not found in the list: ${params.chains}`)); + return + } + if (chainName1 == params.chains[0] && chainName2 == params.chains[1]) { + finishTransferRequest(); + } else { + setChainName1(params.chains[0]); + setChainName2(params.chains[1]); + } } - - log("requestTransfer from: " + e.detail.schains[0], ", to: " + e.detail.schains[1]); - log("amount inside react " + e.detail.amount); } function updateParamsHandler(e) { @@ -189,7 +207,6 @@ export function Widget(props) { sChain1, address ); - setAvailableTokens(tokens); updateBalanceHandler(); setLoadingTokens(false); @@ -262,6 +279,7 @@ export function Widget(props) { useEffect(() => { if (!open && !firstOpen) return; + cleanData(); if (chainName1 !== MAINNET_CHAIN_NAME && chainName2 !== MAINNET_CHAIN_NAME) setMainnet(null); if (chainName1) setChainId(getChainId(props.network, chainName1)); if (address && chainName1) { @@ -278,6 +296,7 @@ export function Widget(props) { }, [open]); useEffect(() => { + cleanData(); if (chainName1 !== MAINNET_CHAIN_NAME && chainName2 !== MAINNET_CHAIN_NAME) setMainnet(null); if (address && chainName2) { if (chainName2 == MAINNET_CHAIN_NAME) { @@ -305,6 +324,13 @@ export function Widget(props) { useEffect(() => { setActiveStep(0); + if (token) { + if (transferRequest) { + setTransferRequest(undefined); + } else { + setAmountLocked(false); + } + } }, [token]); useEffect(() => { @@ -315,6 +341,10 @@ export function Widget(props) { }, [chainName1, chainName2, token, availableTokens]); useEffect(() => { + if (transferRequest) { + finishTransferRequest(); + return + } const defaultToken = getDefaultToken(availableTokens); if (defaultToken) setToken(defaultToken); }, [availableTokens]); @@ -332,28 +362,59 @@ export function Widget(props) { } }, [extChainId, chainId]); + useEffect(() => { + if (transferRequest) transfer(transferRequest); + }, [transferRequest]); + + function cleanData() { + setAmountErrorMessage(undefined); + setActionBtnDisabled(false); + setTokenId(undefined); + setAmount(''); + setLoading(false); + setActiveStep(0); + } + + function finishTransferRequest() { + const tokenData = availableTokens[transferRequest.tokenType][transferRequest.tokenKeyname]; + if (!tokenData) { + setErrorMessage(new CustomErrorMessage( + `Token not found: ${transferRequest.tokenType}, ${transferRequest.tokenKeyname}` + )); + return + } + setAmount(transferRequest.amount); + setTokenId(transferRequest.tokenId); + setToken(tokenData); + } + async function runPreAction() { if (actionSteps && actionSteps[activeStep]) { log('Running preAction'); setActionBtnDisabled(true); const ActionClass: ActionType = actionSteps[activeStep]; - await new ActionClass( - mainnet, - sChain1, - sChain2, - chainName1, - chainName2, - address, - amount, - tokenId, - token, - switchMetamaskChain, - setActiveStep, - activeStep, - setAmountErrorMessage - ).preAction(); - setActionBtnDisabled(false); - log('preAction done'); + try { + await new ActionClass( + mainnet, + sChain1, + sChain2, + chainName1, + chainName2, + address, + amount, + tokenId, + token, + switchMetamaskChain, + setActiveStep, + activeStep, + setAmountErrorMessage + ).preAction(); + } catch (e) { + console.error(e); + } finally { + setActionBtnDisabled(false); + log('preAction done'); + } } } @@ -496,5 +557,7 @@ export function Widget(props) { errorMessage={errorMessage} amountErrorMessage={amountErrorMessage} setAmountErrorMessage={setAmountErrorMessage} + + cleanData={cleanData} />) } \ No newline at end of file diff --git a/src/components/WidgetBody/WidgetBody.tsx b/src/components/WidgetBody/WidgetBody.tsx index 851896e..f4f3b2f 100644 --- a/src/components/WidgetBody/WidgetBody.tsx +++ b/src/components/WidgetBody/WidgetBody.tsx @@ -66,12 +66,9 @@ export default function WidgetBody(props) { onClick={() => { let chain1 = props.chain1; - props.setAmountErrorMessage(undefined); + props.cleanData(); props.setChain1(props.chain2); props.setChain2(chain1); - props.setAmount(null); - props.setLoading(false); - props.setActiveStep(0); }}> @@ -131,7 +128,7 @@ export default function WidgetBody(props) { />
- +
)}
)} diff --git a/src/components/WidgetUI/WidgetUI.scss b/src/components/WidgetUI/WidgetUI.scss index 1ef4ea9..95f7f41 100644 --- a/src/components/WidgetUI/WidgetUI.scss +++ b/src/components/WidgetUI/WidgetUI.scss @@ -137,7 +137,7 @@ } -.mp__noMarg-bott { +.mp__noMargBott { margin-bottom: 0 !important; } @@ -145,6 +145,10 @@ margin: 0 !important; } +.mp__paddTop10 { + padding-top: 10px !important; +} + .mp__chainName { font-weight: bold; padding-left: 10pt; @@ -326,7 +330,7 @@ letter-spacing: 0.03857em !important; } -.mp__errorMessage{ +.mp__errorMessage { color: #ff3737 !important; } @@ -412,10 +416,20 @@ width: min-content; } -.tokenIdIcon{ +.tokenIdIcon { padding: 0 0 0 16px; :global(svg) { //width: 20px; } +} + + +.mp__amountErrorMessage { + height: 15px !important; + margin-bottom: -5px !important; + + :global(p) { + font-size: 0.5525rem !important + } } \ No newline at end of file diff --git a/src/components/WidgetUI/WidgetUI.tsx b/src/components/WidgetUI/WidgetUI.tsx index ee3216d..f33c470 100644 --- a/src/components/WidgetUI/WidgetUI.tsx +++ b/src/components/WidgetUI/WidgetUI.tsx @@ -127,6 +127,8 @@ export function WidgetUI(props) { errorMessage={props.errorMessage} amountErrorMessage={props.amountErrorMessage} setAmountErrorMessage={props.setAmountErrorMessage} + + cleanData={props.cleanData} /> ) : ( . + */ + +/** + * @file erc1155.ts + * @copyright SKALE Labs 2022-Present + */ + + +import debug from 'debug'; +import { Contract } from 'web3-eth-contract'; + +import { TransferAction, ApproveAction } from './action'; + +import { TokenType } from '../dataclasses/TokenType'; +import { addressesEqual } from '../helper'; + +import TokenData from '../dataclasses/TokenData'; + + + +debug.enable('*'); +const log = debug('metaport:actions:erc1155'); + + +interface CheckRes { + res: boolean; + approved: boolean; + msg?: string; +} + + +async function checkERC1155( + address: string, + approvalAddress: string, + tokenId: number, + amount: string, + tokenData: TokenData, + tokenContract: Contract +): Promise { + const checkRes: CheckRes = { res: true, approved: false }; + if (!tokenId || !amount) return checkRes; + + try { + const balance = await tokenContract.methods.balanceOf(address, tokenId).call(); + log(`address: ${address}, balanceEther: ${balance}, amount: ${amount}`); + if (Number(amount) > Number(balance)) { + checkRes.msg = `Current balance: ${balance} ${tokenData.symbol}`; + } + checkRes.approved = await tokenContract.methods.isApprovedForAll( + address, + approvalAddress + ).call(); + } catch (err) { + console.error(err); + checkRes.msg = 'Something went wrong, check developer console'; + return checkRes; + } + return checkRes; +} + + +export class ApproveERC1155M extends ApproveAction { + async execute() { + await this.mainnet.erc1155.approveAll( + this.tokenData.keyname, + { address: this.address } + ) + } + async preAction() { + const checkRes = await checkERC1155( + this.address, + this.mainnet.erc1155.address, + this.tokenId, + this.amount, + this.tokenData, + this.mainnet.erc1155.tokens[this.tokenData.keyname] + ); + this.setAmountErrorMessage(checkRes.msg); + if (checkRes.approved) this.setActiveStep(1); + } +} + + +export class TransferERC1155M2S extends TransferAction { + async execute() { + const destTokenContract = this.sChain2.erc1155.tokens[this.tokenData.keyname] + const balanceOnDestination = await this.sChain2.getERC1155Balance( + destTokenContract, + this.address, + this.tokenId + ); + const tx = await this.mainnet.erc1155.deposit( + this.chainName2, + this.tokenData.keyname, + this.tokenId, + this.amount, + { address: this.address } + ); + log('Transfer transaction done, waiting for tokens to be received'); + await this.sChain2.waitERC1155BalanceChange( + destTokenContract, this.address, this.tokenId, balanceOnDestination); + log('Tokens received to destination chain'); + this.transferComplete(tx); + } + + async preAction() { + const checkRes = await checkERC1155( + this.address, + this.mainnet.erc1155.address, + this.tokenId, + this.amount, + this.tokenData, + this.mainnet.erc1155.tokens[this.tokenData.keyname] + ); + this.setAmountErrorMessage(checkRes.msg); + if (!checkRes.approved) this.setActiveStep(0); + } +} + + + +export class ApproveERC1155S extends ApproveAction { + async execute() { + await this.sChain1.erc1155.approveAll( + this.tokenData.keyname, + this.tokenId, + { address: this.address } + ); + } + async preAction() { + const checkRes = await checkERC1155( + this.address, + this.sChain1.erc1155.address, + this.tokenId, + this.amount, + this.tokenData, + this.sChain1.erc1155.tokens[this.tokenData.keyname] + ); + this.setAmountErrorMessage(checkRes.msg); + if (checkRes.approved) this.setActiveStep(1); + } +} + + +export class TransferERC1155S2M extends TransferAction { + async execute() { + const destTokenContract = this.mainnet.erc1155.tokens[this.tokenData.keyname]; + const balanceOnDestination = await this.mainnet.getERC1155Balance( + destTokenContract, + this.address, + this.tokenId + ); + const tx = await this.sChain1.erc1155.withdraw( + this.tokenData.originAddress, + this.tokenId, + this.amount, + { address: this.address } + ); + log('Transfer transaction done, waiting for tokens to be received'); + await this.mainnet.waitERC1155BalanceChange( + destTokenContract, this.address, this.tokenId, balanceOnDestination); + log('Tokens received to destination chain'); + this.transferComplete(tx); + } + + async preAction() { + const checkRes = await checkERC1155( + this.address, + this.sChain1.erc1155.address, + this.tokenId, + this.amount, + this.tokenData, + this.sChain1.erc1155.tokens[this.tokenData.keyname] + ); + this.setAmountErrorMessage(checkRes.msg); + if (!checkRes.approved) this.setActiveStep(0); + } +} + + +export class TransferERC1155S2S extends TransferAction { + async execute() { + const destTokenContract = this.sChain2.erc1155.tokens[this.tokenData.keyname]; + const ownerOnDestination = await this.sChain2.getERC1155Balance( + destTokenContract, + this.address, + this.tokenId + ); + const tx = await this.sChain1.erc1155.transferToSchain( + this.chainName2, + this.tokenData.originAddress, + this.tokenId, + this.amount, + { address: this.address } + ); + log('Transfer transaction done, waiting for token to be received'); + await this.sChain2.waitERC1155BalanceChange( + destTokenContract, this.address, this.tokenId, ownerOnDestination); + log('Token received to destination chain'); + this.transferComplete(tx); + } + + async preAction() { + const checkRes = await checkERC1155( + this.address, + this.sChain1.erc1155.address, + this.tokenId, + this.amount, + this.tokenData, + this.sChain1.erc1155.tokens[this.tokenData.keyname] + ); + this.setAmountErrorMessage(checkRes.msg); + if (!checkRes.approved) this.setActiveStep(0); + } +} \ No newline at end of file diff --git a/src/core/actions/erc20.ts b/src/core/actions/erc20.ts index d8758aa..25134b6 100644 --- a/src/core/actions/erc20.ts +++ b/src/core/actions/erc20.ts @@ -55,7 +55,7 @@ export class ApproveERC20S extends Action { this.address, this.sChain1.erc20.address ).call(); - const allowanceEther = fromWei(this.sChain1.web3, allowance, this.tokenData.decimals); + const allowanceEther = fromWei(allowance, this.tokenData.decimals); if (Number(allowanceEther) >= Number(this.amount) && this.amount !== '') { const step = this.wrap ? 3 : 1; this.setActiveStep(step); @@ -66,7 +66,7 @@ export class ApproveERC20S extends Action { export class TransferERC20S2S extends TransferAction { async execute() { - const amountWei = toWei(this.sChain1.web3, this.amount, this.tokenData.decimals); + const amountWei = toWei(this.amount, this.tokenData.decimals); const destTokenContract = this.sChain2.erc20.tokens[this.tokenData.keyname]; const balanceOnDestination = await this.sChain2.getERC20Balance(destTokenContract, this.address); @@ -97,7 +97,7 @@ export class TransferERC20S2S extends TransferAction { this.address, this.sChain1.erc20.address ).call(); - const allowanceEther = fromWei(this.sChain1.web3, allowance, this.tokenData.decimals); + const allowanceEther = fromWei(allowance, this.tokenData.decimals); if (Number(allowanceEther) < Number(this.amount) && this.amount !== '') { const step = this.wrap ? 2 : 0; this.setActiveStep(step); @@ -126,7 +126,7 @@ export class ApproveWrapERC20S extends Action { this.address, this.tokenData.originAddress ).call(); - const allowanceEther = fromWei(this.sChain1.web3, allowance, this.tokenData.decimals); + const allowanceEther = fromWei(allowance, this.tokenData.decimals); if (Number(allowanceEther) >= Number(this.amount) && this.amount !== '') { this.setActiveStep(1); } @@ -140,7 +140,7 @@ export class WrapERC20S extends Action { static loadingText = 'Wrapping' async execute() { - const amountWei = toWei(this.sChain1.web3, this.amount, this.tokenData.decimals); + const amountWei = toWei(this.amount, this.tokenData.decimals); await this.sChain1.erc20.wrap( this.tokenData.keyname, amountWei, @@ -154,7 +154,7 @@ export class WrapERC20S extends Action { this.address, this.tokenData.originAddress ).call(); - const allowanceEther = fromWei(this.sChain1.web3, allowance, this.tokenData.decimals); + const allowanceEther = fromWei(allowance, this.tokenData.decimals); if (Number(allowanceEther) < Number(this.amount) && this.amount !== '') { this.setActiveStep(0); } @@ -169,7 +169,7 @@ export class UnWrapERC20S extends Action { async execute() { await this.switchMetamaskChain(); - const amountWei = toWei(this.sChain2.web3, this.amount, this.tokenData.decimals); + const amountWei = toWei(this.amount, this.tokenData.decimals); const tx = await this.sChain2.erc20.unwrap( this.tokenData.keyname, amountWei, @@ -200,7 +200,7 @@ export class ApproveERC20M extends Action { this.address, this.mainnet.erc20.address ).call(); - const allowanceEther = fromWei(this.mainnet.web3, allowance, this.tokenData.decimals); + const allowanceEther = fromWei(allowance, this.tokenData.decimals); if (Number(allowanceEther) >= Number(this.amount) && this.amount !== '') { this.setActiveStep(1); } @@ -210,7 +210,7 @@ export class ApproveERC20M extends Action { export class TransferERC20M2S extends TransferAction { async execute() { - const amountWei = toWei(this.mainnet.web3, this.amount, this.tokenData.decimals); + const amountWei = toWei(this.amount, this.tokenData.decimals); const destTokenContract = this.sChain2.erc20.tokens[this.tokenData.keyname]; const balanceOnDestination = await this.sChain2.getERC20Balance( destTokenContract, @@ -243,7 +243,7 @@ export class TransferERC20M2S extends TransferAction { this.address, this.mainnet.erc20.address ).call(); - const allowanceEther = fromWei(this.mainnet.web3, allowance, this.tokenData.decimals); + const allowanceEther = fromWei(allowance, this.tokenData.decimals); if (Number(allowanceEther) < Number(this.amount) && this.amount !== '') { this.setActiveStep(0); } @@ -253,7 +253,7 @@ export class TransferERC20M2S extends TransferAction { export class TransferERC20S2M extends TransferAction { async execute() { - const amountWei = toWei(this.sChain1.web3, this.amount, this.tokenData.decimals); + const amountWei = toWei(this.amount, this.tokenData.decimals); const destTokenContract = this.mainnet.erc20.tokens[this.tokenData.keyname]; const balanceOnDestination = await this.mainnet.getERC20Balance(destTokenContract, this.address); @@ -281,7 +281,7 @@ export class TransferERC20S2M extends TransferAction { this.address, this.sChain1.erc20.address ).call(); - const allowanceEther = fromWei(this.sChain1.web3, allowance, this.tokenData.decimals); + const allowanceEther = fromWei(allowance, this.tokenData.decimals); if (Number(allowanceEther) < Number(this.amount) && this.amount !== '') { this.setActiveStep(0); } diff --git a/src/core/actions/erc721.ts b/src/core/actions/erc721.ts index a605f54..976e7a2 100644 --- a/src/core/actions/erc721.ts +++ b/src/core/actions/erc721.ts @@ -23,83 +23,118 @@ import debug from 'debug'; +import { Contract } from 'web3-eth-contract'; +import { Action } from './action'; import { TokenType } from '../dataclasses/TokenType'; import { externalEvents } from '../events'; -import { toWei, fromWei } from '../convertation'; -import { MAX_APPROVE_AMOUNT, ZERO_ADDRESS } from '../constants'; - -import { TransferAction, ApproveAction } from './action'; +import { addressesEqual } from '../helper'; debug.enable('*'); const log = debug('metaport:actions:erc721'); -export class ApproveERC721M extends ApproveAction { +interface CheckRes { + res: boolean; + approved: boolean; + msg?: string; +} + - isMeta(): boolean { - return this.tokenData.type === TokenType.erc721meta; +async function checkERC721( + address: string, + approvalAddress: string, + tokenId: number, + tokenContract: Contract +): Promise { + let approvedAddress: string; + const checkRes: CheckRes = { res: true, approved: false }; + if (!tokenId) return checkRes; + try { + approvedAddress = await tokenContract.methods.getApproved(tokenId).call(); + log(`approvedAddress: ${approvedAddress}, address: ${address}`); + } catch (err) { + console.error(err); + checkRes.msg = 'tokenId does not exist, try again' + return checkRes; } + try { + const currentOwner = await tokenContract.methods.ownerOf(tokenId).call();; + log(`currentOwner: ${currentOwner}, address: ${address}`); + if (!addressesEqual(currentOwner, address)) { + checkRes.msg = 'This account is not an owner of this tokenId'; + return checkRes; + } + } catch (err) { + console.error(err); + checkRes.msg = 'Something went wrong, check developer console'; + return checkRes; + } + checkRes.approved = addressesEqual(approvedAddress, approvalAddress); + return checkRes; +} - async execute() { - this.isMeta() ? await this.mainnet.erc721meta.approve( + +class ERC721Action extends Action { + isMeta(): boolean { return this.tokenData.type === TokenType.erc721meta; }; + mn() { return this.isMeta() ? this.mainnet.erc721meta : this.mainnet.erc721; }; + s1() { return this.isMeta() ? this.sChain1.erc721meta : this.sChain1.erc721; }; + s2() { return this.isMeta() ? this.sChain2.erc721meta : this.sChain2.erc721; }; +} + +class ERC721Approve extends ERC721Action { + static label = 'Approve transfer' + static buttonText = 'Approve' + static loadingText = 'Approving' +} + +class ERC721Transfer extends ERC721Action { + static label = 'Transfer' + static buttonText = 'Transfer' + static loadingText = 'Transferring' + + transferComplete(tx): void { + externalEvents.transferComplete( + tx, + this.chainName1, + this.chainName2, this.tokenData.keyname, - this.tokenId, - { address: this.address } - ) : await this.mainnet.erc721.approve( + false + ); + } +} + + +export class ApproveERC721M extends ERC721Approve { + async execute() { + await this.mn().approve( this.tokenData.keyname, this.tokenId, { address: this.address } ) } - async preAction() { // TODO: optimize! - reuse this code - const tokenContract = this.isMeta() ? this.mainnet.erc721meta.tokens[this.tokenData.keyname] : this.mainnet.erc721.tokens[this.tokenData.keyname]; - if (!this.tokenId) { - this.setAmountErrorMessage(undefined); - return; - } - let approvedAddress: string; - try { - approvedAddress = await tokenContract.methods.getApproved(this.tokenId).call(); - log(`approvedAddress: ${approvedAddress}, address: ${this.address}`); - } catch (err) { - console.error(err); - this.setAmountErrorMessage('tokenId does not exist, try again'); - return - } - try { - const currentOwner = await this.mainnet.getERC721OwnerOf(tokenContract, this.tokenId); - if (currentOwner !== this.address) { - this.setAmountErrorMessage('This account is not an owner of this tokenId'); - return; - } - } catch (err) { - this.setAmountErrorMessage(err); - return; - } - this.setAmountErrorMessage(undefined); - if (approvedAddress === this.address) this.setActiveStep(1); + async preAction() { + const checkRes = await checkERC721( + this.address, + this.mn().address, + this.tokenId, + this.mn().tokens[this.tokenData.keyname] + ); + this.setAmountErrorMessage(checkRes.msg); + if (checkRes.approved) this.setActiveStep(1); } } -export class TransferERC721M2S extends TransferAction { - - isMeta(): boolean { return this.tokenData.type === TokenType.erc721meta; } - +export class TransferERC721M2S extends ERC721Transfer { async execute() { - const destTokenContract = this.isMeta() ? this.sChain2.erc721meta.tokens[this.tokenData.keyname] : this.sChain2.erc721.tokens[this.tokenData.keyname]; + const destTokenContract = this.s2().tokens[this.tokenData.keyname] const ownerOnDestination = await this.sChain2.getERC721OwnerOf( destTokenContract, this.tokenId ); - const tx = this.isMeta() ? await this.mainnet.erc721meta.deposit( - this.chainName2, - this.tokenData.keyname, - this.tokenId, - { address: this.address } - ) : await this.mainnet.erc721.deposit( + const tx = await this.mn().deposit( this.chainName2, this.tokenData.keyname, this.tokenId, @@ -109,92 +144,53 @@ export class TransferERC721M2S extends TransferAction { await this.sChain2.waitERC721OwnerChange( destTokenContract, this.tokenId, ownerOnDestination); log('Token received to destination chain'); - externalEvents.transferComplete( - tx, - this.chainName1, - this.chainName2, - this.tokenData.keyname, - false - ); + this.transferComplete(tx); } async preAction() { - // const tokenContract = this.mainnet.erc20.tokens[this.tokenData.keyname]; - // const allowance = await tokenContract.methods.allowance( - // this.address, - // this.mainnet.erc20.address - // ).call(); - // const allowanceEther = fromWei(this.mainnet.web3, allowance, this.tokenData.decimals); - // if (Number(allowanceEther) < Number(this.amount) && this.amount !== '') { - // this.setActiveStep(0); - // } + const checkRes = await checkERC721( + this.address, + this.mn().address, + this.tokenId, + this.mn().tokens[this.tokenData.keyname] + ); + this.setAmountErrorMessage(checkRes.msg); + if (!checkRes.approved) this.setActiveStep(0); } } -export class ApproveERC721S extends ApproveAction { - - isMeta(): boolean { return this.tokenData.type === TokenType.erc721meta; } - +export class ApproveERC721S extends ERC721Approve { async execute() { - this.isMeta() ? await this.sChain1.erc721meta.approve( - this.tokenData.keyname, - this.tokenId, - { address: this.address } - ) : await this.sChain1.erc721.approve( + await this.s1().approve( this.tokenData.keyname, this.tokenId, { address: this.address } - ) + ); } - - async preAction() { // TODO: optimize! - reuse this code - const tokenContract = this.isMeta() ? this.sChain1.erc721meta.tokens[this.tokenData.keyname] : this.sChain1.erc721.tokens[this.tokenData.keyname]; - if (!this.tokenId) { - this.setAmountErrorMessage(undefined); - return; - } - let approvedAddress: string; - try { - approvedAddress = await tokenContract.methods.getApproved(this.tokenId).call(); - log(`approvedAddress: ${approvedAddress}, address: ${this.address}`); - } catch (err) { - console.error(err); - this.setAmountErrorMessage('tokenId does not exist, try again'); - return - } - try { - const currentOwner = await this.sChain1.getERC721OwnerOf(tokenContract, this.tokenId); - if (currentOwner !== this.address) { - this.setAmountErrorMessage('This account is not an owner of this tokenId'); - return; - } - } catch (err) { - this.setAmountErrorMessage(err); - return; - } - this.setAmountErrorMessage(undefined); - if (approvedAddress === this.address) this.setActiveStep(1); + async preAction() { + const checkRes = await checkERC721( + this.address, + this.s1().address, + this.tokenId, + this.s1().tokens[this.tokenData.keyname] + ); + this.setAmountErrorMessage(checkRes.msg); + if (checkRes.approved) this.setActiveStep(1); } } -export class TransferERC721S2M extends TransferAction { - isMeta(): boolean { return this.tokenData.type === TokenType.erc721meta; } - +export class TransferERC721S2M extends ERC721Transfer { async execute() { - const destTokenContract = this.isMeta() ? this.mainnet.erc721meta.tokens[this.tokenData.keyname] : this.mainnet.erc721.tokens[this.tokenData.keyname]; + const destTokenContract = this.mn().tokens[this.tokenData.keyname]; const ownerOnDestination = await this.mainnet.getERC721OwnerOf( destTokenContract, this.tokenId ); - const tx = this.isMeta() ? await this.sChain1.erc721meta.withdraw( - this.tokenData.cloneAddress, - this.tokenId, - { address: this.address } - ) : await this.sChain1.erc721.withdraw( - this.tokenData.cloneAddress, + const tx = await this.s1().withdraw( + this.tokenData.originAddress, this.tokenId, { address: this.address } ); @@ -202,24 +198,50 @@ export class TransferERC721S2M extends TransferAction { await this.mainnet.waitERC721OwnerChange( destTokenContract, this.tokenId, ownerOnDestination); log('Token received to destination chain'); - externalEvents.transferComplete( - tx, - this.chainName1, + this.transferComplete(tx); + } + + async preAction() { + const checkRes = await checkERC721( + this.address, + this.s1().address, + this.tokenId, + this.s1().tokens[this.tokenData.keyname] + ); + this.setAmountErrorMessage(checkRes.msg); + if (!checkRes.approved) this.setActiveStep(0); + } +} + + +export class TransferERC721S2S extends ERC721Transfer { + async execute() { + const destTokenContract = this.s2().tokens[this.tokenData.keyname]; + const ownerOnDestination = await this.sChain2.getERC721OwnerOf( + destTokenContract, + this.tokenId + ); + const tx = await this.sChain1.erc721.transferToSchain( this.chainName2, - this.tokenData.keyname, - false + this.tokenData.originAddress, + this.tokenId, + { address: this.address } ); + log('Transfer transaction done, waiting for token to be received'); + await this.sChain2.waitERC721OwnerChange( + destTokenContract, this.tokenId, ownerOnDestination); + log('Token received to destination chain'); + this.transferComplete(tx); } async preAction() { - // const tokenContract = this.mainnet.erc20.tokens[this.tokenData.keyname]; - // const allowance = await tokenContract.methods.allowance( - // this.address, - // this.mainnet.erc20.address - // ).call(); - // const allowanceEther = fromWei(this.mainnet.web3, allowance, this.tokenData.decimals); - // if (Number(allowanceEther) < Number(this.amount) && this.amount !== '') { - // this.setActiveStep(0); - // } + const checkRes = await checkERC721( + this.address, + this.s1().address, + this.tokenId, + this.s1().tokens[this.tokenData.keyname] + ); + this.setAmountErrorMessage(checkRes.msg); + if (!checkRes.approved) this.setActiveStep(0); } -} +} \ No newline at end of file diff --git a/src/core/actions/eth.ts b/src/core/actions/eth.ts index ea332ea..598e96c 100644 --- a/src/core/actions/eth.ts +++ b/src/core/actions/eth.ts @@ -36,7 +36,7 @@ const log = debug('metaport:actions:eth'); export class TransferEthM2S extends TransferAction { async execute() { log('TransferEthM2S: started'); - const amountWei = toWei(this.mainnet.web3, this.amount, this.tokenData.decimals); + const amountWei = toWei(this.amount, this.tokenData.decimals); const sChainBalanceBefore = await this.sChain2.ethBalance(this.address); const tx = await this.mainnet.eth.deposit( this.chainName2, @@ -54,7 +54,7 @@ export class TransferEthM2S extends TransferAction { export class TransferEthS2M extends TransferAction { async execute() { log('TransferEthS2M: started'); - const amountWei = toWei(this.sChain1.web3, this.amount, this.tokenData.decimals); + const amountWei = toWei(this.amount, this.tokenData.decimals); const lockedETHAmount = await this.mainnet.eth.lockedETHAmount(this.address); const tx = await this.sChain1.eth.withdraw( amountWei, diff --git a/src/core/actions/index.ts b/src/core/actions/index.ts index df8b39f..19b369f 100644 --- a/src/core/actions/index.ts +++ b/src/core/actions/index.ts @@ -41,9 +41,16 @@ import { ApproveERC721M, TransferERC721M2S, ApproveERC721S, - TransferERC721S2M + TransferERC721S2M, + TransferERC721S2S } from './erc721'; -// import { } from './erc1155'; +import { + ApproveERC1155M, + TransferERC1155M2S, + ApproveERC1155S, + TransferERC1155S2M, + TransferERC1155S2S +} from './erc1155'; import { isMainnet } from '../helper'; import TokenData from '../dataclasses/TokenData'; @@ -82,22 +89,23 @@ const unwrapActions = [UnWrapERC20S]; export const ACTIONS = { eth_m2s: [TransferEthM2S], eth_s2m: [TransferEthS2M, UnlockEthM], + eth_s2s: [], - erc20_s2s: [ApproveERC20S, TransferERC20S2S], erc20_m2s: [ApproveERC20M, TransferERC20M2S], erc20_s2m: [ApproveERC20S, TransferERC20S2M], + erc20_s2s: [ApproveERC20S, TransferERC20S2S], erc721_m2s: [ApproveERC721M, TransferERC721M2S], erc721_s2m: [ApproveERC721S, TransferERC721S2M], - erc721_s2s: [], + erc721_s2s: [ApproveERC721S, TransferERC721S2S], erc721meta_m2s: [ApproveERC721M, TransferERC721M2S], erc721meta_s2m: [ApproveERC721S, TransferERC721S2M], - erc721meta_s2s: [], + erc721meta_s2s: [ApproveERC721S, TransferERC721S2S], - erc1155_m2s: [], - erc1155_s2m: [], - erc1155_s2s: [] + erc1155_m2s: [ApproveERC1155M, TransferERC1155M2S], + erc1155_s2m: [ApproveERC1155S, TransferERC1155S2M], + erc1155_s2s: [ApproveERC1155S, TransferERC1155S2S] } diff --git a/src/core/convertation.ts b/src/core/convertation.ts index 6716d44..6952451 100644 --- a/src/core/convertation.ts +++ b/src/core/convertation.ts @@ -21,18 +21,17 @@ * @copyright SKALE Labs 2022-Present */ -import Web3 from 'web3'; -import { Unit } from 'web3-utils'; +import { Unit, toWei as _toWei, fromWei as _fromWei, unitMap, toBN } from 'web3-utils'; -export function toWei(web3: Web3, value: string, decimals: string): string { - return web3.utils.toWei(value, decimalsToUnit(web3, decimals)); +export function toWei(value: string, decimals: string): string { + return _toWei(value, decimalsToUnit(decimals)); } -export function fromWei(web3: Web3, value: string, decimals: string): string { - return web3.utils.fromWei(value, decimalsToUnit(web3, decimals)); +export function fromWei(value: string, decimals: string): string { + return _fromWei(value, decimalsToUnit(decimals)); } -function decimalsToUnit(web3: Web3, decimals: string): Unit { - return Object.keys(web3.utils.unitMap).find(key => web3.utils.unitMap[key] === web3.utils.toBN(10).pow(web3.utils.toBN(decimals)).toString()) as Unit; +function decimalsToUnit(decimals: string): Unit { + return Object.keys(unitMap).find(key => unitMap[key] === toBN(10).pow(toBN(decimals)).toString()) as Unit; } \ No newline at end of file diff --git a/src/core/dataclasses/index.ts b/src/core/dataclasses/index.ts new file mode 100644 index 0000000..1b4170f --- /dev/null +++ b/src/core/dataclasses/index.ts @@ -0,0 +1,24 @@ +/** + * @license + * SKALE Metaport + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/** + * @file index.ts + * @copyright SKALE Labs 2022-Present + */ + +export * from "./TokenType"; diff --git a/src/core/events.ts b/src/core/events.ts index a426473..f0565fe 100644 --- a/src/core/events.ts +++ b/src/core/events.ts @@ -92,7 +92,7 @@ export namespace internalEvents { 'chains': transferParams.chains, 'tokenKeyname': transferParams.tokenKeyname, 'tokenType': transferParams.tokenType, - 'lockAmount': transferParams.lockAmount + 'lockValue': transferParams.lockValue }); } diff --git a/src/core/helper.ts b/src/core/helper.ts index a69fc76..3a36deb 100644 --- a/src/core/helper.ts +++ b/src/core/helper.ts @@ -23,6 +23,7 @@ import { MAINNET_CHAIN_NAME } from './constants'; +import utils from 'web3-utils'; export function clsNames(...args) { @@ -38,3 +39,8 @@ export function eqArrays(arr1, arr2) { export function isMainnet(chainName: string): boolean { return chainName === MAINNET_CHAIN_NAME; } + + +export function addressesEqual(address1: string, address2: string): boolean { + return utils.toChecksumAddress(address1) === utils.toChecksumAddress(address2); +} diff --git a/src/core/interfaces/TransferParams.ts b/src/core/interfaces/TransferParams.ts index 6f760b9..f6496f7 100644 --- a/src/core/interfaces/TransferParams.ts +++ b/src/core/interfaces/TransferParams.ts @@ -28,7 +28,7 @@ export interface TransferParams { tokenKeyname: string; tokenType: TokenType; amount?: string; - tokenId?: string; + tokenId?: number; chains?: string[]; - lockAmount?: boolean; + lockValue?: boolean; } \ No newline at end of file diff --git a/src/core/tokens/erc20.ts b/src/core/tokens/erc20.ts index c4d0c61..c8c475d 100644 --- a/src/core/tokens/erc20.ts +++ b/src/core/tokens/erc20.ts @@ -87,5 +87,5 @@ export async function getTokenBalance( const tokenContract = chain.erc20.tokens[tokenSymbol]; const balance = await chain.getERC20Balance(tokenContract, address); externalEvents.balance(tokenSymbol, chainName, balance); - return fromWei(chain.web3, balance, decimals); + return fromWei(balance, decimals); } diff --git a/src/index.ts b/src/index.ts index dd77f64..4205b85 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1 +1 @@ -export { Metaport, interfaces } from "./Metaport"; +export { Metaport, interfaces, dataclasses } from "./Metaport"; From 28c176d28b045d2e0efb10ffaf8fdad42bc0e91d Mon Sep 17 00:00:00 2001 From: Dmytro Date: Wed, 26 Oct 2022 20:16:43 +0100 Subject: [PATCH 04/12] Update docs, fix transfer request error --- README.md | 61 ++++++++++++++--------- package.json | 2 +- src/components/Widget/Widget.tsx | 17 ++++--- src/components/WidgetBody/WidgetBody.tsx | 3 +- src/components/WidgetUI/WidgetUI.tsx | 1 + src/core/tokens/s2s.ts | 63 +++++++----------------- 6 files changed, 68 insertions(+), 79 deletions(-) diff --git a/README.md b/README.md index dab8fe3..0ac68b3 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Metaport is a Typescript/Javascript widget that could be embeded into a web appl - [Usage with SSR](#usage-with-ssr) - [Token icons](#token-icons) - [Type definitions](#type-definitions) + - [Dataclasses](#dataclasses) - [Events](#events) - [Available Events](#available-events) - [Themes](#themes) @@ -66,7 +67,7 @@ You can import Metaport into any modern web application (Vue/React/Angular/etc). ```Javascript import { Metaport } from '@skalenetwork/metaport'; -const widget = new Metaport(METAPORT_OPTIONS); +const metaport = new Metaport(METAPORT_OPTIONS); ``` ### Initialization options @@ -74,7 +75,7 @@ const widget = new Metaport(METAPORT_OPTIONS); All currently available options are listed below: ```Javascript -const widget = new Metaport({ +const metaport = new Metaport({ openOnLoad: true, // Open Metaport on load (optional, default = false) openButton: false, // Show open/close action button (optional, default = true) autoLookup: false, // Automatic token lookup for M2S tokens (default = true) @@ -122,25 +123,21 @@ const widget = new Metaport({ When sending a transfer request you can specify token and chains or keep ones that are already selected in the Metaport UI. -```Javascript +```Typescript +import { interfaces, dataclasses } from '@skalenetwork/metaport'; -const TRANSFER_PARAMS = { - amount: '1000', // amount to transfer (in wei) - chains: ['chainName1', 'chainName2'], // 'from' and 'to' chains - tokens: { // optional, if token is already selected in the Metaport UI - 'chainName1': { - 'erc20': { - 'tst': { - 'address': '0x0777', - 'name': 'TEST_TOKEN' - } - } - } - }, - lockAmount: true // optional, boolean - lock the amount in the Metaport UI -} +// token keyname is composed from token symbol and origin token address +const tokenKeyname = `_${tokenSymbol}_${tokenAddress}`; -metaport.transfer(TRANSFER_PARAMS); +const params: interfaces.TransferParams = { + tokenId: tokenId, // for erc721, erc721meta and erc1155 tokens + amount: amount, // amount to transfer (in wei) - for eth, erc20 and erc1155 tokens + chains: chains, // 'from' and 'to' chains (must be present in the list on chains) + tokenKeyname: tokenKeyname, // token that you want to transfer + tokenType: dataclasses.TokenType.erc1155, // available TokenTypes are eth, erc20, erc721, erc721meta and erc1155 + lockValue: true // optional, boolean - lock the amount in the Metaport UI +}; +props.metaport.transfer(params); ``` Once transfer will be completed, you will receive `metaport_transferComplete` event (see Events section for more details). @@ -183,7 +180,7 @@ const TOKENS_OVERRIDE = { } }; -const widget = new Metaport({ +const metaport = new Metaport({ ... autoLookup: true, tokens: TOKENS_OVERRIDE @@ -199,7 +196,7 @@ If you're passing multiple tokens to Metaport constructor or to `updateParams` f If you want to lock user on a specific token, pass a single entry to `tokens` param: ```Javascript -const widget = new Metaport({ +const metaport = new Metaport({ ..., tokens: { 'chainName2': { @@ -238,7 +235,7 @@ If you're passing more that 2 chains to Metaport constructor or to `updateParams If you want to perform/request transfer from one particular chain to another, pass exactly 2 chain names to `schain` param: ```Javascript -const widget = new Metaport({ +const metaport = new Metaport({ ..., chains: [ 'chainName1', // this one will be set as 'From' chain @@ -254,7 +251,7 @@ You can use the same approach for `updateParams` and `transfer` functions. ETH clone is already pre-deployed on each chain, so to have it in the Metaport UI, you just need to specify token like that: ```Javascript -const widget = new Metaport({ +const metaport = new Metaport({ ..., chains: ['mainnet', 'chainName1'] tokens: { @@ -368,6 +365,22 @@ const config: interfaces.MetaportConfig = { } ``` +#### Dataclasses + +You can import dataclasses types for the Metaport: + +```typescript +import { dataclasses } from '@skalenetwork/metaport'; + +const params: interfaces.TransferParams = { + amount: amount, + chains: chains, + tokenKeyname: tokenKeyname, + tokenType: dataclasses.TokenType.erc20, +}; +``` + + ### Events You can receive data from the Metaport widget using in-browser events. @@ -400,7 +413,7 @@ You can easily modify Metaport color scheme by providing a theme: ```Javascript // option 1: during the init -const widget = new Metaport({ +const metaport = new Metaport({ ... theme: { primary: '#00d4ff', // primary accent color for action buttons diff --git a/package.json b/package.json index 3ea4f11..4781741 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@skalenetwork/metaport", - "version": "0.2.0", + "version": "1.0.0", "description": "SKALE Metaport Widget", "keywords": [ "skale", diff --git a/src/components/Widget/Widget.tsx b/src/components/Widget/Widget.tsx index a769f77..304d0ad 100644 --- a/src/components/Widget/Widget.tsx +++ b/src/components/Widget/Widget.tsx @@ -248,6 +248,7 @@ export function Widget(props) { } async function initSchain1() { + log('Running initSchain1...'); setSChain1(await initSChainMetamask( props.network, chainName1 @@ -289,7 +290,7 @@ export function Widget(props) { initSchain1(); } } - }, [chainName1, address, firstOpen]); + }, [chainName1, address]); useEffect(() => { if (open && !firstOpen) setFirstOpen(true); @@ -302,12 +303,13 @@ export function Widget(props) { if (chainName2 == MAINNET_CHAIN_NAME) { setMainnet(initMainnet(props.network, mainnetEndpoint)) } else { + log('Running initSchain2...'); setSChain2(initSChain( props.network, chainName2 )); } - console.log('chain2 changed ' + chainName2); + log(`chain2 changed ${chainName2}`); } }, [chainName2, address]); @@ -326,7 +328,7 @@ export function Widget(props) { setActiveStep(0); if (token) { if (transferRequest) { - setTransferRequest(undefined); + // setTransferRequest(undefined); } else { setAmountLocked(false); } @@ -378,14 +380,16 @@ export function Widget(props) { function finishTransferRequest() { const tokenData = availableTokens[transferRequest.tokenType][transferRequest.tokenKeyname]; if (!tokenData) { - setErrorMessage(new CustomErrorMessage( - `Token not found: ${transferRequest.tokenType}, ${transferRequest.tokenKeyname}` - )); + // setErrorMessage(new CustomErrorMessage( + // `Token not found: ${transferRequest.tokenType}, ${transferRequest.tokenKeyname}` + // )); return } + setErrorMessage(undefined); setAmount(transferRequest.amount); setTokenId(transferRequest.tokenId); setToken(tokenData); + setTransferRequest(undefined); } async function runPreAction() { @@ -559,5 +563,6 @@ export function Widget(props) { setAmountErrorMessage={setAmountErrorMessage} cleanData={cleanData} + transferRequest={transferRequest} />) } \ No newline at end of file diff --git a/src/components/WidgetBody/WidgetBody.tsx b/src/components/WidgetBody/WidgetBody.tsx index f4f3b2f..fa633bc 100644 --- a/src/components/WidgetBody/WidgetBody.tsx +++ b/src/components/WidgetBody/WidgetBody.tsx @@ -145,14 +145,13 @@ export default function WidgetBody(props) { actionBtnDisabled={props.actionBtnDisabled} />
-
{!props.token ? (
) : (
- {!props.actionSteps ? () : () : ( ) : ( { + log(`Getting clone address for ${originTokenAddress} on a chain`); const tokenCloneAddress = await sChain[tokenType].getTokenCloneAddress( originTokenAddress, originChainName @@ -163,42 +157,19 @@ async function getCloneAddress( } -function addTokenContracts( - sChain1: SChain, - sChain2: SChain, - tokenKeyname: string, - tokenData: TokenData, - force: boolean, - tokenType: TokenType -) { - const chain1Address = tokenData.clone ? tokenData.cloneAddress : tokenData.originAddress; - const chain2Address = tokenData.clone ? tokenData.originAddress : tokenData.cloneAddress; - - if (sChain1) { addToken(sChain1, chain1Address, tokenKeyname, tokenData, force, tokenType); }; - if (sChain2) { addToken(sChain2, chain2Address, tokenKeyname, tokenData, force, tokenType); }; -} - - -function addToken( - sChain: SChain, - address: string, - tokenSymbol: string, - tokenData: TokenData, - force: boolean, - tokenType: TokenType -) { - if (!sChain[tokenType].tokens[tokenSymbol] && !force) { - if (tokenData.unwrappedSymbol) { - sChain[tokenType].addToken( - tokenSymbol, - initContract('erc20wrap', address, sChain.web3) - ); - sChain[tokenType].addToken( - tokenData.unwrappedSymbol, - initContract(tokenType, tokenData.unwrappedAddress, sChain.web3) - ); - } else { - sChain[tokenType].addToken(tokenSymbol, initContract(tokenType, address, sChain.web3)); - } +function addToken(sChain: SChain, token: TokenData, fromChain: boolean): void { + log(`Adding token to sChain object - ${token.keyname}`); + const address = (fromChain && token.clone) || (!fromChain && !token.clone) ? token.cloneAddress : token.originAddress; + if (token.unwrappedSymbol) { + sChain[token.type].addToken( + token.keyname, + initContract('erc20wrap', address, sChain.web3) + ); + sChain[token.type].addToken( + token.unwrappedSymbol, + initContract(token.type, token.unwrappedAddress, sChain.web3) + ); + } else { + sChain[token.type].addToken(token.keyname, initContract(token.type, address, sChain.web3)); } } From dc0498cef9e92d70b459124e04fea38d7c0b947d Mon Sep 17 00:00:00 2001 From: Dmytro Date: Wed, 26 Oct 2022 20:56:25 +0100 Subject: [PATCH 05/12] Add debug info --- src/components/Widget/Widget.tsx | 10 ++++++---- src/components/WidgetBody/WidgetBody.tsx | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/Widget/Widget.tsx b/src/components/Widget/Widget.tsx index 304d0ad..c8bf270 100644 --- a/src/components/Widget/Widget.tsx +++ b/src/components/Widget/Widget.tsx @@ -343,10 +343,7 @@ export function Widget(props) { }, [chainName1, chainName2, token, availableTokens]); useEffect(() => { - if (transferRequest) { - finishTransferRequest(); - return - } + if (transferRequest) return finishTransferRequest(); const defaultToken = getDefaultToken(availableTokens); if (defaultToken) setToken(defaultToken); }, [availableTokens]); @@ -378,8 +375,13 @@ export function Widget(props) { } function finishTransferRequest() { + log('Running finishTransferRequest'); + log(transferRequest); const tokenData = availableTokens[transferRequest.tokenType][transferRequest.tokenKeyname]; if (!tokenData) { + log(`No token data!`); + log(availableTokens); + log(transferRequest.tokenKeyname); // setErrorMessage(new CustomErrorMessage( // `Token not found: ${transferRequest.tokenType}, ${transferRequest.tokenKeyname}` // )); diff --git a/src/components/WidgetBody/WidgetBody.tsx b/src/components/WidgetBody/WidgetBody.tsx index fa633bc..9ce7a1b 100644 --- a/src/components/WidgetBody/WidgetBody.tsx +++ b/src/components/WidgetBody/WidgetBody.tsx @@ -106,7 +106,7 @@ export default function WidgetBody(props) {
- {props.loadingTokens ? () : () : (
) : (
- {(!props.actionSteps || props.transferRequest) ? () : () : ( Date: Fri, 28 Oct 2022 17:54:37 +0100 Subject: [PATCH 06/12] Rewrite ERC20 action checks --- src/components/Stepper/Stepper.tsx | 4 +- src/components/Widget/Widget.tsx | 6 +- src/core/actions/checks.ts | 178 +++++++++++++++++++++++++++ src/core/actions/erc1155.ts | 45 +------ src/core/actions/erc20.ts | 188 ++++++++++++++++++++++------- src/core/actions/erc721.ts | 44 +------ src/core/actions/eth.ts | 21 ++++ src/core/actions/index.ts | 3 +- src/core/interfaces/CheckRes.ts | 29 +++++ src/core/interfaces/index.ts | 1 + 10 files changed, 384 insertions(+), 135 deletions(-) create mode 100644 src/core/actions/checks.ts create mode 100644 src/core/interfaces/CheckRes.ts diff --git a/src/components/Stepper/Stepper.tsx b/src/components/Stepper/Stepper.tsx index ca69f5d..2794d7f 100644 --- a/src/components/Stepper/Stepper.tsx +++ b/src/components/Stepper/Stepper.tsx @@ -24,7 +24,7 @@ export default function ActionsStepper(props) { props.setActiveStep(0); }; if (!props.token) return; - const nextStepDisabledAmount = [TokenType.erc20, TokenType.erc1155].includes(props.token.type) && (props.amount === '' || props.amount === '0'); + const nextStepDisabledAmount = [TokenType.erc20, TokenType.erc1155].includes(props.token.type) && (props.amount === '' || Number(props.amount) === 0); const nextStepDisabledTokenId = [TokenType.erc721, TokenType.erc721meta, TokenType.erc1155].includes(props.token.type) && !props.tokenId; const nextStepDisabled = nextStepDisabledAmount || nextStepDisabledTokenId || props.loading || props.actionBtnDisabled; return ( @@ -53,7 +53,7 @@ export default function ActionsStepper(props) { variant="contained" color="primary" size="medium" className={clsNames(styles.mp__btnAction, styles.mp__margTop5)} onClick={props.handleNextStep} - disabled={nextStepDisabled || props.amountErrorMessage || (Number(props.amount) > Number(props.token.balance) && step.label !== 'Unwrap')} // TODO: tmp unwrap fix! + disabled={nextStepDisabled || props.amountErrorMessage} > {step.buttonText} diff --git a/src/components/Widget/Widget.tsx b/src/components/Widget/Widget.tsx index c8bf270..490c96a 100644 --- a/src/components/Widget/Widget.tsx +++ b/src/components/Widget/Widget.tsx @@ -120,16 +120,17 @@ export function Widget(props) { function closeWidget(e) { setOpen(false); setActiveStep(0); + setAmountLocked(false); log('closeWidget event processed'); } function openWidget(e) { setOpen(true); + setAmountLocked(false); log('openWidget event processed'); } function resetWidget(e) { - setSchains([]); setChainName1(null); setChainName2(null); @@ -330,7 +331,7 @@ export function Widget(props) { if (transferRequest) { // setTransferRequest(undefined); } else { - setAmountLocked(false); + // setAmountLocked(false); } } }, [token]); @@ -344,6 +345,7 @@ export function Widget(props) { useEffect(() => { if (transferRequest) return finishTransferRequest(); + // setAmountLocked(false); const defaultToken = getDefaultToken(availableTokens); if (defaultToken) setToken(defaultToken); }, [availableTokens]); diff --git a/src/core/actions/checks.ts b/src/core/actions/checks.ts new file mode 100644 index 0000000..ad28026 --- /dev/null +++ b/src/core/actions/checks.ts @@ -0,0 +1,178 @@ +/** + * @license + * SKALE Metaport + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/** + * @file erc20.ts + * @copyright SKALE Labs 2022-Present + */ + + +import debug from 'debug'; +import { Contract } from 'web3-eth-contract'; +import { MainnetChain, SChain } from '@skalenetwork/ima-js'; + +import { fromWei } from '../convertation'; +import TokenData from '../dataclasses/TokenData'; +import * as interfaces from '../interfaces'; +import { addressesEqual } from '../helper'; + + +debug.enable('*'); +const log = debug('metaport:actions:checks'); + + +export async function checkEthBalance( // TODO: optimize balance checks + chain: MainnetChain | SChain, + address: string, + amount: string, + tokenData: TokenData, +): Promise { + const checkRes: interfaces.CheckRes = { res: false }; + + try { + const balance = await chain.ethBalance(address); + log(`address: ${address}, eth balance: ${balance}, amount: ${amount}`); + const balanceEther = fromWei(balance, tokenData.decimals); + if (Number(amount) > Number(balanceEther)) { + checkRes.msg = `Current balance: ${balanceEther}`; + } else { + checkRes.res = true; + } + return checkRes; + } catch (err) { + log(err); + checkRes.msg = 'Something went wrong, check developer console'; + return checkRes; + } +} + + +export async function checkERC20Balance( + address: string, + amount: string, + tokenData: TokenData, + tokenContract: Contract +): Promise { + const checkRes: interfaces.CheckRes = { res: false }; + if (!amount || Number(amount) === 0) return checkRes; + try { + const balance = await tokenContract.methods.balanceOf(address).call(); + log(`address: ${address}, balanceWei: ${balance}, amount: ${amount}`); + const balanceEther = fromWei(balance, tokenData.decimals); + if (Number(amount) > Number(balanceEther)) { + checkRes.msg = `Current balance: ${balanceEther}`; + } else { + checkRes.res = true; + } + return checkRes; + } catch (err) { + log(err); + checkRes.msg = 'Something went wrong, check developer console'; + return checkRes; + } +} + + +export async function checkERC20Allowance( + address: string, + approvalAddress: string, + amount: string, + tokenData: TokenData, + tokenContract: Contract +): Promise { + const checkRes: interfaces.CheckRes = { res: false }; + if (!amount || Number(amount) === 0) return checkRes; + try { + const allowance = await tokenContract.methods.allowance( + address, + approvalAddress + ).call(); + const allowanceEther = fromWei(allowance, tokenData.decimals); + log(`allowanceEther: ${allowanceEther}, amount: ${amount}`); + checkRes.res = Number(allowanceEther) >= Number(amount); + return checkRes; + } catch (err) { + log(err); + checkRes.msg = 'Something went wrong, check developer console'; + return checkRes; + } +} + + +export async function checkERC721( + address: string, + approvalAddress: string, + tokenId: number, + tokenContract: Contract +): Promise { + let approvedAddress: string; + const checkRes: interfaces.CheckRes = { res: true, approved: false }; + if (!tokenId) return checkRes; + try { + approvedAddress = await tokenContract.methods.getApproved(tokenId).call(); + log(`approvedAddress: ${approvedAddress}, address: ${address}`); + } catch (err) { + log(err); + checkRes.msg = 'tokenId does not exist, try again' + return checkRes; + } + try { + const currentOwner = await tokenContract.methods.ownerOf(tokenId).call();; + log(`currentOwner: ${currentOwner}, address: ${address}`); + if (!addressesEqual(currentOwner, address)) { + checkRes.msg = 'This account is not an owner of this tokenId'; + return checkRes; + } + } catch (err) { + log(err); + checkRes.msg = 'Something went wrong, check developer console'; + return checkRes; + } + checkRes.approved = addressesEqual(approvedAddress, approvalAddress); + return checkRes; +} + + +export async function checkERC1155( + address: string, + approvalAddress: string, + tokenId: number, + amount: string, + tokenData: TokenData, + tokenContract: Contract +): Promise { + const checkRes: interfaces.CheckRes = { res: true, approved: false }; + if (!tokenId || !amount) return checkRes; + + try { + const balance = await tokenContract.methods.balanceOf(address, tokenId).call(); + log(`address: ${address}, balanceEther: ${balance}, amount: ${amount}`); + if (Number(amount) > Number(balance)) { + checkRes.msg = `Current balance: ${balance} ${tokenData.symbol}`; + } + checkRes.approved = await tokenContract.methods.isApprovedForAll( + address, + approvalAddress + ).call(); + } catch (err) { + log(err); + checkRes.msg = 'Something went wrong, check developer console'; + return checkRes; + } + return checkRes; +} \ No newline at end of file diff --git a/src/core/actions/erc1155.ts b/src/core/actions/erc1155.ts index 749a1fd..342f2a3 100644 --- a/src/core/actions/erc1155.ts +++ b/src/core/actions/erc1155.ts @@ -23,58 +23,15 @@ import debug from 'debug'; -import { Contract } from 'web3-eth-contract'; import { TransferAction, ApproveAction } from './action'; - -import { TokenType } from '../dataclasses/TokenType'; -import { addressesEqual } from '../helper'; - -import TokenData from '../dataclasses/TokenData'; - +import { checkERC1155 } from './checks'; debug.enable('*'); const log = debug('metaport:actions:erc1155'); -interface CheckRes { - res: boolean; - approved: boolean; - msg?: string; -} - - -async function checkERC1155( - address: string, - approvalAddress: string, - tokenId: number, - amount: string, - tokenData: TokenData, - tokenContract: Contract -): Promise { - const checkRes: CheckRes = { res: true, approved: false }; - if (!tokenId || !amount) return checkRes; - - try { - const balance = await tokenContract.methods.balanceOf(address, tokenId).call(); - log(`address: ${address}, balanceEther: ${balance}, amount: ${amount}`); - if (Number(amount) > Number(balance)) { - checkRes.msg = `Current balance: ${balance} ${tokenData.symbol}`; - } - checkRes.approved = await tokenContract.methods.isApprovedForAll( - address, - approvalAddress - ).call(); - } catch (err) { - console.error(err); - checkRes.msg = 'Something went wrong, check developer console'; - return checkRes; - } - return checkRes; -} - - export class ApproveERC1155M extends ApproveAction { async execute() { await this.mainnet.erc1155.approveAll( diff --git a/src/core/actions/erc20.ts b/src/core/actions/erc20.ts index 25134b6..7060334 100644 --- a/src/core/actions/erc20.ts +++ b/src/core/actions/erc20.ts @@ -25,10 +25,11 @@ import debug from 'debug'; import { externalEvents } from '../events'; -import { toWei, fromWei } from '../convertation'; +import { toWei } from '../convertation'; import { MAX_APPROVE_AMOUNT } from '../constants'; import { TransferAction, Action } from './action'; +import { checkERC20Balance, checkERC20Allowance } from './checks'; debug.enable('*'); @@ -50,15 +51,32 @@ export class ApproveERC20S extends Action { } async preAction() { + const nextStep = this.wrap ? 3 : 1; const tokenContract = this.sChain1.erc20.tokens[this.tokenData.keyname]; - const allowance = await tokenContract.methods.allowance( + + if (this.wrap) { + const checkResBalance = await checkERC20Balance( + this.address, + this.amount, + this.tokenData, + tokenContract + ); + if (!checkResBalance.res) { + this.setActiveStep(1); + return + } + } + + const checkResAllowance = await checkERC20Allowance( this.address, - this.sChain1.erc20.address - ).call(); - const allowanceEther = fromWei(allowance, this.tokenData.decimals); - if (Number(allowanceEther) >= Number(this.amount) && this.amount !== '') { - const step = this.wrap ? 3 : 1; - this.setActiveStep(step); + this.sChain1.erc20.address, + this.amount, + this.tokenData, + tokenContract + ); + if (checkResAllowance.res) { + this.setActiveStep(nextStep); + return; } } } @@ -92,20 +110,40 @@ export class TransferERC20S2S extends TransferAction { } async preAction() { + const previousStep = this.wrap ? 2 : 0; const tokenContract = this.sChain1.erc20.tokens[this.tokenData.keyname]; - const allowance = await tokenContract.methods.allowance( + + const checkResAllowance = await checkERC20Allowance( + this.address, + this.sChain1.erc20.address, + this.amount, + this.tokenData, + tokenContract + ); + if (!checkResAllowance.res) { + this.setActiveStep(previousStep); + return; + } + + const checkResBalance = await checkERC20Balance( this.address, - this.sChain1.erc20.address - ).call(); - const allowanceEther = fromWei(allowance, this.tokenData.decimals); - if (Number(allowanceEther) < Number(this.amount) && this.amount !== '') { - const step = this.wrap ? 2 : 0; - this.setActiveStep(step); + this.amount, + this.tokenData, + tokenContract + ); + + if (!checkResBalance.res) { + if (this.wrap) { + this.setActiveStep(previousStep); + return; + } + this.setAmountErrorMessage(checkResBalance.msg); } } } + export class ApproveWrapERC20S extends Action { static label = 'Approve wrap' static buttonText = 'Approve all' @@ -122,14 +160,27 @@ export class ApproveWrapERC20S extends Action { async preAction() { const tokenContract = this.sChain1.erc20.tokens[this.tokenData.unwrappedSymbol]; - const allowance = await tokenContract.methods.allowance( + const wrappedTokenContract = this.sChain1.erc20.tokens[this.tokenData.keyname]; + + const checkResBalance = await checkERC20Balance( this.address, - this.tokenData.originAddress - ).call(); - const allowanceEther = fromWei(allowance, this.tokenData.decimals); - if (Number(allowanceEther) >= Number(this.amount) && this.amount !== '') { + this.amount, + this.tokenData, + wrappedTokenContract + ); + if (checkResBalance.res) { this.setActiveStep(1); + return } + + const checkResAllowance = await checkERC20Allowance( + this.address, + this.tokenData.originAddress, + this.amount, + this.tokenData, + tokenContract + ); + if (checkResAllowance.res) this.setActiveStep(1); } } @@ -150,13 +201,40 @@ export class WrapERC20S extends Action { async preAction() { const tokenContract = this.sChain1.erc20.tokens[this.tokenData.unwrappedSymbol]; - const allowance = await tokenContract.methods.allowance( + const wrappedTokenContract = this.sChain1.erc20.tokens[this.tokenData.keyname]; + + const checkResBalanceWr = await checkERC20Balance( this.address, - this.tokenData.originAddress - ).call(); - const allowanceEther = fromWei(allowance, this.tokenData.decimals); - if (Number(allowanceEther) < Number(this.amount) && this.amount !== '') { + this.amount, + this.tokenData, + wrappedTokenContract + ); + if (checkResBalanceWr.res) { + this.setActiveStep(2); + return + } + + const checkResAllowance = await checkERC20Allowance( + this.address, + this.tokenData.originAddress, + this.amount, + this.tokenData, + tokenContract + ); + if (!checkResAllowance.res) { this.setActiveStep(0); + return; + } + + const checkResBalance = await checkERC20Balance( + this.address, + this.amount, + this.tokenData, + tokenContract + ); + if (!checkResBalance.res) { + this.setAmountErrorMessage(checkResBalance.msg); + return } } } @@ -196,14 +274,14 @@ export class ApproveERC20M extends Action { async preAction() { const tokenContract = this.mainnet.erc20.tokens[this.tokenData.keyname]; - const allowance = await tokenContract.methods.allowance( + const checkResAllowance = await checkERC20Allowance( this.address, - this.mainnet.erc20.address - ).call(); - const allowanceEther = fromWei(allowance, this.tokenData.decimals); - if (Number(allowanceEther) >= Number(this.amount) && this.amount !== '') { - this.setActiveStep(1); - } + this.mainnet.erc20.address, + this.amount, + this.tokenData, + tokenContract + ); + if (checkResAllowance.res) this.setActiveStep(1); } } @@ -239,13 +317,26 @@ export class TransferERC20M2S extends TransferAction { async preAction() { const tokenContract = this.mainnet.erc20.tokens[this.tokenData.keyname]; - const allowance = await tokenContract.methods.allowance( + const checkResAllowance = await checkERC20Allowance( this.address, - this.mainnet.erc20.address - ).call(); - const allowanceEther = fromWei(allowance, this.tokenData.decimals); - if (Number(allowanceEther) < Number(this.amount) && this.amount !== '') { + this.mainnet.erc20.address, + this.amount, + this.tokenData, + tokenContract + ); + if (!checkResAllowance.res) { this.setActiveStep(0); + return + } + const checkResBalance = await checkERC20Balance( + this.address, + this.amount, + this.tokenData, + tokenContract + ); + if (!checkResBalance.res) { + this.setAmountErrorMessage(checkResBalance.msg); + return } } } @@ -277,13 +368,26 @@ export class TransferERC20S2M extends TransferAction { async preAction() { const tokenContract = this.sChain1.erc20.tokens[this.tokenData.keyname]; - const allowance = await tokenContract.methods.allowance( + const checkResAllowance = await checkERC20Allowance( this.address, - this.sChain1.erc20.address - ).call(); - const allowanceEther = fromWei(allowance, this.tokenData.decimals); - if (Number(allowanceEther) < Number(this.amount) && this.amount !== '') { + this.sChain1.erc20.address, + this.amount, + this.tokenData, + tokenContract + ); + if (!checkResAllowance.res) { this.setActiveStep(0); + return + } + const checkResBalance = await checkERC20Balance( + this.address, + this.amount, + this.tokenData, + tokenContract + ); + if (!checkResBalance.res) { + this.setAmountErrorMessage(checkResBalance.msg); + return } } } diff --git a/src/core/actions/erc721.ts b/src/core/actions/erc721.ts index 976e7a2..53ce14b 100644 --- a/src/core/actions/erc721.ts +++ b/src/core/actions/erc721.ts @@ -23,59 +23,17 @@ import debug from 'debug'; -import { Contract } from 'web3-eth-contract'; import { Action } from './action'; import { TokenType } from '../dataclasses/TokenType'; import { externalEvents } from '../events'; -import { addressesEqual } from '../helper'; +import { checkERC721 } from './checks'; debug.enable('*'); const log = debug('metaport:actions:erc721'); -interface CheckRes { - res: boolean; - approved: boolean; - msg?: string; -} - - -async function checkERC721( - address: string, - approvalAddress: string, - tokenId: number, - tokenContract: Contract -): Promise { - let approvedAddress: string; - const checkRes: CheckRes = { res: true, approved: false }; - if (!tokenId) return checkRes; - try { - approvedAddress = await tokenContract.methods.getApproved(tokenId).call(); - log(`approvedAddress: ${approvedAddress}, address: ${address}`); - } catch (err) { - console.error(err); - checkRes.msg = 'tokenId does not exist, try again' - return checkRes; - } - try { - const currentOwner = await tokenContract.methods.ownerOf(tokenId).call();; - log(`currentOwner: ${currentOwner}, address: ${address}`); - if (!addressesEqual(currentOwner, address)) { - checkRes.msg = 'This account is not an owner of this tokenId'; - return checkRes; - } - } catch (err) { - console.error(err); - checkRes.msg = 'Something went wrong, check developer console'; - return checkRes; - } - checkRes.approved = addressesEqual(approvedAddress, approvalAddress); - return checkRes; -} - - class ERC721Action extends Action { isMeta(): boolean { return this.tokenData.type === TokenType.erc721meta; }; mn() { return this.isMeta() ? this.mainnet.erc721meta : this.mainnet.erc721; }; diff --git a/src/core/actions/eth.ts b/src/core/actions/eth.ts index 598e96c..33026fd 100644 --- a/src/core/actions/eth.ts +++ b/src/core/actions/eth.ts @@ -27,6 +27,7 @@ import debug from 'debug'; import { externalEvents } from '../events'; import { toWei } from '../convertation'; import { TransferAction, Action } from './action'; +import { checkEthBalance, checkERC20Balance } from './checks'; debug.enable('*'); @@ -48,6 +49,16 @@ export class TransferEthM2S extends TransferAction { await this.sChain2.waitETHBalanceChange(this.address, sChainBalanceBefore); externalEvents.transferComplete(tx, this.chainName1, this.chainName2, this.tokenData.keyname); } + + async preAction() { + const checkResBalance = await checkEthBalance( + this.mainnet, + this.address, + this.amount, + this.tokenData + ); + if (!checkResBalance.res) this.setAmountErrorMessage(checkResBalance.msg); + } } @@ -63,6 +74,16 @@ export class TransferEthS2M extends TransferAction { await this.mainnet.eth.waitLockedETHAmountChange(this.address, lockedETHAmount); externalEvents.transferComplete(tx, this.chainName1, this.chainName2, this.tokenData.keyname); } + + async preAction() { + const checkResBalance = await checkEthBalance( + this.sChain1, + this.address, + this.amount, + this.tokenData + ); + if (!checkResBalance.res) this.setAmountErrorMessage(checkResBalance.msg); + } } diff --git a/src/core/actions/index.ts b/src/core/actions/index.ts index 19b369f..e2e5d61 100644 --- a/src/core/actions/index.ts +++ b/src/core/actions/index.ts @@ -72,11 +72,10 @@ export function getActionName( ): string { if (!chainName1 || !chainName2 || !tokenData) return; log('Getting action name: ' + chainName1 + ' ' + chainName2 + ' ' + tokenData.symbol + ' (' + tokenData.type + ')'); - let prefix = tokenData.type; let postfix = S2S_POSTFIX; if (isMainnet(chainName1)) { postfix = M2S_POSTFIX; }; if (isMainnet(chainName2)) { postfix = S2M_POSTFIX; }; - const actionName = prefix + '_' + postfix; + const actionName = tokenData.type + '_' + postfix; log('Action name: ' + actionName); return actionName; } diff --git a/src/core/interfaces/CheckRes.ts b/src/core/interfaces/CheckRes.ts new file mode 100644 index 0000000..1833b90 --- /dev/null +++ b/src/core/interfaces/CheckRes.ts @@ -0,0 +1,29 @@ +/** + * @license + * SKALE Metaport + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/** + * @file CheckRes.ts + * @copyright SKALE Labs 2022-Present + */ + + +export interface CheckRes { + res: boolean; + approved?: boolean; + msg?: string; +} \ No newline at end of file diff --git a/src/core/interfaces/index.ts b/src/core/interfaces/index.ts index 3d6fc53..342fd1d 100644 --- a/src/core/interfaces/index.ts +++ b/src/core/interfaces/index.ts @@ -27,3 +27,4 @@ export * from "./Theme"; export * from "./Tokens"; export * from "./TokenDataMap"; export * from "./TransferParams"; +export * from "./CheckRes"; From 35ef0566f3702cba29f67a904a61edfe33b08fae Mon Sep 17 00:00:00 2001 From: Dmytro Date: Fri, 28 Oct 2022 18:00:04 +0100 Subject: [PATCH 07/12] Fix linter --- src/core/tokens/m2s.ts | 7 +++---- src/core/tokens/s2s.ts | 2 +- tslint.json | 3 ++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/tokens/m2s.ts b/src/core/tokens/m2s.ts index 768508c..d09329c 100644 --- a/src/core/tokens/m2s.ts +++ b/src/core/tokens/m2s.ts @@ -70,7 +70,7 @@ async function getM2STokensAutomatic( availableTokens: interfaces.TokenDataTypesMap ): Promise { log('Starting automatic lookup for M2S tokens...'); - for (let tokenType in TokenType) { + for (const tokenType in TokenType) { await addM2STokensAutomatic( tokenType, mainnet, @@ -110,10 +110,9 @@ async function addM2STokensAutomatic( const symbol = await contract.methods.symbol().call(); const isClone = isMainnet(destChainName); - let name = await contract.methods.name().call(); + const name = await contract.methods.name().call(); let decimals: string; - let tokenIcon: string; if (tokenType === TokenType.erc20) { decimals = await contract.methods.decimals().call(); @@ -130,7 +129,7 @@ async function addM2STokensAutomatic( name, symbol, isClone, - tokenIcon, + null, decimals, tokenType as TokenType, null, diff --git a/src/core/tokens/s2s.ts b/src/core/tokens/s2s.ts index 12d3718..285b78b 100644 --- a/src/core/tokens/s2s.ts +++ b/src/core/tokens/s2s.ts @@ -106,7 +106,7 @@ async function addTokenData( force: boolean, tokenType: TokenType ): Promise { - let cloneAddress = await getCloneAddress( + const cloneAddress = await getCloneAddress( isClone ? sChain1 : sChain2, configToken.address, sChainName, diff --git a/tslint.json b/tslint.json index 492151e..f220419 100644 --- a/tslint.json +++ b/tslint.json @@ -6,7 +6,8 @@ "jsRules": {}, "rules": { "no-namespace": false, - "max-classes-per-file": false + "max-classes-per-file": false, + "forin": false }, "rulesDirectory": [] } \ No newline at end of file From 1c363b9c0702845e8d83abcb10035d0c8501ae0f Mon Sep 17 00:00:00 2001 From: Dmytro Date: Mon, 31 Oct 2022 15:30:52 +0000 Subject: [PATCH 08/12] Fix unwrap procedure --- src/components/Widget/Widget.tsx | 3 ++- src/core/actions/erc20.ts | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Widget/Widget.tsx b/src/components/Widget/Widget.tsx index 490c96a..7ef063b 100644 --- a/src/components/Widget/Widget.tsx +++ b/src/components/Widget/Widget.tsx @@ -356,7 +356,8 @@ export function Widget(props) { }, [actionSteps, activeStep, amount, tokenId]); useEffect(() => { - if (extChainId && chainId && extChainId !== chainId) { + const isUwrapAction = token && token.unwrappedSymbol && token.clone; // TODO: tmp fix for unwrap + if (extChainId && chainId && extChainId !== chainId && !isUwrapAction) { setErrorMessage(new WrongNetworkMessage(enforceMetamaskNetwork)); } else { setErrorMessage(undefined); diff --git a/src/core/actions/erc20.ts b/src/core/actions/erc20.ts index 7060334..cc2c6fd 100644 --- a/src/core/actions/erc20.ts +++ b/src/core/actions/erc20.ts @@ -258,7 +258,6 @@ export class UnWrapERC20S extends Action { } - export class ApproveERC20M extends Action { static label = 'Approve transfer' static buttonText = 'Approve all' From 18504dd5fd953cd50cb6a86d299605ea36b26749 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Mon, 31 Oct 2022 17:39:13 +0000 Subject: [PATCH 09/12] Fix unwrap step, fix linter --- src/components/WidgetUI/StoriesHelper.ts | 3 ++- src/core/actions/erc20.ts | 17 +++++++++++++---- src/core/actions/eth.ts | 6 ++++-- src/core/actions/index.ts | 2 +- src/core/constants.ts | 1 + src/core/convertation.ts | 3 ++- src/core/core.ts | 11 +++++++++-- src/core/tokens/erc20.ts | 3 ++- src/core/tokens/eth.ts | 6 ++++-- src/core/tokens/helper.ts | 16 ++++++++++++---- src/core/tokens/m2s.ts | 17 +++++++++++++---- src/core/tokens/s2s.ts | 3 ++- tslint.json | 11 ++++++++++- 13 files changed, 75 insertions(+), 24 deletions(-) diff --git a/src/components/WidgetUI/StoriesHelper.ts b/src/components/WidgetUI/StoriesHelper.ts index f6d8b13..b8276c2 100644 --- a/src/components/WidgetUI/StoriesHelper.ts +++ b/src/components/WidgetUI/StoriesHelper.ts @@ -68,7 +68,8 @@ export function generateTokenData(tokenSymbol, tokenName, wrapped = false) { undefined ); if (wrapped) { - data.availableTokens.erc20[tokenSymbol].unwrappedBalance = getRandomInt(10000, 70000).toString(); + data.availableTokens.erc20[tokenSymbol].unwrappedBalance = getRandomInt( + 10000, 70000).toString(); data.availableTokens.erc20[tokenSymbol].unwrappedSymbol = 'u' + tokenSymbol; }; data.availableTokens.erc20[tokenSymbol].balance = getRandomInt(10000, 70000).toString(); diff --git a/src/core/actions/erc20.ts b/src/core/actions/erc20.ts index cc2c6fd..138b6f0 100644 --- a/src/core/actions/erc20.ts +++ b/src/core/actions/erc20.ts @@ -86,7 +86,10 @@ export class TransferERC20S2S extends TransferAction { async execute() { const amountWei = toWei(this.amount, this.tokenData.decimals); const destTokenContract = this.sChain2.erc20.tokens[this.tokenData.keyname]; - const balanceOnDestination = await this.sChain2.getERC20Balance(destTokenContract, this.address); + const balanceOnDestination = await this.sChain2.getERC20Balance( + destTokenContract, + this.address + ); const tx = await this.sChain1.erc20.transferToSchain( this.chainName2, @@ -96,7 +99,11 @@ export class TransferERC20S2S extends TransferAction { ); log('Transfer transaction done, waiting for tokens to be received'); log(tx); - await this.sChain2.waitERC20BalanceChange(destTokenContract, this.address, balanceOnDestination); + await this.sChain2.waitERC20BalanceChange( + destTokenContract, + this.address, + balanceOnDestination + ); log('Tokens received to destination chain'); const unwrap = !!this.tokenData.unwrappedSymbol && this.tokenData.clone; @@ -302,7 +309,8 @@ export class TransferERC20M2S extends TransferAction { log('Transfer transaction done, waiting for tokens to be received'); log(tx); - await this.sChain2.waitERC20BalanceChange(destTokenContract, this.address, balanceOnDestination); + await this.sChain2.waitERC20BalanceChange( + destTokenContract, this.address, balanceOnDestination); log('Tokens received to destination chain'); externalEvents.transferComplete( @@ -345,7 +353,8 @@ export class TransferERC20S2M extends TransferAction { async execute() { const amountWei = toWei(this.amount, this.tokenData.decimals); const destTokenContract = this.mainnet.erc20.tokens[this.tokenData.keyname]; - const balanceOnDestination = await this.mainnet.getERC20Balance(destTokenContract, this.address); + const balanceOnDestination = await this.mainnet.getERC20Balance( + destTokenContract, this.address); const tx = await this.sChain1.erc20.withdraw( this.tokenData.originAddress, diff --git a/src/core/actions/eth.ts b/src/core/actions/eth.ts index 33026fd..486b01a 100644 --- a/src/core/actions/eth.ts +++ b/src/core/actions/eth.ts @@ -47,7 +47,8 @@ export class TransferEthM2S extends TransferAction { } ); await this.sChain2.waitETHBalanceChange(this.address, sChainBalanceBefore); - externalEvents.transferComplete(tx, this.chainName1, this.chainName2, this.tokenData.keyname); + externalEvents.transferComplete( + tx,this.chainName1, this.chainName2, this.tokenData.keyname); } async preAction() { @@ -72,7 +73,8 @@ export class TransferEthS2M extends TransferAction { { address: this.address } ); await this.mainnet.eth.waitLockedETHAmountChange(this.address, lockedETHAmount); - externalEvents.transferComplete(tx, this.chainName1, this.chainName2, this.tokenData.keyname); + externalEvents.transferComplete( + tx, this.chainName1, this.chainName2, this.tokenData.keyname); } async preAction() { diff --git a/src/core/actions/index.ts b/src/core/actions/index.ts index e2e5d61..558af2d 100644 --- a/src/core/actions/index.ts +++ b/src/core/actions/index.ts @@ -71,7 +71,7 @@ export function getActionName( tokenData: TokenData ): string { if (!chainName1 || !chainName2 || !tokenData) return; - log('Getting action name: ' + chainName1 + ' ' + chainName2 + ' ' + tokenData.symbol + ' (' + tokenData.type + ')'); + log(`Getting action name: ${chainName1} ${chainName2} ${tokenData.symbol} ${tokenData.type}`); let postfix = S2S_POSTFIX; if (isMainnet(chainName1)) { postfix = M2S_POSTFIX; }; if (isMainnet(chainName2)) { postfix = S2M_POSTFIX; }; diff --git a/src/core/constants.ts b/src/core/constants.ts index 129a611..19325b5 100644 --- a/src/core/constants.ts +++ b/src/core/constants.ts @@ -32,6 +32,7 @@ export const S2S_POSTFIX = 's2s'; export const WRAP_ACTION = 'wrap'; export const UNWRAP_ACTION = 'unwrap'; +// tslint:disable-next-line export const MAX_APPROVE_AMOUNT = '115792089237316195423570985008687907853269984665640564039457584007913129639935'; // (2^256 - 1 ) export const DEFAULT_MIN_SFUEL_WEI = '21000000000000'; diff --git a/src/core/convertation.ts b/src/core/convertation.ts index 6952451..70d7a67 100644 --- a/src/core/convertation.ts +++ b/src/core/convertation.ts @@ -33,5 +33,6 @@ export function fromWei(value: string, decimals: string): string { } function decimalsToUnit(decimals: string): Unit { - return Object.keys(unitMap).find(key => unitMap[key] === toBN(10).pow(toBN(decimals)).toString()) as Unit; + return Object.keys(unitMap).find( + key => unitMap[key] === toBN(10).pow(toBN(decimals)).toString()) as Unit; } \ No newline at end of file diff --git a/src/core/core.ts b/src/core/core.ts index 1ece858..71e9295 100644 --- a/src/core/core.ts +++ b/src/core/core.ts @@ -92,7 +92,11 @@ export function updateWeb3SChain(schain: SChain, network: string, schainName: st schain.updateWeb3(sChainWeb3); } -export async function updateWeb3SChainMetamask(schain: SChain, network: string, schainName: string) { +export async function updateWeb3SChainMetamask( + schain: SChain, + network: string, + schainName: string +): Promise { const endpoint = getSChainEndpoint(network, schainName); const chainId = calcChainId(schainName); const networkParams = schainNetworkParams(schainName, endpoint, chainId); @@ -119,7 +123,10 @@ export function initMainnet(network: string, mainnetEndpoint: string): MainnetCh } -export async function initMainnetMetamask(network: string, mainnetEndpoint: string): Promise { +export async function initMainnetMetamask( + network: string, + mainnetEndpoint: string +): Promise { const networkParams = mainnetNetworkParams(network, mainnetEndpoint); await changeMetamaskNetwork(networkParams); const web3 = new Web3(window.ethereum); diff --git a/src/core/tokens/erc20.ts b/src/core/tokens/erc20.ts index c8c475d..0ca9f3c 100644 --- a/src/core/tokens/erc20.ts +++ b/src/core/tokens/erc20.ts @@ -62,7 +62,8 @@ export async function updateERC20TokenBalances( address ); availableTokens.erc20[symbol].balance = balance; - if (availableTokens.erc20[symbol].unwrappedSymbol && !availableTokens.erc20[symbol].clone) { + if (availableTokens.erc20[symbol].unwrappedSymbol && + !availableTokens.erc20[symbol].clone) { const wBalance = await getTokenBalance( chainName, sChain1, diff --git a/src/core/tokens/eth.ts b/src/core/tokens/eth.ts index 1d403c4..62caa0e 100644 --- a/src/core/tokens/eth.ts +++ b/src/core/tokens/eth.ts @@ -40,7 +40,8 @@ const log = debug('metaport:tokens:eth'); function ethInConfig(configTokens: interfaces.TokensMap): boolean { - return configTokens[MAINNET_CHAIN_NAME] !== undefined && configTokens[MAINNET_CHAIN_NAME].eth !== undefined; + return configTokens[MAINNET_CHAIN_NAME] !== undefined && + configTokens[MAINNET_CHAIN_NAME].eth !== undefined; } @@ -68,7 +69,8 @@ export async function getEthBalance( chainName: string, address: string ) { - const ethBalance = isMainnet(chainName) ? await mainnet.ethBalance(address) : await sChain.ethBalance(address); + const ethBalance = isMainnet(chainName) ? await mainnet.ethBalance(address) : + await sChain.ethBalance(address); log('ETH balance for ' + address + ': ' + ethBalance + ' wei'); externalEvents.balance('eth', chainName, ethBalance); return mainnet ? mainnet.web3.utils.fromWei(ethBalance) : sChain.web3.utils.fromWei(ethBalance); diff --git a/src/core/tokens/helper.ts b/src/core/tokens/helper.ts index c445e06..d663b5c 100644 --- a/src/core/tokens/helper.ts +++ b/src/core/tokens/helper.ts @@ -46,8 +46,16 @@ export function getDefaultToken(availableTokens: interfaces.TokenDataTypesMap): if (availableTokens === undefined) return; const availableTokenNumers = getAvailableTokenNumers(availableTokens); if (eqArrays(availableTokenNumers, [1, 0, 0, 0, 0])) return availableTokens.eth.eth; - if (eqArrays(availableTokenNumers, [0, 1, 0, 0, 0])) return Object.values(availableTokens.erc20)[0]; - if (eqArrays(availableTokenNumers, [0, 0, 1, 0, 0])) return Object.values(availableTokens.erc721)[0]; - if (eqArrays(availableTokenNumers, [0, 0, 0, 1, 0])) return Object.values(availableTokens.erc721meta)[0]; - if (eqArrays(availableTokenNumers, [0, 0, 0, 0, 1])) return Object.values(availableTokens.erc1155)[0]; + if (eqArrays(availableTokenNumers, [0, 1, 0, 0, 0])) { + return Object.values(availableTokens.erc20)[0]; + } + if (eqArrays(availableTokenNumers, [0, 0, 1, 0, 0])) { + return Object.values(availableTokens.erc721)[0]; + } + if (eqArrays(availableTokenNumers, [0, 0, 0, 1, 0])) { + return Object.values(availableTokens.erc721meta)[0]; + } + if (eqArrays(availableTokenNumers, [0, 0, 0, 0, 1])) { + return Object.values(availableTokens.erc1155)[0]; + } } diff --git a/src/core/tokens/m2s.ts b/src/core/tokens/m2s.ts index d09329c..4ad86cc 100644 --- a/src/core/tokens/m2s.ts +++ b/src/core/tokens/m2s.ts @@ -135,7 +135,11 @@ async function addM2STokensAutomatic( null, null ); - availableTokens[tokenType][key] = overrideTokenDataFromConfig(configTokens, tokenData, tokenType); + availableTokens[tokenType][key] = overrideTokenDataFromConfig( + configTokens, + tokenData, + tokenType + ); mainnet[tokenType].addToken(key, contract); sChain[tokenType].addToken(key, initContract(tokenType, cloneAddress, sChain.web3)); } @@ -146,7 +150,10 @@ function overrideTokenDataFromConfig( tokenData: TokenData, tokenType: string ): TokenData { - if (!configTokens[MAINNET_CHAIN_NAME] || !configTokens[MAINNET_CHAIN_NAME][tokenType] || !configTokens[MAINNET_CHAIN_NAME][tokenType][tokenData.keyname]) return tokenData; + if (!configTokens[MAINNET_CHAIN_NAME]) return tokenData; + if (!configTokens[MAINNET_CHAIN_NAME][tokenType]) return tokenData; + if (!configTokens[MAINNET_CHAIN_NAME][tokenType][tokenData.keyname]) return tokenData; + const configTokenData = configTokens[MAINNET_CHAIN_NAME][tokenType][tokenData.keyname]; log(`Overriding token data from config ${tokenData.keyname}: ${configTokenData}`); tokenData.iconUrl = configTokenData.iconUrl ? configTokenData.iconUrl : tokenData.iconUrl; @@ -189,8 +196,10 @@ async function getM2STokensManual( null, null ); - mainnet[tokenType].addToken(tokenKeyname, initContract(tokenType, tokenInfo.address, mainnet.web3)); - sChain[tokenType].addToken(tokenKeyname, initContract(tokenType, cloneAddress, sChain.web3)); + mainnet[tokenType].addToken( + tokenKeyname, initContract(tokenType, tokenInfo.address, mainnet.web3)); + sChain[tokenType].addToken( + tokenKeyname, initContract(tokenType, cloneAddress, sChain.web3)); } } } \ No newline at end of file diff --git a/src/core/tokens/s2s.ts b/src/core/tokens/s2s.ts index 285b78b..92ae957 100644 --- a/src/core/tokens/s2s.ts +++ b/src/core/tokens/s2s.ts @@ -159,7 +159,8 @@ async function getCloneAddress( function addToken(sChain: SChain, token: TokenData, fromChain: boolean): void { log(`Adding token to sChain object - ${token.keyname}`); - const address = (fromChain && token.clone) || (!fromChain && !token.clone) ? token.cloneAddress : token.originAddress; + const isCloneAddress = (fromChain && token.clone) || (!fromChain && !token.clone); + const address = isCloneAddress ? token.cloneAddress : token.originAddress; if (token.unwrappedSymbol) { sChain[token.type].addToken( token.keyname, diff --git a/tslint.json b/tslint.json index f220419..5ea890a 100644 --- a/tslint.json +++ b/tslint.json @@ -7,7 +7,16 @@ "rules": { "no-namespace": false, "max-classes-per-file": false, - "forin": false + "forin": false, + "max-line-length": [ + true, + { + "limit": 100, + "ignore-pattern": "^import |^export {(.*?)}", + "check-strings": true, + "check-regex": true + } + ] }, "rulesDirectory": [] } \ No newline at end of file From 7c1d67eba7d6c7ee02459ef943fe671c64097c46 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Wed, 2 Nov 2022 12:27:14 +0000 Subject: [PATCH 10/12] Update wrap token flow --- src/components/TokenList/TokenBalance.tsx | 16 ++---- src/components/TokenList/TokenList.tsx | 28 ++--------- src/components/TokenList/iconsHelper.ts | 50 +++++++++++++++++++ .../TokenListSection/TokenListSection.tsx | 24 ++------- src/components/WidgetUI/ERC20.stories.tsx | 15 +++++- src/components/WidgetUI/StoriesHelper.ts | 24 ++++++++- src/core/actions/erc20.ts | 26 ---------- src/core/actions/index.ts | 1 + src/core/dataclasses/TokenData.ts | 3 ++ src/core/interfaces/Tokens.ts | 3 +- src/core/tokens/m2s.ts | 2 + src/core/tokens/s2s.ts | 5 +- 12 files changed, 108 insertions(+), 89 deletions(-) create mode 100644 src/components/TokenList/iconsHelper.ts diff --git a/src/components/TokenList/TokenBalance.tsx b/src/components/TokenList/TokenBalance.tsx index 6a489ae..711593d 100644 --- a/src/components/TokenList/TokenBalance.tsx +++ b/src/components/TokenList/TokenBalance.tsx @@ -4,7 +4,6 @@ import { TokenType } from '../../core/dataclasses/TokenType'; import { clsNames } from '../../core/helper'; import styles from "../WidgetUI/WidgetUI.scss"; - function roundDown(number, decimals) { decimals = decimals || 0; return (Math.floor(number * Math.pow(10, decimals)) / Math.pow(10, decimals)); @@ -13,19 +12,10 @@ function roundDown(number, decimals) { export default function TokenBalance(props) { if ([TokenType.erc721, TokenType.erc721meta, TokenType.erc1155].includes(props.token.type)) return; + const balance = props.token.unwrappedSymbol ? props.token.unwrappedBalance : props.token.balance; + const symbol = props.token.unwrappedSymbol ? props.token.unwrappedSymbol : props.token.symbol; return (
- {props.token.unwrappedBalance ? ( -

- {roundDown(props.token.unwrappedBalance, 4)} {props.token.unwrappedSymbol} / -

- ) : null}

- {roundDown(props.token.balance, 4)} {props.token.symbol} + {roundDown(balance, 4)} {symbol}

diff --git a/src/components/TokenList/TokenList.tsx b/src/components/TokenList/TokenList.tsx index f0e2fc7..1c2822a 100644 --- a/src/components/TokenList/TokenList.tsx +++ b/src/components/TokenList/TokenList.tsx @@ -8,8 +8,6 @@ import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import { getAvailableTokensTotal } from '../../core/tokens/helper'; -import TokenData from '../../core/dataclasses/TokenData'; - import { clsNames } from '../../core/helper'; import ErrorMessage, { NoTokenPairsMessage } from '../ErrorMessage'; @@ -19,27 +17,7 @@ import TokenBalance from './TokenBalance'; import styles from "../WidgetUI/WidgetUI.scss"; import localStyles from "./TokenList.scss"; - - -function importAll(r) { - let images = {}; - r.keys().map((item, index) => { images[item.replace('./', '')] = r(item); }); - return images; -} - -const icons = importAll(require.context('../../icons', false, /\.(png|jpe?g|svg)$/)); - - -function iconPath(name) { - if (!name) return; - const key = name.toLowerCase() + '.svg'; - if (icons[key]) { - return icons[key]; - } else { - return icons['eth.svg']; - } -} - +import { getIconSrc, iconPath } from "./iconsHelper"; export default function TokenList(props) { @@ -76,7 +54,7 @@ export default function TokenList(props) {

- {props.token.name} + {props.token.unwrappedSymbol ? props.token.unwrappedSymbol : props.token.name}

diff --git a/src/components/TokenList/iconsHelper.ts b/src/components/TokenList/iconsHelper.ts new file mode 100644 index 0000000..697da52 --- /dev/null +++ b/src/components/TokenList/iconsHelper.ts @@ -0,0 +1,50 @@ +/** + * @license + * SKALE Metaport + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/** + * @file iconsHelper.ts + * @copyright SKALE Labs 2022-Present + */ + +import TokenData from '../../core/dataclasses/TokenData'; + + +function importAll(r) { + let images = {}; + r.keys().map((item, index) => { images[item.replace('./', '')] = r(item); }); + return images; +} + +const icons = importAll(require.context('../../icons', false, /\.(png|jpe?g|svg)$/)); + + +export function iconPath(name) { + if (!name) return; + const key = name.toLowerCase() + '.svg'; + if (icons[key]) { + return icons[key]; + } else { + return icons['eth.svg']; + } +} + + +export function getIconSrc(token: TokenData): string { + if (token.unwrappedIconUrl) return token.unwrappedIconUrl; + return token.iconUrl ? token.iconUrl : iconPath(token.symbol); +} diff --git a/src/components/TokenListSection/TokenListSection.tsx b/src/components/TokenListSection/TokenListSection.tsx index e1f762b..55a1be1 100644 --- a/src/components/TokenListSection/TokenListSection.tsx +++ b/src/components/TokenListSection/TokenListSection.tsx @@ -11,25 +11,7 @@ import TokenBalance from '../TokenList/TokenBalance'; import styles from "../WidgetUI/WidgetUI.scss"; import localStyles from "./TokenListSection.scss"; - -function importAll(r) { - let images = {}; - r.keys().map((item, index) => { images[item.replace('./', '')] = r(item); }); - return images; -} - -const icons = importAll(require.context('../../icons', false, /\.(png|jpe?g|svg)$/)); - - -function iconPath(name) { - if (!name) return; - const key = name.toLowerCase() + '.svg'; - if (icons[key]) { - return icons[key]; - } else { - return icons['eth.svg']; - } -} +import { getIconSrc } from "../TokenList/iconsHelper"; export default function TokenListSection(props) { @@ -58,7 +40,7 @@ export default function TokenListSection(props) {

- {props.tokens[key].name} + {props.tokens[key].unwrappedSymbol ? props.tokens[key].unwrappedSymbol : props.tokens[key].name}

diff --git a/src/components/WidgetUI/ERC20.stories.tsx b/src/components/WidgetUI/ERC20.stories.tsx index 75e8da8..fc3e1c3 100644 --- a/src/components/WidgetUI/ERC20.stories.tsx +++ b/src/components/WidgetUI/ERC20.stories.tsx @@ -1,6 +1,11 @@ import React from "react"; import { WidgetUI } from "./WidgetUI"; -import { commonProps, defaultTokenData, generateTokenData } from './StoriesHelper'; +import { + commonProps, + defaultTokenData, + generateTokenData, + getWrapActionSteps +} from './StoriesHelper'; import PublicOffIcon from '@mui/icons-material/PublicOff'; @@ -179,3 +184,11 @@ export const TransferComplete = () => ( /> ); + +export const WrapUI = () => ( + +); \ No newline at end of file diff --git a/src/components/WidgetUI/StoriesHelper.ts b/src/components/WidgetUI/StoriesHelper.ts index b8276c2..4e5573a 100644 --- a/src/components/WidgetUI/StoriesHelper.ts +++ b/src/components/WidgetUI/StoriesHelper.ts @@ -44,6 +44,25 @@ export const commonProps = { null, TokenType.erc20, null, + null, + null + )) +} + + + +export function getWrapActionSteps() { + return getActionSteps('erc20_s2s', new TokenData( + '', + null, + '', + 'test', + null, + null, + null, + TokenType.erc20, + 'ETHC', + '0x0', null )) } @@ -65,7 +84,8 @@ export function generateTokenData(tokenSymbol, tokenName, wrapped = false) { '18', TokenType.erc20, undefined, - undefined + undefined, + "https://raw.githubusercontent.com/microsoft/fluentui-emoji/main/assets/Globe%20showing%20americas/3D/globe_showing_americas_3d.png" ); if (wrapped) { data.availableTokens.erc20[tokenSymbol].unwrappedBalance = getRandomInt( @@ -96,6 +116,7 @@ export function generateERC721TokenData(tokenSymbol, tokenName) { undefined, TokenType.erc721, undefined, + undefined, undefined ); data.token = data.availableTokens.erc721[tokenSymbol]; @@ -121,6 +142,7 @@ export function generateERC1155TokenData(tokenSymbol, tokenName) { '18', TokenType.erc1155, undefined, + undefined, undefined ); // data.availableTokens.erc1155[tokenSymbol].balance = getRandomInt(10000, 70000).toString(); diff --git a/src/core/actions/erc20.ts b/src/core/actions/erc20.ts index 138b6f0..1198ab4 100644 --- a/src/core/actions/erc20.ts +++ b/src/core/actions/erc20.ts @@ -167,19 +167,6 @@ export class ApproveWrapERC20S extends Action { async preAction() { const tokenContract = this.sChain1.erc20.tokens[this.tokenData.unwrappedSymbol]; - const wrappedTokenContract = this.sChain1.erc20.tokens[this.tokenData.keyname]; - - const checkResBalance = await checkERC20Balance( - this.address, - this.amount, - this.tokenData, - wrappedTokenContract - ); - if (checkResBalance.res) { - this.setActiveStep(1); - return - } - const checkResAllowance = await checkERC20Allowance( this.address, this.tokenData.originAddress, @@ -208,19 +195,6 @@ export class WrapERC20S extends Action { async preAction() { const tokenContract = this.sChain1.erc20.tokens[this.tokenData.unwrappedSymbol]; - const wrappedTokenContract = this.sChain1.erc20.tokens[this.tokenData.keyname]; - - const checkResBalanceWr = await checkERC20Balance( - this.address, - this.amount, - this.tokenData, - wrappedTokenContract - ); - if (checkResBalanceWr.res) { - this.setActiveStep(2); - return - } - const checkResAllowance = await checkERC20Allowance( this.address, this.tokenData.originAddress, diff --git a/src/core/actions/index.ts b/src/core/actions/index.ts index 558af2d..0bef9dc 100644 --- a/src/core/actions/index.ts +++ b/src/core/actions/index.ts @@ -93,6 +93,7 @@ export const ACTIONS = { erc20_m2s: [ApproveERC20M, TransferERC20M2S], erc20_s2m: [ApproveERC20S, TransferERC20S2M], erc20_s2s: [ApproveERC20S, TransferERC20S2S], + erc20_unwrap: unwrapActions, erc721_m2s: [ApproveERC721M, TransferERC721M2S], erc721_s2m: [ApproveERC721S, TransferERC721S2M], diff --git a/src/core/dataclasses/TokenData.ts b/src/core/dataclasses/TokenData.ts index 4112c39..5bedaac 100644 --- a/src/core/dataclasses/TokenData.ts +++ b/src/core/dataclasses/TokenData.ts @@ -43,6 +43,7 @@ export default class TokenData { unwrappedSymbol: string unwrappedAddress: string + unwrappedIconUrl: string unwrappedBalance: string constructor( @@ -56,6 +57,7 @@ export default class TokenData { type: TokenType, unwrappedSymbol: string, unwrappedAddress: string, + unwrappedIconUrl: string ) { this.cloneAddress = cloneAddress; this.originAddress = originAddress; @@ -70,6 +72,7 @@ export default class TokenData { this.unwrappedSymbol = unwrappedSymbol; this.unwrappedAddress = unwrappedAddress; + this.unwrappedIconUrl = unwrappedIconUrl; } } diff --git a/src/core/interfaces/Tokens.ts b/src/core/interfaces/Tokens.ts index ab89d2e..55a73b7 100644 --- a/src/core/interfaces/Tokens.ts +++ b/src/core/interfaces/Tokens.ts @@ -33,7 +33,8 @@ export interface Token { interface WrapsData { symbol: string, - address: string + address: string, + iconUrl?: string } diff --git a/src/core/tokens/m2s.ts b/src/core/tokens/m2s.ts index 4ad86cc..da0b6c2 100644 --- a/src/core/tokens/m2s.ts +++ b/src/core/tokens/m2s.ts @@ -133,6 +133,7 @@ async function addM2STokensAutomatic( decimals, tokenType as TokenType, null, + null, null ); availableTokens[tokenType][key] = overrideTokenDataFromConfig( @@ -194,6 +195,7 @@ async function getM2STokensManual( tokenInfo.decimals, tokenType as TokenType, null, + null, null ); mainnet[tokenType].addToken( diff --git a/src/core/tokens/s2s.ts b/src/core/tokens/s2s.ts index 92ae957..40bea5b 100644 --- a/src/core/tokens/s2s.ts +++ b/src/core/tokens/s2s.ts @@ -118,9 +118,11 @@ async function addTokenData( } let unwrappedSymbol; let unwrappedAddress; + let unwrappedIconUrl; if (configToken.wraps) { unwrappedSymbol = configToken.wraps.symbol; unwrappedAddress = configToken.wraps.address; + unwrappedIconUrl = configToken.wraps.iconUrl; } const tokenKeyname = getTokenKeyname(configToken.symbol, configToken.address); @@ -134,7 +136,8 @@ async function addTokenData( configToken.decimals, tokenType, unwrappedSymbol, - unwrappedAddress + unwrappedAddress, + unwrappedIconUrl ); addToken(sChain1, availableTokens[tokenType][tokenKeyname], true); addToken(sChain2, availableTokens[tokenType][tokenKeyname], false); From 211741cb99a21b546fec51d8df8ab201b73494ed Mon Sep 17 00:00:00 2001 From: Dmytro Date: Thu, 10 Nov 2022 20:01:06 +0000 Subject: [PATCH 11/12] New wrap/unwrap token flow, code refactoring --- README.md | 6 +- .../AmountErrorMessage/AmountErrorMessage.tsx | 1 - src/components/CurrentChain/CurrentChain.tsx | 25 ++- src/components/TokenList/TokenBalance.tsx | 11 +- src/components/TransferUI/TransferUI.tsx | 164 +++++++++++++++ src/components/TransferUI/index.ts | 1 + src/components/UnwrapUI/UnwrapUI.tsx | 103 ++++++++++ src/components/UnwrapUI/index.ts | 1 + src/components/Widget/Widget.tsx | 80 ++++++-- src/components/WidgetBody/WidgetBody.tsx | 192 ++++-------------- src/components/WidgetUI/ERC20.stories.tsx | 65 +++++- src/components/WidgetUI/StoriesHelper.ts | 44 +++- src/components/WidgetUI/WidgetUI.scss | 27 ++- src/components/WidgetUI/WidgetUI.tsx | 50 +---- .../WrappedTokensWarning.tsx | 48 +++++ src/components/WrappedTokensWarning/index.ts | 1 + src/core/actions/erc20.ts | 36 +++- src/core/actions/index.ts | 15 +- src/core/dataclasses/EthTokenData.ts | 2 + src/core/dataclasses/OperationType.ts | 28 +++ src/core/dataclasses/TokenData.ts | 3 + src/core/dataclasses/index.ts | 1 + src/core/interfaces/Tokens.ts | 1 + src/core/tokens/erc20.ts | 54 +++++ src/core/tokens/m2s.ts | 2 + src/core/tokens/s2s.ts | 1 + 26 files changed, 721 insertions(+), 241 deletions(-) create mode 100644 src/components/TransferUI/TransferUI.tsx create mode 100644 src/components/TransferUI/index.ts create mode 100644 src/components/UnwrapUI/UnwrapUI.tsx create mode 100644 src/components/UnwrapUI/index.ts create mode 100644 src/components/WrappedTokensWarning/WrappedTokensWarning.tsx create mode 100644 src/components/WrappedTokensWarning/index.ts create mode 100644 src/core/dataclasses/OperationType.ts diff --git a/README.md b/README.md index 0ac68b3..5820545 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,8 @@ const metaport = new Metaport({ 'symbol1': { // token symbol 'name': 'TOKEN_NAME1', // token display name 'address': '0x0357', // token origin address + 'symbol': 'TST' // token symbol + 'cloneSymbol': 'CTST' // optional, symbol of the clone token 'iconUrl': 'https://example.com/my_token_icon.png', // optional 'decimals': '6' // optional (default = '18') } @@ -277,9 +279,11 @@ const TRANSFER_PARAMS = { 'wreth': { // wrapper token 'address': '0x0123', // wrapper token address 'name': 'wreth', // wrapper token display name + 'symbol': 'TST', 'wraps': { // token that needs to be wrapped 'address': '0xD2Aaa00700000000000000000000000000000000', // unwrapped token address - 'symbol': 'ethc' // unwrapped token symbol + 'symbol': 'ethc', // unwrapped token symbol + 'iconUrl': '' // optional, icon URL for the origin token } } } diff --git a/src/components/AmountErrorMessage/AmountErrorMessage.tsx b/src/components/AmountErrorMessage/AmountErrorMessage.tsx index 387ad45..e20a6c7 100644 --- a/src/components/AmountErrorMessage/AmountErrorMessage.tsx +++ b/src/components/AmountErrorMessage/AmountErrorMessage.tsx @@ -1,6 +1,5 @@ import React from "react"; import LinearProgress from '@mui/material/LinearProgress'; -import Box from '@mui/material/Box'; import { clsNames } from '../../core/helper'; import styles from "../WidgetUI/WidgetUI.scss"; diff --git a/src/components/CurrentChain/CurrentChain.tsx b/src/components/CurrentChain/CurrentChain.tsx index 663e874..5d6a86b 100644 --- a/src/components/CurrentChain/CurrentChain.tsx +++ b/src/components/CurrentChain/CurrentChain.tsx @@ -1,20 +1,37 @@ import React from 'react'; import Collapse from '@mui/material/Collapse'; +import IconButton from '@mui/material/IconButton'; +import Tooltip from '@mui/material/Tooltip'; +import ArrowBackIosIcon from '@mui/icons-material/ArrowBackIos'; import { clsNames } from '../../core/helper'; import styles from '../WidgetUI/WidgetUI.scss'; import ChainsList from '../ChainsList'; import SFuelBadge from '../SFuelBadge'; +import { OperationType } from '../../core/dataclasses/OperationType'; + export default function CurrentChain(props) { return (
-

- Current chain -

+ {props.operationType === OperationType.unwrap ? (
+ { props.setOperationType(OperationType.transfer) }} + > + + +

+ Unwrap stuck tokens +

+
) : + (

+ Current chain +

)}
@@ -31,6 +48,6 @@ export default function CurrentChain(props) { chainsMetadata={props.chainsMetadata} dark={props.theme.mode === 'dark'} /> - + ) } \ No newline at end of file diff --git a/src/components/TokenList/TokenBalance.tsx b/src/components/TokenList/TokenBalance.tsx index 711593d..dbeb395 100644 --- a/src/components/TokenList/TokenBalance.tsx +++ b/src/components/TokenList/TokenBalance.tsx @@ -12,8 +12,15 @@ function roundDown(number, decimals) { export default function TokenBalance(props) { if ([TokenType.erc721, TokenType.erc721meta, TokenType.erc1155].includes(props.token.type)) return; - const balance = props.token.unwrappedSymbol ? props.token.unwrappedBalance : props.token.balance; - const symbol = props.token.unwrappedSymbol ? props.token.unwrappedSymbol : props.token.symbol; + let balance = props.token.unwrappedSymbol ? props.token.unwrappedBalance : props.token.balance; + let symbol = props.token.unwrappedSymbol ? props.token.unwrappedSymbol : props.token.symbol; + + if (props.token.clone) { + balance = props.token.balance; + symbol = props.token.cloneSymbol ? props.token.cloneSymbol : symbol; + } + + if (!balance) return; return (

+ + + { + let chain1 = props.chain1; + props.cleanData(); + props.setChain1(props.chain2); + props.setChain2(chain1); + }}> + + + + + + +

+

+ Transfer to +

+
+ +
+
+ + + + + + +

+ Token +

+
+ +
+ {(props.loadingTokens || props.transferRequest) ? () : ()} +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+ {!props.token ? ( +
+ ) : ( +
+ {(!props.actionSteps) ? () : ()} +
+ )} +
+
+
+ ) +} \ No newline at end of file diff --git a/src/components/TransferUI/index.ts b/src/components/TransferUI/index.ts new file mode 100644 index 0000000..4a06d20 --- /dev/null +++ b/src/components/TransferUI/index.ts @@ -0,0 +1 @@ +export { default } from "./TransferUI"; diff --git a/src/components/UnwrapUI/UnwrapUI.tsx b/src/components/UnwrapUI/UnwrapUI.tsx new file mode 100644 index 0000000..b452df6 --- /dev/null +++ b/src/components/UnwrapUI/UnwrapUI.tsx @@ -0,0 +1,103 @@ +import React from 'react'; + +import Skeleton from '@mui/material/Skeleton'; +import Button from '@mui/material/Button'; +import Collapse from '@mui/material/Collapse'; +import RocketLaunchIcon from '@mui/icons-material/RocketLaunch'; + +import { clsNames } from '../../core/helper'; +import styles from '../WidgetUI/WidgetUI.scss'; + +import Stepper from '../Stepper'; +import TokenList from '../TokenList'; +import AmountErrorMessage from '../AmountErrorMessage'; + +import { OperationType } from '../../core/dataclasses/OperationType'; + + +export default function UnwrapUI(props) { + if (!props.wrappedTokens || !props.wrappedTokens.erc20) return; + const wrappedTokens = Object.entries(props.wrappedTokens.erc20); + if (wrappedTokens.length === 0) return ( +
+
+ +
+
+

+ You don't have any wrapped tokens +

+
+ +
+ ); + + return ( +
+ + + + + +
+ {!props.token ? ( +
+ ) : ( +
+ {(!props.actionSteps) ? () : ()} +
+ )} +
+
+
+ ) +} \ No newline at end of file diff --git a/src/components/UnwrapUI/index.ts b/src/components/UnwrapUI/index.ts new file mode 100644 index 0000000..2271cd1 --- /dev/null +++ b/src/components/UnwrapUI/index.ts @@ -0,0 +1 @@ +export { default } from "./UnwrapUI"; diff --git a/src/components/Widget/Widget.tsx b/src/components/Widget/Widget.tsx index 7ef063b..fb2576c 100644 --- a/src/components/Widget/Widget.tsx +++ b/src/components/Widget/Widget.tsx @@ -16,6 +16,7 @@ import { import { getAvailableTokens, getTokenBalances } from '../../core/tokens/index'; +import { getWrappedTokens } from '../../core/tokens/erc20'; import { getEmptyTokenDataMap, getDefaultToken } from '../../core/tokens/helper'; import { MainnetChain, SChain } from '@skalenetwork/ima-js'; @@ -28,6 +29,7 @@ import { getSFuelData } from '../../core/sfuel'; import * as interfaces from '../../core/interfaces/index'; import TokenData from '../../core/dataclasses/TokenData'; +import { OperationType } from '../../core/dataclasses/OperationType'; debug.enable('*'); @@ -37,7 +39,12 @@ const log = debug('metaport:Widget'); export function Widget(props) { const [configTokens, setConfigTokens] = React.useState(undefined); - const [availableTokens, setAvailableTokens] = React.useState(getEmptyTokenDataMap()); + const [availableTokens, setAvailableTokens] = React.useState( + getEmptyTokenDataMap() + ); + const [wrappedTokens, setWrappedTokens] = React.useState( + getEmptyTokenDataMap() + ); const [token, setToken] = React.useState(undefined); const [firstOpen, setFirstOpen] = React.useState(props.open); @@ -70,8 +77,11 @@ export function Widget(props) { const [amountLocked, setAmountLocked] = React.useState(false); const [actionBtnDisabled, setActionBtnDisabled] = React.useState(false); const [activeStep, setActiveStep] = React.useState(0); + const [actionName, setActionName] = React.useState(undefined); const [actionSteps, setActionSteps] = React.useState(undefined); + const [operationType, setOperationType] = React.useState(OperationType.transfer); + const [loadingTokens, setLoadingTokens] = React.useState(false); const [theme, setTheme] = React.useState(props.theme); @@ -144,6 +154,7 @@ export function Widget(props) { setAmountLocked(false); setActiveStep(0); setActionSteps(undefined); + setActionName(undefined) setAmountErrorMessage(undefined); setActionBtnDisabled(false); log('resetWidget event processed'); @@ -223,6 +234,7 @@ export function Widget(props) { address ); setAvailableTokens(tokens); + checkWrappedTokens(); } async function emitBalanceEvent(schainName, tokenSymbol) { @@ -315,6 +327,7 @@ export function Widget(props) { }, [chainName2, address]); useEffect(() => { + if (sChain1 && configTokens) checkWrappedTokens(); if (((sChain1 && sChain2) || (sChain1 && mainnet) || (mainnet && sChain2)) && configTokens) { externalEvents.connected(); initSFuelData(); @@ -327,20 +340,13 @@ export function Widget(props) { useEffect(() => { setActiveStep(0); - if (token) { - if (transferRequest) { - // setTransferRequest(undefined); - } else { - // setAmountLocked(false); - } - } }, [token]); useEffect(() => { setAmountErrorMessage(undefined); if (token === undefined) return; - let actionName = getActionName(chainName1, chainName2, token); - setActionSteps(getActionSteps(actionName, token)); + let actionName = getActionName(chainName1, chainName2, token, operationType); + setActionName(actionName); }, [chainName1, chainName2, token, availableTokens]); useEffect(() => { @@ -350,6 +356,19 @@ export function Widget(props) { if (defaultToken) setToken(defaultToken); }, [availableTokens]); + useEffect(() => { + setDefaultWrappedToken(); + }, [wrappedTokens]); + + useEffect(() => { + setToken(undefined); + setAmount(''); + setActiveStep(0); + setActionSteps(undefined); + setLoading(false); + setDefaultWrappedToken(); + }, [operationType]); + useEffect(() => { setAmountErrorMessage(undefined); runPreAction(); @@ -368,6 +387,15 @@ export function Widget(props) { if (transferRequest) transfer(transferRequest); }, [transferRequest]); + useEffect(() => { + if (!actionName || !token) return; + setActionSteps(getActionSteps(actionName, token)); + if (actionName === 'erc20_unwrap') { // TODO: tmp fix to unwrap + log('Setting max amount for unwrap: ' + token.balance); + setAmount(token.balance); + } + }, [actionName, token]); + function cleanData() { setAmountErrorMessage(undefined); setActionBtnDisabled(false); @@ -377,17 +405,30 @@ export function Widget(props) { setActiveStep(0); } + async function checkWrappedTokens() { + log('Running checkWrappedTokens'); + const wrappedTokens = await getWrappedTokens(sChain1, chainName1, configTokens, address); + if (Object.entries(wrappedTokens).length === 0 && operationType !== OperationType.transfer) { + setOperationType(OperationType.transfer); + } + setWrappedTokens(wrappedTokens); + } + + function setDefaultWrappedToken() { + const defaultToken = getDefaultToken(wrappedTokens); + if (defaultToken && operationType === OperationType.unwrap) { + log(`Setting defaultToken: ${defaultToken.keyname} from wrappedTokens`) + setToken(defaultToken); + } + } + function finishTransferRequest() { log('Running finishTransferRequest'); log(transferRequest); const tokenData = availableTokens[transferRequest.tokenType][transferRequest.tokenKeyname]; if (!tokenData) { - log(`No token data!`); + log(`No token data: ${transferRequest.tokenKeyname}`); log(availableTokens); - log(transferRequest.tokenKeyname); - // setErrorMessage(new CustomErrorMessage( - // `Token not found: ${transferRequest.tokenType}, ${transferRequest.tokenKeyname}` - // )); return } setErrorMessage(undefined); @@ -398,7 +439,7 @@ export function Widget(props) { } async function runPreAction() { - if (actionSteps && actionSteps[activeStep]) { + if (actionSteps && actionSteps[activeStep] && token) { log('Running preAction'); setActionBtnDisabled(true); const ActionClass: ActionType = actionSteps[activeStep]; @@ -518,7 +559,6 @@ export function Widget(props) { return () } \ No newline at end of file diff --git a/src/components/WidgetBody/WidgetBody.tsx b/src/components/WidgetBody/WidgetBody.tsx index 9ce7a1b..5cf66d8 100644 --- a/src/components/WidgetBody/WidgetBody.tsx +++ b/src/components/WidgetBody/WidgetBody.tsx @@ -1,26 +1,14 @@ import React from 'react'; import Collapse from '@mui/material/Collapse'; -import Skeleton from '@mui/material/Skeleton'; -import IconButton from '@mui/material/IconButton'; -import Tooltip from '@mui/material/Tooltip'; -import { clsNames } from '../../core/helper'; -import styles from '../WidgetUI/WidgetUI.scss'; +import { OperationType } from '../../core/dataclasses/OperationType'; -import ChainsList from '../ChainsList'; -import TokenList from '../TokenList'; -import AmountInput from '../AmountInput'; -import TokenIdInput from '../TokenIdInput'; -import Stepper from '../Stepper'; -import SFuelBadge from '../SFuelBadge'; import CurrentChain from '../CurrentChain'; import ErrorMessage from '../ErrorMessage'; -import AmountErrorMessage from '../AmountErrorMessage'; - -import { TokenType } from '../../core/dataclasses/TokenType'; - -import ImportExportIcon from '@mui/icons-material/ImportExport'; +import UnwrapUI from '../UnwrapUI'; +import TransferUI from '../TransferUI'; +import WrappedTokensWarning from '../WrappedTokensWarning'; export default function WidgetBody(props) { @@ -28,6 +16,9 @@ export default function WidgetBody(props) { const [expandedTo, setExpandedTo] = React.useState(false); const [expandedTokens, setExpandedTokens] = React.useState(false); + // TODO: tmp wrap tokens fix + const wrapTransferAction = props.actionSteps && props.actionSteps.length === 4; + return (
- + + + - - - - { - let chain1 = props.chain1; - props.cleanData(); - props.setChain1(props.chain2); - props.setChain2(chain1); - }}> - - - - - - -
-

- Transfer to -

-
- -
-
- - -
- - - -

- Token -

-
- -
- {(props.loadingTokens || props.transferRequest) ? () : ()} -
-
- -
- -
-
- -
- -
-
- -
- -
- {!props.token ? ( -
- ) : ( -
- {(!props.actionSteps) ? () : ()} -
- )} -
-
+ + + + +
) diff --git a/src/components/WidgetUI/ERC20.stories.tsx b/src/components/WidgetUI/ERC20.stories.tsx index fc3e1c3..6d01783 100644 --- a/src/components/WidgetUI/ERC20.stories.tsx +++ b/src/components/WidgetUI/ERC20.stories.tsx @@ -4,10 +4,11 @@ import { commonProps, defaultTokenData, generateTokenData, - getWrapActionSteps + getWrapActionSteps, + getUnwrapActionSteps, + generateWrappedTokens } from './StoriesHelper'; - -import PublicOffIcon from '@mui/icons-material/PublicOff'; +import { OperationType } from '../../core/dataclasses/OperationType'; export default { @@ -188,7 +189,63 @@ export const TransferComplete = () => ( export const WrapUI = () => ( +); + + +export const UnwrapWarning = () => ( + { commonProps.operationType = operationType; }} + /> +); + + +export const UnwrapWarningLight = () => ( + +); + + +export const UnwrapUINoTokens = () => ( + +); + + +export const UnwrapUILoading = () => ( + +); + +export const UnwrapUI = () => ( + ); \ No newline at end of file diff --git a/src/components/WidgetUI/StoriesHelper.ts b/src/components/WidgetUI/StoriesHelper.ts index 4e5573a..2d4315a 100644 --- a/src/components/WidgetUI/StoriesHelper.ts +++ b/src/components/WidgetUI/StoriesHelper.ts @@ -2,6 +2,8 @@ import { getActionSteps } from '../../core/actions'; import TokenData from '../../core/dataclasses/TokenData'; import { TokenType } from '../../core/dataclasses/TokenType'; import { getEmptyTokenDataMap } from '../../core/tokens/helper'; +import { OperationType } from '../../core/dataclasses/OperationType'; + function setMock() { return }; @@ -13,6 +15,7 @@ function getRandomInt(min, max) { export const commonProps = { + operationType: OperationType.transfer, schains: ['aaa-chain', 'bbb-chain'], chainsMetadata: { 'aaa-chain': { @@ -42,6 +45,7 @@ export const commonProps = { null, null, null, + null, TokenType.erc20, null, null, @@ -60,6 +64,25 @@ export function getWrapActionSteps() { null, null, null, + null, + TokenType.erc20, + 'ETHC', + '0x0', + null + )) +} + + +export function getUnwrapActionSteps() { + return getActionSteps('erc20_unwrap', new TokenData( + '', + null, + '', + 'test', + null, + null, + null, + null, TokenType.erc20, 'ETHC', '0x0', @@ -72,20 +95,24 @@ export function generateTokenData(tokenSymbol, tokenName, wrapped = false) { const data = { token: tokenSymbol, amount: getRandomInt(1000, 10000), - availableTokens: getEmptyTokenDataMap() + availableTokens: getEmptyTokenDataMap(), + wrappedTokens: getEmptyTokenDataMap(), + wrappedToken: undefined } + const unwrappedIconUrl = wrapped ? "https://raw.githubusercontent.com/microsoft/fluentui-emoji/main/assets/Globe%20showing%20americas/3D/globe_showing_americas_3d.png" : null data.availableTokens.erc20[tokenSymbol] = new TokenData( '0x0', '0x0', tokenName, tokenSymbol, + undefined, false, undefined, '18', TokenType.erc20, undefined, undefined, - "https://raw.githubusercontent.com/microsoft/fluentui-emoji/main/assets/Globe%20showing%20americas/3D/globe_showing_americas_3d.png" + unwrappedIconUrl ); if (wrapped) { data.availableTokens.erc20[tokenSymbol].unwrappedBalance = getRandomInt( @@ -111,6 +138,7 @@ export function generateERC721TokenData(tokenSymbol, tokenName) { '0x0', tokenName, tokenSymbol, + tokenSymbol, false, undefined, undefined, @@ -137,6 +165,7 @@ export function generateERC1155TokenData(tokenSymbol, tokenName) { '0x0', tokenName, tokenSymbol, + undefined, false, undefined, '18', @@ -150,4 +179,13 @@ export function generateERC1155TokenData(tokenSymbol, tokenName) { return data; } -export const defaultERC1155TokenData = generateERC1155TokenData('XEM', 'SKALIENS'); \ No newline at end of file +export const defaultERC1155TokenData = generateERC1155TokenData('XEM', 'SKALIENS'); + + + +export function generateWrappedTokens() { + const data = generateTokenData('usdt', 'Tether'); + data.wrappedTokens.erc20 = data.availableTokens.erc20; + data.token.balance = undefined; + return data; +} \ No newline at end of file diff --git a/src/components/WidgetUI/WidgetUI.scss b/src/components/WidgetUI/WidgetUI.scss index 95f7f41..7aab7f9 100644 --- a/src/components/WidgetUI/WidgetUI.scss +++ b/src/components/WidgetUI/WidgetUI.scss @@ -78,6 +78,10 @@ margin-top: 10px !important; } +.mp__margTop20 { + margin-top: 20px !important; +} + .mp__margLeft10 { margin-left: 10px !important; } @@ -173,6 +177,13 @@ .mp__btnAction { width: 100%; + text-transform: uppercase; + font-size: 0.7525rem; + line-height: 1.6; + letter-spacing: 0.02857em; + font-weight: 600 !important; + padding-top: 0.8em !important; + padding-bottom: 0.8em !important; } @@ -229,8 +240,9 @@ } .mp__p, - .mp__infoIcon { - color: rgb(255 255 255 / 65%); + .mp__infoIcon, + .mp__backIcon { + color: rgb(255 255 255 / 65%) !important; } .mp__textGray, @@ -269,8 +281,9 @@ } .mp__p, - .mp__infoIcon { - color: rgb(0 0 0 / 65%); + .mp__infoIcon, + .mp__backIcon { + color: rgb(0 0 0 / 65%) !important; } .MuiInput-root { @@ -432,4 +445,10 @@ :global(p) { font-size: 0.5525rem !important } +} + +.mp__backIcon { + width: 8pt; + height: 8pt; + margin-left: 2pt; } \ No newline at end of file diff --git a/src/components/WidgetUI/WidgetUI.tsx b/src/components/WidgetUI/WidgetUI.tsx index a04ae49..6342eb7 100644 --- a/src/components/WidgetUI/WidgetUI.tsx +++ b/src/components/WidgetUI/WidgetUI.tsx @@ -3,7 +3,6 @@ import { StyledEngineProvider } from '@mui/material/styles'; import Fab from '@mui/material/Fab'; import CloseIcon from '@mui/icons-material/Close'; -import Popper from '@mui/material/Popper'; import Paper from '@mui/material/Paper'; import { createTheme, ThemeProvider } from '@mui/material/styles'; @@ -80,56 +79,9 @@ export function WidgetUI(props) {
{props.walletConnected ? ( ) : ( . + */ + +/** + * @file ErrorMessages.ts + * @copyright SKALE Labs 2022-Present + */ + +import React from 'react'; +import Button from '@mui/material/Button'; +import MoveUpIcon from '@mui/icons-material/MoveUp'; + +import { OperationType } from '../../core/dataclasses/OperationType'; + +import { clsNames } from '../../core/helper'; +import styles from "../WidgetUI/WidgetUI.scss"; + + +export default function WrappedTokensWarning(props) { + if (!props.wrappedTokens || !props.wrappedTokens.erc20) return; + const wrappedTokens = Object.entries(props.wrappedTokens.erc20); + if (wrappedTokens.length === 0) return; + return (
+ +
) +} diff --git a/src/components/WrappedTokensWarning/index.ts b/src/components/WrappedTokensWarning/index.ts new file mode 100644 index 0000000..081c48c --- /dev/null +++ b/src/components/WrappedTokensWarning/index.ts @@ -0,0 +1 @@ +export { default } from "./WrappedTokensWarning"; \ No newline at end of file diff --git a/src/core/actions/erc20.ts b/src/core/actions/erc20.ts index 1198ab4..68b92a0 100644 --- a/src/core/actions/erc20.ts +++ b/src/core/actions/erc20.ts @@ -220,12 +220,10 @@ export class WrapERC20S extends Action { } } - -export class UnWrapERC20S extends Action { +export class UnWrapERC20S2S extends Action { static label = 'Unwrap' static buttonText = 'Unwrap' static loadingText = 'Unwrapping' - async execute() { await this.switchMetamaskChain(); const amountWei = toWei(this.amount, this.tokenData.decimals); @@ -239,6 +237,38 @@ export class UnWrapERC20S extends Action { } +export class UnWrapERC20S extends Action { + static label = 'Unwrap stuck tokens' + static buttonText = 'Unwrap All' + static loadingText = 'Unwrapping' + + async execute() { + log('execute: UnWrapERC20S'); + const amountWei = toWei(this.amount, this.tokenData.decimals); + const tx = await this.sChain1.erc20.unwrap( + this.tokenData.keyname, + amountWei, + { address: this.address } + ); + externalEvents.unwrapComplete(tx, this.chainName2, this.tokenData.keyname); + } + async preAction() { + log('preAction: UnWrapERC20S'); + const tokenContract = this.sChain1.erc20.tokens[this.tokenData.keyname]; + const checkResBalance = await checkERC20Balance( + this.address, + this.amount, + this.tokenData, + tokenContract + ); + if (!checkResBalance.res) { + this.setAmountErrorMessage(checkResBalance.msg); + return + } + } +} + + export class ApproveERC20M extends Action { static label = 'Approve transfer' static buttonText = 'Approve all' diff --git a/src/core/actions/index.ts b/src/core/actions/index.ts index 0bef9dc..69e6802 100644 --- a/src/core/actions/index.ts +++ b/src/core/actions/index.ts @@ -33,6 +33,7 @@ import { ApproveWrapERC20S, WrapERC20S, UnWrapERC20S, + UnWrapERC20S2S, ApproveERC20M, TransferERC20M2S, TransferERC20S2M @@ -60,6 +61,8 @@ import { S2M_POSTFIX, } from '../constants'; +import { OperationType } from '../../core/dataclasses/OperationType'; + debug.enable('*'); const log = debug('metaport:actions'); @@ -68,8 +71,10 @@ const log = debug('metaport:actions'); export function getActionName( chainName1: string, chainName2: string, - tokenData: TokenData + tokenData: TokenData, + operationType: OperationType ): string { + if (chainName1 && operationType === OperationType.unwrap) return 'erc20_unwrap'; if (!chainName1 || !chainName2 || !tokenData) return; log(`Getting action name: ${chainName1} ${chainName2} ${tokenData.symbol} ${tokenData.type}`); let postfix = S2S_POSTFIX; @@ -82,7 +87,7 @@ export function getActionName( const wrapActions = [ApproveWrapERC20S, WrapERC20S]; -const unwrapActions = [UnWrapERC20S]; +const unwrapActions = [UnWrapERC20S2S]; export const ACTIONS = { @@ -93,7 +98,7 @@ export const ACTIONS = { erc20_m2s: [ApproveERC20M, TransferERC20M2S], erc20_s2m: [ApproveERC20S, TransferERC20S2M], erc20_s2s: [ApproveERC20S, TransferERC20S2S], - erc20_unwrap: unwrapActions, + erc20_unwrap: [UnWrapERC20S], erc721_m2s: [ApproveERC721M, TransferERC721M2S], erc721_s2m: [ApproveERC721S, TransferERC721S2M], @@ -115,12 +120,14 @@ export function getActionSteps( ) { log(`Getting action steps ${actionName}, ${tokenData.keyname}`); const actionsList = []; - if (tokenData.unwrappedSymbol && !tokenData.clone) { + if (tokenData.unwrappedSymbol && !tokenData.clone && actionName !== 'erc20_unwrap') { // TODO: tmp fix actionsList.push(...wrapActions); } actionsList.push(...ACTIONS[actionName]); if (tokenData.unwrappedSymbol && tokenData.clone) { actionsList.push(...unwrapActions); } + log('actionsList'); + log(actionsList); return actionsList; } diff --git a/src/core/dataclasses/EthTokenData.ts b/src/core/dataclasses/EthTokenData.ts index bf0e191..664bff3 100644 --- a/src/core/dataclasses/EthTokenData.ts +++ b/src/core/dataclasses/EthTokenData.ts @@ -33,11 +33,13 @@ export default class EthTokenData extends TokenData { null, TokenType.eth, TokenType.eth, + TokenType.eth, clone, null, null, TokenType.eth, null, + null, null ); } diff --git a/src/core/dataclasses/OperationType.ts b/src/core/dataclasses/OperationType.ts new file mode 100644 index 0000000..7f2af54 --- /dev/null +++ b/src/core/dataclasses/OperationType.ts @@ -0,0 +1,28 @@ +/** + * @license + * SKALE Metaport + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/** + * @file OperationType.ts + * @copyright SKALE Labs 2022-Present + */ + + +export enum OperationType { + transfer = 'transfer', + unwrap = 'unwrap' +} \ No newline at end of file diff --git a/src/core/dataclasses/TokenData.ts b/src/core/dataclasses/TokenData.ts index 5bedaac..449a78c 100644 --- a/src/core/dataclasses/TokenData.ts +++ b/src/core/dataclasses/TokenData.ts @@ -28,6 +28,7 @@ import { TokenType } from './TokenType'; export default class TokenData { originAddress: string cloneAddress: string + cloneSymbol: string name: string symbol: string @@ -51,6 +52,7 @@ export default class TokenData { originAddress: string, name: string, symbol: string, + cloneSymbol: string, clone: boolean, iconUrl: string, decimals: string, @@ -60,6 +62,7 @@ export default class TokenData { unwrappedIconUrl: string ) { this.cloneAddress = cloneAddress; + this.cloneSymbol = cloneSymbol ? cloneSymbol : symbol; this.originAddress = originAddress; this.name = name; this.symbol = symbol; diff --git a/src/core/dataclasses/index.ts b/src/core/dataclasses/index.ts index 1b4170f..d6779aa 100644 --- a/src/core/dataclasses/index.ts +++ b/src/core/dataclasses/index.ts @@ -22,3 +22,4 @@ */ export * from "./TokenType"; +export * from "./OperationType"; diff --git a/src/core/interfaces/Tokens.ts b/src/core/interfaces/Tokens.ts index 55a73b7..02ae071 100644 --- a/src/core/interfaces/Tokens.ts +++ b/src/core/interfaces/Tokens.ts @@ -24,6 +24,7 @@ export interface Token { symbol: string, + cloneSymbol?: string, address: string, name?: string, iconUrl?: string, diff --git a/src/core/tokens/erc20.ts b/src/core/tokens/erc20.ts index 0ca9f3c..c0ad899 100644 --- a/src/core/tokens/erc20.ts +++ b/src/core/tokens/erc20.ts @@ -25,8 +25,12 @@ import debug from 'debug'; import { SChain, MainnetChain } from '@skalenetwork/ima-js'; +import { initContract } from '../core'; +import { getEmptyTokenDataMap } from './helper'; import { externalEvents } from '../events'; import { MAINNET_CHAIN_NAME } from '../constants'; +import TokenData, { getTokenKeyname } from '../dataclasses/TokenData'; +import { TokenType } from '../dataclasses/TokenType'; import * as interfaces from '../interfaces/index'; import { fromWei } from '../convertation'; @@ -90,3 +94,53 @@ export async function getTokenBalance( externalEvents.balance(tokenSymbol, chainName, balance); return fromWei(balance, decimals); } + + +export async function getWrappedTokens( + sChain: SChain, + chainName: string, + configTokens: interfaces.TokensMap, + address: string +): Promise { + log('Checking wrapped tokens...'); + const wrappedTokens: interfaces.TokenDataTypesMap = getEmptyTokenDataMap(); + if (configTokens && configTokens[chainName] && configTokens[chainName].erc20) { + for (const [symbol, configToken] of Object.entries(configTokens[chainName].erc20)) { + if (!configToken.wraps) continue; + const tokenKeyname = getTokenKeyname(configToken.symbol, configToken.address); + const tokenContract = initContract('erc20wrap', configToken.address, sChain.web3); + sChain.erc20.addToken( + tokenKeyname, + tokenContract + ); + const balance = await sChain.getERC20Balance( + tokenContract, + address + ); + log(`token ${tokenKeyname}, address: ${address}, balance: ${balance}`); + if (balance !== '0') { + wrappedTokens.erc20[tokenKeyname] = new TokenData( + null, + configToken.address, + configToken.name, + configToken.symbol, + configToken.cloneSymbol, + false, + configToken.iconUrl, + configToken.decimals, + TokenType.erc20, + configToken.wraps.symbol, + configToken.wraps.address, + configToken.wraps.iconUrl + ); + wrappedTokens.erc20[tokenKeyname].balance = fromWei( + balance, + wrappedTokens.erc20[tokenKeyname].decimals + ); + } + } + } + log('wrappedTokens'); + log(wrappedTokens); + return wrappedTokens; +} \ No newline at end of file diff --git a/src/core/tokens/m2s.ts b/src/core/tokens/m2s.ts index da0b6c2..18d3141 100644 --- a/src/core/tokens/m2s.ts +++ b/src/core/tokens/m2s.ts @@ -128,6 +128,7 @@ async function addM2STokensAutomatic( address, name, symbol, + symbol, isClone, null, decimals, @@ -190,6 +191,7 @@ async function getM2STokensManual( tokenInfo.address, tokenInfo.name, tokenInfo.symbol, + tokenInfo.cloneSymbol, false, tokenInfo.iconUrl, tokenInfo.decimals, diff --git a/src/core/tokens/s2s.ts b/src/core/tokens/s2s.ts index 40bea5b..a3c7dec 100644 --- a/src/core/tokens/s2s.ts +++ b/src/core/tokens/s2s.ts @@ -131,6 +131,7 @@ async function addTokenData( configToken.address, configToken.name, configToken.symbol, + configToken.cloneSymbol, isClone, configToken.iconUrl, configToken.decimals, From 6827d2de85ac0115251a71d752c33531c259d543 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Thu, 10 Nov 2022 20:02:37 +0000 Subject: [PATCH 12/12] Fix linter --- src/components/TokenList/iconsHelper.ts | 2 +- src/components/WidgetUI/StoriesHelper.ts | 3 ++- src/core/actions/index.ts | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/TokenList/iconsHelper.ts b/src/components/TokenList/iconsHelper.ts index 697da52..7763699 100644 --- a/src/components/TokenList/iconsHelper.ts +++ b/src/components/TokenList/iconsHelper.ts @@ -25,7 +25,7 @@ import TokenData from '../../core/dataclasses/TokenData'; function importAll(r) { - let images = {}; + const images = {}; r.keys().map((item, index) => { images[item.replace('./', '')] = r(item); }); return images; } diff --git a/src/components/WidgetUI/StoriesHelper.ts b/src/components/WidgetUI/StoriesHelper.ts index 2d4315a..299459b 100644 --- a/src/components/WidgetUI/StoriesHelper.ts +++ b/src/components/WidgetUI/StoriesHelper.ts @@ -99,7 +99,8 @@ export function generateTokenData(tokenSymbol, tokenName, wrapped = false) { wrappedTokens: getEmptyTokenDataMap(), wrappedToken: undefined } - const unwrappedIconUrl = wrapped ? "https://raw.githubusercontent.com/microsoft/fluentui-emoji/main/assets/Globe%20showing%20americas/3D/globe_showing_americas_3d.png" : null + // tslint:disable-next-line + const unwrappedIconUrl = wrapped ? "https://raw.githubusercontent.com/microsoft/fluentui-emoji/main/assets/Globe%20showing%20americas/3D/globe_showing_americas_3d.png" : null data.availableTokens.erc20[tokenSymbol] = new TokenData( '0x0', '0x0', diff --git a/src/core/actions/index.ts b/src/core/actions/index.ts index 69e6802..501933e 100644 --- a/src/core/actions/index.ts +++ b/src/core/actions/index.ts @@ -120,7 +120,8 @@ export function getActionSteps( ) { log(`Getting action steps ${actionName}, ${tokenData.keyname}`); const actionsList = []; - if (tokenData.unwrappedSymbol && !tokenData.clone && actionName !== 'erc20_unwrap') { // TODO: tmp fix + // TODO: tmp fix + if (tokenData.unwrappedSymbol && !tokenData.clone && actionName !== 'erc20_unwrap') { actionsList.push(...wrapActions); } actionsList.push(...ACTIONS[actionName]);