diff --git a/README.md b/README.md index 858289e62..9fbd6bd5f 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ The bridges on each contract are upgradeable, this would enable a smooth transit You can use the ['Token Bridge Dapp'](https://tokenbridge.rsk.co/) together with [Nifty Wallet](https://chrome.google.com/webstore/detail/nifty-wallet/jbdaocneiiinmjbjlgalhcelgbejmnid) or [Metamask with custom network](https://github.com/rsksmart/rskj/wiki/Configure-Metamask-to-connect-with-RSK) to move tokens between networks. This is the [Dapp guide](https://developers.rsk.co/tools/tokenbridge/dappguide/) if you don't know how to use it. Or you can use a wallet with the abi of the contracts. See the ['interaction guide using MyCrypto'](https://developers.rsk.co/tools/tokenbridge/usingmycrypto/) for more information on how to use the bridge. -## Contracts deployed on RSK, Ethereum, RSK Testnet and Kovan +## Contracts deployed on RSK, Ethereum, RSK Testnet and Goerli Here are the ['addresses'](./docs/ContractAddresses.md) of the deployed contracts in the different networks. diff --git a/bridge/.gitignore b/bridge/.gitignore index aa5a812af..713b6ac8b 100644 --- a/bridge/.gitignore +++ b/bridge/.gitignore @@ -8,7 +8,7 @@ etherscan.key #Truffle .openzeppelin/.session .openzeppelin/dev-*.json -.openzeppelin/kovan.json +.openzeppelin/goerli.json .openzeppelin/mainnet.json coverage/ coverage.json diff --git a/bridge/contracts/zeppelin/upgradable/README.md b/bridge/contracts/zeppelin/upgradable/README.md index 3ede2e0f0..696a9fc8c 100644 --- a/bridge/contracts/zeppelin/upgradable/README.md +++ b/bridge/contracts/zeppelin/upgradable/README.md @@ -7,7 +7,7 @@ **OpenZeppelin Contracts is a library for secure smart contract development.** It provides implementations of standards like ERC20 and ERC721 which you can deploy as-is or extend to suit your needs, as well as Solidity components to build custom contracts and more complex decentralized systems. -This fork of OpenZeppelin is set up as a **reusable Ethereum Package**. It is deployed to the kovan, rinkeby, and ropsten test networks, as well as to the main Ethereum network. You can reuse any of the pre-deployed on-chain contracts by simply linking to them using the [OpenZeppelin SDK](https://github.com/openzeppelin/openzeppelin-sdk), or reuse their Solidity source code as with the [vanilla version of OpenZeppelin Contracts](https://github.com/OpenZeppelin/openzeppelin-contracts). +This fork of OpenZeppelin is set up as a **reusable Ethereum Package**. It is deployed to the goerli, rinkeby, and ropsten test networks, as well as to the main Ethereum network. You can reuse any of the pre-deployed on-chain contracts by simply linking to them using the [OpenZeppelin SDK](https://github.com/openzeppelin/openzeppelin-sdk), or reuse their Solidity source code as with the [vanilla version of OpenZeppelin Contracts](https://github.com/OpenZeppelin/openzeppelin-contracts). ## Differences with openzeppelin-contracts @@ -30,7 +30,7 @@ npm install @openzeppelin/contracts-ethereum-package ## Using via the OpenZeppelin CLI -You can easily create upgradeable instances of any of the logic contracts listed above using the OpenZeppelin CLI. This will rely on the pre-deployed instances in mainnet, kovan, ropsten, or rinkeby, greatly reducing your gas deployment costs. To do this, just [create a new OpenZeppelin SDK project](https://docs.zeppelinos.org/docs/deploying.html) and [link to this package](https://docs.zeppelinos.org/docs/linking.html). +You can easily create upgradeable instances of any of the logic contracts listed above using the OpenZeppelin CLI. This will rely on the pre-deployed instances in mainnet, goerli, ropsten, or rinkeby, greatly reducing your gas deployment costs. To do this, just [create a new OpenZeppelin SDK project](https://docs.zeppelinos.org/docs/deploying.html) and [link to this package](https://docs.zeppelinos.org/docs/linking.html). ```bash $ npm install -g @openzeppelin/cli diff --git a/bridge/deploy/01_deploy_multiSigWallet.js b/bridge/deploy/01_deploy_multiSigWallet.js index c3b7d114a..13a6699a8 100644 --- a/bridge/deploy/01_deploy_multiSigWallet.js +++ b/bridge/deploy/01_deploy_multiSigWallet.js @@ -1,4 +1,5 @@ const {deploy1820} = require('@thinkanddev/deploy-eip-1820-web3-rsk'); +const {web3} = require("hardhat"); module.exports = async function({getNamedAccounts, deployments, network}) { // HardhatRuntimeEnvironment const {deployer, multiSig} = await getNamedAccounts(); diff --git a/bridge/deploy/02_deploy_proxyAdmin.js b/bridge/deploy/02_deploy_proxyAdmin.js index 390f45037..057f33eb6 100644 --- a/bridge/deploy/02_deploy_proxyAdmin.js +++ b/bridge/deploy/02_deploy_proxyAdmin.js @@ -1,4 +1,5 @@ const address = require('../hardhat/helper/address'); +const chains = require("../hardhat/helper/chains"); module.exports = async function(hre) { // HardhatRuntimeEnvironment const {getNamedAccounts, deployments} = hre; diff --git a/bridge/deploy/04_deploy_bridge.js b/bridge/deploy/04_deploy_bridge.js index 8a6aafd59..4d7c148da 100644 --- a/bridge/deploy/04_deploy_bridge.js +++ b/bridge/deploy/04_deploy_bridge.js @@ -1,9 +1,10 @@ const address = require('../hardhat/helper/address'); const chains = require("../hardhat/helper/chains"); +const {web3} = require("hardhat"); module.exports = async function(hre) { // HardhatRuntimeEnvironment const {deployments, network} = hre; - const {deployer} = await getNamedAccounts(); + const {deployer} = await hre.getNamedAccounts(); const {deploy, log} = deployments; const BRIDGE_LAST_VERSION = 'v4' diff --git a/bridge/deploy/05_deploy_bridgeProxy.js b/bridge/deploy/05_deploy_bridgeProxy.js index f4d6934bb..1dee3e86e 100644 --- a/bridge/deploy/05_deploy_bridgeProxy.js +++ b/bridge/deploy/05_deploy_bridgeProxy.js @@ -1,5 +1,6 @@ const chains = require('../hardhat/helper/chains'); const address = require('../hardhat/helper/address'); +const {web3} = require("hardhat"); module.exports = async function (hre) { // HardhatRuntimeEnvironment const {getNamedAccounts, deployments, network} = hre; @@ -30,19 +31,21 @@ module.exports = async function (hre) { // HardhatRuntimeEnvironment methodCall.encodeABI() ]; - const deployProxyResult = await deploy('BridgeProxy', { + const deployResult = await deploy('BridgeProxy', { from: deployer, args: constructorArguments, log: true, }); - if (deployProxyResult.newlyDeployed) { - log(`Contract BridgeProxy deployed at ${deployProxyResult.address} using ${deployProxyResult.receipt.gasUsed.toString()} gas`); + + if (deployResult.newlyDeployed) { + log(`Contract BridgeProxy deployed at ${deployResult.address} using ${deployResult.receipt.gasUsed.toString()} gas`); if(network.live && !chains.isRSK(network)) { log(`Startig Verification of ${deployResult.address}`); await hre.run("verify:verify", { address: deployResult.address, constructorArguments: constructorArguments, + contract: 'contracts/Proxies.sol:BridgeProxy' }); } } diff --git a/bridge/deploy/06_deploy_federation.js b/bridge/deploy/06_deploy_federation.js index 95871d247..16a0e3063 100644 --- a/bridge/deploy/06_deploy_federation.js +++ b/bridge/deploy/06_deploy_federation.js @@ -1,8 +1,9 @@ const address = require('../hardhat/helper/address'); const chains = require('../hardhat/helper/chains'); +const {web3} = require("hardhat"); module.exports = async function(hre) { // HardhatRuntimeEnvironment - const {deployments, network} = hre; + const {deployments, network, getNamedAccounts} = hre; const {deployer} = await getNamedAccounts(); const {deploy, log} = deployments; const FEDERATION_LAST_VERSION = 'v3' diff --git a/bridge/deploy/07_deploy_federationProxy.js b/bridge/deploy/07_deploy_federationProxy.js index 3c1630084..9968e7098 100644 --- a/bridge/deploy/07_deploy_federationProxy.js +++ b/bridge/deploy/07_deploy_federationProxy.js @@ -58,7 +58,7 @@ module.exports.dependencies = ['MultiSigWallet', 'ProxyAdmin', 'Federation', 'Br function getFederationConf(deployer, network) { const networkName = network.name.toLowerCase(); - if (networkName.includes('testnet') || networkName.includes('kovan') || networkName.includes('rinkeby')) { + if (networkName.includes('testnet') || networkName.includes('goerli') || networkName.includes('rinkeby')) { return { members: ['0x8f397ff074ff190fc650e5cab4da039a8163e12a'], required: 1, diff --git a/bridge/deploy/08_deploy_allowToken.js b/bridge/deploy/08_deploy_allowToken.js index 58d751245..3696e8e7c 100644 --- a/bridge/deploy/08_deploy_allowToken.js +++ b/bridge/deploy/08_deploy_allowToken.js @@ -1,5 +1,6 @@ const address = require('../hardhat/helper/address'); const chains = require('../hardhat/helper/chains'); +const {web3} = require("hardhat"); module.exports = async function(hre) { // HardhatRuntimeEnvironment const {getNamedAccounts, deployments, network} = hre; diff --git a/bridge/deploy/09_deploy_allowTokensProxy.js b/bridge/deploy/09_deploy_allowTokensProxy.js index 2c86e3341..2eca2b9d9 100644 --- a/bridge/deploy/09_deploy_allowTokensProxy.js +++ b/bridge/deploy/09_deploy_allowTokensProxy.js @@ -1,8 +1,9 @@ // We are actually gonna use the latest Bridge but truffle only knows the address of the proxy -const toWei = web3.utils.toWei; const deployHelper = require('../deployed/deployHelper'); const chains = require('../hardhat/helper/chains'); const address = require('../hardhat/helper/address'); +const {web3} = require("hardhat"); +const toWei = web3.utils.toWei; module.exports = async function(hre) { // HardhatRuntimeEnvironment const {getNamedAccounts, deployments, network} = hre; diff --git a/bridge/deploy/10_transfer_setTokens_allowTokens.js b/bridge/deploy/10_transfer_setTokens_allowTokens.js index 963c8ca69..7c7788a64 100644 --- a/bridge/deploy/10_transfer_setTokens_allowTokens.js +++ b/bridge/deploy/10_transfer_setTokens_allowTokens.js @@ -1,5 +1,6 @@ const { tokensByChainId } = require("../hardhat/helper/tokens"); const address = require('../hardhat/helper/address'); +const {web3} = require("hardhat"); function formatToken(token) { return {token: token.address, typeId: token.typeId}; diff --git a/bridge/deploy/11_transfer_sideTokenFactoryToBridge.js b/bridge/deploy/11_transfer_sideTokenFactoryToBridge.js index aea7b909e..d93c21684 100644 --- a/bridge/deploy/11_transfer_sideTokenFactoryToBridge.js +++ b/bridge/deploy/11_transfer_sideTokenFactoryToBridge.js @@ -1,3 +1,4 @@ +const {web3} = require("hardhat"); const sideTokenFactoryName = 'SideTokenFactory'; const bridgeProxyName = 'BridgeProxy'; const GAS_LIMIT = 4000000; diff --git a/bridge/deploy/12_transfer_federationToBridge.js b/bridge/deploy/12_transfer_federationToBridge.js index 8ff2e6d66..3de36256d 100644 --- a/bridge/deploy/12_transfer_federationToBridge.js +++ b/bridge/deploy/12_transfer_federationToBridge.js @@ -1,4 +1,5 @@ const address = require('../hardhat/helper/address'); +const {web3} = require("hardhat"); module.exports = async function (hre) { // HardhatRuntimeEnvironment const {getNamedAccounts, deployments} = hre; diff --git a/bridge/deploy/13_transfer_allowTokensToBridge.js b/bridge/deploy/13_transfer_allowTokensToBridge.js index 9e72c4935..fd661a8fd 100644 --- a/bridge/deploy/13_transfer_allowTokensToBridge.js +++ b/bridge/deploy/13_transfer_allowTokensToBridge.js @@ -1,4 +1,5 @@ const address = require('../hardhat/helper/address'); +const {web3} = require("hardhat"); module.exports = async function (hre) { // HardhatRuntimeEnvironment const {getNamedAccounts, deployments} = hre; diff --git a/bridge/deploy/14_conditional_deploy_mainToken.js b/bridge/deploy/14_conditional_deploy_mainToken.js index 4acabea7b..06a26f025 100644 --- a/bridge/deploy/14_conditional_deploy_mainToken.js +++ b/bridge/deploy/14_conditional_deploy_mainToken.js @@ -1,3 +1,4 @@ +const {web3} = require("hardhat"); module.exports = async function ({getNamedAccounts, deployments, network}) { // HardhatRuntimeEnvironment const {deployer} = await getNamedAccounts() const {deploy, log} = deployments diff --git a/bridge/deploy/17_set_wrapped_currency.js b/bridge/deploy/17_set_wrapped_currency.js index 47d78d482..9f841e2f5 100644 --- a/bridge/deploy/17_set_wrapped_currency.js +++ b/bridge/deploy/17_set_wrapped_currency.js @@ -1,4 +1,5 @@ const address = require('../hardhat/helper/address'); +const {web3} = require("hardhat"); module.exports = async function (hre) { // HardhatRuntimeEnvironment const {getNamedAccounts, deployments, network} = hre; diff --git a/bridge/deployed/deployHelper.js b/bridge/deployed/deployHelper.js index 90d40a9ab..553b73a36 100644 --- a/bridge/deployed/deployHelper.js +++ b/bridge/deployed/deployHelper.js @@ -6,7 +6,7 @@ function isMainnet(network) { function isLocalNetwork(network) { return !network.toLowerCase().includes('mainnet') - && !network.toLowerCase().includes('kovan') + && !network.toLowerCase().includes('goerli') && !network.toLowerCase().includes('testnet'); } diff --git a/bridge/deployed/kovan.json b/bridge/deployed/goerli.json similarity index 97% rename from bridge/deployed/kovan.json rename to bridge/deployed/goerli.json index 860250e8b..eb84c3572 100644 --- a/bridge/deployed/kovan.json +++ b/bridge/deployed/goerli.json @@ -1,5 +1,5 @@ { - "network": "kovan", + "network": "goerli", "MultiSig": "0x040007b1804ad78a97f541bebed377dcb60e4138", "ProxyAdmin": "0xe4d351911a6d599f91a3db1843e2ecb0f851e7e6", "Utils": "0xE18b8fb2942493EA96BfC46a044e4F966f2dFaB6", diff --git a/bridge/deployments/goerli/.chainId b/bridge/deployments/goerli/.chainId new file mode 100644 index 000000000..7813681f5 --- /dev/null +++ b/bridge/deployments/goerli/.chainId @@ -0,0 +1 @@ +5 \ No newline at end of file diff --git a/bridge/deployments/goerli/AllowTokens.json b/bridge/deployments/goerli/AllowTokens.json new file mode 100644 index 000000000..2fa8a6ee8 --- /dev/null +++ b/bridge/deployments/goerli/AllowTokens.json @@ -0,0 +1,1238 @@ +{ + "address": "0x7bEfBB1bC878960bfd2F9318aAC721A2c61f6640", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_tokenAddress", + "type": "address" + } + ], + "name": "AllowedTokenRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_smallAmountConfirmations", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_mediumAmountConfirmations", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_largeAmountConfirmations", + "type": "uint256" + } + ], + "name": "ConfirmationsChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "PrimaryTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_tokenAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_typeId", + "type": "uint256" + } + ], + "name": "SetToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_typeId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "_typeDescription", + "type": "string" + } + ], + "name": "TokenTypeAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_typeId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "daily", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mediumAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "largeAmount", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct IAllowTokens.Limits", + "name": "limits", + "type": "tuple" + } + ], + "name": "TypeLimitsChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_tokenAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_lastDay", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_spentToday", + "type": "uint256" + } + ], + "name": "UpdateTokensTransfered", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_TYPES", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "__Secondary_init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "daily", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mediumAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "largeAmount", + "type": "uint256" + } + ], + "internalType": "struct IAllowTokens.Limits", + "name": "limits", + "type": "tuple" + } + ], + "name": "addTokenType", + "outputs": [ + { + "internalType": "uint256", + "name": "len", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowedTokens", + "outputs": [ + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "typeId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spentToday", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastDay", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "calcMaxWithdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "maxWithdraw", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getConfirmations", + "outputs": [ + { + "internalType": "uint256", + "name": "smallAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mediumAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "largeAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + } + ], + "name": "getInfoAndLimits", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "typeId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spentToday", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastDay", + "type": "uint256" + } + ], + "internalType": "struct IAllowTokens.TokenInfo", + "name": "info", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "daily", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mediumAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "largeAmount", + "type": "uint256" + } + ], + "internalType": "struct IAllowTokens.Limits", + "name": "limit", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTypeDescriptions", + "outputs": [ + { + "internalType": "string[]", + "name": "descriptions", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTypeDescriptionsLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTypesLimits", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "daily", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mediumAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "largeAmount", + "type": "uint256" + } + ], + "internalType": "struct IAllowTokens.Limits[]", + "name": "limits", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_primary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_smallAmountConfirmations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_mediumAmountConfirmations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_largeAmountConfirmations", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "daily", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mediumAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "largeAmount", + "type": "uint256" + } + ], + "internalType": "struct IAllowTokens.Limits", + "name": "limits", + "type": "tuple" + } + ], + "internalType": "struct IAllowTokens.TypeInfo[]", + "name": "typesInfo", + "type": "tuple[]" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isOwner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "isTokenAllowed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "largeAmountConfirmations", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "mediumAmountConfirmations", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "primary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "removeAllowedToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_smallAmountConfirmations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_mediumAmountConfirmations", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_largeAmountConfirmations", + "type": "uint256" + } + ], + "name": "setConfirmations", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "typeId", + "type": "uint256" + } + ], + "internalType": "struct IAllowTokens.TokensAndType[]", + "name": "tokensAndTypes", + "type": "tuple[]" + } + ], + "name": "setMultipleTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "typeId", + "type": "uint256" + } + ], + "name": "setToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "typeId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "daily", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mediumAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "largeAmount", + "type": "uint256" + } + ], + "internalType": "struct IAllowTokens.Limits", + "name": "limits", + "type": "tuple" + } + ], + "name": "setTypeLimits", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "smallAmountConfirmations", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + } + ], + "name": "tokenInfo", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "typeId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "spentToday", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastDay", + "type": "uint256" + } + ], + "internalType": "struct IAllowTokens.TokenInfo", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "transferPrimary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "typeDescriptions", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "typeLimits", + "outputs": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "daily", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mediumAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "largeAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "updateTokenTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + } + ], + "transactionHash": "0x162fd396e8a4bc06fc521355bb42fc1b3b991d1615d4b5938620e6d7599024d5", + "receipt": { + "to": null, + "from": "0xa554d96413FF72E93437C4072438302C38350EE3", + "contractAddress": "0x7bEfBB1bC878960bfd2F9318aAC721A2c61f6640", + "transactionIndex": 0, + "gasUsed": "2056299", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xdf0d7b7fdc6035e9b94ae280c01df0ae7faeb296ee6b926a92c79aa9632fbc1f", + "transactionHash": "0x162fd396e8a4bc06fc521355bb42fc1b3b991d1615d4b5938620e6d7599024d5", + "logs": [], + "blockNumber": 7664855, + "cumulativeGasUsed": "2056299", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "caeb40de80c8668828546c6b3fb7fad2", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_tokenAddress\",\"type\":\"address\"}],\"name\":\"AllowedTokenRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_smallAmountConfirmations\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_mediumAmountConfirmations\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_largeAmountConfirmations\",\"type\":\"uint256\"}],\"name\":\"ConfirmationsChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"PrimaryTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_tokenAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_typeId\",\"type\":\"uint256\"}],\"name\":\"SetToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_typeId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_typeDescription\",\"type\":\"string\"}],\"name\":\"TokenTypeAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_typeId\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"daily\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mediumAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"largeAmount\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"struct IAllowTokens.Limits\",\"name\":\"limits\",\"type\":\"tuple\"}],\"name\":\"TypeLimitsChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_tokenAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_lastDay\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_spentToday\",\"type\":\"uint256\"}],\"name\":\"UpdateTokensTransfered\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MAX_TYPES\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"__Secondary_init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"daily\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mediumAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"largeAmount\",\"type\":\"uint256\"}],\"internalType\":\"struct IAllowTokens.Limits\",\"name\":\"limits\",\"type\":\"tuple\"}],\"name\":\"addTokenType\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"len\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowedTokens\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"typeId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"spentToday\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastDay\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"calcMaxWithdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"maxWithdraw\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfirmations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"smallAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mediumAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"largeAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"getInfoAndLimits\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"typeId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"spentToday\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastDay\",\"type\":\"uint256\"}],\"internalType\":\"struct IAllowTokens.TokenInfo\",\"name\":\"info\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"daily\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mediumAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"largeAmount\",\"type\":\"uint256\"}],\"internalType\":\"struct IAllowTokens.Limits\",\"name\":\"limit\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTypeDescriptions\",\"outputs\":[{\"internalType\":\"string[]\",\"name\":\"descriptions\",\"type\":\"string[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTypeDescriptionsLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTypesLimits\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"daily\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mediumAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"largeAmount\",\"type\":\"uint256\"}],\"internalType\":\"struct IAllowTokens.Limits[]\",\"name\":\"limits\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_primary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_smallAmountConfirmations\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_mediumAmountConfirmations\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_largeAmountConfirmations\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"daily\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mediumAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"largeAmount\",\"type\":\"uint256\"}],\"internalType\":\"struct IAllowTokens.Limits\",\"name\":\"limits\",\"type\":\"tuple\"}],\"internalType\":\"struct IAllowTokens.TypeInfo[]\",\"name\":\"typesInfo\",\"type\":\"tuple[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isOwner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isTokenAllowed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"largeAmountConfirmations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"mediumAmountConfirmations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"primary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"removeAllowedToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_smallAmountConfirmations\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_mediumAmountConfirmations\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_largeAmountConfirmations\",\"type\":\"uint256\"}],\"name\":\"setConfirmations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"typeId\",\"type\":\"uint256\"}],\"internalType\":\"struct IAllowTokens.TokensAndType[]\",\"name\":\"tokensAndTypes\",\"type\":\"tuple[]\"}],\"name\":\"setMultipleTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"typeId\",\"type\":\"uint256\"}],\"name\":\"setToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"typeId\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"daily\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mediumAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"largeAmount\",\"type\":\"uint256\"}],\"internalType\":\"struct IAllowTokens.Limits\",\"name\":\"limits\",\"type\":\"tuple\"}],\"name\":\"setTypeLimits\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"smallAmountConfirmations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"tokenInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"typeId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"spentToday\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastDay\",\"type\":\"uint256\"}],\"internalType\":\"struct IAllowTokens.TokenInfo\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"transferPrimary\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"typeDescriptions\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"typeLimits\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"daily\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"mediumAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"largeAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"updateTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"__Secondary_init(address)\":{\"details\":\"Sets the primary account to the one that is creating the Secondary contract.\"},\"initialize(address)\":{\"details\":\"Initializes the contract setting the deployer as the initial owner.\"},\"isOwner()\":{\"details\":\"Returns true if the caller is the current owner.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"primary()\":{\"returns\":{\"_0\":\"the address of the primary.\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. > Note: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"transferPrimary(address)\":{\"details\":\"Transfers contract to a new primary.\",\"params\":{\"recipient\":\"The address of new primary.\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/AllowTokens/AllowTokens.sol\":\"AllowTokens\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/AllowTokens/AllowTokens.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"../zeppelin/math/SafeMath.sol\\\";\\n// Upgradables\\nimport \\\"../zeppelin/upgradable/Initializable.sol\\\";\\nimport \\\"../zeppelin/upgradable/ownership/UpgradableOwnable.sol\\\";\\nimport \\\"../zeppelin/upgradable/ownership/UpgradableSecondary.sol\\\";\\n\\nimport \\\"../interface/IAllowTokens.sol\\\";\\n\\ncontract AllowTokens is Initializable, UpgradableOwnable, UpgradableSecondary, IAllowTokens {\\n\\tusing SafeMath for uint256;\\n\\n\\taddress constant private NULL_ADDRESS = address(0);\\n\\tuint256 constant public MAX_TYPES = 250;\\n\\tmapping (address => TokenInfo) public allowedTokens;\\n\\tmapping (uint256 => Limits) public typeLimits;\\n\\tuint256 public smallAmountConfirmations;\\n\\tuint256 public mediumAmountConfirmations;\\n\\tuint256 public largeAmountConfirmations;\\n\\tstring[] public typeDescriptions;\\n\\n\\tevent SetToken(address indexed _tokenAddress, uint256 _typeId);\\n\\tevent AllowedTokenRemoved(address indexed _tokenAddress);\\n\\tevent TokenTypeAdded(uint256 indexed _typeId, string _typeDescription);\\n\\tevent TypeLimitsChanged(uint256 indexed _typeId, Limits limits);\\n\\tevent UpdateTokensTransfered(address indexed _tokenAddress, uint256 _lastDay, uint256 _spentToday);\\n\\tevent ConfirmationsChanged(uint256 _smallAmountConfirmations, uint256 _mediumAmountConfirmations, uint256 _largeAmountConfirmations);\\n\\n\\tmodifier notNull(address _address) {\\n\\t\\trequire(_address != NULL_ADDRESS, \\\"AllowTokens: Null Address\\\");\\n\\t\\t_;\\n\\t}\\n\\n\\tfunction initialize(\\n\\t\\taddress _manager,\\n\\t\\taddress _primary,\\n\\t\\tuint256 _smallAmountConfirmations,\\n\\t\\tuint256 _mediumAmountConfirmations,\\n\\t\\tuint256 _largeAmountConfirmations,\\n\\t\\tTypeInfo[] memory typesInfo) public initializer {\\n\\t\\tUpgradableOwnable.initialize(_manager);\\n\\t\\tUpgradableSecondary.__Secondary_init(_primary);\\n\\t\\t_setConfirmations(_smallAmountConfirmations, _mediumAmountConfirmations, _largeAmountConfirmations);\\n\\t\\tfor(uint i = 0; i < typesInfo.length; i = i + 1) {\\n\\t\\t\\t_addTokenType(typesInfo[i].description, typesInfo[i].limits);\\n\\t\\t}\\n\\t}\\n\\n\\tfunction version() override external pure returns (string memory) {\\n\\t\\treturn \\\"v1\\\";\\n\\t}\\n\\n\\tfunction tokenInfo(address tokenAddress) public view returns(TokenInfo memory) {\\n\\t\\treturn allowedTokens[tokenAddress];\\n\\t}\\n\\n\\tfunction setTokenInfoByTokenAddress(address tokenAddress, TokenInfo memory info) internal {\\n\\t\\trequire(isOwner() || _msgSender() == primary(), \\\"AllowTokens: unauthorized sender\\\");\\n\\t\\tallowedTokens[tokenAddress] = info;\\n\\t}\\n\\n\\tfunction getInfoAndLimits(\\n\\t\\taddress tokenAddress\\n\\t) public view override returns (\\n\\t\\tTokenInfo memory info,\\n\\t\\tLimits memory limit\\n\\t) {\\n\\t\\tinfo = tokenInfo(tokenAddress);\\n\\t\\tlimit = typeLimits[info.typeId];\\n\\t\\treturn (info, limit);\\n\\t}\\n\\n\\tfunction calcMaxWithdraw(address token) public view override returns (uint256 maxWithdraw) {\\n\\t\\t(TokenInfo memory info, Limits memory limits) = getInfoAndLimits(token);\\n\\t\\treturn _calcMaxWithdraw(info, limits);\\n\\t}\\n\\n\\tfunction _calcMaxWithdraw(TokenInfo memory info, Limits memory limits) private view returns (uint256 maxWithdraw) {\\n\\t\\t// solium-disable-next-line security/no-block-members\\n\\t\\tif (block.timestamp > info.lastDay + 24 hours) { // solhint-disable-line not-rely-on-time\\n\\t\\t\\tinfo.spentToday = 0;\\n\\t\\t}\\n\\t\\tif (limits.daily <= info.spentToday) {\\n\\t\\t\\treturn 0;\\n\\t\\t}\\n\\t\\tmaxWithdraw = limits.daily - info.spentToday;\\n\\t\\tif (maxWithdraw > limits.max) {\\n\\t\\t\\tmaxWithdraw = limits.max;\\n\\t\\t}\\n\\t\\treturn maxWithdraw;\\n\\t}\\n\\n\\tfunction updateTokenTransfer(address token, uint256 amount) override external onlyPrimary {\\n\\t\\t(TokenInfo memory info, Limits memory limit) = getInfoAndLimits(token);\\n\\t\\trequire(isTokenAllowed(token), \\\"AllowTokens: Not whitelisted\\\");\\n\\t\\trequire(amount >= limit.min, \\\"AllowTokens: Lower than limit\\\");\\n\\n\\t\\t// solium-disable-next-line security/no-block-members\\n\\t\\tif (block.timestamp > info.lastDay + 24 hours) { // solhint-disable-line not-rely-on-time\\n\\t\\t\\t// solium-disable-next-line security/no-block-members\\n\\t\\t\\tinfo.lastDay = block.timestamp; // solhint-disable-line not-rely-on-time\\n\\t\\t\\tinfo.spentToday = 0;\\n\\t\\t}\\n\\t\\tuint maxWithdraw = _calcMaxWithdraw(info, limit);\\n\\t\\trequire(amount <= maxWithdraw, \\\"AllowTokens: Exceeded limit\\\");\\n\\t\\tinfo.spentToday = info.spentToday.add(amount);\\n\\t\\tsetTokenInfoByTokenAddress(token, info);\\n\\n\\t\\temit UpdateTokensTransfered(token, info.lastDay, info.spentToday);\\n\\t}\\n\\n\\tfunction _addTokenType(string memory description, Limits memory limits) private returns(uint256 len) {\\n\\t\\trequire(bytes(description).length > 0, \\\"AllowTokens: Empty description\\\");\\n\\t\\tlen = typeDescriptions.length;\\n\\t\\trequire(len + 1 <= MAX_TYPES, \\\"AllowTokens: Reached MAX_TYPES\\\");\\n\\t\\ttypeDescriptions.push(description);\\n\\t\\t_setTypeLimits(len, limits);\\n\\t\\temit TokenTypeAdded(len, description);\\n\\t\\treturn len;\\n\\t}\\n\\n\\tfunction addTokenType(string calldata description, Limits calldata limits) external onlyOwner returns(uint256 len) {\\n\\t\\treturn _addTokenType(description, limits);\\n\\t}\\n\\n\\tfunction _setTypeLimits(uint256 typeId, Limits memory limits) private {\\n\\t\\trequire(typeId < typeDescriptions.length, \\\"AllowTokens: bigger than typeDescriptions\\\");\\n\\t\\trequire(limits.max >= limits.min, \\\"AllowTokens: maxTokens smaller than minTokens\\\");\\n\\t\\trequire(limits.daily >= limits.max, \\\"AllowTokens: dailyLimit smaller than maxTokens\\\");\\n\\t\\trequire(limits.mediumAmount > limits.min, \\\"AllowTokens: limits.mediumAmount smaller than min\\\");\\n\\t\\trequire(limits.largeAmount > limits.mediumAmount, \\\"AllowTokens: limits.largeAmount smaller than mediumAmount\\\");\\n\\t\\ttypeLimits[typeId] = limits;\\n\\t\\temit TypeLimitsChanged(typeId, limits);\\n\\t}\\n\\n\\tfunction setTypeLimits(uint256 typeId, Limits memory limits) public onlyOwner {\\n\\t\\t_setTypeLimits(typeId, limits);\\n\\t}\\n\\n\\tfunction getTypesLimits() external view override returns(Limits[] memory limits) {\\n\\t\\tlimits = new Limits[](typeDescriptions.length);\\n\\t\\tfor (uint256 i = 0; i < typeDescriptions.length; i++) {\\n\\t\\t\\tlimits[i] = typeLimits[i];\\n\\t\\t}\\n\\t\\treturn limits;\\n\\t}\\n\\n\\tfunction getTypeDescriptionsLength() external view override returns(uint256) {\\n\\t\\treturn typeDescriptions.length;\\n\\t}\\n\\n\\tfunction getTypeDescriptions() external view override returns(string[] memory descriptions) {\\n\\t\\tdescriptions = new string[](typeDescriptions.length);\\n\\t\\tfor (uint256 i = 0; i < typeDescriptions.length; i++) {\\n\\t\\t\\tdescriptions[i] = typeDescriptions[i];\\n\\t\\t}\\n\\t\\treturn descriptions;\\n\\t}\\n\\n\\tfunction isTokenAllowed(address token) public view notNull(token) override returns (bool) {\\n\\t\\treturn tokenInfo(token).allowed;\\n\\t}\\n\\n\\tfunction setToken(address token, uint256 typeId) override public notNull(token) {\\n\\t\\trequire(isOwner() || _msgSender() == primary(), \\\"AllowTokens: unauthorized sender\\\");\\n\\t\\trequire(typeId < typeDescriptions.length, \\\"AllowTokens: typeId does not exist\\\");\\n\\t\\tTokenInfo memory info = tokenInfo(token);\\n\\t\\tinfo.allowed = true;\\n\\t\\tinfo.typeId = typeId;\\n\\t\\tsetTokenInfoByTokenAddress(token, info);\\n\\t\\temit SetToken(token, typeId);\\n\\t}\\n\\n\\tfunction setMultipleTokens(TokensAndType[] calldata tokensAndTypes) external onlyOwner {\\n\\t\\trequire(tokensAndTypes.length > 0, \\\"AllowTokens: empty tokens\\\");\\n\\t\\tfor(uint256 i = 0; i < tokensAndTypes.length; i = i + 1) {\\n\\t\\t\\tsetToken(tokensAndTypes[i].token, tokensAndTypes[i].typeId);\\n\\t\\t}\\n\\t}\\n\\n\\tfunction removeAllowedToken(address token) external notNull(token) onlyOwner {\\n\\t\\tTokenInfo memory info = tokenInfo(token);\\n\\t\\trequire(info.allowed, \\\"AllowTokens: Not Allowed\\\");\\n\\t\\tinfo.allowed = false;\\n\\t\\tsetTokenInfoByTokenAddress(token, info);\\n\\t\\temit AllowedTokenRemoved(token);\\n\\t}\\n\\n\\tfunction setConfirmations(\\n\\t\\tuint256 _smallAmountConfirmations,\\n\\t\\tuint256 _mediumAmountConfirmations,\\n\\t\\tuint256 _largeAmountConfirmations) external onlyOwner {\\n\\t\\t_setConfirmations(_smallAmountConfirmations, _mediumAmountConfirmations, _largeAmountConfirmations);\\n\\t}\\n\\n\\tfunction _setConfirmations(\\n\\t\\tuint256 _smallAmountConfirmations,\\n\\t\\tuint256 _mediumAmountConfirmations,\\n\\t\\tuint256 _largeAmountConfirmations) private {\\n\\t\\trequire(_smallAmountConfirmations <= _mediumAmountConfirmations, \\\"AllowTokens: small bigger than medium confirmations\\\");\\n\\t\\trequire(_mediumAmountConfirmations <= _largeAmountConfirmations, \\\"AllowTokens: medium bigger than large confirmations\\\");\\n\\t\\tsmallAmountConfirmations = _smallAmountConfirmations;\\n\\t\\tmediumAmountConfirmations = _mediumAmountConfirmations;\\n\\t\\tlargeAmountConfirmations = _largeAmountConfirmations;\\n\\t\\temit ConfirmationsChanged(_smallAmountConfirmations, _mediumAmountConfirmations, _largeAmountConfirmations);\\n\\t}\\n\\n\\tfunction getConfirmations() external view override\\n\\t\\treturns (\\n\\t\\tuint256 smallAmount,\\n\\t\\tuint256 mediumAmount,\\n\\t\\tuint256 largeAmount\\n\\t) {\\n\\t\\treturn (smallAmountConfirmations, mediumAmountConfirmations, largeAmountConfirmations);\\n\\t}\\n\\n}\\n\",\"keccak256\":\"0x1a797098e5b85585c7386202b0901d86d08dc3d6224d3bae3e650a257a2fcea8\",\"license\":\"MIT\"},\"contracts/interface/IAllowTokens.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\ninterface IAllowTokens {\\n\\n\\tstruct Limits {\\n\\t\\tuint256 min;\\n\\t\\tuint256 max;\\n\\t\\tuint256 daily;\\n\\t\\tuint256 mediumAmount;\\n\\t\\tuint256 largeAmount;\\n\\t}\\n\\n\\tstruct TokenInfo {\\n\\t\\tbool allowed;\\n\\t\\tuint256 typeId;\\n\\t\\tuint256 spentToday;\\n\\t\\tuint256 lastDay;\\n\\t}\\n\\n\\tstruct TypeInfo {\\n\\t\\tstring description;\\n\\t\\tLimits limits;\\n\\t}\\n\\n\\tstruct TokensAndType {\\n\\t\\taddress token;\\n\\t\\tuint256 typeId;\\n\\t}\\n\\n\\tfunction version() external pure returns (string memory);\\n\\n\\tfunction getInfoAndLimits(address token) external view returns (TokenInfo memory info, Limits memory limit);\\n\\n\\tfunction calcMaxWithdraw(address token) external view returns (uint256 maxWithdraw);\\n\\n\\tfunction getTypesLimits() external view returns(Limits[] memory limits);\\n\\n\\tfunction getTypeDescriptionsLength() external view returns(uint256);\\n\\n\\tfunction getTypeDescriptions() external view returns(string[] memory descriptions);\\n\\n\\tfunction setToken(address token, uint256 typeId) external;\\n\\n\\tfunction getConfirmations() external view returns (uint256 smallAmount, uint256 mediumAmount, uint256 largeAmount);\\n\\n\\tfunction isTokenAllowed(address token) external view returns (bool);\\n\\n\\tfunction updateTokenTransfer(address token, uint256 amount) external;\\n}\",\"keccak256\":\"0x7a68f098e5efaad2d9d84314b2df76897fa9dbbe65c64d629b02b1dc4d9d36b5\",\"license\":\"MIT\"},\"contracts/zeppelin/GSN/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n\\n function _msgSender() internal view returns (address payable) {\\n return payable(msg.sender);\\n }\\n\\n function _msgData() internal view returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x6f3f274a2270bfe073339370edfa2485e2d515a2656039937f6b972fae96d297\",\"license\":\"MIT\"},\"contracts/zeppelin/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n return sub(a, b, \\\"SafeMath: subtraction overflow\\\");\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n * - Subtraction cannot overflow.\\n *\\n * _Available since v2.4.0._\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers. Reverts on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n return div(a, b, \\\"SafeMath: division by zero\\\");\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers. Reverts with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n *\\n * _Available since v2.4.0._\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n // Solidity only automatically asserts when dividing by 0\\n require(b > 0, errorMessage);\\n uint256 c = a / b;\\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * Reverts when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n return mod(a, b, \\\"SafeMath: modulo by zero\\\");\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * Reverts with custom message when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n *\\n * _Available since v2.4.0._\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b != 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0x8038a6eca31e013b0c7f248c7a4eb5846ab0d52bb3f7636fafcf00b075643afe\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @title Initializable\\n *\\n * @dev Helper contract to support initializer functions. To use it, replace\\n * the constructor with a function that has the `initializer` modifier.\\n * WARNING: Unlike constructors, initializer functions must be manually\\n * invoked. This applies both to deploying an Initializable contract, as well\\n * as extending an Initializable contract via inheritance.\\n * WARNING: When used with inheritance, manual care must be taken to not invoke\\n * a parent initializer twice, or ensure that all initializers are idempotent,\\n * because this is not dealt with automatically as with constructors.\\n */\\ncontract Initializable {\\n\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private initializing;\\n\\n /**\\n * @dev Modifier to use in the initializer function of a contract.\\n */\\n modifier initializer() {\\n require(initializing || !initialized, \\\"Contract instance is already initialized\\\");\\n\\n bool isTopLevelCall = !initializing;\\n if (isTopLevelCall) {\\n initializing = true;\\n initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n initializing = false;\\n }\\n }\\n\\n // Reserved storage space to allow for layout changes in the future.\\n uint256[50] private ______gap;\\n}\",\"keccak256\":\"0x14063a689bff5eecf0f36cb519feb575f60349ecf0d425ead5b931b77dd599d4\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/ownership/UpgradableOwnable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"../Initializable.sol\\\";\\n\\nimport \\\"../../GSN/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be aplied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract UpgradableOwnable is Initializable, Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function initialize(address sender) public initializer {\\n _owner = sender;\\n emit OwnershipTransferred(address(0), _owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(isOwner(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the caller is the current owner.\\n */\\n function isOwner() public view returns (bool) {\\n return _msgSender() == _owner;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * > Note: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public onlyOwner {\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n */\\n function _transferOwnership(address newOwner) internal {\\n require(newOwner != address(0), \\\"Ownable: new owner is zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n\\n}\\n\",\"keccak256\":\"0xdf439a167ae82e7e3dd241ea0c831a1bb0329432ceb4fa889778d1f2d196ce00\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/ownership/UpgradableSecondary.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"../Initializable.sol\\\";\\n\\nimport \\\"../../GSN/Context.sol\\\";\\n\\n/**\\n * @dev A Secondary contract can only be used by its primary account (the one that created it).\\n */\\ncontract UpgradableSecondary is Initializable, Context {\\n address private _primary;\\n\\n /**\\n * @dev Emitted when the primary contract changes.\\n */\\n event PrimaryTransferred(\\n address recipient\\n );\\n\\n /**\\n * @dev Sets the primary account to the one that is creating the Secondary contract.\\n */\\n function __Secondary_init(address sender) public initializer {\\n _primary = sender;\\n emit PrimaryTransferred(_primary);\\n }\\n\\n /**\\n * @dev Reverts if called from any account other than the primary.\\n */\\n modifier onlyPrimary() {\\n require(_msgSender() == _primary, \\\"Secondary: caller is not the primary account\\\");\\n _;\\n }\\n\\n /**\\n * @return the address of the primary.\\n */\\n function primary() public view returns (address) {\\n return _primary;\\n }\\n\\n /**\\n * @dev Transfers contract to a new primary.\\n * @param recipient The address of new primary.\\n */\\n function transferPrimary(address recipient) public onlyPrimary {\\n require(recipient != address(0), \\\"Secondary: new primary is the zero address\\\");\\n _primary = recipient;\\n emit PrimaryTransferred(recipient);\\n }\\n\\n}\",\"keccak256\":\"0x3dc61c8d0ab62fff2c3d1c56a5e2dbb20be7d0a11947463d86572afec5a1fe27\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5061243c806100206000396000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c806390469a9d1161010f578063c6dbdf61116100a2578063e744092e11610071578063e744092e14610488578063f2fde38b146104e3578063f5dab711146104f6578063f9eaee0d1461051657600080fd5b8063c6dbdf6114610449578063d4164b5d1461045a578063d7516faa1461046d578063e4f89ae41461047557600080fd5b8063b348a29f116100de578063b348a29f146103ec578063bb698dad146103ff578063c361ce8314610412578063c4d66de81461043657600080fd5b806390469a9d1461039c5780639d27d226146103af578063a81a8b1f146103d0578063adfeb5eb146103d957600080fd5b8063601ad4c9116101875780638c34bc55116101565780638c34bc551461033c5780638da5cb5b1461034f5780638de52dd7146103745780638f32d59b1461037d57600080fd5b8063601ad4c914610305578063715018a61461031857806378bf2b53146103205780637d496be91461033357600080fd5b8063250540cf116101c3578063250540cf146102aa5780633777804f146102bd57806353a8b574146102d257806354fd4d50146102e757600080fd5b806307fc9eb9146101f55780630a9763d71461025f5780631c21a08f146102755780632348238c14610295575b600080fd5b610232610203366004611bad565b603660205260009081526040902080546001820154600283015460038401546004909401549293919290919085565b604080519586526020860194909452928401919091526060830152608082015260a0015b60405180910390f35b61026760fa81565b604051908152602001610256565b610288610283366004611bad565b610529565b6040516102569190611c13565b6102a86102a3366004611c42565b6105d5565b005b6102676102b8366004611c42565b6106ce565b6102c56106f2565b6040516102569190611c5d565b6102da610807565b6040516102569190611cd6565b604080518082019091526002815261763160f01b6020820152610288565b6102a8610313366004611d38565b61093e565b6102a8610978565b6102a861032e366004611d64565b6109ec565b61026760395481565b6102a861034a366004611d64565b610b49565b6033546001600160a01b03165b6040516001600160a01b039091168152602001610256565b61026760385481565b6033546001600160a01b031633145b6040519015158152602001610256565b6102a86103aa366004611c42565b610d27565b6103c26103bd366004611c42565b610e1b565b604051610256929190611d8e565b61026760375481565b6102a86103e7366004611c42565b610ee0565b6102a86103fa366004611eca565b610f9e565b61026761040d366004611ef7565b610fd2565b60375460385460395460408051938452602084019290925290820152606001610256565b6102a8610444366004611c42565b611057565b6034546001600160a01b031661035c565b6102a8610468366004611f86565b61110c565b603a54610267565b6102a8610483366004612164565b6111ff565b6104c1610496366004611c42565b603560205260009081526040902080546001820154600283015460039093015460ff90921692909184565b6040805194151585526020850193909352918301526060820152608001610256565b6102a86104f1366004611c42565b6112df565b610509610504366004611c42565b611315565b60405161025691906121d9565b61038c610524366004611c42565b611395565b603a818154811061053957600080fd5b90600052602060002001600091509050805461055490612206565b80601f016020809104026020016040519081016040528092919081815260200182805461058090612206565b80156105cd5780601f106105a2576101008083540402835291602001916105cd565b820191906000526020600020905b8154815290600101906020018083116105b057829003601f168201915b505050505081565b6034546001600160a01b0316336001600160a01b0316146106115760405162461bcd60e51b81526004016106089061223b565b60405180910390fd5b6001600160a01b03811661067a5760405162461bcd60e51b815260206004820152602a60248201527f5365636f6e646172793a206e6577207072696d61727920697320746865207a65604482015269726f206164647265737360b01b6064820152608401610608565b603480546001600160a01b0319166001600160a01b0383169081179091556040519081527f4101e71e974f68df5e9730cc223280b41654676bbb052cdcc735c3337e64d2d99060200160405180910390a150565b60008060006106dc84610e1b565b915091506106ea82826113d1565b949350505050565b603a5460609067ffffffffffffffff81111561071057610710611dea565b60405190808252806020026020018201604052801561077357816020015b6107606040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b81526020019060019003908161072e5790505b50905060005b603a5481101561080357603660008281526020019081526020016000206040518060a0016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820154815250508282815181106107e5576107e5612287565b602002602001018190525080806107fb906122b3565b915050610779565b5090565b603a5460609067ffffffffffffffff81111561082557610825611dea565b60405190808252806020026020018201604052801561085857816020015b60608152602001906001900390816108435790505b50905060005b603a5481101561080357603a818154811061087b5761087b612287565b90600052602060002001805461089090612206565b80601f01602080910402602001604051908101604052809291908181526020018280546108bc90612206565b80156109095780601f106108de57610100808354040283529160200191610909565b820191906000526020600020905b8154815290600101906020018083116108ec57829003601f168201915b505050505082828151811061092057610920612287565b60200260200101819052508080610936906122b3565b91505061085e565b6033546001600160a01b031633146109685760405162461bcd60e51b8152600401610608906122ce565b61097383838361143b565b505050565b6033546001600160a01b031633146109a25760405162461bcd60e51b8152600401610608906122ce565b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b816001600160a01b038116610a135760405162461bcd60e51b815260040161060890612303565b6033546001600160a01b0316331480610a3657506034546001600160a01b031633145b610a825760405162461bcd60e51b815260206004820181905260248201527f416c6c6f77546f6b656e733a20756e617574686f72697a65642073656e6465726044820152606401610608565b603a548210610ade5760405162461bcd60e51b815260206004820152602260248201527f416c6c6f77546f6b656e733a2074797065496420646f6573206e6f74206578696044820152611cdd60f21b6064820152608401610608565b6000610ae984611315565b60018152602081018490529050610b008482611568565b836001600160a01b03167f720764556647dd167f4229d6a4255ac86018e302a50fc29dd67a70edb7b314d084604051610b3b91815260200190565b60405180910390a250505050565b6034546001600160a01b0316336001600160a01b031614610b7c5760405162461bcd60e51b81526004016106089061223b565b600080610b8884610e1b565b91509150610b9584611395565b610be15760405162461bcd60e51b815260206004820152601c60248201527f416c6c6f77546f6b656e733a204e6f742077686974656c6973746564000000006044820152606401610608565b8051831015610c325760405162461bcd60e51b815260206004820152601d60248201527f416c6c6f77546f6b656e733a204c6f776572207468616e206c696d69740000006044820152606401610608565b6060820151610c44906201518061233a565b421115610c5957426060830152600060408301525b6000610c6583836113d1565b905080841115610cb75760405162461bcd60e51b815260206004820152601b60248201527f416c6c6f77546f6b656e733a204578636565646564206c696d697400000000006044820152606401610608565b6040830151610cc69085611623565b6040840152610cd58584611568565b6060830151604080850151815192835260208301526001600160a01b038716917f84480cc6a063ffd72c3eddf21e3ffd30db3e2b8e386ec3abf09c98ee9e0e8d34910160405180910390a25050505050565b806001600160a01b038116610d4e5760405162461bcd60e51b815260040161060890612303565b6033546001600160a01b03163314610d785760405162461bcd60e51b8152600401610608906122ce565b6000610d8383611315565b8051909150610dd45760405162461bcd60e51b815260206004820152601860248201527f416c6c6f77546f6b656e733a204e6f7420416c6c6f77656400000000000000006044820152606401610608565b60008152610de28382611568565b6040516001600160a01b038416907fbf996b4fd74f0c7159bb017b1db415b0d9a6f13129f46d0b93309d170b78df3190600090a2505050565b610e4860405180608001604052806000151581526020016000815260200160008152602001600081525090565b610e7a6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b610e8383611315565b915060366000836020015181526020019081526020016000206040518060a0016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820154815250509050915091565b600054610100900460ff1680610ef9575060005460ff16155b610f155760405162461bcd60e51b815260040161060890612352565b600054610100900460ff16158015610f37576000805461ffff19166101011790555b603480546001600160a01b0319166001600160a01b0384169081179091556040519081527f4101e71e974f68df5e9730cc223280b41654676bbb052cdcc735c3337e64d2d99060200160405180910390a18015610f9a576000805461ff00191690555b5050565b6033546001600160a01b03163314610fc85760405162461bcd60e51b8152600401610608906122ce565b610f9a8282611682565b6033546000906001600160a01b03163314610fff5760405162461bcd60e51b8152600401610608906122ce565b61104d84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611048925050503685900385018561239a565b611923565b90505b9392505050565b600054610100900460ff1680611070575060005460ff16155b61108c5760405162461bcd60e51b815260040161060890612352565b600054610100900460ff161580156110ae576000805461ffff19166101011790555b603380546001600160a01b0319166001600160a01b0384169081179091556040516000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a38015610f9a576000805461ff00191690555050565b600054610100900460ff1680611125575060005460ff16155b6111415760405162461bcd60e51b815260040161060890612352565b600054610100900460ff16158015611163576000805461ffff19166101011790555b61116c87611057565b61117586610ee0565b61118085858561143b565b60005b82518110156111e3576111d08382815181106111a1576111a1612287565b6020026020010151600001518483815181106111bf576111bf612287565b602002602001015160200151611923565b506111dc81600161233a565b9050611183565b5080156111f6576000805461ff00191690555b50505050505050565b6033546001600160a01b031633146112295760405162461bcd60e51b8152600401610608906122ce565b806112765760405162461bcd60e51b815260206004820152601960248201527f416c6c6f77546f6b656e733a20656d70747920746f6b656e73000000000000006044820152606401610608565b60005b81811015610973576112cd83838381811061129657611296612287565b6112ac9260206040909202019081019150611c42565b8484848181106112be576112be612287565b905060400201602001356109ec565b6112d881600161233a565b9050611279565b6033546001600160a01b031633146113095760405162461bcd60e51b8152600401610608906122ce565b61131281611a60565b50565b61134260405180608001604052806000151581526020016000815260200160008152602001600081525090565b506001600160a01b03166000908152603560209081526040918290208251608081018452815460ff1615158152600182015492810192909252600281015492820192909252600390910154606082015290565b6000816001600160a01b0381166113be5760405162461bcd60e51b815260040161060890612303565b6113c783611315565b5191505b50919050565b60008260600151620151806113e6919061233a565b4211156113f557600060408401525b826040015182604001511161140c57506000611435565b8260400151826040015161142091906123b6565b90508160200151811115611435575060208101515b92915050565b818311156114a75760405162461bcd60e51b815260206004820152603360248201527f416c6c6f77546f6b656e733a20736d616c6c20626967676572207468616e206d604482015272656469756d20636f6e6669726d6174696f6e7360681b6064820152608401610608565b808211156115135760405162461bcd60e51b815260206004820152603360248201527f416c6c6f77546f6b656e733a206d656469756d20626967676572207468616e206044820152726c6172676520636f6e6669726d6174696f6e7360681b6064820152608401610608565b60378390556038829055603981905560408051848152602081018490529081018290527ffcc55d4aea72e6d2d439843942c59b3141c952375a217e381f6a40e0b5ac42199060600160405180910390a1505050565b6033546001600160a01b031633148061158b57506034546001600160a01b031633145b6115d75760405162461bcd60e51b815260206004820181905260248201527f416c6c6f77546f6b656e733a20756e617574686f72697a65642073656e6465726044820152606401610608565b6001600160a01b03919091166000908152603560209081526040918290208351815460ff1916901515178155908301516001820155908201516002820155606090910151600390910155565b600080611630838561233a565b9050838110156110505760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610608565b603a5482106116e55760405162461bcd60e51b815260206004820152602960248201527f416c6c6f77546f6b656e733a20626967676572207468616e20747970654465736044820152686372697074696f6e7360b81b6064820152608401610608565b8051602082015110156117505760405162461bcd60e51b815260206004820152602d60248201527f416c6c6f77546f6b656e733a206d6178546f6b656e7320736d616c6c6572207460448201526c68616e206d696e546f6b656e7360981b6064820152608401610608565b8060200151816040015110156117bf5760405162461bcd60e51b815260206004820152602e60248201527f416c6c6f77546f6b656e733a206461696c794c696d697420736d616c6c65722060448201526d7468616e206d6178546f6b656e7360901b6064820152608401610608565b805160608201511161182d5760405162461bcd60e51b815260206004820152603160248201527f416c6c6f77546f6b656e733a206c696d6974732e6d656469756d416d6f756e746044820152701039b6b0b63632b9103a3430b71036b4b760791b6064820152608401610608565b80606001518160800151116118aa5760405162461bcd60e51b815260206004820152603960248201527f416c6c6f77546f6b656e733a206c696d6974732e6c61726765416d6f756e742060448201527f736d616c6c6572207468616e206d656469756d416d6f756e74000000000000006064820152608401610608565b600082815260366020908152604091829020835181559083015160018201558183015160028201556060830151600382015560808301516004909101555182907f1d2b256bb06ebc298b1980410a5e3b1e9bc4be642e8f26a58dc8a97d7fe2bbbb906119179084906123cd565b60405180910390a25050565b6000808351116119755760405162461bcd60e51b815260206004820152601e60248201527f416c6c6f77546f6b656e733a20456d707479206465736372697074696f6e00006044820152606401610608565b50603a5460fa61198682600161233a565b11156119d45760405162461bcd60e51b815260206004820152601e60248201527f416c6c6f77546f6b656e733a2052656163686564204d41585f545950455300006044820152606401610608565b603a80546001810182556000919091528351611a17917fa2999d817b6757290b50e8ecf3fa939673403dd35c97de392fdb343b4015ce9e01906020860190611b1d565b50611a228183611682565b807fb30844b47136a66c1307afd352145423a1c237692b6ba474578f06f4614b35a084604051611a529190611c13565b60405180910390a292915050565b6001600160a01b038116611ac15760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a206e6577206f776e6572206973207a65726f206164647265604482015261737360f01b6064820152608401610608565b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b828054611b2990612206565b90600052602060002090601f016020900481019282611b4b5760008555611b91565b82601f10611b6457805160ff1916838001178555611b91565b82800160010185558215611b91579182015b82811115611b91578251825591602001919060010190611b76565b506108039291505b808211156108035760008155600101611b99565b600060208284031215611bbf57600080fd5b5035919050565b6000815180845260005b81811015611bec57602081850181015186830182015201611bd0565b81811115611bfe576000602083870101525b50601f01601f19169290920160200192915050565b6020815260006110506020830184611bc6565b80356001600160a01b0381168114611c3d57600080fd5b919050565b600060208284031215611c5457600080fd5b61105082611c26565b6020808252825182820181905260009190848201906040850190845b81811015611cca57611cb783855180518252602081015160208301526040810151604083015260608101516060830152608081015160808301525050565b9284019260a09290920191600101611c79565b50909695505050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611d2b57603f19888603018452611d19858351611bc6565b94509285019290850190600101611cfd565b5092979650505050505050565b600080600060608486031215611d4d57600080fd5b505081359360208301359350604090920135919050565b60008060408385031215611d7757600080fd5b611d8083611c26565b946020939093013593505050565b82511515815260208084015181830152604080850151818401526060808601518185015284516080808601919091529285015160a08501529084015160c084015283015160e08301528201516101008201526101208101611050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715611e2357611e23611dea565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611e5257611e52611dea565b604052919050565b600060a08284031215611e6c57600080fd5b60405160a0810181811067ffffffffffffffff82111715611e8f57611e8f611dea565b806040525080915082358152602083013560208201526040830135604082015260608301356060820152608083013560808201525092915050565b60008060c08385031215611edd57600080fd5b82359150611eee8460208501611e5a565b90509250929050565b600080600083850360c0811215611f0d57600080fd5b843567ffffffffffffffff80821115611f2557600080fd5b818701915087601f830112611f3957600080fd5b813581811115611f4857600080fd5b886020828501011115611f5a57600080fd5b60209290920195509093505060a0601f1982011215611f7857600080fd5b506020840190509250925092565b60008060008060008060c08789031215611f9f57600080fd5b611fa887611c26565b9550611fb660208801611c26565b945060408701359350606087013592506080870135915067ffffffffffffffff60a08801351115611fe657600080fd5b60a0870135870188601f820112611ffc57600080fd5b67ffffffffffffffff8135111561201557612015611dea565b6120256020823560051b01611e29565b81358082526020808301929160051b8401018b101561204357600080fd5b602083015b6020843560051b8501018110156121535767ffffffffffffffff8135111561206f57600080fd5b8035840160c0818e03601f1901121561208757600080fd5b61208f611e00565b67ffffffffffffffff602083013511156120a857600080fd5b8d603f6020840135840101126120bd57600080fd5b6020808301358301013567ffffffffffffffff8111156120df576120df611dea565b6120f2601f8201601f1916602001611e29565b8181528f604083602087013587010101111561210d57600080fd5b8160406020860135860101602083013760006020838301015280835250506121388e60408401611e5a565b60208201528085525050602083019250602081019050612048565b508093505050509295509295509295565b6000806020838503121561217757600080fd5b823567ffffffffffffffff8082111561218f57600080fd5b818501915085601f8301126121a357600080fd5b8135818111156121b257600080fd5b8660208260061b85010111156121c757600080fd5b60209290920196919550909350505050565b81511515815260208083015190820152604080830151908201526060808301519082015260808101611435565b600181811c9082168061221a57607f821691505b602082108114156113cb57634e487b7160e01b600052602260045260246000fd5b6020808252602c908201527f5365636f6e646172793a2063616c6c6572206973206e6f74207468652070726960408201526b1b585c9e481858d8dbdd5b9d60a21b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156122c7576122c761229d565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526019908201527f416c6c6f77546f6b656e733a204e756c6c204164647265737300000000000000604082015260600190565b6000821982111561234d5761234d61229d565b500190565b60208082526028908201527f436f6e747261637420696e7374616e636520697320616c726561647920696e696040820152671d1a585b1a5e995960c21b606082015260800190565b600060a082840312156123ac57600080fd5b6110508383611e5a565b6000828210156123c8576123c861229d565b500390565b60a0810161143582848051825260208101516020830152604081015160408301526060810151606083015260808101516080830152505056fea2646970667358221220523a51d2401e28d050fe1fdfceb55f1ad54b63d70c677f91baa2f885a48ea79b64736f6c63430008090033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101f05760003560e01c806390469a9d1161010f578063c6dbdf61116100a2578063e744092e11610071578063e744092e14610488578063f2fde38b146104e3578063f5dab711146104f6578063f9eaee0d1461051657600080fd5b8063c6dbdf6114610449578063d4164b5d1461045a578063d7516faa1461046d578063e4f89ae41461047557600080fd5b8063b348a29f116100de578063b348a29f146103ec578063bb698dad146103ff578063c361ce8314610412578063c4d66de81461043657600080fd5b806390469a9d1461039c5780639d27d226146103af578063a81a8b1f146103d0578063adfeb5eb146103d957600080fd5b8063601ad4c9116101875780638c34bc55116101565780638c34bc551461033c5780638da5cb5b1461034f5780638de52dd7146103745780638f32d59b1461037d57600080fd5b8063601ad4c914610305578063715018a61461031857806378bf2b53146103205780637d496be91461033357600080fd5b8063250540cf116101c3578063250540cf146102aa5780633777804f146102bd57806353a8b574146102d257806354fd4d50146102e757600080fd5b806307fc9eb9146101f55780630a9763d71461025f5780631c21a08f146102755780632348238c14610295575b600080fd5b610232610203366004611bad565b603660205260009081526040902080546001820154600283015460038401546004909401549293919290919085565b604080519586526020860194909452928401919091526060830152608082015260a0015b60405180910390f35b61026760fa81565b604051908152602001610256565b610288610283366004611bad565b610529565b6040516102569190611c13565b6102a86102a3366004611c42565b6105d5565b005b6102676102b8366004611c42565b6106ce565b6102c56106f2565b6040516102569190611c5d565b6102da610807565b6040516102569190611cd6565b604080518082019091526002815261763160f01b6020820152610288565b6102a8610313366004611d38565b61093e565b6102a8610978565b6102a861032e366004611d64565b6109ec565b61026760395481565b6102a861034a366004611d64565b610b49565b6033546001600160a01b03165b6040516001600160a01b039091168152602001610256565b61026760385481565b6033546001600160a01b031633145b6040519015158152602001610256565b6102a86103aa366004611c42565b610d27565b6103c26103bd366004611c42565b610e1b565b604051610256929190611d8e565b61026760375481565b6102a86103e7366004611c42565b610ee0565b6102a86103fa366004611eca565b610f9e565b61026761040d366004611ef7565b610fd2565b60375460385460395460408051938452602084019290925290820152606001610256565b6102a8610444366004611c42565b611057565b6034546001600160a01b031661035c565b6102a8610468366004611f86565b61110c565b603a54610267565b6102a8610483366004612164565b6111ff565b6104c1610496366004611c42565b603560205260009081526040902080546001820154600283015460039093015460ff90921692909184565b6040805194151585526020850193909352918301526060820152608001610256565b6102a86104f1366004611c42565b6112df565b610509610504366004611c42565b611315565b60405161025691906121d9565b61038c610524366004611c42565b611395565b603a818154811061053957600080fd5b90600052602060002001600091509050805461055490612206565b80601f016020809104026020016040519081016040528092919081815260200182805461058090612206565b80156105cd5780601f106105a2576101008083540402835291602001916105cd565b820191906000526020600020905b8154815290600101906020018083116105b057829003601f168201915b505050505081565b6034546001600160a01b0316336001600160a01b0316146106115760405162461bcd60e51b81526004016106089061223b565b60405180910390fd5b6001600160a01b03811661067a5760405162461bcd60e51b815260206004820152602a60248201527f5365636f6e646172793a206e6577207072696d61727920697320746865207a65604482015269726f206164647265737360b01b6064820152608401610608565b603480546001600160a01b0319166001600160a01b0383169081179091556040519081527f4101e71e974f68df5e9730cc223280b41654676bbb052cdcc735c3337e64d2d99060200160405180910390a150565b60008060006106dc84610e1b565b915091506106ea82826113d1565b949350505050565b603a5460609067ffffffffffffffff81111561071057610710611dea565b60405190808252806020026020018201604052801561077357816020015b6107606040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b81526020019060019003908161072e5790505b50905060005b603a5481101561080357603660008281526020019081526020016000206040518060a0016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820154815250508282815181106107e5576107e5612287565b602002602001018190525080806107fb906122b3565b915050610779565b5090565b603a5460609067ffffffffffffffff81111561082557610825611dea565b60405190808252806020026020018201604052801561085857816020015b60608152602001906001900390816108435790505b50905060005b603a5481101561080357603a818154811061087b5761087b612287565b90600052602060002001805461089090612206565b80601f01602080910402602001604051908101604052809291908181526020018280546108bc90612206565b80156109095780601f106108de57610100808354040283529160200191610909565b820191906000526020600020905b8154815290600101906020018083116108ec57829003601f168201915b505050505082828151811061092057610920612287565b60200260200101819052508080610936906122b3565b91505061085e565b6033546001600160a01b031633146109685760405162461bcd60e51b8152600401610608906122ce565b61097383838361143b565b505050565b6033546001600160a01b031633146109a25760405162461bcd60e51b8152600401610608906122ce565b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b816001600160a01b038116610a135760405162461bcd60e51b815260040161060890612303565b6033546001600160a01b0316331480610a3657506034546001600160a01b031633145b610a825760405162461bcd60e51b815260206004820181905260248201527f416c6c6f77546f6b656e733a20756e617574686f72697a65642073656e6465726044820152606401610608565b603a548210610ade5760405162461bcd60e51b815260206004820152602260248201527f416c6c6f77546f6b656e733a2074797065496420646f6573206e6f74206578696044820152611cdd60f21b6064820152608401610608565b6000610ae984611315565b60018152602081018490529050610b008482611568565b836001600160a01b03167f720764556647dd167f4229d6a4255ac86018e302a50fc29dd67a70edb7b314d084604051610b3b91815260200190565b60405180910390a250505050565b6034546001600160a01b0316336001600160a01b031614610b7c5760405162461bcd60e51b81526004016106089061223b565b600080610b8884610e1b565b91509150610b9584611395565b610be15760405162461bcd60e51b815260206004820152601c60248201527f416c6c6f77546f6b656e733a204e6f742077686974656c6973746564000000006044820152606401610608565b8051831015610c325760405162461bcd60e51b815260206004820152601d60248201527f416c6c6f77546f6b656e733a204c6f776572207468616e206c696d69740000006044820152606401610608565b6060820151610c44906201518061233a565b421115610c5957426060830152600060408301525b6000610c6583836113d1565b905080841115610cb75760405162461bcd60e51b815260206004820152601b60248201527f416c6c6f77546f6b656e733a204578636565646564206c696d697400000000006044820152606401610608565b6040830151610cc69085611623565b6040840152610cd58584611568565b6060830151604080850151815192835260208301526001600160a01b038716917f84480cc6a063ffd72c3eddf21e3ffd30db3e2b8e386ec3abf09c98ee9e0e8d34910160405180910390a25050505050565b806001600160a01b038116610d4e5760405162461bcd60e51b815260040161060890612303565b6033546001600160a01b03163314610d785760405162461bcd60e51b8152600401610608906122ce565b6000610d8383611315565b8051909150610dd45760405162461bcd60e51b815260206004820152601860248201527f416c6c6f77546f6b656e733a204e6f7420416c6c6f77656400000000000000006044820152606401610608565b60008152610de28382611568565b6040516001600160a01b038416907fbf996b4fd74f0c7159bb017b1db415b0d9a6f13129f46d0b93309d170b78df3190600090a2505050565b610e4860405180608001604052806000151581526020016000815260200160008152602001600081525090565b610e7a6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b610e8383611315565b915060366000836020015181526020019081526020016000206040518060a0016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820154815250509050915091565b600054610100900460ff1680610ef9575060005460ff16155b610f155760405162461bcd60e51b815260040161060890612352565b600054610100900460ff16158015610f37576000805461ffff19166101011790555b603480546001600160a01b0319166001600160a01b0384169081179091556040519081527f4101e71e974f68df5e9730cc223280b41654676bbb052cdcc735c3337e64d2d99060200160405180910390a18015610f9a576000805461ff00191690555b5050565b6033546001600160a01b03163314610fc85760405162461bcd60e51b8152600401610608906122ce565b610f9a8282611682565b6033546000906001600160a01b03163314610fff5760405162461bcd60e51b8152600401610608906122ce565b61104d84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611048925050503685900385018561239a565b611923565b90505b9392505050565b600054610100900460ff1680611070575060005460ff16155b61108c5760405162461bcd60e51b815260040161060890612352565b600054610100900460ff161580156110ae576000805461ffff19166101011790555b603380546001600160a01b0319166001600160a01b0384169081179091556040516000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a38015610f9a576000805461ff00191690555050565b600054610100900460ff1680611125575060005460ff16155b6111415760405162461bcd60e51b815260040161060890612352565b600054610100900460ff16158015611163576000805461ffff19166101011790555b61116c87611057565b61117586610ee0565b61118085858561143b565b60005b82518110156111e3576111d08382815181106111a1576111a1612287565b6020026020010151600001518483815181106111bf576111bf612287565b602002602001015160200151611923565b506111dc81600161233a565b9050611183565b5080156111f6576000805461ff00191690555b50505050505050565b6033546001600160a01b031633146112295760405162461bcd60e51b8152600401610608906122ce565b806112765760405162461bcd60e51b815260206004820152601960248201527f416c6c6f77546f6b656e733a20656d70747920746f6b656e73000000000000006044820152606401610608565b60005b81811015610973576112cd83838381811061129657611296612287565b6112ac9260206040909202019081019150611c42565b8484848181106112be576112be612287565b905060400201602001356109ec565b6112d881600161233a565b9050611279565b6033546001600160a01b031633146113095760405162461bcd60e51b8152600401610608906122ce565b61131281611a60565b50565b61134260405180608001604052806000151581526020016000815260200160008152602001600081525090565b506001600160a01b03166000908152603560209081526040918290208251608081018452815460ff1615158152600182015492810192909252600281015492820192909252600390910154606082015290565b6000816001600160a01b0381166113be5760405162461bcd60e51b815260040161060890612303565b6113c783611315565b5191505b50919050565b60008260600151620151806113e6919061233a565b4211156113f557600060408401525b826040015182604001511161140c57506000611435565b8260400151826040015161142091906123b6565b90508160200151811115611435575060208101515b92915050565b818311156114a75760405162461bcd60e51b815260206004820152603360248201527f416c6c6f77546f6b656e733a20736d616c6c20626967676572207468616e206d604482015272656469756d20636f6e6669726d6174696f6e7360681b6064820152608401610608565b808211156115135760405162461bcd60e51b815260206004820152603360248201527f416c6c6f77546f6b656e733a206d656469756d20626967676572207468616e206044820152726c6172676520636f6e6669726d6174696f6e7360681b6064820152608401610608565b60378390556038829055603981905560408051848152602081018490529081018290527ffcc55d4aea72e6d2d439843942c59b3141c952375a217e381f6a40e0b5ac42199060600160405180910390a1505050565b6033546001600160a01b031633148061158b57506034546001600160a01b031633145b6115d75760405162461bcd60e51b815260206004820181905260248201527f416c6c6f77546f6b656e733a20756e617574686f72697a65642073656e6465726044820152606401610608565b6001600160a01b03919091166000908152603560209081526040918290208351815460ff1916901515178155908301516001820155908201516002820155606090910151600390910155565b600080611630838561233a565b9050838110156110505760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610608565b603a5482106116e55760405162461bcd60e51b815260206004820152602960248201527f416c6c6f77546f6b656e733a20626967676572207468616e20747970654465736044820152686372697074696f6e7360b81b6064820152608401610608565b8051602082015110156117505760405162461bcd60e51b815260206004820152602d60248201527f416c6c6f77546f6b656e733a206d6178546f6b656e7320736d616c6c6572207460448201526c68616e206d696e546f6b656e7360981b6064820152608401610608565b8060200151816040015110156117bf5760405162461bcd60e51b815260206004820152602e60248201527f416c6c6f77546f6b656e733a206461696c794c696d697420736d616c6c65722060448201526d7468616e206d6178546f6b656e7360901b6064820152608401610608565b805160608201511161182d5760405162461bcd60e51b815260206004820152603160248201527f416c6c6f77546f6b656e733a206c696d6974732e6d656469756d416d6f756e746044820152701039b6b0b63632b9103a3430b71036b4b760791b6064820152608401610608565b80606001518160800151116118aa5760405162461bcd60e51b815260206004820152603960248201527f416c6c6f77546f6b656e733a206c696d6974732e6c61726765416d6f756e742060448201527f736d616c6c6572207468616e206d656469756d416d6f756e74000000000000006064820152608401610608565b600082815260366020908152604091829020835181559083015160018201558183015160028201556060830151600382015560808301516004909101555182907f1d2b256bb06ebc298b1980410a5e3b1e9bc4be642e8f26a58dc8a97d7fe2bbbb906119179084906123cd565b60405180910390a25050565b6000808351116119755760405162461bcd60e51b815260206004820152601e60248201527f416c6c6f77546f6b656e733a20456d707479206465736372697074696f6e00006044820152606401610608565b50603a5460fa61198682600161233a565b11156119d45760405162461bcd60e51b815260206004820152601e60248201527f416c6c6f77546f6b656e733a2052656163686564204d41585f545950455300006044820152606401610608565b603a80546001810182556000919091528351611a17917fa2999d817b6757290b50e8ecf3fa939673403dd35c97de392fdb343b4015ce9e01906020860190611b1d565b50611a228183611682565b807fb30844b47136a66c1307afd352145423a1c237692b6ba474578f06f4614b35a084604051611a529190611c13565b60405180910390a292915050565b6001600160a01b038116611ac15760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a206e6577206f776e6572206973207a65726f206164647265604482015261737360f01b6064820152608401610608565b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b828054611b2990612206565b90600052602060002090601f016020900481019282611b4b5760008555611b91565b82601f10611b6457805160ff1916838001178555611b91565b82800160010185558215611b91579182015b82811115611b91578251825591602001919060010190611b76565b506108039291505b808211156108035760008155600101611b99565b600060208284031215611bbf57600080fd5b5035919050565b6000815180845260005b81811015611bec57602081850181015186830182015201611bd0565b81811115611bfe576000602083870101525b50601f01601f19169290920160200192915050565b6020815260006110506020830184611bc6565b80356001600160a01b0381168114611c3d57600080fd5b919050565b600060208284031215611c5457600080fd5b61105082611c26565b6020808252825182820181905260009190848201906040850190845b81811015611cca57611cb783855180518252602081015160208301526040810151604083015260608101516060830152608081015160808301525050565b9284019260a09290920191600101611c79565b50909695505050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611d2b57603f19888603018452611d19858351611bc6565b94509285019290850190600101611cfd565b5092979650505050505050565b600080600060608486031215611d4d57600080fd5b505081359360208301359350604090920135919050565b60008060408385031215611d7757600080fd5b611d8083611c26565b946020939093013593505050565b82511515815260208084015181830152604080850151818401526060808601518185015284516080808601919091529285015160a08501529084015160c084015283015160e08301528201516101008201526101208101611050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715611e2357611e23611dea565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611e5257611e52611dea565b604052919050565b600060a08284031215611e6c57600080fd5b60405160a0810181811067ffffffffffffffff82111715611e8f57611e8f611dea565b806040525080915082358152602083013560208201526040830135604082015260608301356060820152608083013560808201525092915050565b60008060c08385031215611edd57600080fd5b82359150611eee8460208501611e5a565b90509250929050565b600080600083850360c0811215611f0d57600080fd5b843567ffffffffffffffff80821115611f2557600080fd5b818701915087601f830112611f3957600080fd5b813581811115611f4857600080fd5b886020828501011115611f5a57600080fd5b60209290920195509093505060a0601f1982011215611f7857600080fd5b506020840190509250925092565b60008060008060008060c08789031215611f9f57600080fd5b611fa887611c26565b9550611fb660208801611c26565b945060408701359350606087013592506080870135915067ffffffffffffffff60a08801351115611fe657600080fd5b60a0870135870188601f820112611ffc57600080fd5b67ffffffffffffffff8135111561201557612015611dea565b6120256020823560051b01611e29565b81358082526020808301929160051b8401018b101561204357600080fd5b602083015b6020843560051b8501018110156121535767ffffffffffffffff8135111561206f57600080fd5b8035840160c0818e03601f1901121561208757600080fd5b61208f611e00565b67ffffffffffffffff602083013511156120a857600080fd5b8d603f6020840135840101126120bd57600080fd5b6020808301358301013567ffffffffffffffff8111156120df576120df611dea565b6120f2601f8201601f1916602001611e29565b8181528f604083602087013587010101111561210d57600080fd5b8160406020860135860101602083013760006020838301015280835250506121388e60408401611e5a565b60208201528085525050602083019250602081019050612048565b508093505050509295509295509295565b6000806020838503121561217757600080fd5b823567ffffffffffffffff8082111561218f57600080fd5b818501915085601f8301126121a357600080fd5b8135818111156121b257600080fd5b8660208260061b85010111156121c757600080fd5b60209290920196919550909350505050565b81511515815260208083015190820152604080830151908201526060808301519082015260808101611435565b600181811c9082168061221a57607f821691505b602082108114156113cb57634e487b7160e01b600052602260045260246000fd5b6020808252602c908201527f5365636f6e646172793a2063616c6c6572206973206e6f74207468652070726960408201526b1b585c9e481858d8dbdd5b9d60a21b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156122c7576122c761229d565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526019908201527f416c6c6f77546f6b656e733a204e756c6c204164647265737300000000000000604082015260600190565b6000821982111561234d5761234d61229d565b500190565b60208082526028908201527f436f6e747261637420696e7374616e636520697320616c726561647920696e696040820152671d1a585b1a5e995960c21b606082015260800190565b600060a082840312156123ac57600080fd5b6110508383611e5a565b6000828210156123c8576123c861229d565b500390565b60a0810161143582848051825260208101516020830152604081015160408301526060810151606083015260808101516080830152505056fea2646970667358221220523a51d2401e28d050fe1fdfceb55f1ad54b63d70c677f91baa2f885a48ea79b64736f6c63430008090033", + "devdoc": { + "kind": "dev", + "methods": { + "__Secondary_init(address)": { + "details": "Sets the primary account to the one that is creating the Secondary contract." + }, + "initialize(address)": { + "details": "Initializes the contract setting the deployer as the initial owner." + }, + "isOwner()": { + "details": "Returns true if the caller is the current owner." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "primary()": { + "returns": { + "_0": "the address of the primary." + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. > Note: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "transferPrimary(address)": { + "details": "Transfers contract to a new primary.", + "params": { + "recipient": "The address of new primary." + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 15921, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "initialized", + "offset": 0, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 15924, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 15964, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "______gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 16210, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 16343, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "_primary", + "offset": 0, + "slot": "52", + "type": "t_address" + }, + { + "astId": 32, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "allowedTokens", + "offset": 0, + "slot": "53", + "type": "t_mapping(t_address,t_struct(TokenInfo)8146_storage)" + }, + { + "astId": 37, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "typeLimits", + "offset": 0, + "slot": "54", + "type": "t_mapping(t_uint256,t_struct(Limits)8137_storage)" + }, + { + "astId": 39, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "smallAmountConfirmations", + "offset": 0, + "slot": "55", + "type": "t_uint256" + }, + { + "astId": 41, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "mediumAmountConfirmations", + "offset": 0, + "slot": "56", + "type": "t_uint256" + }, + { + "astId": 43, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "largeAmountConfirmations", + "offset": 0, + "slot": "57", + "type": "t_uint256" + }, + { + "astId": 46, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "typeDescriptions", + "offset": 0, + "slot": "58", + "type": "t_array(t_string_storage)dyn_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_string_storage)dyn_storage": { + "base": "t_string_storage", + "encoding": "dynamic_array", + "label": "string[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_struct(TokenInfo)8146_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct IAllowTokens.TokenInfo)", + "numberOfBytes": "32", + "value": "t_struct(TokenInfo)8146_storage" + }, + "t_mapping(t_uint256,t_struct(Limits)8137_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct IAllowTokens.Limits)", + "numberOfBytes": "32", + "value": "t_struct(Limits)8137_storage" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Limits)8137_storage": { + "encoding": "inplace", + "label": "struct IAllowTokens.Limits", + "members": [ + { + "astId": 8128, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "min", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 8130, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "max", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 8132, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "daily", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 8134, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "mediumAmount", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 8136, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "largeAmount", + "offset": 0, + "slot": "4", + "type": "t_uint256" + } + ], + "numberOfBytes": "160" + }, + "t_struct(TokenInfo)8146_storage": { + "encoding": "inplace", + "label": "struct IAllowTokens.TokenInfo", + "members": [ + { + "astId": 8139, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "allowed", + "offset": 0, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 8141, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "typeId", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 8143, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "spentToday", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 8145, + "contract": "contracts/AllowTokens/AllowTokens.sol:AllowTokens", + "label": "lastDay", + "offset": 0, + "slot": "3", + "type": "t_uint256" + } + ], + "numberOfBytes": "128" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/bridge/deployments/goerli/AllowTokensProxy.json b/bridge/deployments/goerli/AllowTokensProxy.json new file mode 100644 index 000000000..6a39e333e --- /dev/null +++ b/bridge/deployments/goerli/AllowTokensProxy.json @@ -0,0 +1,427 @@ +{ + "address": "0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xf664d0a789bbe314dc0f28bb3621b6ae24db954c76df15319ddb1b1445e62c31", + "receipt": { + "to": null, + "from": "0xa554d96413FF72E93437C4072438302C38350EE3", + "contractAddress": "0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED", + "transactionIndex": 1, + "gasUsed": "1744501", + "logsBloom": "0x04000000000000000000000000010000000000000000200000800000000000000000008000000000000040000100000000002000020400000000000000040000000010000000000000000000000000000001000100040000000000000000000008000000020000000000810000000800000000000000000000000000000000400000000400000000000000000004001000000800000000000000000000000000000000000000000000000100000004000000002002800000002000080000400000000000000004000000000000000000000008008000000000000000000060200000000080000000000000000000000000000000008000000000000000100000", + "blockHash": "0x9a7ae63eb5f640b6d3c46a9b6fc503eb2380d4792bb995074b91804274d6915d", + "transactionHash": "0xf664d0a789bbe314dc0f28bb3621b6ae24db954c76df15319ddb1b1445e62c31", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 7664856, + "transactionHash": "0xf664d0a789bbe314dc0f28bb3621b6ae24db954c76df15319ddb1b1445e62c31", + "address": "0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000a554d96413ff72e93437c4072438302c38350ee3" + ], + "data": "0x", + "logIndex": 10, + "blockHash": "0x9a7ae63eb5f640b6d3c46a9b6fc503eb2380d4792bb995074b91804274d6915d" + }, + { + "transactionIndex": 1, + "blockNumber": 7664856, + "transactionHash": "0xf664d0a789bbe314dc0f28bb3621b6ae24db954c76df15319ddb1b1445e62c31", + "address": "0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED", + "topics": [ + "0x4101e71e974f68df5e9730cc223280b41654676bbb052cdcc735c3337e64d2d9" + ], + "data": "0x000000000000000000000000a3acf79aded2dd5e2a8bd2e3d1e9f797e96972d3", + "logIndex": 11, + "blockHash": "0x9a7ae63eb5f640b6d3c46a9b6fc503eb2380d4792bb995074b91804274d6915d" + }, + { + "transactionIndex": 1, + "blockNumber": 7664856, + "transactionHash": "0xf664d0a789bbe314dc0f28bb3621b6ae24db954c76df15319ddb1b1445e62c31", + "address": "0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED", + "topics": [ + "0xfcc55d4aea72e6d2d439843942c59b3141c952375a217e381f6a40e0b5ac4219" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000028", + "logIndex": 12, + "blockHash": "0x9a7ae63eb5f640b6d3c46a9b6fc503eb2380d4792bb995074b91804274d6915d" + }, + { + "transactionIndex": 1, + "blockNumber": 7664856, + "transactionHash": "0xf664d0a789bbe314dc0f28bb3621b6ae24db954c76df15319ddb1b1445e62c31", + "address": "0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED", + "topics": [ + "0x1d2b256bb06ebc298b1980410a5e3b1e9bc4be642e8f26a58dc8a97d7fe2bbbb", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "data": "0x00000000000000000000000000000000000000000000000000005af3107a40000000000000000000000000000000000000000000000000015af1d78b58c400000000000000000000000000000000000000000000000000056bc75e2d63100000000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000000000016345785d8a0000", + "logIndex": 13, + "blockHash": "0x9a7ae63eb5f640b6d3c46a9b6fc503eb2380d4792bb995074b91804274d6915d" + }, + { + "transactionIndex": 1, + "blockNumber": 7664856, + "transactionHash": "0xf664d0a789bbe314dc0f28bb3621b6ae24db954c76df15319ddb1b1445e62c31", + "address": "0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED", + "topics": [ + "0xb30844b47136a66c1307afd352145423a1c237692b6ba474578f06f4614b35a0", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000", + "logIndex": 14, + "blockHash": "0x9a7ae63eb5f640b6d3c46a9b6fc503eb2380d4792bb995074b91804274d6915d" + }, + { + "transactionIndex": 1, + "blockNumber": 7664856, + "transactionHash": "0xf664d0a789bbe314dc0f28bb3621b6ae24db954c76df15319ddb1b1445e62c31", + "address": "0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED", + "topics": [ + "0x1d2b256bb06ebc298b1980410a5e3b1e9bc4be642e8f26a58dc8a97d7fe2bbbb", + "0x0000000000000000000000000000000000000000000000000000000000000001" + ], + "data": "0x0000000000000000000000000000000000000000000000000001c6bf52634000000000000000000000000000000000000000000000000028a857425466f800000000000000000000000000000000000000000000000000a2a15d09519be00000000000000000000000000000000000000000000000000000006a94d74f4300000000000000000000000000000000000000000000000000000429d069189e0000", + "logIndex": 15, + "blockHash": "0x9a7ae63eb5f640b6d3c46a9b6fc503eb2380d4792bb995074b91804274d6915d" + }, + { + "transactionIndex": 1, + "blockNumber": 7664856, + "transactionHash": "0xf664d0a789bbe314dc0f28bb3621b6ae24db954c76df15319ddb1b1445e62c31", + "address": "0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED", + "topics": [ + "0xb30844b47136a66c1307afd352145423a1c237692b6ba474578f06f4614b35a0", + "0x0000000000000000000000000000000000000000000000000000000000000001" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000034554480000000000000000000000000000000000000000000000000000000000", + "logIndex": 16, + "blockHash": "0x9a7ae63eb5f640b6d3c46a9b6fc503eb2380d4792bb995074b91804274d6915d" + }, + { + "transactionIndex": 1, + "blockNumber": 7664856, + "transactionHash": "0xf664d0a789bbe314dc0f28bb3621b6ae24db954c76df15319ddb1b1445e62c31", + "address": "0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED", + "topics": [ + "0x1d2b256bb06ebc298b1980410a5e3b1e9bc4be642e8f26a58dc8a97d7fe2bbbb", + "0x0000000000000000000000000000000000000000000000000000000000000002" + ], + "data": "0x00000000000000000000000000000000000000000000000000038d7ea4c680000000000000000000000000000000000000000000000000878678326eac90000000000000000000000000000000000000000000000000010f0cf064dd59200000000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000000000016345785d8a0000", + "logIndex": 17, + "blockHash": "0x9a7ae63eb5f640b6d3c46a9b6fc503eb2380d4792bb995074b91804274d6915d" + }, + { + "transactionIndex": 1, + "blockNumber": 7664856, + "transactionHash": "0xf664d0a789bbe314dc0f28bb3621b6ae24db954c76df15319ddb1b1445e62c31", + "address": "0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED", + "topics": [ + "0xb30844b47136a66c1307afd352145423a1c237692b6ba474578f06f4614b35a0", + "0x0000000000000000000000000000000000000000000000000000000000000002" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000083c31303030757364000000000000000000000000000000000000000000000000", + "logIndex": 18, + "blockHash": "0x9a7ae63eb5f640b6d3c46a9b6fc503eb2380d4792bb995074b91804274d6915d" + }, + { + "transactionIndex": 1, + "blockNumber": 7664856, + "transactionHash": "0xf664d0a789bbe314dc0f28bb3621b6ae24db954c76df15319ddb1b1445e62c31", + "address": "0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED", + "topics": [ + "0x1d2b256bb06ebc298b1980410a5e3b1e9bc4be642e8f26a58dc8a97d7fe2bbbb", + "0x0000000000000000000000000000000000000000000000000000000000000003" + ], + "data": "0x000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000054b40b1f852bda00000000000000000000000000000000000000000000000000a968163f0a57b4000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000008ac7230489e80000", + "logIndex": 19, + "blockHash": "0x9a7ae63eb5f640b6d3c46a9b6fc503eb2380d4792bb995074b91804274d6915d" + }, + { + "transactionIndex": 1, + "blockNumber": 7664856, + "transactionHash": "0xf664d0a789bbe314dc0f28bb3621b6ae24db954c76df15319ddb1b1445e62c31", + "address": "0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED", + "topics": [ + "0xb30844b47136a66c1307afd352145423a1c237692b6ba474578f06f4614b35a0", + "0x0000000000000000000000000000000000000000000000000000000000000003" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000073c31303075736400000000000000000000000000000000000000000000000000", + "logIndex": 20, + "blockHash": "0x9a7ae63eb5f640b6d3c46a9b6fc503eb2380d4792bb995074b91804274d6915d" + }, + { + "transactionIndex": 1, + "blockNumber": 7664856, + "transactionHash": "0xf664d0a789bbe314dc0f28bb3621b6ae24db954c76df15319ddb1b1445e62c31", + "address": "0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED", + "topics": [ + "0x1d2b256bb06ebc298b1980410a5e3b1e9bc4be642e8f26a58dc8a97d7fe2bbbb", + "0x0000000000000000000000000000000000000000000000000000000000000004" + ], + "data": "0x0000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000002116545850052128000000000000000000000000000000000000000000000000422ca8b0a00a4250000000000000000000000000000000000000000000000000000008ac7230489e800000000000000000000000000000000000000000000000000056bc75e2d63100000", + "logIndex": 21, + "blockHash": "0x9a7ae63eb5f640b6d3c46a9b6fc503eb2380d4792bb995074b91804274d6915d" + }, + { + "transactionIndex": 1, + "blockNumber": 7664856, + "transactionHash": "0xf664d0a789bbe314dc0f28bb3621b6ae24db954c76df15319ddb1b1445e62c31", + "address": "0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED", + "topics": [ + "0xb30844b47136a66c1307afd352145423a1c237692b6ba474578f06f4614b35a0", + "0x0000000000000000000000000000000000000000000000000000000000000004" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000053d31757364000000000000000000000000000000000000000000000000000000", + "logIndex": 22, + "blockHash": "0x9a7ae63eb5f640b6d3c46a9b6fc503eb2380d4792bb995074b91804274d6915d" + }, + { + "transactionIndex": 1, + "blockNumber": 7664856, + "transactionHash": "0xf664d0a789bbe314dc0f28bb3621b6ae24db954c76df15319ddb1b1445e62c31", + "address": "0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED", + "topics": [ + "0x1d2b256bb06ebc298b1980410a5e3b1e9bc4be642e8f26a58dc8a97d7fe2bbbb", + "0x0000000000000000000000000000000000000000000000000000000000000005" + ], + "data": "0x0000000000000000000000000000000000000000000000008ac7230489e80000000000000000000000000000000000000000000000cecb8f27f4200f3a0000000000000000000000000000000000000000000000019d971e4fe8401e740000000000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000003635c9adc5dea00000", + "logIndex": 23, + "blockHash": "0x9a7ae63eb5f640b6d3c46a9b6fc503eb2380d4792bb995074b91804274d6915d" + }, + { + "transactionIndex": 1, + "blockNumber": 7664856, + "transactionHash": "0xf664d0a789bbe314dc0f28bb3621b6ae24db954c76df15319ddb1b1445e62c31", + "address": "0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED", + "topics": [ + "0xb30844b47136a66c1307afd352145423a1c237692b6ba474578f06f4614b35a0", + "0x0000000000000000000000000000000000000000000000000000000000000005" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000053c31757364000000000000000000000000000000000000000000000000000000", + "logIndex": 24, + "blockHash": "0x9a7ae63eb5f640b6d3c46a9b6fc503eb2380d4792bb995074b91804274d6915d" + }, + { + "transactionIndex": 1, + "blockNumber": 7664856, + "transactionHash": "0xf664d0a789bbe314dc0f28bb3621b6ae24db954c76df15319ddb1b1445e62c31", + "address": "0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED", + "topics": [ + "0x1d2b256bb06ebc298b1980410a5e3b1e9bc4be642e8f26a58dc8a97d7fe2bbbb", + "0x0000000000000000000000000000000000000000000000000000000000000006" + ], + "data": "0x0000000000000000000000000000000000000000000000008ac7230489e80000000000000000000000000000000000000000000050c783eb9b5c85f2a80000000000000000000000000000000000000000000000a18f07d736b90be5500000000000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000003635c9adc5dea00000", + "logIndex": 25, + "blockHash": "0x9a7ae63eb5f640b6d3c46a9b6fc503eb2380d4792bb995074b91804274d6915d" + }, + { + "transactionIndex": 1, + "blockNumber": 7664856, + "transactionHash": "0xf664d0a789bbe314dc0f28bb3621b6ae24db954c76df15319ddb1b1445e62c31", + "address": "0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED", + "topics": [ + "0xb30844b47136a66c1307afd352145423a1c237692b6ba474578f06f4614b35a0", + "0x0000000000000000000000000000000000000000000000000000000000000006" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000063c3163656e740000000000000000000000000000000000000000000000000000", + "logIndex": 26, + "blockHash": "0x9a7ae63eb5f640b6d3c46a9b6fc503eb2380d4792bb995074b91804274d6915d" + } + ], + "blockNumber": 7664856, + "cumulativeGasUsed": "2042361", + "status": 1, + "byzantium": true + }, + "args": [ + "0x7bEfBB1bC878960bfd2F9318aAC721A2c61f6640", + "0x39055c999A8528535Af012F4F4CF7B548dD97481", + "0xd4164b5d000000000000000000000000a554d96413ff72e93437c4072438302c38350ee3000000000000000000000000a3acf79aded2dd5e2a8bd2e3d1e9f797e96972d3000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000003e000000000000000000000000000000000000000000000000000000000000004e000000000000000000000000000000000000000000000000000000000000005e000000000000000000000000000000000000000000000000000000000000006e000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000005af3107a40000000000000000000000000000000000000000000000000015af1d78b58c400000000000000000000000000000000000000000000000000056bc75e2d63100000000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000003425443000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000001c6bf52634000000000000000000000000000000000000000000000000028a857425466f800000000000000000000000000000000000000000000000000a2a15d09519be00000000000000000000000000000000000000000000000000000006a94d74f4300000000000000000000000000000000000000000000000000000429d069189e00000000000000000000000000000000000000000000000000000000000000000003455448000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000038d7ea4c680000000000000000000000000000000000000000000000000878678326eac90000000000000000000000000000000000000000000000000010f0cf064dd59200000000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000000000000000000000083c3130303075736400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000054b40b1f852bda00000000000000000000000000000000000000000000000000a968163f0a57b4000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000000000000000000000000073c3130307573640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000002116545850052128000000000000000000000000000000000000000000000000422ca8b0a00a4250000000000000000000000000000000000000000000000000000008ac7230489e800000000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000000053d3175736400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000008ac7230489e80000000000000000000000000000000000000000000000cecb8f27f4200f3a0000000000000000000000000000000000000000000000019d971e4fe8401e740000000000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000003635c9adc5dea0000000000000000000000000000000000000000000000000000000000000000000053c3175736400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000008ac7230489e80000000000000000000000000000000000000000000050c783eb9b5c85f2a80000000000000000000000000000000000000000000000a18f07d736b90be5500000000000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000003635c9adc5dea0000000000000000000000000000000000000000000000000000000000000000000063c3163656e740000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "caeb40de80c8668828546c6b3fb7fad2", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emitted when the admin account has changed.\"}},\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {UpgradeableProxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"stateVariables\":{\"_ADMIN_SLOT\":{\"details\":\"Storage slot with the admin of the contract. This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is validated in the constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/zeppelin/upgradable/proxy/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/zeppelin/upgradable/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback () external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive () external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {\\n }\\n}\\n\",\"keccak256\":\"0xdc0ebdc6f4ae0b5f9dd0a6c041a2238e4a7a2afbc6cef539437b0004ada42370\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/proxy/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"./UpgradeableProxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is UpgradeableProxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {UpgradeableProxy-constructor}.\\n */\\n constructor(address _logic, address admin_, bytes memory _data) payable UpgradeableProxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _setAdmin(admin_);\\n }\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _admin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _admin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n require(newAdmin != address(0), \\\"TransparentUpgradeableProxy: new admin is the zero address\\\");\\n emit AdminChanged(_admin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external virtual ifAdmin {\\n _upgradeTo(newImplementation);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable virtual ifAdmin {\\n _upgradeTo(newImplementation);\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address adm) {\\n bytes32 slot = _ADMIN_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n adm := sload(slot)\\n }\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n bytes32 slot = _ADMIN_SLOT;\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, newAdmin)\\n }\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _admin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x3327b21f85d71d3b9bad1a89267f08b19966e03446a18d810bd80fe42789ac5f\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/proxy/UpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"./Proxy.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n *\\n * Upgradeability is only provided internally through {_upgradeTo}. For an externally upgradeable proxy see\\n * {TransparentUpgradeableProxy}.\\n */\\ncontract UpgradeableProxy is Proxy {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _setImplementation(_logic);\\n if(_data.length > 0) {\\n Address.functionDelegateCall(_logic, _data);\\n }\\n }\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 private constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n bytes32 slot = _IMPLEMENTATION_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n impl := sload(slot)\\n }\\n }\\n\\n /**\\n * @dev Upgrades the proxy to a new implementation.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal virtual {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"UpgradeableProxy: new implementation is not a contract\\\");\\n\\n bytes32 slot = _IMPLEMENTATION_SLOT;\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, newImplementation)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb54322ec8ec142c149ad1f561aa2f0da6d6ea2d9f45639164088db9e16d5a69d\",\"license\":\"MIT\"},\"contracts/zeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x04801fc2398ee3370f3903f95389ea3a8da65a8df01f24b352e499e44d492e9b\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405162000d9138038062000d91833981016040819052620000269162000369565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd62000449565b60008051602062000d4a833981519152146200007557620000756200046f565b620000808262000112565b805115620000a1576200009f8282620001b360201b620003ba1760201c565b505b50620000d1905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610462000449565b60008051602062000d2a83398151915214620000f157620000f16200046f565b620001098260008051602062000d2a83398151915255565b505050620004d8565b6200012881620001e260201b620003e61760201c565b620001a05760405162461bcd60e51b815260206004820152603660248201527f5570677261646561626c6550726f78793a206e657720696d706c656d656e746160448201527f74696f6e206973206e6f74206120636f6e74726163740000000000000000000060648201526084015b60405180910390fd5b60008051602062000d4a83398151915255565b6060620001db838360405180606001604052806027815260200162000d6a60279139620001e8565b9392505050565b3b151590565b6060833b620002495760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840162000197565b600080856001600160a01b03168560405162000266919062000485565b600060405180830381855af49150503d8060008114620002a3576040519150601f19603f3d011682016040523d82523d6000602084013e620002a8565b606091505b509092509050620002bb828286620002c5565b9695505050505050565b60608315620002d6575081620001db565b825115620002e75782518084602001fd5b8160405162461bcd60e51b8152600401620001979190620004a3565b80516001600160a01b03811681146200031b57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035357818101518382015260200162000339565b8381111562000363576000848401525b50505050565b6000806000606084860312156200037f57600080fd5b6200038a8462000303565b92506200039a6020850162000303565b60408501519092506001600160401b0380821115620003b857600080fd5b818601915086601f830112620003cd57600080fd5b815181811115620003e257620003e262000320565b604051601f8201601f19908116603f011681019083821181831017156200040d576200040d62000320565b816040528281528960208487010111156200042757600080fd5b6200043a83602083016020880162000336565b80955050505050509250925092565b6000828210156200046a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b600082516200049981846020870162000336565b9190910192915050565b6020815260008251806020840152620004c481604085016020870162000336565b601f01601f19169190910160400192915050565b61084280620004e86000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106ac565b610138565b61005b6100933660046106c7565b610175565b3480156100a457600080fd5b506100ad6101fa565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106ac565b61025c565b3480156100f557600080fd5b506100ad610375565b6101066103ec565b6101366101317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b61048e565b565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b0316141561016d5761016a816104b2565b50565b61016a6100fe565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b031614156101ed576101a7836104b2565b6101e78383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103ba92505050565b50505050565b6101f56100fe565b505050565b60006102126000805160206107c68339815191525490565b6001600160a01b0316336001600160a01b0316141561025157507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6102596100fe565b90565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b0316141561016d576001600160a01b0381166103065760405162461bcd60e51b815260206004820152603a60248201527f5472616e73706172656e745570677261646561626c6550726f78793a206e657760448201527f2061646d696e20697320746865207a65726f206164647265737300000000000060648201526084015b60405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61033d6000805160206107c68339815191525490565b604080516001600160a01b03928316815291841660208301520160405180910390a161016a816000805160206107c683398151915255565b600061038d6000805160206107c68339815191525490565b6001600160a01b0316336001600160a01b0316141561025157506000805160206107c68339815191525490565b60606103df83836040518060600160405280602781526020016107e6602791396104f2565b9392505050565b3b151590565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b031614156101365760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4016102fd565b3660008037600080366000845af43d6000803e8080156104ad573d6000f35b3d6000fd5b6104bb816105c6565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060833b6105515760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102fd565b600080856001600160a01b03168560405161056c9190610776565b600060405180830381855af49150503d80600081146105a7576040519150601f19603f3d011682016040523d82523d6000602084013e6105ac565b606091505b50915091506105bc828286610657565b9695505050505050565b803b6106335760405162461bcd60e51b815260206004820152603660248201527f5570677261646561626c6550726f78793a206e657720696d706c656d656e74616044820152751d1a5bdb881a5cc81b9bdd08184818dbdb9d1c9858dd60521b60648201526084016102fd565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b606083156106665750816103df565b8251156106765782518084602001fd5b8160405162461bcd60e51b81526004016102fd9190610792565b80356001600160a01b03811681146106a757600080fd5b919050565b6000602082840312156106be57600080fd5b6103df82610690565b6000806000604084860312156106dc57600080fd5b6106e584610690565b9250602084013567ffffffffffffffff8082111561070257600080fd5b818601915086601f83011261071657600080fd5b81358181111561072557600080fd5b87602082850101111561073757600080fd5b6020830194508093505050509250925092565b60005b8381101561076557818101518382015260200161074d565b838111156101e75750506000910152565b6000825161078881846020870161074a565b9190910192915050565b60208152600082518060208401526107b181604085016020870161074a565b601f01601f1916919091016040019291505056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122001f23e5e5d70499e22926447138d9a73085390bf4c2f13e017a1d16843ca77ac64736f6c63430008090033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106ac565b610138565b61005b6100933660046106c7565b610175565b3480156100a457600080fd5b506100ad6101fa565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106ac565b61025c565b3480156100f557600080fd5b506100ad610375565b6101066103ec565b6101366101317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b61048e565b565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b0316141561016d5761016a816104b2565b50565b61016a6100fe565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b031614156101ed576101a7836104b2565b6101e78383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103ba92505050565b50505050565b6101f56100fe565b505050565b60006102126000805160206107c68339815191525490565b6001600160a01b0316336001600160a01b0316141561025157507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6102596100fe565b90565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b0316141561016d576001600160a01b0381166103065760405162461bcd60e51b815260206004820152603a60248201527f5472616e73706172656e745570677261646561626c6550726f78793a206e657760448201527f2061646d696e20697320746865207a65726f206164647265737300000000000060648201526084015b60405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61033d6000805160206107c68339815191525490565b604080516001600160a01b03928316815291841660208301520160405180910390a161016a816000805160206107c683398151915255565b600061038d6000805160206107c68339815191525490565b6001600160a01b0316336001600160a01b0316141561025157506000805160206107c68339815191525490565b60606103df83836040518060600160405280602781526020016107e6602791396104f2565b9392505050565b3b151590565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b031614156101365760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4016102fd565b3660008037600080366000845af43d6000803e8080156104ad573d6000f35b3d6000fd5b6104bb816105c6565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060833b6105515760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102fd565b600080856001600160a01b03168560405161056c9190610776565b600060405180830381855af49150503d80600081146105a7576040519150601f19603f3d011682016040523d82523d6000602084013e6105ac565b606091505b50915091506105bc828286610657565b9695505050505050565b803b6106335760405162461bcd60e51b815260206004820152603660248201527f5570677261646561626c6550726f78793a206e657720696d706c656d656e74616044820152751d1a5bdb881a5cc81b9bdd08184818dbdb9d1c9858dd60521b60648201526084016102fd565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b606083156106665750816103df565b8251156106765782518084602001fd5b8160405162461bcd60e51b81526004016102fd9190610792565b80356001600160a01b03811681146106a757600080fd5b919050565b6000602082840312156106be57600080fd5b6103df82610690565b6000806000604084860312156106dc57600080fd5b6106e584610690565b9250602084013567ffffffffffffffff8082111561070257600080fd5b818601915086601f83011261071657600080fd5b81358181111561072557600080fd5b87602082850101111561073757600080fd5b6020830194508093505050509250925092565b60005b8381101561076557818101518382015260200161074d565b838111156101e75750506000910152565b6000825161078881846020870161074a565b9190910192915050565b60208152600082518060208401526107b181604085016020870161074a565b601f01601f1916919091016040019291505056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122001f23e5e5d70499e22926447138d9a73085390bf4c2f13e017a1d16843ca77ac64736f6c63430008090033", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "events": { + "AdminChanged(address,address)": { + "details": "Emitted when the admin account has changed." + } + }, + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {UpgradeableProxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "stateVariables": { + "_ADMIN_SLOT": { + "details": "Storage slot with the admin of the contract. This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is validated in the constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/bridge/deployments/goerli/Bridge.json b/bridge/deployments/goerli/Bridge.json new file mode 100644 index 000000000..f638684df --- /dev/null +++ b/bridge/deployments/goerli/Bridge.json @@ -0,0 +1,2174 @@ +{ + "address": "0x5767040f92e6752085fB0FAC19C74557642d0F6E", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "_transactionHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "_originalTokenAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "_blockHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_logIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_originChainId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_destinationChainId", + "type": "uint256" + } + ], + "name": "AcceptedCrossTransfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_newAllowTokens", + "type": "address" + } + ], + "name": "AllowTokensChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "_transactionHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "_originalTokenAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "_blockHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_logIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "_reciever", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "_relayer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_destinationChainId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_originChainId", + "type": "uint256" + } + ], + "name": "Claimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_tokenAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_destinationChainId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_originChainId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_userData", + "type": "bytes" + } + ], + "name": "Cross", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_newFederation", + "type": "address" + } + ], + "name": "FederationChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "FeePercentageChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_newSideTokenAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_originalTokenAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "_newSymbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_granularity", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + } + ], + "name": "NewSideToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "PauserAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "PauserRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_newSideTokenFactory", + "type": "address" + } + ], + "name": "SideTokenFactoryChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "_isUpgrading", + "type": "bool" + } + ], + "name": "Upgrading", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_wrappedCurrency", + "type": "address" + } + ], + "name": "WrappedCurrencyChanged", + "type": "event" + }, + { + "inputs": [], + "name": "CLAIM_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "__Pausable_init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "__PauserRol_init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_originalTokenAddress", + "type": "address" + }, + { + "internalType": "address payable", + "name": "_from", + "type": "address" + }, + { + "internalType": "address payable", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_blockHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_transactionHash", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "_logIndex", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "_originChainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_destinationChainId", + "type": "uint256" + } + ], + "name": "acceptTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "addPauser", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "allowTokens", + "outputs": [ + { + "internalType": "contract IAllowTokens", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAllowTokens", + "type": "address" + } + ], + "name": "changeAllowTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newFederation", + "type": "address" + } + ], + "name": "changeFederation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newSideTokenFactory", + "type": "address" + } + ], + "name": "changeSideTokenFactory", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address payable", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "transactionHash", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "logIndex", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "originChainId", + "type": "uint256" + } + ], + "internalType": "struct IBridge.ClaimData", + "name": "_claimData", + "type": "tuple" + } + ], + "name": "claim", + "outputs": [ + { + "internalType": "uint256", + "name": "receivedAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address payable", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "transactionHash", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "logIndex", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "originChainId", + "type": "uint256" + } + ], + "internalType": "struct IBridge.ClaimData", + "name": "_claimData", + "type": "tuple" + } + ], + "name": "claimFallback", + "outputs": [ + { + "internalType": "uint256", + "name": "receivedAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address payable", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "transactionHash", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "logIndex", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "originChainId", + "type": "uint256" + } + ], + "internalType": "struct IBridge.ClaimData", + "name": "_claimData", + "type": "tuple" + }, + { + "internalType": "address payable", + "name": "_relayer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "_v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "_r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_s", + "type": "bytes32" + } + ], + "name": "claimGasless", + "outputs": [ + { + "internalType": "uint256", + "name": "receivedAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "claimed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "_typeId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_originalTokenAddress", + "type": "address" + }, + { + "internalType": "uint8", + "name": "_originalTokenDecimals", + "type": "uint8" + }, + { + "internalType": "string", + "name": "_originalTokenSymbol", + "type": "string" + }, + { + "internalType": "string", + "name": "_originalTokenName", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_originChainId", + "type": "uint256" + } + ], + "internalType": "struct IBridge.CreateSideTokenStruct[]", + "name": "createSideTokenStruct", + "type": "tuple[]" + } + ], + "name": "createMultipleSideTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_typeId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_originalTokenAddress", + "type": "address" + }, + { + "internalType": "uint8", + "name": "_originalTokenDecimals", + "type": "uint8" + }, + { + "internalType": "string", + "name": "_tokenSymbol", + "type": "string" + }, + { + "internalType": "string", + "name": "_tokenName", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_originChainId", + "type": "uint256" + } + ], + "name": "createSideToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "depositTo", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "deprecatedKnownTokens", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "deprecatedMappedTokens", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "deprecatedOriginalTokens", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "deprecatedSymbolPrefix", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "domainSeparator", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "feePercentageDivider", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getFederation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getFeePercentage", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sideToken", + "type": "address" + } + ], + "name": "getOriginalTokenBySideToken", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "originChainId", + "type": "uint256" + } + ], + "internalType": "struct IBridge.OriginalToken", + "name": "originalToken", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "_blockHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_transactionHash", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "_logIndex", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "_originChainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_destinationChainId", + "type": "uint256" + } + ], + "name": "getTransactionDataHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "transactionHash", + "type": "bytes32" + } + ], + "name": "hasBeenClaimed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "transactionHash", + "type": "bytes32" + } + ], + "name": "hasCrossed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initDomainSeparator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_federation", + "type": "address" + }, + { + "internalType": "address", + "name": "_allowTokens", + "type": "address" + }, + { + "internalType": "address", + "name": "_sideTokenFactory", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address payable", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "transactionHash", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "logIndex", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "originChainId", + "type": "uint256" + } + ], + "internalType": "struct IBridge.ClaimData", + "name": "_claimData", + "type": "tuple" + }, + { + "internalType": "bytes32", + "name": "transactionDataHashMultichain", + "type": "bytes32" + } + ], + "name": "isClaimed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "transactionDataHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "transactionDataHashMultichain", + "type": "bytes32" + } + ], + "name": "isClaimed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isOwner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "isPauser", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isUpgrading", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "originalToken", + "type": "address" + } + ], + "name": "knownToken", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "knownTokenByChain", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "originalTokenAddresses", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "originalTokenBySideToken", + "outputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "originChainId", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "destinationChainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenToUse", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "receiveTokensTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renouncePauser", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "senderAddresses", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "setFeePercentage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sideToken", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "originChainId", + "type": "uint256" + } + ], + "internalType": "struct IBridge.OriginalToken", + "name": "originalToken", + "type": "tuple" + } + ], + "name": "setOriginalTokenBySideTokenByChain", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "originalToken", + "type": "address" + }, + { + "internalType": "address", + "name": "sideToken", + "type": "address" + } + ], + "name": "setSideTokenByOriginalAddressByChain", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_isUpgrading", + "type": "bool" + } + ], + "name": "setUpgrading", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_wrappedCurrency", + "type": "address" + } + ], + "name": "setWrappedCurrency", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "originalToken", + "type": "address" + } + ], + "name": "sideTokenByOriginalToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "sideTokenByOriginalTokenByChain", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "sideTokenFactory", + "outputs": [ + { + "internalType": "contract ISideTokenFactory", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "tokensReceived", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "transactionsDataHashes", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "wrappedCurrency", + "outputs": [ + { + "internalType": "contract IWrapped", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xde2ab44479f4174e45909b81a9e6b3b6f0c8c23d5d56f8e8a8e22831f4f64c4f", + "receipt": { + "to": null, + "from": "0xa554d96413FF72E93437C4072438302C38350EE3", + "contractAddress": "0x5767040f92e6752085fB0FAC19C74557642d0F6E", + "transactionIndex": 1, + "gasUsed": "4394597", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xad0ec584741c58db253262be75aecdecad9a7a07e1cfe82f8981a4100c55c04f", + "transactionHash": "0xde2ab44479f4174e45909b81a9e6b3b6f0c8c23d5d56f8e8a8e22831f4f64c4f", + "logs": [], + "blockNumber": 7664848, + "cumulativeGasUsed": "4453713", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "b0b92d5309f21b72c82ad032fd7538bd", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_transactionHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_originalTokenAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_logIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_originChainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_destinationChainId\",\"type\":\"uint256\"}],\"name\":\"AcceptedCrossTransfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_newAllowTokens\",\"type\":\"address\"}],\"name\":\"AllowTokensChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_transactionHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_originalTokenAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_logIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_reciever\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_relayer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_destinationChainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_originChainId\",\"type\":\"uint256\"}],\"name\":\"Claimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_tokenAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_destinationChainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_originChainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_userData\",\"type\":\"bytes\"}],\"name\":\"Cross\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_newFederation\",\"type\":\"address\"}],\"name\":\"FederationChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"FeePercentageChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_newSideTokenAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_originalTokenAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_newSymbol\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_granularity\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"}],\"name\":\"NewSideToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"PauserAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"PauserRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_newSideTokenFactory\",\"type\":\"address\"}],\"name\":\"SideTokenFactoryChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_isUpgrading\",\"type\":\"bool\"}],\"name\":\"Upgrading\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_wrappedCurrency\",\"type\":\"address\"}],\"name\":\"WrappedCurrencyChanged\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CLAIM_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"__Pausable_init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"__PauserRol_init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_originalTokenAddress\",\"type\":\"address\"},{\"internalType\":\"address payable\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"address payable\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_transactionHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"_logIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_originChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_destinationChainId\",\"type\":\"uint256\"}],\"name\":\"acceptTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"addPauser\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"allowTokens\",\"outputs\":[{\"internalType\":\"contract IAllowTokens\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAllowTokens\",\"type\":\"address\"}],\"name\":\"changeAllowTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newFederation\",\"type\":\"address\"}],\"name\":\"changeFederation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newSideTokenFactory\",\"type\":\"address\"}],\"name\":\"changeSideTokenFactory\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address payable\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"transactionHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"logIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"originChainId\",\"type\":\"uint256\"}],\"internalType\":\"struct IBridge.ClaimData\",\"name\":\"_claimData\",\"type\":\"tuple\"}],\"name\":\"claim\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"receivedAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address payable\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"transactionHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"logIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"originChainId\",\"type\":\"uint256\"}],\"internalType\":\"struct IBridge.ClaimData\",\"name\":\"_claimData\",\"type\":\"tuple\"}],\"name\":\"claimFallback\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"receivedAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address payable\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"transactionHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"logIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"originChainId\",\"type\":\"uint256\"}],\"internalType\":\"struct IBridge.ClaimData\",\"name\":\"_claimData\",\"type\":\"tuple\"},{\"internalType\":\"address payable\",\"name\":\"_relayer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"_v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_s\",\"type\":\"bytes32\"}],\"name\":\"claimGasless\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"receivedAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"claimed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"_typeId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_originalTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"_originalTokenDecimals\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"_originalTokenSymbol\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_originalTokenName\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_originChainId\",\"type\":\"uint256\"}],\"internalType\":\"struct IBridge.CreateSideTokenStruct[]\",\"name\":\"createSideTokenStruct\",\"type\":\"tuple[]\"}],\"name\":\"createMultipleSideTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_typeId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_originalTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"_originalTokenDecimals\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"_tokenSymbol\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_tokenName\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_originChainId\",\"type\":\"uint256\"}],\"name\":\"createSideToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"depositTo\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"deprecatedKnownTokens\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"deprecatedMappedTokens\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"deprecatedOriginalTokens\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deprecatedSymbolPrefix\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"domainSeparator\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feePercentageDivider\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFederation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFeePercentage\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sideToken\",\"type\":\"address\"}],\"name\":\"getOriginalTokenBySideToken\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"originChainId\",\"type\":\"uint256\"}],\"internalType\":\"struct IBridge.OriginalToken\",\"name\":\"originalToken\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_transactionHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"_logIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_originChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_destinationChainId\",\"type\":\"uint256\"}],\"name\":\"getTransactionDataHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transactionHash\",\"type\":\"bytes32\"}],\"name\":\"hasBeenClaimed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transactionHash\",\"type\":\"bytes32\"}],\"name\":\"hasCrossed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initDomainSeparator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_federation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_allowTokens\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_sideTokenFactory\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address payable\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"transactionHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"logIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"originChainId\",\"type\":\"uint256\"}],\"internalType\":\"struct IBridge.ClaimData\",\"name\":\"_claimData\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"transactionDataHashMultichain\",\"type\":\"bytes32\"}],\"name\":\"isClaimed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transactionDataHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"transactionDataHashMultichain\",\"type\":\"bytes32\"}],\"name\":\"isClaimed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isOwner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"isPauser\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isUpgrading\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"originalToken\",\"type\":\"address\"}],\"name\":\"knownToken\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"knownTokenByChain\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"originalTokenAddresses\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"originalTokenBySideToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"originChainId\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"destinationChainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenToUse\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"receiveTokensTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renouncePauser\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"senderAddresses\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"setFeePercentage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sideToken\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"originChainId\",\"type\":\"uint256\"}],\"internalType\":\"struct IBridge.OriginalToken\",\"name\":\"originalToken\",\"type\":\"tuple\"}],\"name\":\"setOriginalTokenBySideTokenByChain\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"originalToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sideToken\",\"type\":\"address\"}],\"name\":\"setSideTokenByOriginalAddressByChain\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_isUpgrading\",\"type\":\"bool\"}],\"name\":\"setUpgrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_wrappedCurrency\",\"type\":\"address\"}],\"name\":\"setWrappedCurrency\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"originalToken\",\"type\":\"address\"}],\"name\":\"sideTokenByOriginalToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"sideTokenByOriginalTokenByChain\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sideTokenFactory\",\"outputs\":[{\"internalType\":\"contract ISideTokenFactory\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"userData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"tokensReceived\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"transactionsDataHashes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"wrappedCurrency\",\"outputs\":[{\"internalType\":\"contract IWrapped\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"__Pausable_init(address)\":{\"details\":\"Initializes the contract in unpaused state. Assigns the Pauser role to the deployer.\"},\"initialize(address)\":{\"details\":\"Initializes the contract setting the deployer as the initial owner.\"},\"isOwner()\":{\"details\":\"Returns true if the caller is the current owner.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pause()\":{\"details\":\"Called by a pauser to pause, triggers stopped state.\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. > Note: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"tokensReceived(address,address,address,uint256,bytes,bytes)\":{\"params\":{\"userData\":\"it can be 2 options in the first one you can send the receiver and the chain id of the destination const userData = web3.eth.abi.encodeParameters( [\\\"address\\\", \\\"uint256\\\"], [anAccount.toLowerCase(), chains.ETHEREUM_MAIN_NET_CHAIN_ID] ); or you also can send only the destination chain id, and the receiver would be the same as the from parameter const userData = web3.eth.abi.encodeParameters([\\\"uint256\\\"], [chains.ETHEREUM_MAIN_NET_CHAIN_ID]);\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unpause()\":{\"details\":\"Called by a pauser to unpause, returns to normal state.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"acceptTransfer(address,address,address,uint256,bytes32,bytes32,uint32,uint256,uint256)\":{\"notice\":\"Accepts the transaction from the other chain that was voted and sent by the Federation contract\"},\"claim((address,uint256,bytes32,bytes32,uint32,uint256))\":{\"notice\":\"Claims the crossed transaction using the hash, this sends the funds to the address indicated in\"},\"depositTo(uint256,address)\":{\"notice\":\"Use network currency and cross it.\"},\"receiveTokensTo(uint256,address,address,uint256)\":{\"notice\":\"ERC-20 tokens approve and transferFrom pattern See https://eips.ethereum.org/EIPS/eip-20#transferfrom\"},\"tokensReceived(address,address,address,uint256,bytes,bytes)\":{\"notice\":\"ERC-777 tokensReceived hook allows to send tokens to a contract and notify it in a single transaction See https://eips.ethereum.org/EIPS/eip-777#motivation for details\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Bridge/Bridge.sol\":\"Bridge\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/Bridge/Bridge.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n// import \\\"hardhat/console.sol\\\";\\n// Import base Initializable contract\\nimport \\\"../zeppelin/upgradable/Initializable.sol\\\";\\n// Import interface and library from OpenZeppelin contracts\\nimport \\\"../zeppelin/upgradable/utils/ReentrancyGuard.sol\\\";\\nimport \\\"../zeppelin/upgradable/lifecycle/UpgradablePausable.sol\\\";\\nimport \\\"../zeppelin/upgradable/ownership/UpgradableOwnable.sol\\\";\\n\\nimport \\\"../zeppelin/introspection/IERC1820Registry.sol\\\";\\nimport \\\"../zeppelin/token/ERC777/IERC777Recipient.sol\\\";\\nimport \\\"../zeppelin/token/ERC20/IERC20.sol\\\";\\nimport \\\"../zeppelin/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"../zeppelin/utils/Address.sol\\\";\\nimport \\\"../zeppelin/math/SafeMath.sol\\\";\\nimport \\\"../zeppelin/token/ERC777/IERC777.sol\\\";\\n\\nimport \\\"../lib/LibEIP712.sol\\\";\\nimport \\\"../lib/LibUtils.sol\\\";\\n\\nimport \\\"../interface/IBridge.sol\\\";\\nimport \\\"../interface/ISideToken.sol\\\";\\nimport \\\"../interface/ISideTokenFactory.sol\\\";\\nimport \\\"../interface/IAllowTokens.sol\\\";\\nimport \\\"../interface/IWrapped.sol\\\";\\n\\n// solhint-disable-next-line max-states-count\\ncontract Bridge is Initializable, IBridge, IERC777Recipient, UpgradablePausable, UpgradableOwnable, ReentrancyGuard {\\n\\tusing SafeMath for uint256;\\n\\tusing SafeERC20 for IERC20;\\n\\tusing Address for address;\\n\\n\\taddress constant internal NULL_ADDRESS = address(0);\\n\\tbytes32 constant internal NULL_HASH = bytes32(0);\\n\\tIERC1820Registry constant internal ERC1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);\\n\\n\\taddress internal federation;\\n\\tuint256 internal feePercentage;\\n\\tstring public deprecatedSymbolPrefix;\\n\\t// domainSeparator replaces uint256 internal _depprecatedLastDay;\\n\\tbytes32 public domainSeparator;\\n\\tuint256 internal _deprecatedSpentToday;\\n\\n\\tmapping (address => address) public deprecatedMappedTokens; // OriginalToken => SideToken\\n\\tmapping (address => address) public deprecatedOriginalTokens; // SideToken => OriginalToken\\n\\tmapping (address => bool) public deprecatedKnownTokens; // OriginalToken => true\\n\\n\\t// claimed can use the same of bytes32\\n\\tmapping (bytes32 => bool) public claimed; // transactionDataHash => true // previously named processed\\n\\n\\tIAllowTokens public allowTokens;\\n\\tISideTokenFactory public sideTokenFactory;\\n\\t//Bridge_v1 variables\\n\\tbool public isUpgrading;\\n\\t// Percentage with up to 2 decimals\\n\\tuint256 constant public feePercentageDivider = 10000; // solhint-disable-line const-name-snakecase\\n\\t//Bridge_v2 variables\\n\\tbytes32 constant internal _erc777Interface = keccak256(\\\"ERC777Token\\\"); // solhint-disable-line const-name-snakecase\\n\\tIWrapped public wrappedCurrency;\\n\\tmapping (bytes32 => bytes32) public transactionsDataHashes; // transactionHash => transactionDataHash\\n\\tmapping (bytes32 => address) public originalTokenAddresses; // transactionHash => originalTokenAddress\\n\\tmapping (bytes32 => address) public senderAddresses; // transactionHash => senderAddress\\n\\n\\t// keccak256(\\\"Claim(address to,uint256 amount,bytes32 transactionHash,uint256 originChainId,address relayer,uint256 fee,uint256 nonce,uint256 deadline)\\\");\\n\\tbytes32 public constant CLAIM_TYPEHASH = 0xaf3ac34fea9cc1b1def33a9bdc482d988feb61b5015ae4a55e2a62bb3600d54c;\\n\\tmapping(address => uint) public nonces;\\n\\n\\t//Bridge_v3 variables multichain\\n\\tmapping (uint256 => mapping(address => address)) public sideTokenByOriginalTokenByChain; // chainId => OriginalToken Address => SideToken Address\\n\\tmapping (address => OriginalToken) public originalTokenBySideToken; // SideTokenAddress => struct {}\\n\\tmapping (uint256 => mapping(address => bool)) public knownTokenByChain; // chainId => OriginalToken Address => Know\\n\\n\\tevent AllowTokensChanged(address _newAllowTokens);\\n\\tevent FederationChanged(address _newFederation);\\n\\tevent SideTokenFactoryChanged(address _newSideTokenFactory);\\n\\tevent Upgrading(bool _isUpgrading);\\n\\tevent WrappedCurrencyChanged(address _wrappedCurrency);\\n\\n\\tfunction initialize(\\n\\t\\taddress _manager,\\n\\t\\taddress _federation,\\n\\t\\taddress _allowTokens,\\n\\t\\taddress _sideTokenFactory\\n\\t) public initializer {\\n\\t\\tUpgradableOwnable.initialize(_manager);\\n\\t\\tUpgradablePausable.__Pausable_init(_manager);\\n\\t\\tallowTokens = IAllowTokens(_allowTokens);\\n\\t\\tsideTokenFactory = ISideTokenFactory(_sideTokenFactory);\\n\\t\\tfederation = _federation;\\n\\t\\t//keccak256(\\\"ERC777TokensRecipient\\\")\\n\\t\\tERC1820.setInterfaceImplementer(address(this), 0xb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b, address(this));\\n\\t\\tinitDomainSeparator();\\n\\t}\\n\\n\\treceive () external payable {\\n\\t\\t// The fallback function is needed to use WRBTC\\n\\t\\trequire(_msgSender() == address(wrappedCurrency), \\\"Bridge: not wrappedCurrency\\\");\\n\\t}\\n\\n\\tfunction version() override external pure returns (string memory) {\\n\\t\\treturn \\\"v4\\\";\\n\\t}\\n\\n\\tfunction initDomainSeparator() public {\\n\\t\\tdomainSeparator = LibEIP712.hashEIP712Domain(\\n\\t\\t\\t\\\"RSK Token Bridge\\\",\\n\\t\\t\\t\\\"1\\\",\\n\\t\\t\\tblock.chainid,\\n\\t\\t\\taddress(this)\\n\\t\\t);\\n\\t}\\n\\n\\tmodifier whenNotUpgrading() {\\n\\t\\trequire(!isUpgrading, \\\"Bridge: Upgrading\\\");\\n\\t\\t_;\\n\\t}\\n\\n\\tfunction shouldBeCurrentChainId(uint256 chainId) internal view {\\n\\t\\trequire(chainId == block.chainid, \\\"Bridge: Not block.chainid\\\");\\n\\t}\\n\\n\\tfunction sideTokenByOriginalToken(uint256 chainId, address originalToken) public view returns(address) {\\n\\t\\taddress sideTokenAddr = sideTokenByOriginalTokenByChain[chainId][originalToken];\\n\\n\\t\\tif (sideTokenAddr != NULL_ADDRESS) {\\n\\t\\t\\treturn sideTokenAddr;\\n\\t\\t}\\n\\n\\t\\t// specification for retrocompatibility\\n\\t\\treturn deprecatedMappedTokens[originalToken];\\n\\t}\\n\\n\\tfunction setSideTokenByOriginalAddressByChain(uint256 chainId, address originalToken, address sideToken) public onlyOwner {\\n\\t\\tsideTokenByOriginalTokenByChain[chainId][originalToken] = sideToken;\\n\\t}\\n\\n\\tfunction getOriginalTokenBySideToken(address sideToken) public view returns(OriginalToken memory originalToken) {\\n\\t\\toriginalToken = originalTokenBySideToken[sideToken];\\n\\t\\tif (originalToken.tokenAddress != NULL_ADDRESS) {\\n\\t\\t\\treturn originalToken;\\n\\t\\t}\\n\\n\\t\\t// specification for retrocompatibility\\n\\t\\toriginalToken.originChainId = 1; // ethereum main chain id\\n\\t\\toriginalToken.tokenAddress = deprecatedOriginalTokens[sideToken];\\n\\t\\treturn originalToken;\\n\\t}\\n\\n\\tfunction setOriginalTokenBySideTokenByChain(address sideToken, OriginalToken memory originalToken) public onlyOwner {\\n\\t\\toriginalTokenBySideToken[sideToken] = originalToken;\\n\\t}\\n\\n\\tfunction knownToken(uint256 chainId, address originalToken) public view returns(bool) {\\n\\t\\tbool knowToken = knownTokenByChain[chainId][originalToken];\\n\\t\\tif (knowToken) {\\n\\t\\t\\treturn knowToken;\\n\\t\\t}\\n\\n\\t\\t// specification for retrocompatibility\\n\\t\\treturn deprecatedKnownTokens[originalToken];\\n\\t}\\n\\n\\tfunction _setKnownTokenByChain(uint256 chainId, address originalToken, bool knownTokenValue) internal {\\n\\t\\tknownTokenByChain[chainId][originalToken] = knownTokenValue;\\n\\t}\\n\\n\\tfunction acceptTransfer(\\n\\t\\taddress _originalTokenAddress,\\n\\t\\taddress payable _from,\\n\\t\\taddress payable _to,\\n\\t\\tuint256 _amount,\\n\\t\\tbytes32 _blockHash,\\n\\t\\tbytes32 _transactionHash,\\n\\t\\tuint32 _logIndex,\\n\\t\\tuint256 _originChainId,\\n\\t\\tuint256\\t_destinationChainId\\n\\t) external whenNotPaused nonReentrant override {\\n\\t\\trequire(_msgSender() == federation, \\\"Bridge: Not Federation\\\");\\n\\t\\tcheckChainId(_originChainId);\\n\\t\\tshouldBeCurrentChainId(_destinationChainId);\\n\\t\\trequire(knownToken(_originChainId, _originalTokenAddress) ||\\n\\t\\t\\tsideTokenByOriginalToken(_originChainId, _originalTokenAddress) != NULL_ADDRESS,\\n\\t\\t\\t\\\"Bridge: Unknown token\\\"\\n\\t\\t);\\n\\t\\trequire(_to != NULL_ADDRESS, \\\"Bridge: Null To\\\");\\n\\t\\trequire(_amount > 0, \\\"Bridge: Amount 0\\\");\\n\\t\\trequire(_blockHash != NULL_HASH, \\\"Bridge: Null BlockHash\\\");\\n\\t\\trequire(_transactionHash != NULL_HASH, \\\"Bridge: Null TxHash\\\");\\n\\t\\trequire(transactionsDataHashes[_transactionHash] == bytes32(0), \\\"Bridge: Already accepted\\\");\\n\\n\\t\\tbytes32 _transactionDataHash = getTransactionDataHash(\\n\\t\\t\\t_to,\\n\\t\\t\\t_amount,\\n\\t\\t\\t_blockHash,\\n\\t\\t\\t_transactionHash,\\n\\t\\t\\t_logIndex\\n\\t\\t);\\n\\n\\t\\tbytes32 _transactionDataHashMultichain = getTransactionDataHash(\\n\\t\\t\\t_to,\\n\\t\\t\\t_amount,\\n\\t\\t\\t_blockHash,\\n\\t\\t\\t_transactionHash,\\n\\t\\t\\t_logIndex,\\n\\t\\t\\t_originChainId,\\n\\t\\t\\t_destinationChainId\\n\\t\\t);\\n\\t\\t// Do not remove, claimed also has the previously processed using the older bridge version\\n\\t\\t// https://github.com/rsksmart/tokenbridge/blob/TOKENBRIDGE-1.2.0/bridge/contracts/Bridge.sol#L41\\n\\t\\trequire(!isClaimed(_transactionDataHash, _transactionDataHashMultichain), \\\"Bridge: Already claimed\\\");\\n\\n\\t\\ttransactionsDataHashes[_transactionHash] = _transactionDataHashMultichain;\\n\\t\\toriginalTokenAddresses[_transactionHash] = _originalTokenAddress;\\n\\t\\tsenderAddresses[_transactionHash] = _from;\\n\\n\\t\\temit AcceptedCrossTransfer(\\n\\t\\t\\t_transactionHash,\\n\\t\\t\\t_originalTokenAddress,\\n\\t\\t\\t_to,\\n\\t\\t\\t_from,\\n\\t\\t\\t_amount,\\n\\t\\t\\t_blockHash,\\n\\t\\t\\t_logIndex,\\n\\t\\t\\t_originChainId,\\n\\t\\t\\t_destinationChainId\\n\\t\\t);\\n\\t}\\n\\n\\tfunction checkChainId(uint256 chainId) internal pure {\\n\\t\\trequire(chainId > 0, \\\"Bridge: ChainId is 0\\\");\\n\\t}\\n\\n\\tfunction _createSideToken(\\n\\t\\tuint256 _typeId,\\n\\t\\taddress _originalTokenAddress,\\n\\t\\tuint8 _originalTokenDecimals,\\n\\t\\tstring calldata _tokenSymbol,\\n\\t\\tstring calldata _tokenName,\\n\\t\\tuint256 _originChainId\\n\\t) internal {\\n\\t\\trequire(_originalTokenAddress != NULL_ADDRESS, \\\"Bridge: Null token\\\");\\n\\t\\tcheckChainId(_originChainId);\\n\\t\\taddress sideToken = sideTokenByOriginalToken(_originChainId, _originalTokenAddress);\\n\\t\\trequire(sideToken == NULL_ADDRESS, \\\"Bridge: Already exists\\\");\\n\\n\\t\\tuint256 granularity = LibUtils.decimalsToGranularity(_originalTokenDecimals);\\n\\n\\t\\t// Create side token\\n\\t\\tsideToken = sideTokenFactory.createSideToken(_tokenName, _tokenSymbol, granularity);\\n\\n\\t\\tsetSideTokenByOriginalAddressByChain(_originChainId, _originalTokenAddress, sideToken);\\n\\n\\t\\tOriginalToken memory originalToken;\\n\\t\\toriginalToken.originChainId = _originChainId;\\n\\t\\toriginalToken.tokenAddress = _originalTokenAddress;\\n\\t\\tsetOriginalTokenBySideTokenByChain(sideToken, originalToken);\\n\\t\\tallowTokens.setToken(sideToken, _typeId);\\n\\n\\t\\temit NewSideToken(sideToken, _originalTokenAddress, _tokenSymbol, granularity, _originChainId);\\n\\t}\\n\\n\\tfunction createSideToken(\\n\\t\\tuint256 _typeId,\\n\\t\\taddress _originalTokenAddress,\\n\\t\\tuint8 _originalTokenDecimals,\\n\\t\\tstring calldata _tokenSymbol,\\n\\t\\tstring calldata _tokenName,\\n\\t\\tuint256 _originChainId\\n\\t) external onlyOwner override {\\n\\t\\t_createSideToken(\\n\\t\\t\\t_typeId,\\n\\t\\t\\t_originalTokenAddress,\\n\\t\\t\\t_originalTokenDecimals,\\n\\t\\t\\t_tokenSymbol,\\n\\t\\t\\t_tokenName,\\n\\t\\t\\t_originChainId\\n\\t\\t);\\n\\t}\\n\\n\\tfunction createMultipleSideTokens(\\n\\t\\tCreateSideTokenStruct[] calldata createSideTokenStruct\\n\\t) external onlyOwner {\\n\\t\\tfor(uint256 i = 0; i < createSideTokenStruct.length; i++) {\\n\\t\\t\\t_createSideToken(\\n\\t\\t\\t\\tcreateSideTokenStruct[i]._typeId,\\n\\t\\t\\t\\tcreateSideTokenStruct[i]._originalTokenAddress,\\n\\t\\t\\t\\tcreateSideTokenStruct[i]._originalTokenDecimals,\\n\\t\\t\\t\\tcreateSideTokenStruct[i]._originalTokenSymbol,\\n\\t\\t\\t\\tcreateSideTokenStruct[i]._originalTokenName,\\n\\t\\t\\t\\tcreateSideTokenStruct[i]._originChainId\\n\\t\\t\\t);\\n\\t\\t}\\n\\t}\\n\\n\\tfunction claim(ClaimData calldata _claimData) external override returns (uint256 receivedAmount) {\\n\\t\\treceivedAmount = _claim(\\n\\t\\t\\t_claimData,\\n\\t\\t\\t_claimData.to,\\n\\t\\t\\tpayable(address(0)),\\n\\t\\t\\t0\\n\\t\\t);\\n\\t\\treturn receivedAmount;\\n\\t}\\n\\n\\tfunction claimFallback(ClaimData calldata _claimData) external override returns (uint256 receivedAmount) {\\n\\t\\trequire(_msgSender() == senderAddresses[_claimData.transactionHash],\\\"Bridge: invalid sender\\\");\\n\\t\\treceivedAmount = _claim(\\n\\t\\t\\t_claimData,\\n\\t\\t\\t_msgSender(),\\n\\t\\t\\tpayable(address(0)),\\n\\t\\t\\t0\\n\\t\\t);\\n\\t\\treturn receivedAmount;\\n\\t}\\n\\n\\tfunction getDigest(\\n\\t\\tClaimData memory _claimData,\\n\\t\\taddress payable _relayer,\\n\\t\\tuint256 _fee,\\n\\t\\tuint256 _deadline\\n\\t) internal returns (bytes32) {\\n\\t\\treturn LibEIP712.hashEIP712Message(\\n\\t\\t\\tdomainSeparator,\\n\\t\\t\\tkeccak256(\\n\\t\\t\\t\\tabi.encode(\\n\\t\\t\\t\\t\\tCLAIM_TYPEHASH,\\n\\t\\t\\t\\t\\t_claimData.to,\\n\\t\\t\\t\\t\\t_claimData.amount,\\n\\t\\t\\t\\t\\t_claimData.transactionHash,\\n\\t\\t\\t\\t\\t_claimData.originChainId,\\n\\t\\t\\t\\t\\t_relayer,\\n\\t\\t\\t\\t\\t_fee,\\n\\t\\t\\t\\t\\tnonces[_claimData.to]++,\\n\\t\\t\\t\\t\\t_deadline\\n\\t\\t\\t\\t)\\n\\t\\t\\t)\\n\\t\\t);\\n\\t}\\n\\n\\t// Inspired by https://github.com/dapphub/ds-dach/blob/master/src/dach.sol\\n\\tfunction claimGasless(\\n\\t\\tClaimData calldata _claimData,\\n\\t\\taddress payable _relayer,\\n\\t\\tuint256 _fee,\\n\\t\\tuint256 _deadline,\\n\\t\\tuint8 _v,\\n\\t\\tbytes32 _r,\\n\\t\\tbytes32 _s\\n\\t) external override returns (uint256 receivedAmount) {\\n\\t\\trequire(_deadline >= block.timestamp, \\\"Bridge: EXPIRED\\\"); // solhint-disable-line not-rely-on-time\\n\\n\\t\\tbytes32 digest = getDigest(_claimData, _relayer, _fee, _deadline);\\n\\t\\taddress recoveredAddress = ecrecover(digest, _v, _r, _s);\\n\\t\\trequire(_claimData.to != address(0) && recoveredAddress == _claimData.to, \\\"Bridge: INVALID_SIGNATURE\\\");\\n\\n\\t\\treturn _claim(\\n\\t\\t\\t_claimData,\\n\\t\\t\\t_claimData.to,\\n\\t\\t\\t_relayer,\\n\\t\\t\\t_fee\\n\\t\\t);\\n\\t}\\n\\n\\tfunction isClaimed(bytes32 transactionDataHash, bytes32 transactionDataHashMultichain) public view returns(bool) {\\n\\t\\treturn claimed[transactionDataHash] || claimed[transactionDataHashMultichain];\\n\\t}\\n\\n\\tfunction isClaimed(ClaimData calldata _claimData, bytes32 transactionDataHashMultichain) public view returns(bool) {\\n\\t\\tbytes32 transactionDataHash = getTransactionDataHash(\\n\\t\\t\\t_claimData.to,\\n\\t\\t\\t_claimData.amount,\\n\\t\\t\\t_claimData.blockHash,\\n\\t\\t\\t_claimData.transactionHash,\\n\\t\\t\\t_claimData.logIndex\\n\\t\\t);\\n\\n\\t\\treturn claimed[transactionDataHash] || claimed[transactionDataHashMultichain];\\n\\t}\\n\\n\\tfunction _claim(\\n\\t\\tClaimData calldata _claimData,\\n\\t\\taddress payable _reciever,\\n\\t\\taddress payable _relayer,\\n\\t\\tuint256 _fee\\n\\t) internal nonReentrant returns (uint256 receivedAmount) {\\n\\t\\taddress originalTokenAddress = originalTokenAddresses[_claimData.transactionHash];\\n\\t\\trequire(originalTokenAddress != NULL_ADDRESS, \\\"Bridge: Tx not crossed\\\");\\n\\n\\t\\tbytes32 transactionDataHash = getTransactionDataHash(\\n\\t\\t\\t_claimData.to,\\n\\t\\t\\t_claimData.amount,\\n\\t\\t\\t_claimData.blockHash,\\n\\t\\t\\t_claimData.transactionHash,\\n\\t\\t\\t_claimData.logIndex,\\n\\t\\t\\t_claimData.originChainId,\\n\\t\\t\\tblock.chainid\\n\\t\\t);\\n\\n\\t\\trequire(transactionsDataHashes[_claimData.transactionHash] == transactionDataHash, \\\"Bridge: Wrong transactionDataHash\\\");\\n\\t\\trequire(!isClaimed(_claimData, transactionDataHash), \\\"Bridge: Already claimed\\\");\\n\\t\\tclaimed[transactionDataHash] = true;\\n\\n\\t\\treceivedAmount = _claimCross(\\n\\t\\t\\t_claimData.originChainId,\\n\\t\\t\\toriginalTokenAddress,\\n\\t\\t\\t_reciever,\\n\\t\\t\\t_claimData.amount,\\n\\t\\t\\t_relayer,\\n\\t\\t\\t_fee\\n\\t\\t);\\n\\n\\t\\temitClaimed(_claimData, originalTokenAddress, _reciever, _relayer, _fee);\\n\\t\\treturn receivedAmount;\\n\\t}\\n\\n\\tfunction emitClaimed(\\n\\t\\tClaimData calldata _claimData,\\n\\t\\taddress _originalTokenAddress,\\n\\t\\taddress payable _reciever,\\n\\t\\taddress payable _relayer,\\n\\t\\tuint256 _fee\\n\\t) internal {\\n\\t\\temit Claimed(\\n\\t\\t\\t_claimData.transactionHash,\\n\\t\\t\\t_originalTokenAddress,\\n\\t\\t\\t_claimData.to,\\n\\t\\t\\tsenderAddresses[_claimData.transactionHash],\\n\\t\\t\\t_claimData.amount,\\n\\t\\t\\t_claimData.blockHash,\\n\\t\\t\\t_claimData.logIndex,\\n\\t\\t\\t_reciever,\\n\\t\\t\\t_relayer,\\n\\t\\t\\t_fee,\\n\\t\\t\\t_claimData.originChainId,\\n\\t\\t\\tblock.chainid\\n\\t\\t);\\n\\t}\\n\\n\\tfunction _claimCross(\\n\\t\\tuint256 _originalChainId,\\n\\t\\taddress _originalTokenAddress,\\n\\t\\taddress payable _reciever,\\n\\t\\tuint256 _amount,\\n\\t\\taddress payable _relayer,\\n\\t\\tuint256 _fee\\n\\t) internal returns (uint256) {\\n\\t\\tcheckChainId(_originalChainId);\\n\\t\\tif (knownToken(_originalChainId, _originalTokenAddress)) {\\n\\t\\t\\treturn _claimCrossBackToToken(\\n\\t\\t\\t\\t_originalTokenAddress,\\n\\t\\t\\t\\t_reciever,\\n\\t\\t\\t\\t_amount,\\n\\t\\t\\t\\t_relayer,\\n\\t\\t\\t\\t_fee\\n\\t\\t\\t);\\n\\t\\t}\\n\\n\\t\\treturn _claimCrossToSideToken(\\n\\t\\t\\tsideTokenByOriginalToken(_originalChainId, _originalTokenAddress),\\n\\t\\t\\t_reciever,\\n\\t\\t\\t_amount,\\n\\t\\t\\t_relayer,\\n\\t\\t\\t_fee\\n\\t\\t);\\n\\t}\\n\\n\\tfunction _claimCrossToSideToken(\\n\\t\\taddress _sideToken,\\n\\t\\taddress payable _receiver,\\n\\t\\tuint256 _amount,\\n\\t\\taddress payable _relayer,\\n\\t\\tuint256 _fee\\n\\t) internal returns (uint256 receivedAmount) {\\n\\t\\trequire(_sideToken != NULL_ADDRESS, \\\"Bridge: side token is null\\\");\\n\\t\\tuint256 granularity = IERC777(_sideToken).granularity();\\n\\t\\tuint256 formattedAmount = _amount.mul(granularity);\\n\\t\\trequire(_fee <= formattedAmount, \\\"Bridge: fee too high\\\");\\n\\t\\treceivedAmount = formattedAmount.sub(_fee);\\n\\t\\tISideToken(_sideToken).mint(_receiver, receivedAmount, \\\"\\\", \\\"\\\");\\n\\t\\tif (_fee > 0) {\\n\\t\\t\\tISideToken(_sideToken).mint(_relayer, _fee, \\\"\\\", \\\"relayer fee\\\");\\n\\t\\t}\\n\\t\\treturn receivedAmount;\\n\\t}\\n\\n\\tfunction _claimCrossBackToToken(\\n\\t\\taddress _originalTokenAddress,\\n\\t\\taddress payable _receiver,\\n\\t\\tuint256 _amount,\\n\\t\\taddress payable _relayer,\\n\\t\\tuint256 _fee\\n\\t) internal returns (uint256 receivedAmount) {\\n\\t\\tuint256 decimals = LibUtils.getDecimals(_originalTokenAddress);\\n\\t\\t//As side tokens are ERC777 they will always have 18 decimals\\n\\t\\tuint256 formattedAmount = _amount.div(uint256(10) ** (18 - decimals));\\n\\t\\trequire(_fee <= formattedAmount, \\\"Bridge: fee too high\\\");\\n\\t\\treceivedAmount = formattedAmount.sub(_fee);\\n\\t\\tif (address(wrappedCurrency) == _originalTokenAddress) {\\n\\t\\t\\twrappedCurrency.withdraw(formattedAmount);\\n\\t\\t\\t_receiver.transfer(receivedAmount);\\n\\t\\t\\tif(_fee > 0) {\\n\\t\\t\\t\\t_relayer.transfer(_fee);\\n\\t\\t\\t}\\n\\t\\t} else {\\n\\t\\t\\tIERC20(_originalTokenAddress).safeTransfer(_receiver, receivedAmount);\\n\\t\\t\\tif(_fee > 0) {\\n\\t\\t\\t\\tIERC20(_originalTokenAddress).safeTransfer(_relayer, _fee);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn receivedAmount;\\n\\t}\\n\\n\\t/**\\n\\t\\t* ERC-20 tokens approve and transferFrom pattern\\n\\t\\t* See https://eips.ethereum.org/EIPS/eip-20#transferfrom\\n\\t\\t*/\\n\\tfunction receiveTokensTo(uint256 destinationChainId, address tokenToUse, address to, uint256 amount) external override {\\n\\t\\taddress sender = _msgSender();\\n\\t\\t//Transfer the tokens on IERC20, they should be already Approved for the bridge Address to use them\\n\\t\\tIERC20(tokenToUse).safeTransferFrom(sender, address(this), amount);\\n\\t\\tcrossTokens(tokenToUse, sender, to, amount, \\\"\\\", destinationChainId);\\n\\t}\\n\\n\\t/**\\n\\t\\t* Use network currency and cross it.\\n\\t\\t*/\\n\\tfunction depositTo(uint256 chainId, address to) external payable override {\\n\\t\\taddress sender = _msgSender();\\n\\t\\trequire(address(wrappedCurrency) != NULL_ADDRESS, \\\"Bridge: wrappedCurrency empty\\\");\\n\\t\\twrappedCurrency.deposit{ value: msg.value }();\\n\\t\\tcrossTokens(address(wrappedCurrency), sender, to, msg.value, \\\"\\\", chainId);\\n\\t}\\n\\n\\t/**\\n\\t\\t* ERC-777 tokensReceived hook allows to send tokens to a contract and notify it in a single transaction\\n\\t\\t* See https://eips.ethereum.org/EIPS/eip-777#motivation for details\\n\\t\\t* @param userData it can be 2 options in the first one you can send the receiver and the chain id of the destination\\n\\t\\t* const userData = web3.eth.abi.encodeParameters(\\n * [\\\"address\\\", \\\"uint256\\\"],\\n * [anAccount.toLowerCase(), chains.ETHEREUM_MAIN_NET_CHAIN_ID]\\n * );\\n\\t\\t* or you also can send only the destination chain id, and the receiver would be the same as the from parameter\\n\\t\\t* const userData = web3.eth.abi.encodeParameters([\\\"uint256\\\"], [chains.ETHEREUM_MAIN_NET_CHAIN_ID]);\\n\\t\\t*/\\n\\tfunction tokensReceived(\\n\\t\\taddress operator,\\n\\t\\taddress from,\\n\\t\\taddress to,\\n\\t\\tuint amount,\\n\\t\\tbytes calldata userData, // [address,uint256] user addrest receiver, destinationChainId || [uint256] same as from, destinationChainId\\n\\t\\tbytes calldata\\n\\t) external override(IBridge, IERC777Recipient) {\\n\\t\\t//Hook from ERC777address\\n\\t\\tif(operator == address(this)) return; // Avoid loop from bridge calling to ERC77transferFrom\\n\\t\\trequire(to == address(this), \\\"Bridge: Not to this address\\\");\\n\\t\\taddress tokenToUse = _msgSender();\\n\\t\\trequire(ERC1820.getInterfaceImplementer(tokenToUse, _erc777Interface) != NULL_ADDRESS, \\\"Bridge: Not ERC777 token\\\");\\n\\t\\trequire(userData.length >= 32, \\\"Bridge: user data with at least the destinationChainId\\\");\\n\\t\\trequire(userData.length == 64 || !from.isContract(), \\\"Bridge: Specify receiver address in data\\\");\\n\\t\\taddress receiver = userData.length == 32 ? from : LibUtils.toAddress(userData, 12);\\n\\t\\tuint256 destinationChainId = LibUtils.toUint256(userData, userData.length - 32);\\n\\t\\tcrossTokens(tokenToUse, from, receiver, amount, userData, destinationChainId);\\n\\t}\\n\\n\\tfunction crossTokens(\\n\\t\\taddress tokenToUse,\\n\\t\\taddress from,\\n\\t\\taddress to,\\n\\t\\tuint256 amount,\\n\\t\\tbytes memory userData,\\n\\t\\tuint256 destinationChainId\\n\\t) internal whenNotUpgrading whenNotPaused nonReentrant {\\n\\t\\trequire(block.chainid != destinationChainId, \\\"Bridge: destination chain id equal current chain id\\\");\\n\\t\\tcheckChainId(destinationChainId);\\n\\t\\t_setKnownTokenByChain(destinationChainId, tokenToUse, true);\\n\\t\\tuint256 fee = amount.mul(feePercentage).div(feePercentageDivider);\\n\\t\\tuint256 amountMinusFees = amount.sub(fee);\\n\\t\\tuint8 decimals = LibUtils.getDecimals(tokenToUse);\\n\\t\\tuint formattedAmount = amount;\\n\\t\\tif (decimals != 18) {\\n\\t\\t\\tformattedAmount = amount.mul(uint256(10)**(18-decimals));\\n\\t\\t}\\n\\t\\t// We consider the amount before fees converted to 18 decimals to check the limits\\n\\t\\t// updateTokenTransfer revert if token not allowed\\n\\t\\tallowTokens.updateTokenTransfer(tokenToUse, formattedAmount);\\n\\n\\t\\tOriginalToken memory sideToken = getOriginalTokenBySideToken(tokenToUse);\\n\\t\\tif (sideToken.tokenAddress != NULL_ADDRESS) {\\n\\t\\t\\t// Side Token Crossing back\\n\\t\\t\\t{ // Created scope to avoid stack too deep\\n\\t\\t\\t\\tuint256 granularity = LibUtils.getGranularity(tokenToUse);\\n\\t\\t\\t\\tuint256 modulo = amountMinusFees.mod(granularity);\\n\\t\\t\\t\\tfee = fee.add(modulo);\\n\\t\\t\\t\\tamountMinusFees = amountMinusFees.sub(modulo);\\n\\t\\t\\t\\tIERC777(tokenToUse).burn(amountMinusFees, userData);\\n\\t\\t\\t}\\n\\t\\t\\temit Cross(\\n\\t\\t\\t\\tsideToken.tokenAddress,\\n\\t\\t\\t\\tto,\\n\\t\\t\\t\\tdestinationChainId,\\n\\t\\t\\t\\tfrom,\\n\\t\\t\\t\\tblock.chainid,\\n\\t\\t\\t\\tamountMinusFees,\\n\\t\\t\\t\\tuserData\\n\\t\\t\\t);\\n\\t\\t} else {\\n\\t\\t\\temit Cross(\\n\\t\\t\\t\\ttokenToUse,\\n\\t\\t\\t\\tto,\\n\\t\\t\\t\\tdestinationChainId,\\n\\t\\t\\t\\tfrom,\\n\\t\\t\\t\\tblock.chainid,\\n\\t\\t\\t\\tamountMinusFees,\\n\\t\\t\\t\\tuserData\\n\\t\\t\\t);\\n\\t\\t}\\n\\n\\t\\tif (fee > 0) {\\n\\t\\t\\t//Send the payment to the MultiSig of the Federation\\n\\t\\t\\tIERC20(tokenToUse).safeTransfer(owner(), fee);\\n\\t\\t}\\n\\t}\\n\\n\\t// function for retrocompatibility\\n\\tfunction getTransactionDataHash(\\n\\t\\taddress _to,\\n\\t\\tuint256 _amount,\\n\\t\\tbytes32 _blockHash,\\n\\t\\tbytes32 _transactionHash,\\n\\t\\tuint32 _logIndex\\n\\t) internal pure returns(bytes32) {\\n\\t\\treturn keccak256(abi.encodePacked(_blockHash, _transactionHash, _to, _amount, _logIndex));\\n\\t}\\n\\n\\tfunction getTransactionDataHash(\\n\\t\\taddress _to,\\n\\t\\tuint256 _amount,\\n\\t\\tbytes32 _blockHash,\\n\\t\\tbytes32 _transactionHash,\\n\\t\\tuint32 _logIndex,\\n\\t\\tuint256 _originChainId,\\n\\t\\tuint256\\t_destinationChainId\\n\\t) public pure override returns(bytes32) {\\n\\t\\treturn keccak256(abi.encodePacked(_blockHash, _transactionHash, _to, _amount, _logIndex, _originChainId, _destinationChainId));\\n\\t}\\n\\n\\tfunction setFeePercentage(uint amount) external onlyOwner {\\n\\t\\trequire(amount < (feePercentageDivider/10), \\\"Bridge: bigger than 10%\\\");\\n\\t\\tfeePercentage = amount;\\n\\t\\temit FeePercentageChanged(feePercentage);\\n\\t}\\n\\n\\tfunction getFeePercentage() external view override returns(uint) {\\n\\t\\treturn feePercentage;\\n\\t}\\n\\n\\tfunction changeFederation(address newFederation) external onlyOwner {\\n\\t\\trequire(newFederation != NULL_ADDRESS, \\\"Bridge: Federation is empty\\\");\\n\\t\\tfederation = newFederation;\\n\\t\\temit FederationChanged(federation);\\n\\t}\\n\\n\\tfunction changeAllowTokens(address newAllowTokens) external onlyOwner {\\n\\t\\trequire(newAllowTokens != NULL_ADDRESS, \\\"Bridge: AllowTokens is empty\\\");\\n\\t\\tallowTokens = IAllowTokens(newAllowTokens);\\n\\t\\temit AllowTokensChanged(newAllowTokens);\\n\\t}\\n\\n\\tfunction getFederation() external view returns(address) {\\n\\t\\treturn federation;\\n\\t}\\n\\n\\tfunction changeSideTokenFactory(address newSideTokenFactory) external onlyOwner {\\n\\t\\trequire(newSideTokenFactory != NULL_ADDRESS, \\\"Bridge: SideTokenFactory is empty\\\");\\n\\t\\tsideTokenFactory = ISideTokenFactory(newSideTokenFactory);\\n\\t\\temit SideTokenFactoryChanged(newSideTokenFactory);\\n\\t}\\n\\n\\tfunction setUpgrading(bool _isUpgrading) external onlyOwner {\\n\\t\\tisUpgrading = _isUpgrading;\\n\\t\\temit Upgrading(isUpgrading);\\n\\t}\\n\\n\\tfunction setWrappedCurrency(address _wrappedCurrency) external onlyOwner {\\n\\t\\trequire(_wrappedCurrency != NULL_ADDRESS, \\\"Bridge: wrapp is empty\\\");\\n\\t\\twrappedCurrency = IWrapped(_wrappedCurrency);\\n\\t\\temit WrappedCurrencyChanged(_wrappedCurrency);\\n\\t}\\n\\n\\tfunction hasCrossed(bytes32 transactionHash) public view returns (bool) {\\n\\t\\treturn transactionsDataHashes[transactionHash] != bytes32(0);\\n\\t}\\n\\n\\tfunction hasBeenClaimed(bytes32 transactionHash) public view returns (bool) {\\n\\t\\treturn claimed[transactionsDataHashes[transactionHash]];\\n\\t}\\n\\n}\\n\",\"keccak256\":\"0xb86625857e1fbf57abe4356692a4a550fbe53e1ead4ecc09de069cad3807706e\",\"license\":\"MIT\"},\"contracts/interface/IAllowTokens.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\ninterface IAllowTokens {\\n\\n\\tstruct Limits {\\n\\t\\tuint256 min;\\n\\t\\tuint256 max;\\n\\t\\tuint256 daily;\\n\\t\\tuint256 mediumAmount;\\n\\t\\tuint256 largeAmount;\\n\\t}\\n\\n\\tstruct TokenInfo {\\n\\t\\tbool allowed;\\n\\t\\tuint256 typeId;\\n\\t\\tuint256 spentToday;\\n\\t\\tuint256 lastDay;\\n\\t}\\n\\n\\tstruct TypeInfo {\\n\\t\\tstring description;\\n\\t\\tLimits limits;\\n\\t}\\n\\n\\tstruct TokensAndType {\\n\\t\\taddress token;\\n\\t\\tuint256 typeId;\\n\\t}\\n\\n\\tfunction version() external pure returns (string memory);\\n\\n\\tfunction getInfoAndLimits(address token) external view returns (TokenInfo memory info, Limits memory limit);\\n\\n\\tfunction calcMaxWithdraw(address token) external view returns (uint256 maxWithdraw);\\n\\n\\tfunction getTypesLimits() external view returns(Limits[] memory limits);\\n\\n\\tfunction getTypeDescriptionsLength() external view returns(uint256);\\n\\n\\tfunction getTypeDescriptions() external view returns(string[] memory descriptions);\\n\\n\\tfunction setToken(address token, uint256 typeId) external;\\n\\n\\tfunction getConfirmations() external view returns (uint256 smallAmount, uint256 mediumAmount, uint256 largeAmount);\\n\\n\\tfunction isTokenAllowed(address token) external view returns (bool);\\n\\n\\tfunction updateTokenTransfer(address token, uint256 amount) external;\\n}\",\"keccak256\":\"0x7a68f098e5efaad2d9d84314b2df76897fa9dbbe65c64d629b02b1dc4d9d36b5\",\"license\":\"MIT\"},\"contracts/interface/IBridge.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\ninterface IBridge {\\n\\n\\tstruct ClaimData {\\n\\t\\taddress payable to;\\n\\t\\tuint256 amount;\\n\\t\\tbytes32 blockHash;\\n\\t\\tbytes32 transactionHash;\\n\\t\\tuint32 logIndex;\\n\\t\\tuint256 originChainId;\\n\\t}\\n\\n\\tstruct OriginalToken {\\n\\t\\taddress tokenAddress;\\n\\t\\tuint256 originChainId;\\n\\t}\\n\\t\\n\\tstruct CreateSideTokenStruct {\\n\\t\\tuint256 _typeId;\\n\\t\\taddress _originalTokenAddress;\\n\\t\\tuint8 _originalTokenDecimals;\\n\\t\\tstring _originalTokenSymbol;\\n\\t\\tstring _originalTokenName;\\n\\t\\tuint256 _originChainId;\\n\\t}\\n\\n\\tfunction version() external pure returns (string memory);\\n\\n\\tfunction getFeePercentage() external view returns(uint);\\n\\n\\t/**\\n\\t\\t* ERC-20 tokens approve and transferFrom pattern\\n\\t\\t* See https://eips.ethereum.org/EIPS/eip-20#transferfrom\\n\\t\\t*/\\n\\tfunction receiveTokensTo(uint256 chainId, address tokenToUse, address to, uint256 amount) external;\\n\\n\\t/**\\n\\t\\t* Use network currency and cross it.\\n\\t\\t*/\\n\\tfunction depositTo(uint256 chainId, address to) external payable;\\n\\n\\t/**\\n\\t\\t* ERC-777 tokensReceived hook allows to send tokens to a contract and notify it in a single transaction\\n\\t\\t* See https://eips.ethereum.org/EIPS/eip-777#motivation for details\\n\\t\\t* @param userData it can be 2 options in the first one you can send the receiver and the chain id of the destination\\n\\t\\t* const userData = web3.eth.abi.encodeParameters(\\n * [\\\"address\\\", \\\"uint256\\\"],\\n * [anAccount.toLowerCase(), chains.ETHEREUM_MAIN_NET_CHAIN_ID]\\n * );\\n\\t\\t* or you also can send only the destination chain id, and the receiver would be the same as the from parameter\\n\\t\\t* const userData = web3.eth.abi.encodeParameters([\\\"uint256\\\"], [chains.ETHEREUM_MAIN_NET_CHAIN_ID]);\\n\\t\\t*/\\n\\tfunction tokensReceived (\\n\\t\\taddress operator,\\n\\t\\taddress from,\\n\\t\\taddress to,\\n\\t\\tuint amount,\\n\\t\\tbytes calldata userData,\\n\\t\\tbytes calldata operatorData\\n\\t) external;\\n\\n\\t/**\\n\\t\\t* Accepts the transaction from the other chain that was voted and sent by the Federation contract\\n\\t\\t*/\\n\\tfunction acceptTransfer(\\n\\t\\taddress _originalTokenAddress,\\n\\t\\taddress payable _from,\\n\\t\\taddress payable _to,\\n\\t\\tuint256 _amount,\\n\\t\\tbytes32 _blockHash,\\n\\t\\tbytes32 _transactionHash,\\n\\t\\tuint32 _logIndex,\\n\\t\\tuint256 _originChainId,\\n\\t\\tuint256\\t_destinationChainId\\n\\t) external;\\n\\n\\t/**\\n\\t\\t* Claims the crossed transaction using the hash, this sends the funds to the address indicated in\\n\\t\\t*/\\n\\tfunction claim(ClaimData calldata _claimData) external returns (uint256 receivedAmount);\\n\\n\\tfunction claimFallback(ClaimData calldata _claimData) external returns (uint256 receivedAmount);\\n\\n\\tfunction claimGasless(\\n\\t\\tClaimData calldata _claimData,\\n\\t\\taddress payable _relayer,\\n\\t\\tuint256 _fee,\\n\\t\\tuint256 _deadline,\\n\\t\\tuint8 _v,\\n\\t\\tbytes32 _r,\\n\\t\\tbytes32 _s\\n\\t) external returns (uint256 receivedAmount);\\n\\n\\tfunction createSideToken(\\n\\t\\tuint256 _typeId,\\n\\t\\taddress _originalTokenAddress,\\n\\t\\tuint8 _originalTokenDecimals,\\n\\t\\tstring calldata _originalTokenSymbol,\\n\\t\\tstring calldata _originalTokenName,\\n\\t\\tuint256 _chainId\\n\\t) external;\\n\\n\\tfunction createMultipleSideTokens(\\n\\t\\tCreateSideTokenStruct[] calldata createSideTokenStruct\\n\\t) external;\\n\\n\\tfunction getTransactionDataHash(\\n\\t\\taddress _to,\\n\\t\\tuint256 _amount,\\n\\t\\tbytes32 _blockHash,\\n\\t\\tbytes32 _transactionHash,\\n\\t\\tuint32 _logIndex,\\n\\t\\tuint256 _originChainId,\\n\\t\\tuint256 _destinationChainId\\n\\t) external returns(bytes32);\\n\\n\\tevent Cross(\\n\\t\\taddress indexed _tokenAddress,\\n\\t\\taddress indexed _to,\\n\\t\\tuint256 indexed _destinationChainId,\\n\\t\\taddress _from,\\n\\t\\tuint256 _originChainId,\\n\\t\\tuint256 _amount,\\n\\t\\tbytes _userData\\n\\t);\\n\\n\\tevent NewSideToken(\\n\\t\\taddress indexed _newSideTokenAddress,\\n\\t\\taddress indexed _originalTokenAddress,\\n\\t\\tstring _newSymbol,\\n\\t\\tuint256 _granularity,\\n\\t\\tuint256 _chainId\\n\\t);\\n\\tevent AcceptedCrossTransfer(\\n\\t\\tbytes32 indexed _transactionHash,\\n\\t\\taddress indexed _originalTokenAddress,\\n\\t\\taddress indexed _to,\\n\\t\\taddress _from,\\n\\t\\tuint256 _amount,\\n\\t\\tbytes32 _blockHash,\\n\\t\\tuint256 _logIndex,\\n\\t\\tuint256 _originChainId,\\n\\t\\tuint256\\t_destinationChainId\\n\\t);\\n\\tevent FeePercentageChanged(uint256 _amount);\\n\\tevent Claimed(\\n\\t\\tbytes32 indexed _transactionHash,\\n\\t\\taddress indexed _originalTokenAddress,\\n\\t\\taddress indexed _to,\\n\\t\\taddress _sender,\\n\\t\\tuint256 _amount,\\n\\t\\tbytes32 _blockHash,\\n\\t\\tuint256 _logIndex,\\n\\t\\taddress _reciever,\\n\\t\\taddress _relayer,\\n\\t\\tuint256 _fee,\\n\\t\\tuint256 _destinationChainId,\\n\\t\\tuint256 _originChainId\\n\\t);\\n}\",\"keccak256\":\"0x1c5d6422edd509f1abc62bc29b41b1c6f80df08235ca289da81c661b8aa33044\",\"license\":\"MIT\"},\"contracts/interface/ISideToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\ninterface ISideToken {\\n function mint(address account, uint256 amount, bytes calldata userData, bytes calldata operatorData) external;\\n}\",\"keccak256\":\"0x43d96442dcb622e7efbad6ff3fcfe109d9f881c18415b571511f326b39d7a70e\",\"license\":\"MIT\"},\"contracts/interface/ISideTokenFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\ninterface ISideTokenFactory {\\n\\n function createSideToken(string calldata name, string calldata symbol, uint256 granularity) external returns(address);\\n\\n event SideTokenCreated(address indexed sideToken, string symbol, uint256 granularity);\\n}\",\"keccak256\":\"0x5c3c0db3ad07c2cb9933ea8a37e01b83d4ec77c7bc0ac684de87f6b1e09d25dc\",\"license\":\"MIT\"},\"contracts/interface/IWrapped.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\ninterface IWrapped {\\n function balanceOf(address) external returns(uint);\\n\\n function deposit() external payable;\\n\\n function withdraw(uint wad) external;\\n\\n function totalSupply() external view returns (uint);\\n\\n function approve(address guy, uint wad) external returns (bool);\\n\\n function transfer(address dst, uint wad) external returns (bool);\\n\\n function transferFrom(address src, address dst, uint wad)\\n external\\n returns (bool);\\n}\",\"keccak256\":\"0xea9894370181d2b7a43d973e033d1ceb8d8d229fed2b775d267ca23b58836e7f\",\"license\":\"MIT\"},\"contracts/lib/LibEIP712.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n// https://github.com/0xProject/0x-monorepo/blob/development/contracts/utils/contracts/src/LibEIP712.sol\\nlibrary LibEIP712 {\\n\\n // Hash of the EIP712 Domain Separator Schema\\n // keccak256(abi.encodePacked(\\n // \\\"EIP712Domain(\\\",\\n // \\\"string name,\\\",\\n // \\\"string version,\\\",\\n // \\\"uint256 chainId,\\\",\\n // \\\"address verifyingContract\\\",\\n // \\\")\\\"\\n // ))\\n bytes32 constant internal _EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f;\\n\\n /// @dev Calculates a EIP712 domain separator.\\n /// @param name The EIP712 domain name.\\n /// @param version The EIP712 domain version.\\n /// @param verifyingContract The EIP712 verifying contract.\\n /// @return result EIP712 domain separator.\\n function hashEIP712Domain(\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract\\n )\\n internal\\n pure\\n returns (bytes32 result)\\n {\\n bytes32 schemaHash = _EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH;\\n\\n // Assembly for more efficient computing:\\n // keccak256(abi.encodePacked(\\n // _EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\\n // keccak256(bytes(name)),\\n // keccak256(bytes(version)),\\n // chainId,\\n // uint256(verifyingContract)\\n // ))\\n\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n // Calculate hashes of dynamic data\\n let nameHash := keccak256(add(name, 32), mload(name))\\n let versionHash := keccak256(add(version, 32), mload(version))\\n\\n // Load free memory pointer\\n let memPtr := mload(64)\\n\\n // Store params in memory\\n mstore(memPtr, schemaHash)\\n mstore(add(memPtr, 32), nameHash)\\n mstore(add(memPtr, 64), versionHash)\\n mstore(add(memPtr, 96), chainId)\\n mstore(add(memPtr, 128), verifyingContract)\\n\\n // Compute hash\\n result := keccak256(memPtr, 160)\\n }\\n return result;\\n }\\n\\n /// @dev Calculates EIP712 encoding for a hash struct with a given domain hash.\\n /// @param eip712DomainHash Hash of the domain domain separator data, computed\\n /// with getDomainHash().\\n /// @param hashStruct The EIP712 hash struct.\\n /// @return result EIP712 hash applied to the given EIP712 Domain.\\n function hashEIP712Message(bytes32 eip712DomainHash, bytes32 hashStruct)\\n internal\\n pure\\n returns (bytes32 result)\\n {\\n // Assembly for more efficient computing:\\n // keccak256(abi.encodePacked(\\n // EIP191_HEADER,\\n // EIP712_DOMAIN_HASH,\\n // hashStruct\\n // ));\\n\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n // Load free memory pointer\\n let memPtr := mload(64)\\n\\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\\n\\n // Compute hash\\n result := keccak256(memPtr, 66)\\n }\\n return result;\\n }\\n}\",\"keccak256\":\"0x0314f8cfcab5979a2d713b4863bf5783b1181151ac144091d23f802d3f8ac7c5\",\"license\":\"MIT\"},\"contracts/lib/LibUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nlibrary LibUtils {\\n\\n function decimalsToGranularity(uint8 decimals) internal pure returns (uint256) {\\n require(decimals <= 18, \\\"LibUtils: Decimals not <= 18\\\");\\n return uint256(10)**(18-decimals);\\n }\\n\\n function getDecimals(address tokenToUse) internal view returns (uint8) {\\n //support decimals as uint256 or uint8\\n (bool success, bytes memory data) = tokenToUse.staticcall(abi.encodeWithSignature(\\\"decimals()\\\"));\\n require(success, \\\"LibUtils: No decimals\\\");\\n // uint: enc(X) is the big-endian encoding of X,\\n //padded on the higher-order (left) side with zero-bytes such that the length is 32 bytes.\\n return uint8(abi.decode(data, (uint256)));\\n }\\n\\n function getGranularity(address tokenToUse) internal view returns (uint256) {\\n //support granularity if ERC777\\n (bool success, bytes memory data) = tokenToUse.staticcall(abi.encodeWithSignature(\\\"granularity()\\\"));\\n require(success, \\\"LibUtils: No granularity\\\");\\n\\n return abi.decode(data, (uint256));\\n }\\n\\n function bytesToAddress(bytes memory bys) internal pure returns (address addr) {\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n addr := mload(add(bys,20))\\n }\\n }\\n\\n function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {\\n require(_bytes.length >= _start + 20, \\\"LibUtils: toAddress_outOfBounds\\\");\\n address tempAddress;\\n\\n assembly {\\n tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\\n }\\n\\n return tempAddress;\\n }\\n\\n function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {\\n require(_bytes.length >= _start + 16, \\\"LibUtils: toUint128_outOfBounds\\\");\\n uint128 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x10), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {\\n\\t\\trequire(_bytes.length >= _start + 32, \\\"LibUtils: toUint256_outOfBounds\\\");\\n\\t\\tuint256 tempUint;\\n\\n // solium-disable-next-line security/no-inline-assembly\\n\\t\\tassembly {\\n\\t\\t\\ttempUint := mload(add(add(_bytes, 0x20), _start))\\n\\t\\t}\\n\\n\\t\\treturn tempUint;\\n\\t}\\n}\\n\",\"keccak256\":\"0xf9495f9e5371f47c7ae2a3ce423598414ee24e60983602d76563a782b2562104\",\"license\":\"MIT\"},\"contracts/zeppelin/GSN/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n\\n function _msgSender() internal view returns (address payable) {\\n return payable(msg.sender);\\n }\\n\\n function _msgData() internal view returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x6f3f274a2270bfe073339370edfa2485e2d515a2656039937f6b972fae96d297\",\"license\":\"MIT\"},\"contracts/zeppelin/access/Roles.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @title Roles\\n * @dev Library for managing addresses assigned to a Role.\\n */\\nlibrary Roles {\\n struct Role {\\n mapping (address => bool) bearer;\\n }\\n\\n /**\\n * @dev Give an account access to this role.\\n */\\n function add(Role storage role, address account) internal {\\n require(!has(role, account), \\\"Roles: account already has role\\\");\\n role.bearer[account] = true;\\n }\\n\\n /**\\n * @dev Remove an account's access to this role.\\n */\\n function remove(Role storage role, address account) internal {\\n require(has(role, account), \\\"Roles: account doesn't have role\\\");\\n role.bearer[account] = false;\\n }\\n\\n /**\\n * @dev Check if an account has this role.\\n * @return bool\\n */\\n function has(Role storage role, address account) internal view returns (bool) {\\n require(account != address(0), \\\"Roles: account is the zero address\\\");\\n return role.bearer[account];\\n }\\n}\\n\",\"keccak256\":\"0x932fc31748c82142ad9f51abd8c9bbaa562c7e6183b967b78a61884ee18e3474\",\"license\":\"MIT\"},\"contracts/zeppelin/introspection/IERC1820Registry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev Interface of the global ERC1820 Registry, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-1820[EIP]. Accounts may register\\n * implementers for interfaces in this registry, as well as query support.\\n *\\n * Implementers may be shared by multiple accounts, and can also implement more\\n * than a single interface for each account. Contracts can implement interfaces\\n * for themselves, but externally-owned accounts (EOA) must delegate this to a\\n * contract.\\n *\\n * {IERC165} interfaces can also be queried via the registry.\\n *\\n * For an in-depth explanation and source code analysis, see the EIP text.\\n */\\ninterface IERC1820Registry {\\n /**\\n * @dev Sets `newManager` as the manager for `account`. A manager of an\\n * account is able to set interface implementers for it.\\n *\\n * By default, each account is its own manager. Passing a value of `0x0` in\\n * `newManager` will reset the manager to this initial state.\\n *\\n * Emits a {ManagerChanged} event.\\n *\\n * Requirements:\\n *\\n * - the caller must be the current manager for `account`.\\n */\\n function setManager(address account, address newManager) external;\\n\\n /**\\n * @dev Returns the manager for `account`.\\n *\\n * See {setManager}.\\n */\\n function getManager(address account) external view returns (address);\\n\\n /**\\n * @dev Sets the `implementer` contract as `account`'s implementer for\\n * `interfaceHash`.\\n *\\n * `account` being the zero address is an alias for the caller's address.\\n * The zero address can also be used in `implementer` to remove an old one.\\n *\\n * See {interfaceHash} to learn how these are created.\\n *\\n * Emits an {InterfaceImplementerSet} event.\\n *\\n * Requirements:\\n *\\n * - the caller must be the current manager for `_account`.\\n * - `_interfaceHash` must not be an {IERC165} interface id (i.e. it must not\\n * end in 28 zeroes).\\n * - `_implementer` must implement {IERC1820Implementer} and return true when\\n * queried for support, unless `implementer` is the caller. See\\n * {IERC1820Implementer-canImplementInterfaceForAddress}.\\n */\\n function setInterfaceImplementer(address _account, bytes32 _interfaceHash, address _implementer) external;\\n\\n /**\\n * @dev Returns the implementer of `_interfaceHash` for `_account`. If no such\\n * implementer is registered, returns the zero address.\\n *\\n * If `_interfaceHash` is an {IERC165} interface id (i.e. it ends with 28\\n * zeroes), `_account` will be queried for support of it.\\n *\\n * `account` being the zero address is an alias for the caller's address.\\n */\\n function getInterfaceImplementer(address _account, bytes32 _interfaceHash) external view returns (address);\\n\\n /**\\n * @dev Returns the interface hash for an `interfaceName`, as defined in the\\n * corresponding\\n * https://eips.ethereum.org/EIPS/eip-1820#interface-name[section of the EIP].\\n */\\n function interfaceHash(string calldata interfaceName) external pure returns (bytes32);\\n\\n /**\\n * @notice Updates the cache with whether the contract implements an ERC165 interface or not.\\n * @param account Address of the contract for which to update the cache.\\n * @param interfaceId ERC165 interface for which to update the cache.\\n */\\n function updateERC165Cache(address account, bytes4 interfaceId) external;\\n\\n /**\\n * @notice Checks whether a contract implements an ERC165 interface or not.\\n * If the result is not cached a direct lookup on the contract address is performed.\\n * If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling\\n * {updateERC165Cache} with the contract address.\\n * @param account Address of the contract to check.\\n * @param interfaceId ERC165 interface to check.\\n * @return True if `account` implements `interfaceId`, false otherwise.\\n */\\n function implementsERC165Interface(address account, bytes4 interfaceId) external view returns (bool);\\n\\n /**\\n * @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache.\\n * @param account Address of the contract to check.\\n * @param interfaceId ERC165 interface to check.\\n * @return True if `account` implements `interfaceId`, false otherwise.\\n */\\n function implementsERC165InterfaceNoCache(address account, bytes4 interfaceId) external view returns (bool);\\n\\n event InterfaceImplementerSet(address indexed account, bytes32 indexed interfaceHash, address indexed implementer);\\n\\n event ManagerChanged(address indexed account, address indexed newManager);\\n}\\n\",\"keccak256\":\"0x8877787cbe99ab8e2dcb85e9b22066b7e62bcea328091c1ff9ae462e54afa66e\",\"license\":\"MIT\"},\"contracts/zeppelin/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n return sub(a, b, \\\"SafeMath: subtraction overflow\\\");\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n * - Subtraction cannot overflow.\\n *\\n * _Available since v2.4.0._\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers. Reverts on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n return div(a, b, \\\"SafeMath: division by zero\\\");\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers. Reverts with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n *\\n * _Available since v2.4.0._\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n // Solidity only automatically asserts when dividing by 0\\n require(b > 0, errorMessage);\\n uint256 c = a / b;\\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * Reverts when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n return mod(a, b, \\\"SafeMath: modulo by zero\\\");\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * Reverts with custom message when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n *\\n * _Available since v2.4.0._\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b != 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0x8038a6eca31e013b0c7f248c7a4eb5846ab0d52bb3f7636fafcf00b075643afe\",\"license\":\"MIT\"},\"contracts/zeppelin/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP. Does not include\\n * the optional functions; to access them see {ERC20Detailed}.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0xdb194e173849ac56dbc15eaf0c01848361748ff8e4679985c3d11013ee4fa4b6\",\"license\":\"MIT\"},\"contracts/zeppelin/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n // solhint-disable-next-line max-line-length\\n require((value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve non-zero to non-zero allowance\\\"\\n );\\n callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\\n callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \\\"SafeERC20: decreased allowance below zero\\\");\\n callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves.\\n\\n // A Solidity high level call has three parts:\\n // 1. The target address is checked to verify it contains contract code\\n // 2. The call itself is made, and success asserted\\n // 3. The return value is decoded, which in turn checks the size of the returned data.\\n // solhint-disable-next-line max-line-length\\n require(address(token).isContract(), \\\"SafeERC20: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = address(token).call(data);\\n require(success, \\\"SafeERC20: low-level call failed\\\");\\n\\n if (returndata.length > 0) { // Return data is optional\\n // solhint-disable-next-line max-line-length\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb7197e89889e574b9774604c7583b7226b06f6ebf8327c462fb15d5f8465ab8b\",\"license\":\"MIT\"},\"contracts/zeppelin/token/ERC777/IERC777.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev Interface of the ERC777Token standard as defined in the EIP.\\n *\\n * This contract uses the\\n * [ERC1820 registry standard](https://eips.ethereum.org/EIPS/eip-1820) to let\\n * token holders and recipients react to token movements by using setting implementers\\n * for the associated interfaces in said registry. See `IERC1820Registry` and\\n * `ERC1820Implementer`.\\n */\\ninterface IERC777 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the smallest part of the token that is not divisible. This\\n * means all token operations (creation, movement and destruction) must have\\n * amounts that are a multiple of this number.\\n *\\n * For most token contracts, this value will equal 1.\\n */\\n function granularity() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by an account (`owner`).\\n */\\n function balanceOf(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * If send or receive hooks are registered for the caller and `recipient`,\\n * the corresponding functions will be called with `data` and empty\\n * `operatorData`. See `IERC777Sender` and `IERC777Recipient`.\\n *\\n * Emits a `Sent` event.\\n *\\n * Requirements\\n *\\n * - the caller must have at least `amount` tokens.\\n * - `recipient` cannot be the zero address.\\n * - if `recipient` is a contract, it must implement the `tokensReceived`\\n * interface.\\n */\\n function send(address recipient, uint256 amount, bytes calldata data) external;\\n\\n /**\\n * @dev Destroys `amount` tokens from the caller's account, reducing the\\n * total supply.\\n *\\n * If a send hook is registered for the caller, the corresponding function\\n * will be called with `data` and empty `operatorData`. See `IERC777Sender`.\\n *\\n * Emits a `Burned` event.\\n *\\n * Requirements\\n *\\n * - the caller must have at least `amount` tokens.\\n */\\n function burn(uint256 amount, bytes calldata data) external;\\n\\n /**\\n * @dev Returns true if an account is an operator of `tokenHolder`.\\n * Operators can send and burn tokens on behalf of their owners. All\\n * accounts are their own operator.\\n *\\n * See `operatorSend` and `operatorBurn`.\\n */\\n function isOperatorFor(address operator, address tokenHolder) external view returns (bool);\\n\\n /**\\n * @dev Make an account an operator of the caller.\\n *\\n * See `isOperatorFor`.\\n *\\n * Emits an `AuthorizedOperator` event.\\n *\\n * Requirements\\n *\\n * - `operator` cannot be calling address.\\n */\\n function authorizeOperator(address operator) external;\\n\\n /**\\n * @dev Make an account an operator of the caller.\\n *\\n * See `isOperatorFor` and `defaultOperators`.\\n *\\n * Emits a `RevokedOperator` event.\\n *\\n * Requirements\\n *\\n * - `operator` cannot be calling address.\\n */\\n function revokeOperator(address operator) external;\\n\\n /**\\n * @dev Returns the list of default operators. These accounts are operators\\n * for all token holders, even if `authorizeOperator` was never called on\\n * them.\\n *\\n * This list is immutable, but individual holders may revoke these via\\n * `revokeOperator`, in which case `isOperatorFor` will return false.\\n */\\n function defaultOperators() external view returns (address[] memory);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient`. The caller must\\n * be an operator of `sender`.\\n *\\n * If send or receive hooks are registered for `sender` and `recipient`,\\n * the corresponding functions will be called with `data` and\\n * `operatorData`. See `IERC777Sender` and `IERC777Recipient`.\\n *\\n * Emits a `Sent` event.\\n *\\n * Requirements\\n *\\n * - `sender` cannot be the zero address.\\n * - `sender` must have at least `amount` tokens.\\n * - the caller must be an operator for `sender`.\\n * - `recipient` cannot be the zero address.\\n * - if `recipient` is a contract, it must implement the `tokensReceived`\\n * interface.\\n */\\n function operatorSend(\\n address sender,\\n address recipient,\\n uint256 amount,\\n bytes calldata data,\\n bytes calldata operatorData\\n ) external;\\n\\n /**\\n * @dev Destoys `amount` tokens from `account`, reducing the total supply.\\n * The caller must be an operator of `account`.\\n *\\n * If a send hook is registered for `account`, the corresponding function\\n * will be called with `data` and `operatorData`. See `IERC777Sender`.\\n *\\n * Emits a `Burned` event.\\n *\\n * Requirements\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n * - the caller must be an operator for `account`.\\n */\\n function operatorBurn(\\n address account,\\n uint256 amount,\\n bytes calldata data,\\n bytes calldata operatorData\\n ) external;\\n\\n event Sent(\\n address indexed operator,\\n address indexed from,\\n address indexed to,\\n uint256 amount,\\n bytes data,\\n bytes operatorData\\n );\\n\\n function decimals() external returns (uint8);\\n\\n event Minted(address indexed operator, address indexed to, uint256 amount, bytes data, bytes operatorData);\\n\\n event Burned(address indexed operator, address indexed from, uint256 amount, bytes data, bytes operatorData);\\n\\n event AuthorizedOperator(address indexed operator, address indexed tokenHolder);\\n\\n event RevokedOperator(address indexed operator, address indexed tokenHolder);\\n}\\n\",\"keccak256\":\"0xd8fb2f5bda9acc32af1bc5ed8a64c67a42ac7f32dd1195387535e8e148d40421\",\"license\":\"MIT\"},\"contracts/zeppelin/token/ERC777/IERC777Recipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev Interface of the ERC777TokensRecipient standard as defined in the EIP.\\n *\\n * Accounts can be notified of `IERC777` tokens being sent to them by having a\\n * contract implement this interface (contract holders can be their own\\n * implementer) and registering it on the\\n * [ERC1820 global registry](https://eips.ethereum.org/EIPS/eip-1820).\\n *\\n * See `IERC1820Registry` and `ERC1820Implementer`.\\n */\\ninterface IERC777Recipient {\\n /**\\n * @dev Called by an `IERC777` token contract whenever tokens are being\\n * moved or created into a registered account (`to`). The type of operation\\n * is conveyed by `from` being the zero address or not.\\n *\\n * This call occurs _after_ the token contract's state is updated, so\\n * `IERC777.balanceOf`, etc., can be used to query the post-operation state.\\n *\\n * This function may revert to prevent the operation from being executed.\\n */\\n function tokensReceived(\\n address operator,\\n address from,\\n address to,\\n uint amount,\\n bytes calldata userData,\\n bytes calldata operatorData\\n ) external;\\n}\\n\",\"keccak256\":\"0xc1e6f2d257d4973a27a86e590e01a3289317bd4b44ea040a622b4823c7793875\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @title Initializable\\n *\\n * @dev Helper contract to support initializer functions. To use it, replace\\n * the constructor with a function that has the `initializer` modifier.\\n * WARNING: Unlike constructors, initializer functions must be manually\\n * invoked. This applies both to deploying an Initializable contract, as well\\n * as extending an Initializable contract via inheritance.\\n * WARNING: When used with inheritance, manual care must be taken to not invoke\\n * a parent initializer twice, or ensure that all initializers are idempotent,\\n * because this is not dealt with automatically as with constructors.\\n */\\ncontract Initializable {\\n\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private initializing;\\n\\n /**\\n * @dev Modifier to use in the initializer function of a contract.\\n */\\n modifier initializer() {\\n require(initializing || !initialized, \\\"Contract instance is already initialized\\\");\\n\\n bool isTopLevelCall = !initializing;\\n if (isTopLevelCall) {\\n initializing = true;\\n initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n initializing = false;\\n }\\n }\\n\\n // Reserved storage space to allow for layout changes in the future.\\n uint256[50] private ______gap;\\n}\",\"keccak256\":\"0x14063a689bff5eecf0f36cb519feb575f60349ecf0d425ead5b931b77dd599d4\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/access/roles/UpgradablePauserRole.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"../../Initializable.sol\\\";\\n\\nimport \\\"../../../GSN/Context.sol\\\";\\nimport \\\"../../../access/Roles.sol\\\";\\n\\ncontract UpgradablePauserRole is Initializable, Context {\\n using Roles for Roles.Role;\\n\\n event PauserAdded(address indexed account);\\n event PauserRemoved(address indexed account);\\n\\n Roles.Role private _pausers;\\n\\n function __PauserRol_init(address sender) public initializer {\\n if (!isPauser(sender)) {\\n _addPauser(sender);\\n }\\n }\\n\\n modifier onlyPauser() {\\n require(isPauser(_msgSender()), \\\"PauserRole: caller doesn't have the role\\\");\\n _;\\n }\\n\\n function isPauser(address account) public view returns (bool) {\\n return _pausers.has(account);\\n }\\n\\n function addPauser(address account) public onlyPauser {\\n _addPauser(account);\\n }\\n\\n function renouncePauser() public {\\n _removePauser(_msgSender());\\n }\\n\\n function _addPauser(address account) internal {\\n _pausers.add(account);\\n emit PauserAdded(account);\\n }\\n\\n function _removePauser(address account) internal {\\n _pausers.remove(account);\\n emit PauserRemoved(account);\\n }\\n}\\n\",\"keccak256\":\"0xb484fd9ca5d28b46ec2c0d765cd592786a5a2c796987b5a7000e0b3d8b2a0ac9\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/lifecycle/UpgradablePausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"../Initializable.sol\\\";\\n\\nimport \\\"../../GSN/Context.sol\\\";\\nimport \\\"../access/roles/UpgradablePauserRole.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\ncontract UpgradablePausable is Initializable, Context, UpgradablePauserRole {\\n /**\\n * @dev Emitted when the pause is triggered by a pauser (`account`).\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by a pauser (`account`).\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state. Assigns the Pauser role\\n * to the deployer.\\n */\\n function __Pausable_init(address sender) public initializer {\\n UpgradablePauserRole.__PauserRol_init(sender);\\n\\n _paused = false;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n */\\n modifier whenNotPaused() {\\n require(!_paused, \\\"Pausable: paused\\\");\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n */\\n modifier whenPaused() {\\n require(_paused, \\\"Pausable: not paused\\\");\\n _;\\n }\\n\\n /**\\n * @dev Called by a pauser to pause, triggers stopped state.\\n */\\n function pause() public onlyPauser whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Called by a pauser to unpause, returns to normal state.\\n */\\n function unpause() public onlyPauser whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0xdc64aa92b0dd6c6d4dc898bee62b70ebf64449b8c27fac6dff027e2fb367e6c0\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/ownership/UpgradableOwnable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"../Initializable.sol\\\";\\n\\nimport \\\"../../GSN/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be aplied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract UpgradableOwnable is Initializable, Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function initialize(address sender) public initializer {\\n _owner = sender;\\n emit OwnershipTransferred(address(0), _owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(isOwner(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the caller is the current owner.\\n */\\n function isOwner() public view returns (bool) {\\n return _msgSender() == _owner;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * > Note: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public onlyOwner {\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n */\\n function _transferOwnership(address newOwner) internal {\\n require(newOwner != address(0), \\\"Ownable: new owner is zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n\\n}\\n\",\"keccak256\":\"0xdf439a167ae82e7e3dd241ea0c831a1bb0329432ceb4fa889778d1f2d196ce00\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/utils/ReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"../Initializable.sol\\\";\\n\\n/**\\n * @title Helps contracts guard against reentrancy attacks.\\n * @author Remco Bloemen , Eenae \\n * @dev If you mark a function `nonReentrant`, you should also\\n * mark it `external`.\\n */\\ncontract ReentrancyGuard is Initializable {\\n /// @dev counter to allow mutex lock with only one SSTORE operation\\n uint256 private _guardCounter;\\n\\n function initialize() public initializer {\\n // The counter starts at one to prevent changing it from zero to a non-zero\\n // value, which is a more expensive operation.\\n _guardCounter = 1;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and make it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _guardCounter += 1;\\n uint256 localCounter = _guardCounter;\\n _;\\n require(localCounter == _guardCounter, \\\"ReentrancyGuard: no reentrant allowed\\\");\\n }\\n}\",\"keccak256\":\"0x56f7b326ffaf9484cbcad316cb3344153584065d5b33da5698e3eedce30565fa\",\"license\":\"MIT\"},\"contracts/zeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x04801fc2398ee3370f3903f95389ea3a8da65a8df01f24b352e499e44d492e9b\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50614e8d806100206000396000f3fe6080604052600436106103bb5760003560e01c806382a0b8cb116101f2578063c4d66de81161010d578063e4e5bbcb116100a0578063f2fde38b1161006f578063f2fde38b14610ce0578063f698da2514610d00578063f8c8765e14610d16578063fa0caa1614610d3657600080fd5b8063e4e5bbcb14610c6c578063e6fc774414610c8c578063ea21709114610ca2578063eb16136f14610cc057600080fd5b8063d12e825d116100dc578063d12e825d14610be8578063d3401a2214610bfd578063da67703714610c1d578063e07801d014610c4c57600080fd5b8063c4d66de814610b42578063ca07140c14610b62578063cbc7328014610b98578063cc3c0f0614610bb857600080fd5b8063a53d6e6e11610185578063b0e1268e11610154578063b0e1268e14610a9d578063b794726214610abd578063b86f60d214610ade578063b984a40414610afe57600080fd5b8063a53d6e6e14610a1d578063a89f298a14610a3d578063ae06c1b714610a5d578063b048c4fb14610a7d57600080fd5b80638ca01082116101c15780638ca010821461099f5780638da5cb5b146109b45780638f32d59b146109d7578063916dc59d146109fd57600080fd5b806382a0b8cb1461091a57806382dc1ec41461094a5780638456cb591461096a57806388710e2e1461097f57600080fd5b80633f4ba83a116102e25780636b0509b1116102755780637a0ab28f116102445780637a0ab28f146108435780637a98187b146108795780637ecebe00146108d85780638129fc1c1461090557600080fd5b80636b0509b1146107d25780636ef8d66d1461080657806370aff70f1461081b578063715018a61461082e57600080fd5b80634c739509116102b15780634c7395091461074657806354fd4d50146107665780635c975abb1461079a578063615bfd6e146107b257600080fd5b80633f4ba83a146106d157806342cdb2c6146106e657806346fbf68e1461070657806347f8bbd41461072657600080fd5b806322f89ba41161035a5780633a1cbbcb116103295780633a1cbbcb146105ec5780633c3f63f41461063a5780633c7e0cb71461067b5780633cf3058b1461069b57600080fd5b806322f89ba4146105245780632f3cca4e1461056f5780633500c1dc1461058f57806337e76109146105af57600080fd5b80630ed928af116103965780630ed928af146104af5780630ef1335c146104cf57806311efbf61146104ef578063122aa5d41461050457600080fd5b806223de291461042f578063026976191461044f57806307c8f7b01461048f57600080fd5b3661042a576041546001600160a01b0316336001600160a01b0316146104285760405162461bcd60e51b815260206004820152601b60248201527f4272696467653a206e6f74207772617070656443757272656e6379000000000060448201526064015b60405180910390fd5b005b600080fd5b34801561043b57600080fd5b5061042861044a36600461424b565b610d56565b34801561045b57600080fd5b5061047c61046a3660046142fc565b60426020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561049b57600080fd5b506104286104aa366004614323565b6110b1565b3480156104bb57600080fd5b5061047c6104ca366004614358565b611140565b3480156104db57600080fd5b5061047c6104ea366004614358565b611161565b3480156104fb57600080fd5b5060375461047c565b34801561051057600080fd5b5061042861051f36600461438d565b6111d8565b34801561053057600080fd5b5061055f61053f366004614418565b604860209081526000928352604080842090915290825290205460ff1681565b6040519015158152602001610486565b34801561057b57600080fd5b5061042861058a366004614448565b611616565b34801561059b57600080fd5b506104286105aa366004614448565b611696565b3480156105bb57600080fd5b5061055f6105ca3660046142fc565b6000908152604260209081526040808320548352603e90915290205460ff1690565b3480156105f857600080fd5b50610622610607366004614448565b603b602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610486565b34801561064657600080fd5b50610622610655366004614418565b60466020908152600092835260408084209091529082529020546001600160a01b031681565b34801561068757600080fd5b50610428610696366004614465565b611768565b3480156106a757600080fd5b506106226106b63660046142fc565b6044602052600090815260409020546001600160a01b031681565b3480156106dd57600080fd5b506104286118e2565b3480156106f257600080fd5b50610428610701366004614448565b61199a565b34801561071257600080fd5b5061055f610721366004614448565b611a7b565b34801561073257600080fd5b506104286107413660046144da565b611a88565b34801561075257600080fd5b50610428610761366004614565565b611af9565b34801561077257600080fd5b506040805180820190915260028152611d8d60f21b60208201525b60405161048691906145ff565b3480156107a657600080fd5b5060345460ff1661055f565b3480156107be57600080fd5b5061055f6107cd366004614612565b611b69565b3480156107de57600080fd5b5061047c7faf3ac34fea9cc1b1def33a9bdc482d988feb61b5015ae4a55e2a62bb3600d54c81565b34801561081257600080fd5b50610428611bd6565b610428610829366004614418565b611be1565b34801561083a57600080fd5b50610428611cd6565b34801561084f57600080fd5b5061062261085e366004614448565b603c602052600090815260409020546001600160a01b031681565b34801561088557600080fd5b506108b9610894366004614448565b604760205260009081526040902080546001909101546001600160a01b039091169082565b604080516001600160a01b039093168352602083019190915201610486565b3480156108e457600080fd5b5061047c6108f3366004614448565b60456020526000908152604090205481565b34801561091157600080fd5b50610428611d5b565b34801561092657600080fd5b5061055f610935366004614448565b603d6020526000908152604090205460ff1681565b34801561095657600080fd5b50610428610965366004614448565b611dcc565b34801561097657600080fd5b50610428611dfa565b34801561098b57600080fd5b5061047c61099a36600461464e565b611e77565b3480156109ab57600080fd5b5061078d611ff2565b3480156109c057600080fd5b5060345461010090046001600160a01b0316610622565b3480156109e357600080fd5b5061055f60345461010090046001600160a01b0316331490565b348015610a0957600080fd5b50610428610a18366004614448565b612080565b348015610a2957600080fd5b50603f54610622906001600160a01b031681565b348015610a4957600080fd5b5061047c610a583660046146c0565b612159565b348015610a6957600080fd5b50610428610a783660046142fc565b6121cb565b348015610a8957600080fd5b5061055f610a98366004614725565b612290565b348015610aa957600080fd5b50604154610622906001600160a01b031681565b348015610ac957600080fd5b5060405461055f90600160a01b900460ff1681565b348015610aea57600080fd5b50604054610622906001600160a01b031681565b348015610b0a57600080fd5b50610b1e610b19366004614448565b6122c2565b6040805182516001600160a01b031681526020928301519281019290925201610486565b348015610b4e57600080fd5b50610428610b5d366004614448565b612341565b348015610b6e57600080fd5b50610622610b7d3660046142fc565b6043602052600090815260409020546001600160a01b031681565b348015610ba457600080fd5b50610428610bb3366004614747565b612403565b348015610bc457600080fd5b5061055f610bd33660046142fc565b603e6020526000908152604090205460ff1681565b348015610bf457600080fd5b50610428612448565b348015610c0957600080fd5b50610622610c18366004614418565b6124ef565b348015610c2957600080fd5b5061055f610c383660046142fc565b600090815260426020526040902054151590565b348015610c5857600080fd5b5061055f610c67366004614418565b612542565b348015610c7857600080fd5b50610428610c873660046147eb565b612597565b348015610c9857600080fd5b5061047c61271081565b348015610cae57600080fd5b506036546001600160a01b0316610622565b348015610ccc57600080fd5b50610428610cdb366004614448565b6125d1565b348015610cec57600080fd5b50610428610cfb366004614448565b612653565b348015610d0c57600080fd5b5061047c60395481565b348015610d2257600080fd5b50610428610d31366004614833565b612691565b348015610d4257600080fd5b50610428610d51366004614448565b6127e6565b6001600160a01b038816301415610d6c576110a7565b6001600160a01b0386163014610dc45760405162461bcd60e51b815260206004820152601b60248201527f4272696467653a204e6f7420746f207468697320616464726573730000000000604482015260640161041f565b60003360405163555ddc6560e11b81526001600160a01b03821660048201527fac7fbab5f54a3ca8194167523c6753bfeb96a445279294b6125b68cce21770546024820152909150600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b158015610e4657600080fd5b505afa158015610e5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7e919061488f565b6001600160a01b03161415610ed55760405162461bcd60e51b815260206004820152601860248201527f4272696467653a204e6f742045524337373720746f6b656e0000000000000000604482015260640161041f565b6020841015610f455760405162461bcd60e51b815260206004820152603660248201527f4272696467653a207573657220646174612077697468206174206c65617374206044820152751d1a194819195cdd1a5b985d1a5bdb90da185a5b925960521b606482015260840161041f565b6040841480610f5c57506001600160a01b0388163b155b610fb95760405162461bcd60e51b815260206004820152602860248201527f4272696467653a2053706563696679207265636569766572206164647265737360448201526720696e206461746160c01b606482015260840161041f565b60006020851461100a5761100586868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600c92506128bf915050565b61100c565b885b9050600061105c87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506110579250602091508a90506148c2565b61292c565b90506110a3838b848b8b8b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250899250612992915050565b5050505b5050505050505050565b6110ca60345461010090046001600160a01b0316331490565b6110e65760405162461bcd60e51b815260040161041f906148d9565b6040805460ff60a01b1916600160a01b831515810291909117808355915160ff9190920416151581527f983e436223c000a441c2443b394ca5fb4669a513fe86dc1dd44494047b514ad9906020015b60405180910390a150565b600061115b826111536020820182614448565b600080612d52565b92915050565b60608101356000908152604460205260408120546001600160a01b0316336001600160a01b0316146111ce5760405162461bcd60e51b8152602060048201526016602482015275213934b233b29d1034b73b30b634b21039b2b73232b960511b604482015260640161041f565b61115b8233611153565b60345460ff16156111fb5760405162461bcd60e51b815260040161041f9061490e565b60016035600082825461120e9190614938565b90915550506035546036546001600160a01b0316336001600160a01b0316146112725760405162461bcd60e51b8152602060048201526016602482015275213934b233b29d102737ba102332b232b930ba34b7b760511b604482015260640161041f565b61127b83612f3d565b61128482612f84565b61128e838b612542565b806112ac575060006112a0848c6124ef565b6001600160a01b031614155b6112f05760405162461bcd60e51b8152602060048201526015602482015274213934b233b29d102ab735b737bbb7103a37b5b2b760591b604482015260640161041f565b6001600160a01b0388166113385760405162461bcd60e51b815260206004820152600f60248201526e4272696467653a204e756c6c20546f60881b604482015260640161041f565b6000871161137b5760405162461bcd60e51b815260206004820152601060248201526f04272696467653a20416d6f756e7420360841b604482015260640161041f565b856113c15760405162461bcd60e51b8152602060048201526016602482015275084e4d2c8ceca74409cead8d84084d8dec6d690c2e6d60531b604482015260640161041f565b846114045760405162461bcd60e51b8152602060048201526013602482015272084e4d2c8ceca74409cead8d840a8f090c2e6d606b1b604482015260640161041f565b600085815260426020526040902054156114605760405162461bcd60e51b815260206004820152601860248201527f4272696467653a20416c72656164792061636365707465640000000000000000604482015260640161041f565b600061146f8989898989612fd3565b905060006114828a8a8a8a8a8a8a612159565b905061148e8282612290565b156114d55760405162461bcd60e51b8152602060048201526017602482015276109c9a5919d94e88105b1c9958591e4818db185a5b5959604a1b604482015260640161041f565b8060426000898152602001908152602001600020819055508b6043600089815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b031602179055508a6044600089815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550896001600160a01b03168c6001600160a01b0316887fddae5e892ad96ac0e35e9018a1a3e32ecd7f3dfe55ea34d9ab1e8faecd6ccb5a8e8d8d8c8c8c6040516115df969594939291906001600160a01b039690961686526020860194909452604085019290925263ffffffff166060840152608083015260a082015260c00190565b60405180910390a45050603554811461160a5760405162461bcd60e51b815260040161041f90614950565b50505050505050505050565b600054610100900460ff168061162f575060005460ff16155b61164b5760405162461bcd60e51b815260040161041f90614995565b600054610100900460ff1615801561166d576000805461ffff19166101011790555b611676826125d1565b6034805460ff191690558015611692576000805461ff00191690555b5050565b6116af60345461010090046001600160a01b0316331490565b6116cb5760405162461bcd60e51b815260040161041f906148d9565b6001600160a01b03811661171a5760405162461bcd60e51b81526020600482015260166024820152754272696467653a20777261707020697320656d70747960501b604482015260640161041f565b604180546001600160a01b0319166001600160a01b0383169081179091556040519081527f0966c958966f6fac9ff807af074f8117eb2e9ce2b76390db7a158e9bdeb2485c90602001611135565b61178160345461010090046001600160a01b0316331490565b61179d5760405162461bcd60e51b815260040161041f906148d9565b60005b818110156118dd576118cb8383838181106117bd576117bd6149dd565b90506020028101906117cf91906149f3565b358484848181106117e2576117e26149dd565b90506020028101906117f491906149f3565b611805906040810190602001614448565b858585818110611817576118176149dd565b905060200281019061182991906149f3565b61183a906060810190604001614a13565b86868681811061184c5761184c6149dd565b905060200281019061185e91906149f3565b61186c906060810190614a2e565b88888881811061187e5761187e6149dd565b905060200281019061189091906149f3565b61189e906080810190614a2e565b8a8a8a8181106118b0576118b06149dd565b90506020028101906118c291906149f3565b60a0013561303e565b806118d581614a75565b9150506117a0565b505050565b6118eb33611a7b565b6119075760405162461bcd60e51b815260040161041f90614a90565b60345460ff166119505760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161041f565b6034805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6119b360345461010090046001600160a01b0316331490565b6119cf5760405162461bcd60e51b815260040161041f906148d9565b6001600160a01b038116611a2f5760405162461bcd60e51b815260206004820152602160248201527f4272696467653a2053696465546f6b656e466163746f727920697320656d70746044820152607960f81b606482015260840161041f565b604080546001600160a01b0319166001600160a01b038316908117825590519081527f619936bc6e3618d0b8dc69bcc70134fe9d88f9967f3a8b8304e318369252162590602001611135565b600061115b60338361327e565b611aa160345461010090046001600160a01b0316331490565b611abd5760405162461bcd60e51b815260040161041f906148d9565b6001600160a01b039182166000908152604760209081526040909120825181546001600160a01b03191694169390931783550151600190910155565b611b1260345461010090046001600160a01b0316331490565b611b2e5760405162461bcd60e51b815260040161041f906148d9565b60009283526046602090815260408085206001600160a01b0394851686529091529092208054919092166001600160a01b0319909116179055565b600080611ba0611b7c6020860186614448565b602086013560408701356060880135611b9b60a08a0160808b01614ad8565b612fd3565b6000818152603e602052604090205490915060ff1680611bce57506000838152603e602052604090205460ff165b949350505050565b611bdf33613301565b565b60415433906001600160a01b0316611c3b5760405162461bcd60e51b815260206004820152601d60248201527f4272696467653a207772617070656443757272656e637920656d707479000000604482015260640161041f565b604160009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b158015611c8b57600080fd5b505af1158015611c9f573d6000803e3d6000fd5b50505050506118dd604160009054906101000a90046001600160a01b03168284346040518060200160405280600081525088612992565b611cef60345461010090046001600160a01b0316331490565b611d0b5760405162461bcd60e51b815260040161041f906148d9565b60345460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360348054610100600160a81b0319169055565b600054610100900460ff1680611d74575060005460ff16155b611d905760405162461bcd60e51b815260040161041f90614995565b600054610100900460ff16158015611db2576000805461ffff19166101011790555b60016035558015611dc9576000805461ff00191690555b50565b611dd533611a7b565b611df15760405162461bcd60e51b815260040161041f90614a90565b611dc981613343565b611e0333611a7b565b611e1f5760405162461bcd60e51b815260040161041f90614a90565b60345460ff1615611e425760405162461bcd60e51b815260040161041f9061490e565b6034805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861197d3390565b600042851015611ebb5760405162461bcd60e51b815260206004820152600f60248201526e109c9a5919d94e8811561412549151608a1b604482015260640161041f565b6000611ed7611ecf368b90038b018b614af3565b898989613385565b6040805160008082526020820180845284905260ff89169282019290925260608101879052608081018690529192509060019060a0016020604051602081039080840390855afa158015611f2f573d6000803e3d6000fd5b5050604051601f190151915060009050611f4c60208c018c614448565b6001600160a01b031614158015611f805750611f6b60208b018b614448565b6001600160a01b0316816001600160a01b0316145b611fcc5760405162461bcd60e51b815260206004820152601960248201527f4272696467653a20494e56414c49445f5349474e415455524500000000000000604482015260640161041f565b611fe48a611fdd6020820182614448565b8b8b612d52565b9a9950505050505050505050565b60388054611fff90614b8b565b80601f016020809104026020016040519081016040528092919081815260200182805461202b90614b8b565b80156120785780601f1061204d57610100808354040283529160200191612078565b820191906000526020600020905b81548152906001019060200180831161205b57829003601f168201915b505050505081565b61209960345461010090046001600160a01b0316331490565b6120b55760405162461bcd60e51b815260040161041f906148d9565b6001600160a01b03811661210b5760405162461bcd60e51b815260206004820152601c60248201527f4272696467653a20416c6c6f77546f6b656e7320697320656d70747900000000604482015260640161041f565b603f80546001600160a01b0319166001600160a01b0383169081179091556040519081527f5f2c1fe803fd576d8af05ea156011cc9cc8c025bda24c1e85772fc05a0b3f1e390602001611135565b6040805160208082019790975280820195909552606097881b6bffffffffffffffffffffffff191697850197909752607484019590955260e09190911b6001600160e01b0319166094830152609882015260b8808201939093528351808203909301835260d801909252805191012090565b6121e460345461010090046001600160a01b0316331490565b6122005760405162461bcd60e51b815260040161041f906148d9565b61220d600a612710614bd6565b811061225b5760405162461bcd60e51b815260206004820152601760248201527f4272696467653a20626967676572207468616e20313025000000000000000000604482015260640161041f565b60378190556040518181527f97e97c577f03bda90e2c9739011ec065ed5fbfb36ae217d20bb0d9be95e160cd90602001611135565b6000828152603e602052604081205460ff16806122bb57506000828152603e602052604090205460ff165b9392505050565b604080518082018252600080825260209182018190526001600160a01b038481168252604783529083902083518085019094528054909116808452600190910154918301919091521561231457919050565b60016020808301919091526001600160a01b039283166000908152603c9091526040902054909116815290565b600054610100900460ff168061235a575060005460ff16155b6123765760405162461bcd60e51b815260040161041f90614995565b600054610100900460ff16158015612398576000805461ffff19166101011790555b60348054610100600160a81b0319166101006001600160a01b0385811682029290921792839055604051920416906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a38015611692576000805461ff00191690555050565b61241c60345461010090046001600160a01b0316331490565b6124385760405162461bcd60e51b815260040161041f906148d9565b6110a7888888888888888861303e565b604080518082018252601081526f52534b20546f6b656e2042726964676560801b60208083019182528351808501855260018152603160f81b908201529151902082517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8152918201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc69181019190915246606082015230608082015260a09020603955565b60008281526046602090815260408083206001600160a01b038086168552925282205416801561252057905061115b565b50506001600160a01b039081166000908152603b602052604090205416919050565b60008281526048602090815260408083206001600160a01b038516845290915281205460ff16801561257557905061115b565b50506001600160a01b03166000908152603d602052604090205460ff16919050565b336125ad6001600160a01b038516823085613489565b6125ca84828585604051806020016040528060008152508a612992565b5050505050565b600054610100900460ff16806125ea575060005460ff16155b6126065760405162461bcd60e51b815260040161041f90614995565b600054610100900460ff16158015612628576000805461ffff19166101011790555b61263182611a7b565b61263e5761263e82613343565b8015611692576000805461ff00191690555050565b61266c60345461010090046001600160a01b0316331490565b6126885760405162461bcd60e51b815260040161041f906148d9565b611dc9816134fa565b600054610100900460ff16806126aa575060005460ff16155b6126c65760405162461bcd60e51b815260040161041f90614995565b600054610100900460ff161580156126e8576000805461ffff19166101011790555b6126f185612341565b6126fa85611616565b603f80546001600160a01b038581166001600160a01b031992831617909255604080548584169083161781556036805493881693909216929092179055516329965a1d60e01b815230600482018190527fb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b60248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad24906329965a1d90606401600060405180830381600087803b1580156127ae57600080fd5b505af11580156127c2573d6000803e3d6000fd5b505050506127ce612448565b80156125ca576000805461ff00191690555050505050565b6127ff60345461010090046001600160a01b0316331490565b61281b5760405162461bcd60e51b815260040161041f906148d9565b6001600160a01b0381166128715760405162461bcd60e51b815260206004820152601b60248201527f4272696467653a2046656465726174696f6e20697320656d7074790000000000604482015260640161041f565b603680546001600160a01b0319166001600160a01b0383169081179091556040519081527f4a41a4d11aaf0c0c9e4311ac1d68b2b0134556da594779a2a35b0ddf7cd1eafb90602001611135565b60006128cc826014614938565b8351101561291c5760405162461bcd60e51b815260206004820152601f60248201527f4c69625574696c733a20746f416464726573735f6f75744f66426f756e647300604482015260640161041f565b500160200151600160601b900490565b6000612939826020614938565b835110156129895760405162461bcd60e51b815260206004820152601f60248201527f4c69625574696c733a20746f55696e743235365f6f75744f66426f756e647300604482015260640161041f565b50016020015190565b604054600160a01b900460ff16156129e05760405162461bcd60e51b81526020600482015260116024820152704272696467653a20557067726164696e6760781b604482015260640161041f565b60345460ff1615612a035760405162461bcd60e51b815260040161041f9061490e565b600160356000828254612a169190614938565b909155505060355446821415612a8a5760405162461bcd60e51b815260206004820152603360248201527f4272696467653a2064657374696e6174696f6e20636861696e20696420657175604482015272185b0818dd5c9c995b9d0818da185a5b881a59606a1b606482015260840161041f565b612a9382612f3d565b60008281526048602090815260408083206001600160a01b038b1684529091529020805460ff191660011790556000612ae3612710612add603754886135c290919063ffffffff16565b90613641565b90506000612af18683613683565b90506000612afe8a6136c5565b905086601260ff831614612b2f57612b2c612b1a836012614bea565b612b2590600a614cf1565b89906135c2565b90505b603f54604051638c34bc5560e01b81526001600160a01b038d811660048301526024820184905290911690638c34bc5590604401600060405180830381600087803b158015612b7d57600080fd5b505af1158015612b91573d6000803e3d6000fd5b505050506000612ba08c6122c2565b80519091506001600160a01b031615612ca4576000612bbe8d6137a9565b90506000612bcc8683613881565b9050612bd887826138c3565b9650612be48682613683565b60405163fe9d930360e01b81529096506001600160a01b038f169063fe9d930390612c159089908e90600401614d00565b600060405180830381600087803b158015612c2f57600080fd5b505af1158015612c43573d6000803e3d6000fd5b505050505050868a6001600160a01b031682600001516001600160a01b03167fb2320a1ad388e1e16b142f7d2e822f31d8a2bbdd7d4f29260e7c203c5f45e8498e46898e604051612c979493929190614d19565b60405180910390a4612cf7565b868a6001600160a01b03168d6001600160a01b03167fb2320a1ad388e1e16b142f7d2e822f31d8a2bbdd7d4f29260e7c203c5f45e8498e46898e604051612cee9493929190614d19565b60405180910390a45b8415612d2357603454612d239061010090046001600160a01b03166001600160a01b038e169087613922565b50505050506035548114612d495760405162461bcd60e51b815260040161041f90614950565b50505050505050565b6000600160356000828254612d679190614938565b909155505060355460608601356000908152604360205260409020546001600160a01b031680612dd25760405162461bcd60e51b8152602060048201526016602482015275109c9a5919d94e88151e081b9bdd0818dc9bdcdcd95960521b604482015260640161041f565b6000612e0e612de460208a018a614448565b60208a013560408b013560608c0135612e0360a08e0160808f01614ad8565b8d60a0013546612159565b60608901356000908152604260205260409020549091508114612e7d5760405162461bcd60e51b815260206004820152602160248201527f4272696467653a2057726f6e67207472616e73616374696f6e446174614861736044820152600d60fb1b606482015260840161041f565b612e878882611b69565b15612ece5760405162461bcd60e51b8152602060048201526017602482015276109c9a5919d94e88105b1c9958591e4818db185a5b5959604a1b604482015260640161041f565b6000818152603e60209081526040909120805460ff19166001179055612f029060a08a01359084908a908c01358a8a613952565b9350612f1188838989896139a3565b50506035548114612f345760405162461bcd60e51b815260040161041f90614950565b50949350505050565b60008111611dc95760405162461bcd60e51b815260206004820152601460248201527304272696467653a20436861696e496420697320360641b604482015260640161041f565b468114611dc95760405162461bcd60e51b815260206004820152601960248201527f4272696467653a204e6f7420626c6f636b2e636861696e696400000000000000604482015260640161041f565b6040805160208101859052908101839052606086811b6bffffffffffffffffffffffff1916908201526074810185905260e082901b6001600160e01b031916609482015260009060980160405160208183030381529060405280519060200120905095945050505050565b6001600160a01b0387166130895760405162461bcd60e51b8152602060048201526012602482015271213934b233b29d10273ab636103a37b5b2b760711b604482015260640161041f565b61309281612f3d565b600061309e82896124ef565b90506001600160a01b038116156130f05760405162461bcd60e51b81526020600482015260166024820152754272696467653a20416c72656164792065786973747360501b604482015260640161041f565b60006130fb88613a7e565b6040805490516326d9e96360e01b81529192506001600160a01b0316906326d9e9639061313490889088908c908c908890600401614d6f565b602060405180830381600087803b15801561314e57600080fd5b505af1158015613162573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613186919061488f565b9150613193838a84611af9565b60408051808201909152602081018490526001600160a01b038a1681526131ba8382611a88565b603f546040516378bf2b5360e01b81526001600160a01b038581166004830152602482018e9052909116906378bf2b5390604401600060405180830381600087803b15801561320857600080fd5b505af115801561321c573d6000803e3d6000fd5b50505050896001600160a01b0316836001600160a01b03167f88dcf8b72e53287db29df3fee9a0f2cb07d1f986cee153aa7d7554405d5db0178a8a86896040516132699493929190614da9565b60405180910390a35050505050505050505050565b60006001600160a01b0382166132e15760405162461bcd60e51b815260206004820152602260248201527f526f6c65733a206163636f756e7420697320746865207a65726f206164647265604482015261737360f01b606482015260840161041f565b506001600160a01b03166000908152602091909152604090205460ff1690565b61330c603382613aea565b6040516001600160a01b038216907fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e90600090a250565b61334e603382613b62565b6040516001600160a01b038216907f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f890600090a250565b6039548451602080870151606088015160a08901516001600160a01b0385166000908152604590945260408420805494966134809690957faf3ac34fea9cc1b1def33a9bdc482d988feb61b5015ae4a55e2a62bb3600d54c959194919391928c918c918b6133f283614a75565b909155506040805160208101999099526001600160a01b03978816908901526060880195909552608087019390935260a086019190915290921660c084015260e08301919091526101008201526101208101859052610140016040516020818303038152906040528051906020012060405161190160f01b8152600281019290925260228201526042902090565b95945050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526134f49085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613bde565b50505050565b6001600160a01b03811661355b5760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a206e6577206f776e6572206973207a65726f206164647265604482015261737360f01b606482015260840161041f565b6034546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603480546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6000826135d15750600061115b565b60006135dd8385614dd0565b9050826135ea8583614bd6565b146122bb5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161041f565b60006122bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613d5e565b60006122bb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613d8c565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b1790529051600091829182916001600160a01b0386169161370b9190614def565b600060405180830381855afa9150503d8060008114613746576040519150601f19603f3d011682016040523d82523d6000602084013e61374b565b606091505b5091509150816137955760405162461bcd60e51b81526020600482015260156024820152744c69625574696c733a204e6f20646563696d616c7360581b604482015260640161041f565b80806020019051810190611bce9190614e01565b60408051600481526024810182526020810180516001600160e01b031663556f0dc760e01b1790529051600091829182916001600160a01b038616916137ef9190614def565b600060405180830381855afa9150503d806000811461382a576040519150601f19603f3d011682016040523d82523d6000602084013e61382f565b606091505b5091509150816137955760405162461bcd60e51b815260206004820152601860248201527f4c69625574696c733a204e6f206772616e756c61726974790000000000000000604482015260640161041f565b60006122bb83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250613dbd565b6000806138d08385614938565b9050838110156122bb5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161041f565b6040516001600160a01b0383166024820152604481018290526118dd90849063a9059cbb60e01b906064016134bd565b600061395d87612f3d565b6139678787612542565b15613980576139798686868686613de9565b9050613999565b61399661398d88886124ef565b86868686613f99565b90505b9695505050505050565b6139b06020860186614448565b6060860135600081815260446020908152604091829020546001600160a01b039485169489811694937fa7a84dcc6757cdf9b9122d3bbc42d58358c28dc4b09cc24349599a63c56c62fd9392909116918b0135908b0135613a1760a08d0160808e01614ad8565b604080516001600160a01b039586168152602081019490945283019190915263ffffffff166060820152818916608082015290871660a08281019190915260c082018790528a013560e0820152466101008201526101200160405180910390a45050505050565b600060128260ff161115613ad45760405162461bcd60e51b815260206004820152601c60248201527f4c69625574696c733a20446563696d616c73206e6f74203c3d20313800000000604482015260640161041f565b613adf826012614bea565b61115b90600a614cf1565b613af4828261327e565b613b405760405162461bcd60e51b815260206004820181905260248201527f526f6c65733a206163636f756e7420646f65736e2774206861766520726f6c65604482015260640161041f565b6001600160a01b0316600090815260209190915260409020805460ff19169055565b613b6c828261327e565b15613bb95760405162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015260640161041f565b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b6001600160a01b0382163b613c355760405162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015260640161041f565b600080836001600160a01b031683604051613c509190614def565b6000604051808303816000865af19150503d8060008114613c8d576040519150601f19603f3d011682016040523d82523d6000602084013e613c92565b606091505b509150915081613ce45760405162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015260640161041f565b8051156134f45780806020019051810190613cff9190614e1a565b6134f45760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161041f565b60008183613d7f5760405162461bcd60e51b815260040161041f91906145ff565b5060006134808486614bd6565b60008184841115613db05760405162461bcd60e51b815260040161041f91906145ff565b50600061348084866148c2565b60008183613dde5760405162461bcd60e51b815260040161041f91906145ff565b50611bce8385614e37565b600080613df5876136c5565b60ff1690506000613e1c613e0a8360126148c2565b613e1590600a614e4b565b8790613641565b905080841115613e655760405162461bcd60e51b8152602060048201526014602482015273084e4d2c8ceca7440cccaca40e8dede40d0d2ced60631b604482015260640161041f565b613e6f8185613683565b6041549093506001600160a01b0389811691161415613f6057604154604051632e1a7d4d60e01b8152600481018390526001600160a01b0390911690632e1a7d4d90602401600060405180830381600087803b158015613ece57600080fd5b505af1158015613ee2573d6000803e3d6000fd5b50506040516001600160a01b038a16925085156108fc02915085906000818181858888f19350505050158015613f1c573d6000803e3d6000fd5b508315613f5b576040516001600160a01b0386169085156108fc029086906000818181858888f19350505050158015613f59573d6000803e3d6000fd5b505b613f8e565b613f746001600160a01b0389168885613922565b8315613f8e57613f8e6001600160a01b0389168686613922565b505095945050505050565b60006001600160a01b038616613ff15760405162461bcd60e51b815260206004820152601a60248201527f4272696467653a207369646520746f6b656e206973206e756c6c000000000000604482015260640161041f565b6000866001600160a01b031663556f0dc76040518163ffffffff1660e01b815260040160206040518083038186803b15801561402c57600080fd5b505afa158015614040573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140649190614e01565b9050600061407286836135c2565b9050808411156140bb5760405162461bcd60e51b8152602060048201526014602482015273084e4d2c8ceca7440cccaca40e8dede40d0d2ced60631b604482015260640161041f565b6140c58185613683565b604051630dcdc7dd60e41b81526001600160a01b038981166004830152602482018390526080604483015260006084830181905260a0606484015260a48301529194509089169063dcdc7dd09060c401600060405180830381600087803b15801561412f57600080fd5b505af1158015614143573d6000803e3d6000fd5b505050506000841115613f8e57604051630dcdc7dd60e41b81526001600160a01b03868116600483015260248201869052608060448301526000608483015260a06064830152600b60a48301526a72656c617965722066656560a81b60c483015289169063dcdc7dd09060e401600060405180830381600087803b1580156141ca57600080fd5b505af11580156141de573d6000803e3d6000fd5b50505050505095945050505050565b6001600160a01b0381168114611dc957600080fd5b60008083601f84011261421457600080fd5b50813567ffffffffffffffff81111561422c57600080fd5b60208301915083602082850101111561424457600080fd5b9250929050565b60008060008060008060008060c0898b03121561426757600080fd5b8835614272816141ed565b97506020890135614282816141ed565b96506040890135614292816141ed565b955060608901359450608089013567ffffffffffffffff808211156142b657600080fd5b6142c28c838d01614202565b909650945060a08b01359150808211156142db57600080fd5b506142e88b828c01614202565b999c989b5096995094979396929594505050565b60006020828403121561430e57600080fd5b5035919050565b8015158114611dc957600080fd5b60006020828403121561433557600080fd5b81356122bb81614315565b600060c0828403121561435257600080fd5b50919050565b600060c0828403121561436a57600080fd5b6122bb8383614340565b803563ffffffff8116811461438857600080fd5b919050565b60008060008060008060008060006101208a8c0312156143ac57600080fd5b89356143b7816141ed565b985060208a01356143c7816141ed565b975060408a01356143d7816141ed565b965060608a0135955060808a0135945060a08a013593506143fa60c08b01614374565b925060e08a013591506101008a013590509295985092959850929598565b6000806040838503121561442b57600080fd5b82359150602083013561443d816141ed565b809150509250929050565b60006020828403121561445a57600080fd5b81356122bb816141ed565b6000806020838503121561447857600080fd5b823567ffffffffffffffff8082111561449057600080fd5b818501915085601f8301126144a457600080fd5b8135818111156144b357600080fd5b8660208260051b85010111156144c857600080fd5b60209290920196919550909350505050565b60008082840360608112156144ee57600080fd5b83356144f9816141ed565b92506040601f198201121561450d57600080fd5b506040516040810181811067ffffffffffffffff8211171561453f57634e487b7160e01b600052604160045260246000fd5b6040526020840135614550816141ed565b81526040939093013560208401525092909150565b60008060006060848603121561457a57600080fd5b83359250602084013561458c816141ed565b9150604084013561459c816141ed565b809150509250925092565b60005b838110156145c25781810151838201526020016145aa565b838111156134f45750506000910152565b600081518084526145eb8160208601602086016145a7565b601f01601f19169290920160200192915050565b6020815260006122bb60208301846145d3565b60008060e0838503121561462557600080fd5b61462f8484614340565b9460c0939093013593505050565b803560ff8116811461438857600080fd5b6000806000806000806000610180888a03121561466a57600080fd5b6146748989614340565b965060c0880135614684816141ed565b955060e0880135945061010088013593506146a2610120890161463d565b92506101408801359150610160880135905092959891949750929550565b600080600080600080600060e0888a0312156146db57600080fd5b87356146e6816141ed565b965060208801359550604088013594506060880135935061470960808901614374565b925060a0880135915060c0880135905092959891949750929550565b6000806040838503121561473857600080fd5b50508035926020909101359150565b60008060008060008060008060c0898b03121561476357600080fd5b883597506020890135614775816141ed565b965061478360408a0161463d565b9550606089013567ffffffffffffffff808211156147a057600080fd5b6147ac8c838d01614202565b909750955060808b01359150808211156147c557600080fd5b506147d28b828c01614202565b999c989b50969995989497949560a00135949350505050565b6000806000806080858703121561480157600080fd5b843593506020850135614813816141ed565b92506040850135614823816141ed565b9396929550929360600135925050565b6000806000806080858703121561484957600080fd5b8435614854816141ed565b93506020850135614864816141ed565b92506040850135614874816141ed565b91506060850135614884816141ed565b939692955090935050565b6000602082840312156148a157600080fd5b81516122bb816141ed565b634e487b7160e01b600052601160045260246000fd5b6000828210156148d4576148d46148ac565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6000821982111561494b5761494b6148ac565b500190565b60208082526025908201527f5265656e7472616e637947756172643a206e6f207265656e7472616e7420616c6040820152641b1bddd95960da1b606082015260800190565b60208082526028908201527f436f6e747261637420696e7374616e636520697320616c726561647920696e696040820152671d1a585b1a5e995960c21b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b6000823560be19833603018112614a0957600080fd5b9190910192915050565b600060208284031215614a2557600080fd5b6122bb8261463d565b6000808335601e19843603018112614a4557600080fd5b83018035915067ffffffffffffffff821115614a6057600080fd5b60200191503681900382131561424457600080fd5b6000600019821415614a8957614a896148ac565b5060010190565b60208082526028908201527f506175736572526f6c653a2063616c6c657220646f65736e277420686176652060408201526774686520726f6c6560c01b606082015260800190565b600060208284031215614aea57600080fd5b6122bb82614374565b600060c08284031215614b0557600080fd5b60405160c0810181811067ffffffffffffffff82111715614b3657634e487b7160e01b600052604160045260246000fd5b6040528235614b44816141ed565b80825250602083013560208201526040830135604082015260608301356060820152614b7260808401614374565b608082015260a083013560a08201528091505092915050565b600181811c90821680614b9f57607f821691505b6020821081141561435257634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082614be557614be5614bc0565b500490565b600060ff821660ff841680821015614c0457614c046148ac565b90039392505050565b600181815b80851115614c48578160001904821115614c2e57614c2e6148ac565b80851615614c3b57918102915b93841c9390800290614c12565b509250929050565b600082614c5f5750600161115b565b81614c6c5750600061115b565b8160018114614c825760028114614c8c57614ca8565b600191505061115b565b60ff841115614c9d57614c9d6148ac565b50506001821b61115b565b5060208310610133831016604e8410600b8410161715614ccb575081810a61115b565b614cd58383614c0d565b8060001904821115614ce957614ce96148ac565b029392505050565b60006122bb60ff841683614c50565b828152604060208201526000611bce60408301846145d3565b60018060a01b038516815283602082015282604082015260806060820152600061399960808301846145d3565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b606081526000614d83606083018789614d46565b8281036020840152614d96818688614d46565b9150508260408301529695505050505050565b606081526000614dbd606083018688614d46565b6020830194909452506040015292915050565b6000816000190483118215151615614dea57614dea6148ac565b500290565b60008251614a098184602087016145a7565b600060208284031215614e1357600080fd5b5051919050565b600060208284031215614e2c57600080fd5b81516122bb81614315565b600082614e4657614e46614bc0565b500690565b60006122bb8383614c5056fea264697066735822122056e9c6d68b936a7b2c66545886a13f33f54fec9bc3a8a09c82fde6ed9811029364736f6c63430008090033", + "deployedBytecode": "0x6080604052600436106103bb5760003560e01c806382a0b8cb116101f2578063c4d66de81161010d578063e4e5bbcb116100a0578063f2fde38b1161006f578063f2fde38b14610ce0578063f698da2514610d00578063f8c8765e14610d16578063fa0caa1614610d3657600080fd5b8063e4e5bbcb14610c6c578063e6fc774414610c8c578063ea21709114610ca2578063eb16136f14610cc057600080fd5b8063d12e825d116100dc578063d12e825d14610be8578063d3401a2214610bfd578063da67703714610c1d578063e07801d014610c4c57600080fd5b8063c4d66de814610b42578063ca07140c14610b62578063cbc7328014610b98578063cc3c0f0614610bb857600080fd5b8063a53d6e6e11610185578063b0e1268e11610154578063b0e1268e14610a9d578063b794726214610abd578063b86f60d214610ade578063b984a40414610afe57600080fd5b8063a53d6e6e14610a1d578063a89f298a14610a3d578063ae06c1b714610a5d578063b048c4fb14610a7d57600080fd5b80638ca01082116101c15780638ca010821461099f5780638da5cb5b146109b45780638f32d59b146109d7578063916dc59d146109fd57600080fd5b806382a0b8cb1461091a57806382dc1ec41461094a5780638456cb591461096a57806388710e2e1461097f57600080fd5b80633f4ba83a116102e25780636b0509b1116102755780637a0ab28f116102445780637a0ab28f146108435780637a98187b146108795780637ecebe00146108d85780638129fc1c1461090557600080fd5b80636b0509b1146107d25780636ef8d66d1461080657806370aff70f1461081b578063715018a61461082e57600080fd5b80634c739509116102b15780634c7395091461074657806354fd4d50146107665780635c975abb1461079a578063615bfd6e146107b257600080fd5b80633f4ba83a146106d157806342cdb2c6146106e657806346fbf68e1461070657806347f8bbd41461072657600080fd5b806322f89ba41161035a5780633a1cbbcb116103295780633a1cbbcb146105ec5780633c3f63f41461063a5780633c7e0cb71461067b5780633cf3058b1461069b57600080fd5b806322f89ba4146105245780632f3cca4e1461056f5780633500c1dc1461058f57806337e76109146105af57600080fd5b80630ed928af116103965780630ed928af146104af5780630ef1335c146104cf57806311efbf61146104ef578063122aa5d41461050457600080fd5b806223de291461042f578063026976191461044f57806307c8f7b01461048f57600080fd5b3661042a576041546001600160a01b0316336001600160a01b0316146104285760405162461bcd60e51b815260206004820152601b60248201527f4272696467653a206e6f74207772617070656443757272656e6379000000000060448201526064015b60405180910390fd5b005b600080fd5b34801561043b57600080fd5b5061042861044a36600461424b565b610d56565b34801561045b57600080fd5b5061047c61046a3660046142fc565b60426020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561049b57600080fd5b506104286104aa366004614323565b6110b1565b3480156104bb57600080fd5b5061047c6104ca366004614358565b611140565b3480156104db57600080fd5b5061047c6104ea366004614358565b611161565b3480156104fb57600080fd5b5060375461047c565b34801561051057600080fd5b5061042861051f36600461438d565b6111d8565b34801561053057600080fd5b5061055f61053f366004614418565b604860209081526000928352604080842090915290825290205460ff1681565b6040519015158152602001610486565b34801561057b57600080fd5b5061042861058a366004614448565b611616565b34801561059b57600080fd5b506104286105aa366004614448565b611696565b3480156105bb57600080fd5b5061055f6105ca3660046142fc565b6000908152604260209081526040808320548352603e90915290205460ff1690565b3480156105f857600080fd5b50610622610607366004614448565b603b602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610486565b34801561064657600080fd5b50610622610655366004614418565b60466020908152600092835260408084209091529082529020546001600160a01b031681565b34801561068757600080fd5b50610428610696366004614465565b611768565b3480156106a757600080fd5b506106226106b63660046142fc565b6044602052600090815260409020546001600160a01b031681565b3480156106dd57600080fd5b506104286118e2565b3480156106f257600080fd5b50610428610701366004614448565b61199a565b34801561071257600080fd5b5061055f610721366004614448565b611a7b565b34801561073257600080fd5b506104286107413660046144da565b611a88565b34801561075257600080fd5b50610428610761366004614565565b611af9565b34801561077257600080fd5b506040805180820190915260028152611d8d60f21b60208201525b60405161048691906145ff565b3480156107a657600080fd5b5060345460ff1661055f565b3480156107be57600080fd5b5061055f6107cd366004614612565b611b69565b3480156107de57600080fd5b5061047c7faf3ac34fea9cc1b1def33a9bdc482d988feb61b5015ae4a55e2a62bb3600d54c81565b34801561081257600080fd5b50610428611bd6565b610428610829366004614418565b611be1565b34801561083a57600080fd5b50610428611cd6565b34801561084f57600080fd5b5061062261085e366004614448565b603c602052600090815260409020546001600160a01b031681565b34801561088557600080fd5b506108b9610894366004614448565b604760205260009081526040902080546001909101546001600160a01b039091169082565b604080516001600160a01b039093168352602083019190915201610486565b3480156108e457600080fd5b5061047c6108f3366004614448565b60456020526000908152604090205481565b34801561091157600080fd5b50610428611d5b565b34801561092657600080fd5b5061055f610935366004614448565b603d6020526000908152604090205460ff1681565b34801561095657600080fd5b50610428610965366004614448565b611dcc565b34801561097657600080fd5b50610428611dfa565b34801561098b57600080fd5b5061047c61099a36600461464e565b611e77565b3480156109ab57600080fd5b5061078d611ff2565b3480156109c057600080fd5b5060345461010090046001600160a01b0316610622565b3480156109e357600080fd5b5061055f60345461010090046001600160a01b0316331490565b348015610a0957600080fd5b50610428610a18366004614448565b612080565b348015610a2957600080fd5b50603f54610622906001600160a01b031681565b348015610a4957600080fd5b5061047c610a583660046146c0565b612159565b348015610a6957600080fd5b50610428610a783660046142fc565b6121cb565b348015610a8957600080fd5b5061055f610a98366004614725565b612290565b348015610aa957600080fd5b50604154610622906001600160a01b031681565b348015610ac957600080fd5b5060405461055f90600160a01b900460ff1681565b348015610aea57600080fd5b50604054610622906001600160a01b031681565b348015610b0a57600080fd5b50610b1e610b19366004614448565b6122c2565b6040805182516001600160a01b031681526020928301519281019290925201610486565b348015610b4e57600080fd5b50610428610b5d366004614448565b612341565b348015610b6e57600080fd5b50610622610b7d3660046142fc565b6043602052600090815260409020546001600160a01b031681565b348015610ba457600080fd5b50610428610bb3366004614747565b612403565b348015610bc457600080fd5b5061055f610bd33660046142fc565b603e6020526000908152604090205460ff1681565b348015610bf457600080fd5b50610428612448565b348015610c0957600080fd5b50610622610c18366004614418565b6124ef565b348015610c2957600080fd5b5061055f610c383660046142fc565b600090815260426020526040902054151590565b348015610c5857600080fd5b5061055f610c67366004614418565b612542565b348015610c7857600080fd5b50610428610c873660046147eb565b612597565b348015610c9857600080fd5b5061047c61271081565b348015610cae57600080fd5b506036546001600160a01b0316610622565b348015610ccc57600080fd5b50610428610cdb366004614448565b6125d1565b348015610cec57600080fd5b50610428610cfb366004614448565b612653565b348015610d0c57600080fd5b5061047c60395481565b348015610d2257600080fd5b50610428610d31366004614833565b612691565b348015610d4257600080fd5b50610428610d51366004614448565b6127e6565b6001600160a01b038816301415610d6c576110a7565b6001600160a01b0386163014610dc45760405162461bcd60e51b815260206004820152601b60248201527f4272696467653a204e6f7420746f207468697320616464726573730000000000604482015260640161041f565b60003360405163555ddc6560e11b81526001600160a01b03821660048201527fac7fbab5f54a3ca8194167523c6753bfeb96a445279294b6125b68cce21770546024820152909150600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b158015610e4657600080fd5b505afa158015610e5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7e919061488f565b6001600160a01b03161415610ed55760405162461bcd60e51b815260206004820152601860248201527f4272696467653a204e6f742045524337373720746f6b656e0000000000000000604482015260640161041f565b6020841015610f455760405162461bcd60e51b815260206004820152603660248201527f4272696467653a207573657220646174612077697468206174206c65617374206044820152751d1a194819195cdd1a5b985d1a5bdb90da185a5b925960521b606482015260840161041f565b6040841480610f5c57506001600160a01b0388163b155b610fb95760405162461bcd60e51b815260206004820152602860248201527f4272696467653a2053706563696679207265636569766572206164647265737360448201526720696e206461746160c01b606482015260840161041f565b60006020851461100a5761100586868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600c92506128bf915050565b61100c565b885b9050600061105c87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506110579250602091508a90506148c2565b61292c565b90506110a3838b848b8b8b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250899250612992915050565b5050505b5050505050505050565b6110ca60345461010090046001600160a01b0316331490565b6110e65760405162461bcd60e51b815260040161041f906148d9565b6040805460ff60a01b1916600160a01b831515810291909117808355915160ff9190920416151581527f983e436223c000a441c2443b394ca5fb4669a513fe86dc1dd44494047b514ad9906020015b60405180910390a150565b600061115b826111536020820182614448565b600080612d52565b92915050565b60608101356000908152604460205260408120546001600160a01b0316336001600160a01b0316146111ce5760405162461bcd60e51b8152602060048201526016602482015275213934b233b29d1034b73b30b634b21039b2b73232b960511b604482015260640161041f565b61115b8233611153565b60345460ff16156111fb5760405162461bcd60e51b815260040161041f9061490e565b60016035600082825461120e9190614938565b90915550506035546036546001600160a01b0316336001600160a01b0316146112725760405162461bcd60e51b8152602060048201526016602482015275213934b233b29d102737ba102332b232b930ba34b7b760511b604482015260640161041f565b61127b83612f3d565b61128482612f84565b61128e838b612542565b806112ac575060006112a0848c6124ef565b6001600160a01b031614155b6112f05760405162461bcd60e51b8152602060048201526015602482015274213934b233b29d102ab735b737bbb7103a37b5b2b760591b604482015260640161041f565b6001600160a01b0388166113385760405162461bcd60e51b815260206004820152600f60248201526e4272696467653a204e756c6c20546f60881b604482015260640161041f565b6000871161137b5760405162461bcd60e51b815260206004820152601060248201526f04272696467653a20416d6f756e7420360841b604482015260640161041f565b856113c15760405162461bcd60e51b8152602060048201526016602482015275084e4d2c8ceca74409cead8d84084d8dec6d690c2e6d60531b604482015260640161041f565b846114045760405162461bcd60e51b8152602060048201526013602482015272084e4d2c8ceca74409cead8d840a8f090c2e6d606b1b604482015260640161041f565b600085815260426020526040902054156114605760405162461bcd60e51b815260206004820152601860248201527f4272696467653a20416c72656164792061636365707465640000000000000000604482015260640161041f565b600061146f8989898989612fd3565b905060006114828a8a8a8a8a8a8a612159565b905061148e8282612290565b156114d55760405162461bcd60e51b8152602060048201526017602482015276109c9a5919d94e88105b1c9958591e4818db185a5b5959604a1b604482015260640161041f565b8060426000898152602001908152602001600020819055508b6043600089815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b031602179055508a6044600089815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550896001600160a01b03168c6001600160a01b0316887fddae5e892ad96ac0e35e9018a1a3e32ecd7f3dfe55ea34d9ab1e8faecd6ccb5a8e8d8d8c8c8c6040516115df969594939291906001600160a01b039690961686526020860194909452604085019290925263ffffffff166060840152608083015260a082015260c00190565b60405180910390a45050603554811461160a5760405162461bcd60e51b815260040161041f90614950565b50505050505050505050565b600054610100900460ff168061162f575060005460ff16155b61164b5760405162461bcd60e51b815260040161041f90614995565b600054610100900460ff1615801561166d576000805461ffff19166101011790555b611676826125d1565b6034805460ff191690558015611692576000805461ff00191690555b5050565b6116af60345461010090046001600160a01b0316331490565b6116cb5760405162461bcd60e51b815260040161041f906148d9565b6001600160a01b03811661171a5760405162461bcd60e51b81526020600482015260166024820152754272696467653a20777261707020697320656d70747960501b604482015260640161041f565b604180546001600160a01b0319166001600160a01b0383169081179091556040519081527f0966c958966f6fac9ff807af074f8117eb2e9ce2b76390db7a158e9bdeb2485c90602001611135565b61178160345461010090046001600160a01b0316331490565b61179d5760405162461bcd60e51b815260040161041f906148d9565b60005b818110156118dd576118cb8383838181106117bd576117bd6149dd565b90506020028101906117cf91906149f3565b358484848181106117e2576117e26149dd565b90506020028101906117f491906149f3565b611805906040810190602001614448565b858585818110611817576118176149dd565b905060200281019061182991906149f3565b61183a906060810190604001614a13565b86868681811061184c5761184c6149dd565b905060200281019061185e91906149f3565b61186c906060810190614a2e565b88888881811061187e5761187e6149dd565b905060200281019061189091906149f3565b61189e906080810190614a2e565b8a8a8a8181106118b0576118b06149dd565b90506020028101906118c291906149f3565b60a0013561303e565b806118d581614a75565b9150506117a0565b505050565b6118eb33611a7b565b6119075760405162461bcd60e51b815260040161041f90614a90565b60345460ff166119505760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161041f565b6034805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6119b360345461010090046001600160a01b0316331490565b6119cf5760405162461bcd60e51b815260040161041f906148d9565b6001600160a01b038116611a2f5760405162461bcd60e51b815260206004820152602160248201527f4272696467653a2053696465546f6b656e466163746f727920697320656d70746044820152607960f81b606482015260840161041f565b604080546001600160a01b0319166001600160a01b038316908117825590519081527f619936bc6e3618d0b8dc69bcc70134fe9d88f9967f3a8b8304e318369252162590602001611135565b600061115b60338361327e565b611aa160345461010090046001600160a01b0316331490565b611abd5760405162461bcd60e51b815260040161041f906148d9565b6001600160a01b039182166000908152604760209081526040909120825181546001600160a01b03191694169390931783550151600190910155565b611b1260345461010090046001600160a01b0316331490565b611b2e5760405162461bcd60e51b815260040161041f906148d9565b60009283526046602090815260408085206001600160a01b0394851686529091529092208054919092166001600160a01b0319909116179055565b600080611ba0611b7c6020860186614448565b602086013560408701356060880135611b9b60a08a0160808b01614ad8565b612fd3565b6000818152603e602052604090205490915060ff1680611bce57506000838152603e602052604090205460ff165b949350505050565b611bdf33613301565b565b60415433906001600160a01b0316611c3b5760405162461bcd60e51b815260206004820152601d60248201527f4272696467653a207772617070656443757272656e637920656d707479000000604482015260640161041f565b604160009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b158015611c8b57600080fd5b505af1158015611c9f573d6000803e3d6000fd5b50505050506118dd604160009054906101000a90046001600160a01b03168284346040518060200160405280600081525088612992565b611cef60345461010090046001600160a01b0316331490565b611d0b5760405162461bcd60e51b815260040161041f906148d9565b60345460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360348054610100600160a81b0319169055565b600054610100900460ff1680611d74575060005460ff16155b611d905760405162461bcd60e51b815260040161041f90614995565b600054610100900460ff16158015611db2576000805461ffff19166101011790555b60016035558015611dc9576000805461ff00191690555b50565b611dd533611a7b565b611df15760405162461bcd60e51b815260040161041f90614a90565b611dc981613343565b611e0333611a7b565b611e1f5760405162461bcd60e51b815260040161041f90614a90565b60345460ff1615611e425760405162461bcd60e51b815260040161041f9061490e565b6034805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861197d3390565b600042851015611ebb5760405162461bcd60e51b815260206004820152600f60248201526e109c9a5919d94e8811561412549151608a1b604482015260640161041f565b6000611ed7611ecf368b90038b018b614af3565b898989613385565b6040805160008082526020820180845284905260ff89169282019290925260608101879052608081018690529192509060019060a0016020604051602081039080840390855afa158015611f2f573d6000803e3d6000fd5b5050604051601f190151915060009050611f4c60208c018c614448565b6001600160a01b031614158015611f805750611f6b60208b018b614448565b6001600160a01b0316816001600160a01b0316145b611fcc5760405162461bcd60e51b815260206004820152601960248201527f4272696467653a20494e56414c49445f5349474e415455524500000000000000604482015260640161041f565b611fe48a611fdd6020820182614448565b8b8b612d52565b9a9950505050505050505050565b60388054611fff90614b8b565b80601f016020809104026020016040519081016040528092919081815260200182805461202b90614b8b565b80156120785780601f1061204d57610100808354040283529160200191612078565b820191906000526020600020905b81548152906001019060200180831161205b57829003601f168201915b505050505081565b61209960345461010090046001600160a01b0316331490565b6120b55760405162461bcd60e51b815260040161041f906148d9565b6001600160a01b03811661210b5760405162461bcd60e51b815260206004820152601c60248201527f4272696467653a20416c6c6f77546f6b656e7320697320656d70747900000000604482015260640161041f565b603f80546001600160a01b0319166001600160a01b0383169081179091556040519081527f5f2c1fe803fd576d8af05ea156011cc9cc8c025bda24c1e85772fc05a0b3f1e390602001611135565b6040805160208082019790975280820195909552606097881b6bffffffffffffffffffffffff191697850197909752607484019590955260e09190911b6001600160e01b0319166094830152609882015260b8808201939093528351808203909301835260d801909252805191012090565b6121e460345461010090046001600160a01b0316331490565b6122005760405162461bcd60e51b815260040161041f906148d9565b61220d600a612710614bd6565b811061225b5760405162461bcd60e51b815260206004820152601760248201527f4272696467653a20626967676572207468616e20313025000000000000000000604482015260640161041f565b60378190556040518181527f97e97c577f03bda90e2c9739011ec065ed5fbfb36ae217d20bb0d9be95e160cd90602001611135565b6000828152603e602052604081205460ff16806122bb57506000828152603e602052604090205460ff165b9392505050565b604080518082018252600080825260209182018190526001600160a01b038481168252604783529083902083518085019094528054909116808452600190910154918301919091521561231457919050565b60016020808301919091526001600160a01b039283166000908152603c9091526040902054909116815290565b600054610100900460ff168061235a575060005460ff16155b6123765760405162461bcd60e51b815260040161041f90614995565b600054610100900460ff16158015612398576000805461ffff19166101011790555b60348054610100600160a81b0319166101006001600160a01b0385811682029290921792839055604051920416906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a38015611692576000805461ff00191690555050565b61241c60345461010090046001600160a01b0316331490565b6124385760405162461bcd60e51b815260040161041f906148d9565b6110a7888888888888888861303e565b604080518082018252601081526f52534b20546f6b656e2042726964676560801b60208083019182528351808501855260018152603160f81b908201529151902082517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8152918201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc69181019190915246606082015230608082015260a09020603955565b60008281526046602090815260408083206001600160a01b038086168552925282205416801561252057905061115b565b50506001600160a01b039081166000908152603b602052604090205416919050565b60008281526048602090815260408083206001600160a01b038516845290915281205460ff16801561257557905061115b565b50506001600160a01b03166000908152603d602052604090205460ff16919050565b336125ad6001600160a01b038516823085613489565b6125ca84828585604051806020016040528060008152508a612992565b5050505050565b600054610100900460ff16806125ea575060005460ff16155b6126065760405162461bcd60e51b815260040161041f90614995565b600054610100900460ff16158015612628576000805461ffff19166101011790555b61263182611a7b565b61263e5761263e82613343565b8015611692576000805461ff00191690555050565b61266c60345461010090046001600160a01b0316331490565b6126885760405162461bcd60e51b815260040161041f906148d9565b611dc9816134fa565b600054610100900460ff16806126aa575060005460ff16155b6126c65760405162461bcd60e51b815260040161041f90614995565b600054610100900460ff161580156126e8576000805461ffff19166101011790555b6126f185612341565b6126fa85611616565b603f80546001600160a01b038581166001600160a01b031992831617909255604080548584169083161781556036805493881693909216929092179055516329965a1d60e01b815230600482018190527fb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b60248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad24906329965a1d90606401600060405180830381600087803b1580156127ae57600080fd5b505af11580156127c2573d6000803e3d6000fd5b505050506127ce612448565b80156125ca576000805461ff00191690555050505050565b6127ff60345461010090046001600160a01b0316331490565b61281b5760405162461bcd60e51b815260040161041f906148d9565b6001600160a01b0381166128715760405162461bcd60e51b815260206004820152601b60248201527f4272696467653a2046656465726174696f6e20697320656d7074790000000000604482015260640161041f565b603680546001600160a01b0319166001600160a01b0383169081179091556040519081527f4a41a4d11aaf0c0c9e4311ac1d68b2b0134556da594779a2a35b0ddf7cd1eafb90602001611135565b60006128cc826014614938565b8351101561291c5760405162461bcd60e51b815260206004820152601f60248201527f4c69625574696c733a20746f416464726573735f6f75744f66426f756e647300604482015260640161041f565b500160200151600160601b900490565b6000612939826020614938565b835110156129895760405162461bcd60e51b815260206004820152601f60248201527f4c69625574696c733a20746f55696e743235365f6f75744f66426f756e647300604482015260640161041f565b50016020015190565b604054600160a01b900460ff16156129e05760405162461bcd60e51b81526020600482015260116024820152704272696467653a20557067726164696e6760781b604482015260640161041f565b60345460ff1615612a035760405162461bcd60e51b815260040161041f9061490e565b600160356000828254612a169190614938565b909155505060355446821415612a8a5760405162461bcd60e51b815260206004820152603360248201527f4272696467653a2064657374696e6174696f6e20636861696e20696420657175604482015272185b0818dd5c9c995b9d0818da185a5b881a59606a1b606482015260840161041f565b612a9382612f3d565b60008281526048602090815260408083206001600160a01b038b1684529091529020805460ff191660011790556000612ae3612710612add603754886135c290919063ffffffff16565b90613641565b90506000612af18683613683565b90506000612afe8a6136c5565b905086601260ff831614612b2f57612b2c612b1a836012614bea565b612b2590600a614cf1565b89906135c2565b90505b603f54604051638c34bc5560e01b81526001600160a01b038d811660048301526024820184905290911690638c34bc5590604401600060405180830381600087803b158015612b7d57600080fd5b505af1158015612b91573d6000803e3d6000fd5b505050506000612ba08c6122c2565b80519091506001600160a01b031615612ca4576000612bbe8d6137a9565b90506000612bcc8683613881565b9050612bd887826138c3565b9650612be48682613683565b60405163fe9d930360e01b81529096506001600160a01b038f169063fe9d930390612c159089908e90600401614d00565b600060405180830381600087803b158015612c2f57600080fd5b505af1158015612c43573d6000803e3d6000fd5b505050505050868a6001600160a01b031682600001516001600160a01b03167fb2320a1ad388e1e16b142f7d2e822f31d8a2bbdd7d4f29260e7c203c5f45e8498e46898e604051612c979493929190614d19565b60405180910390a4612cf7565b868a6001600160a01b03168d6001600160a01b03167fb2320a1ad388e1e16b142f7d2e822f31d8a2bbdd7d4f29260e7c203c5f45e8498e46898e604051612cee9493929190614d19565b60405180910390a45b8415612d2357603454612d239061010090046001600160a01b03166001600160a01b038e169087613922565b50505050506035548114612d495760405162461bcd60e51b815260040161041f90614950565b50505050505050565b6000600160356000828254612d679190614938565b909155505060355460608601356000908152604360205260409020546001600160a01b031680612dd25760405162461bcd60e51b8152602060048201526016602482015275109c9a5919d94e88151e081b9bdd0818dc9bdcdcd95960521b604482015260640161041f565b6000612e0e612de460208a018a614448565b60208a013560408b013560608c0135612e0360a08e0160808f01614ad8565b8d60a0013546612159565b60608901356000908152604260205260409020549091508114612e7d5760405162461bcd60e51b815260206004820152602160248201527f4272696467653a2057726f6e67207472616e73616374696f6e446174614861736044820152600d60fb1b606482015260840161041f565b612e878882611b69565b15612ece5760405162461bcd60e51b8152602060048201526017602482015276109c9a5919d94e88105b1c9958591e4818db185a5b5959604a1b604482015260640161041f565b6000818152603e60209081526040909120805460ff19166001179055612f029060a08a01359084908a908c01358a8a613952565b9350612f1188838989896139a3565b50506035548114612f345760405162461bcd60e51b815260040161041f90614950565b50949350505050565b60008111611dc95760405162461bcd60e51b815260206004820152601460248201527304272696467653a20436861696e496420697320360641b604482015260640161041f565b468114611dc95760405162461bcd60e51b815260206004820152601960248201527f4272696467653a204e6f7420626c6f636b2e636861696e696400000000000000604482015260640161041f565b6040805160208101859052908101839052606086811b6bffffffffffffffffffffffff1916908201526074810185905260e082901b6001600160e01b031916609482015260009060980160405160208183030381529060405280519060200120905095945050505050565b6001600160a01b0387166130895760405162461bcd60e51b8152602060048201526012602482015271213934b233b29d10273ab636103a37b5b2b760711b604482015260640161041f565b61309281612f3d565b600061309e82896124ef565b90506001600160a01b038116156130f05760405162461bcd60e51b81526020600482015260166024820152754272696467653a20416c72656164792065786973747360501b604482015260640161041f565b60006130fb88613a7e565b6040805490516326d9e96360e01b81529192506001600160a01b0316906326d9e9639061313490889088908c908c908890600401614d6f565b602060405180830381600087803b15801561314e57600080fd5b505af1158015613162573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613186919061488f565b9150613193838a84611af9565b60408051808201909152602081018490526001600160a01b038a1681526131ba8382611a88565b603f546040516378bf2b5360e01b81526001600160a01b038581166004830152602482018e9052909116906378bf2b5390604401600060405180830381600087803b15801561320857600080fd5b505af115801561321c573d6000803e3d6000fd5b50505050896001600160a01b0316836001600160a01b03167f88dcf8b72e53287db29df3fee9a0f2cb07d1f986cee153aa7d7554405d5db0178a8a86896040516132699493929190614da9565b60405180910390a35050505050505050505050565b60006001600160a01b0382166132e15760405162461bcd60e51b815260206004820152602260248201527f526f6c65733a206163636f756e7420697320746865207a65726f206164647265604482015261737360f01b606482015260840161041f565b506001600160a01b03166000908152602091909152604090205460ff1690565b61330c603382613aea565b6040516001600160a01b038216907fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e90600090a250565b61334e603382613b62565b6040516001600160a01b038216907f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f890600090a250565b6039548451602080870151606088015160a08901516001600160a01b0385166000908152604590945260408420805494966134809690957faf3ac34fea9cc1b1def33a9bdc482d988feb61b5015ae4a55e2a62bb3600d54c959194919391928c918c918b6133f283614a75565b909155506040805160208101999099526001600160a01b03978816908901526060880195909552608087019390935260a086019190915290921660c084015260e08301919091526101008201526101208101859052610140016040516020818303038152906040528051906020012060405161190160f01b8152600281019290925260228201526042902090565b95945050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526134f49085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613bde565b50505050565b6001600160a01b03811661355b5760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a206e6577206f776e6572206973207a65726f206164647265604482015261737360f01b606482015260840161041f565b6034546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603480546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6000826135d15750600061115b565b60006135dd8385614dd0565b9050826135ea8583614bd6565b146122bb5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161041f565b60006122bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613d5e565b60006122bb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613d8c565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b1790529051600091829182916001600160a01b0386169161370b9190614def565b600060405180830381855afa9150503d8060008114613746576040519150601f19603f3d011682016040523d82523d6000602084013e61374b565b606091505b5091509150816137955760405162461bcd60e51b81526020600482015260156024820152744c69625574696c733a204e6f20646563696d616c7360581b604482015260640161041f565b80806020019051810190611bce9190614e01565b60408051600481526024810182526020810180516001600160e01b031663556f0dc760e01b1790529051600091829182916001600160a01b038616916137ef9190614def565b600060405180830381855afa9150503d806000811461382a576040519150601f19603f3d011682016040523d82523d6000602084013e61382f565b606091505b5091509150816137955760405162461bcd60e51b815260206004820152601860248201527f4c69625574696c733a204e6f206772616e756c61726974790000000000000000604482015260640161041f565b60006122bb83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250613dbd565b6000806138d08385614938565b9050838110156122bb5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161041f565b6040516001600160a01b0383166024820152604481018290526118dd90849063a9059cbb60e01b906064016134bd565b600061395d87612f3d565b6139678787612542565b15613980576139798686868686613de9565b9050613999565b61399661398d88886124ef565b86868686613f99565b90505b9695505050505050565b6139b06020860186614448565b6060860135600081815260446020908152604091829020546001600160a01b039485169489811694937fa7a84dcc6757cdf9b9122d3bbc42d58358c28dc4b09cc24349599a63c56c62fd9392909116918b0135908b0135613a1760a08d0160808e01614ad8565b604080516001600160a01b039586168152602081019490945283019190915263ffffffff166060820152818916608082015290871660a08281019190915260c082018790528a013560e0820152466101008201526101200160405180910390a45050505050565b600060128260ff161115613ad45760405162461bcd60e51b815260206004820152601c60248201527f4c69625574696c733a20446563696d616c73206e6f74203c3d20313800000000604482015260640161041f565b613adf826012614bea565b61115b90600a614cf1565b613af4828261327e565b613b405760405162461bcd60e51b815260206004820181905260248201527f526f6c65733a206163636f756e7420646f65736e2774206861766520726f6c65604482015260640161041f565b6001600160a01b0316600090815260209190915260409020805460ff19169055565b613b6c828261327e565b15613bb95760405162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015260640161041f565b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b6001600160a01b0382163b613c355760405162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015260640161041f565b600080836001600160a01b031683604051613c509190614def565b6000604051808303816000865af19150503d8060008114613c8d576040519150601f19603f3d011682016040523d82523d6000602084013e613c92565b606091505b509150915081613ce45760405162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015260640161041f565b8051156134f45780806020019051810190613cff9190614e1a565b6134f45760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161041f565b60008183613d7f5760405162461bcd60e51b815260040161041f91906145ff565b5060006134808486614bd6565b60008184841115613db05760405162461bcd60e51b815260040161041f91906145ff565b50600061348084866148c2565b60008183613dde5760405162461bcd60e51b815260040161041f91906145ff565b50611bce8385614e37565b600080613df5876136c5565b60ff1690506000613e1c613e0a8360126148c2565b613e1590600a614e4b565b8790613641565b905080841115613e655760405162461bcd60e51b8152602060048201526014602482015273084e4d2c8ceca7440cccaca40e8dede40d0d2ced60631b604482015260640161041f565b613e6f8185613683565b6041549093506001600160a01b0389811691161415613f6057604154604051632e1a7d4d60e01b8152600481018390526001600160a01b0390911690632e1a7d4d90602401600060405180830381600087803b158015613ece57600080fd5b505af1158015613ee2573d6000803e3d6000fd5b50506040516001600160a01b038a16925085156108fc02915085906000818181858888f19350505050158015613f1c573d6000803e3d6000fd5b508315613f5b576040516001600160a01b0386169085156108fc029086906000818181858888f19350505050158015613f59573d6000803e3d6000fd5b505b613f8e565b613f746001600160a01b0389168885613922565b8315613f8e57613f8e6001600160a01b0389168686613922565b505095945050505050565b60006001600160a01b038616613ff15760405162461bcd60e51b815260206004820152601a60248201527f4272696467653a207369646520746f6b656e206973206e756c6c000000000000604482015260640161041f565b6000866001600160a01b031663556f0dc76040518163ffffffff1660e01b815260040160206040518083038186803b15801561402c57600080fd5b505afa158015614040573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140649190614e01565b9050600061407286836135c2565b9050808411156140bb5760405162461bcd60e51b8152602060048201526014602482015273084e4d2c8ceca7440cccaca40e8dede40d0d2ced60631b604482015260640161041f565b6140c58185613683565b604051630dcdc7dd60e41b81526001600160a01b038981166004830152602482018390526080604483015260006084830181905260a0606484015260a48301529194509089169063dcdc7dd09060c401600060405180830381600087803b15801561412f57600080fd5b505af1158015614143573d6000803e3d6000fd5b505050506000841115613f8e57604051630dcdc7dd60e41b81526001600160a01b03868116600483015260248201869052608060448301526000608483015260a06064830152600b60a48301526a72656c617965722066656560a81b60c483015289169063dcdc7dd09060e401600060405180830381600087803b1580156141ca57600080fd5b505af11580156141de573d6000803e3d6000fd5b50505050505095945050505050565b6001600160a01b0381168114611dc957600080fd5b60008083601f84011261421457600080fd5b50813567ffffffffffffffff81111561422c57600080fd5b60208301915083602082850101111561424457600080fd5b9250929050565b60008060008060008060008060c0898b03121561426757600080fd5b8835614272816141ed565b97506020890135614282816141ed565b96506040890135614292816141ed565b955060608901359450608089013567ffffffffffffffff808211156142b657600080fd5b6142c28c838d01614202565b909650945060a08b01359150808211156142db57600080fd5b506142e88b828c01614202565b999c989b5096995094979396929594505050565b60006020828403121561430e57600080fd5b5035919050565b8015158114611dc957600080fd5b60006020828403121561433557600080fd5b81356122bb81614315565b600060c0828403121561435257600080fd5b50919050565b600060c0828403121561436a57600080fd5b6122bb8383614340565b803563ffffffff8116811461438857600080fd5b919050565b60008060008060008060008060006101208a8c0312156143ac57600080fd5b89356143b7816141ed565b985060208a01356143c7816141ed565b975060408a01356143d7816141ed565b965060608a0135955060808a0135945060a08a013593506143fa60c08b01614374565b925060e08a013591506101008a013590509295985092959850929598565b6000806040838503121561442b57600080fd5b82359150602083013561443d816141ed565b809150509250929050565b60006020828403121561445a57600080fd5b81356122bb816141ed565b6000806020838503121561447857600080fd5b823567ffffffffffffffff8082111561449057600080fd5b818501915085601f8301126144a457600080fd5b8135818111156144b357600080fd5b8660208260051b85010111156144c857600080fd5b60209290920196919550909350505050565b60008082840360608112156144ee57600080fd5b83356144f9816141ed565b92506040601f198201121561450d57600080fd5b506040516040810181811067ffffffffffffffff8211171561453f57634e487b7160e01b600052604160045260246000fd5b6040526020840135614550816141ed565b81526040939093013560208401525092909150565b60008060006060848603121561457a57600080fd5b83359250602084013561458c816141ed565b9150604084013561459c816141ed565b809150509250925092565b60005b838110156145c25781810151838201526020016145aa565b838111156134f45750506000910152565b600081518084526145eb8160208601602086016145a7565b601f01601f19169290920160200192915050565b6020815260006122bb60208301846145d3565b60008060e0838503121561462557600080fd5b61462f8484614340565b9460c0939093013593505050565b803560ff8116811461438857600080fd5b6000806000806000806000610180888a03121561466a57600080fd5b6146748989614340565b965060c0880135614684816141ed565b955060e0880135945061010088013593506146a2610120890161463d565b92506101408801359150610160880135905092959891949750929550565b600080600080600080600060e0888a0312156146db57600080fd5b87356146e6816141ed565b965060208801359550604088013594506060880135935061470960808901614374565b925060a0880135915060c0880135905092959891949750929550565b6000806040838503121561473857600080fd5b50508035926020909101359150565b60008060008060008060008060c0898b03121561476357600080fd5b883597506020890135614775816141ed565b965061478360408a0161463d565b9550606089013567ffffffffffffffff808211156147a057600080fd5b6147ac8c838d01614202565b909750955060808b01359150808211156147c557600080fd5b506147d28b828c01614202565b999c989b50969995989497949560a00135949350505050565b6000806000806080858703121561480157600080fd5b843593506020850135614813816141ed565b92506040850135614823816141ed565b9396929550929360600135925050565b6000806000806080858703121561484957600080fd5b8435614854816141ed565b93506020850135614864816141ed565b92506040850135614874816141ed565b91506060850135614884816141ed565b939692955090935050565b6000602082840312156148a157600080fd5b81516122bb816141ed565b634e487b7160e01b600052601160045260246000fd5b6000828210156148d4576148d46148ac565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6000821982111561494b5761494b6148ac565b500190565b60208082526025908201527f5265656e7472616e637947756172643a206e6f207265656e7472616e7420616c6040820152641b1bddd95960da1b606082015260800190565b60208082526028908201527f436f6e747261637420696e7374616e636520697320616c726561647920696e696040820152671d1a585b1a5e995960c21b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b6000823560be19833603018112614a0957600080fd5b9190910192915050565b600060208284031215614a2557600080fd5b6122bb8261463d565b6000808335601e19843603018112614a4557600080fd5b83018035915067ffffffffffffffff821115614a6057600080fd5b60200191503681900382131561424457600080fd5b6000600019821415614a8957614a896148ac565b5060010190565b60208082526028908201527f506175736572526f6c653a2063616c6c657220646f65736e277420686176652060408201526774686520726f6c6560c01b606082015260800190565b600060208284031215614aea57600080fd5b6122bb82614374565b600060c08284031215614b0557600080fd5b60405160c0810181811067ffffffffffffffff82111715614b3657634e487b7160e01b600052604160045260246000fd5b6040528235614b44816141ed565b80825250602083013560208201526040830135604082015260608301356060820152614b7260808401614374565b608082015260a083013560a08201528091505092915050565b600181811c90821680614b9f57607f821691505b6020821081141561435257634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082614be557614be5614bc0565b500490565b600060ff821660ff841680821015614c0457614c046148ac565b90039392505050565b600181815b80851115614c48578160001904821115614c2e57614c2e6148ac565b80851615614c3b57918102915b93841c9390800290614c12565b509250929050565b600082614c5f5750600161115b565b81614c6c5750600061115b565b8160018114614c825760028114614c8c57614ca8565b600191505061115b565b60ff841115614c9d57614c9d6148ac565b50506001821b61115b565b5060208310610133831016604e8410600b8410161715614ccb575081810a61115b565b614cd58383614c0d565b8060001904821115614ce957614ce96148ac565b029392505050565b60006122bb60ff841683614c50565b828152604060208201526000611bce60408301846145d3565b60018060a01b038516815283602082015282604082015260806060820152600061399960808301846145d3565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b606081526000614d83606083018789614d46565b8281036020840152614d96818688614d46565b9150508260408301529695505050505050565b606081526000614dbd606083018688614d46565b6020830194909452506040015292915050565b6000816000190483118215151615614dea57614dea6148ac565b500290565b60008251614a098184602087016145a7565b600060208284031215614e1357600080fd5b5051919050565b600060208284031215614e2c57600080fd5b81516122bb81614315565b600082614e4657614e46614bc0565b500690565b60006122bb8383614c5056fea264697066735822122056e9c6d68b936a7b2c66545886a13f33f54fec9bc3a8a09c82fde6ed9811029364736f6c63430008090033", + "devdoc": { + "kind": "dev", + "methods": { + "__Pausable_init(address)": { + "details": "Initializes the contract in unpaused state. Assigns the Pauser role to the deployer." + }, + "initialize(address)": { + "details": "Initializes the contract setting the deployer as the initial owner." + }, + "isOwner()": { + "details": "Returns true if the caller is the current owner." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "pause()": { + "details": "Called by a pauser to pause, triggers stopped state." + }, + "paused()": { + "details": "Returns true if the contract is paused, and false otherwise." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. > Note: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "tokensReceived(address,address,address,uint256,bytes,bytes)": { + "params": { + "userData": "it can be 2 options in the first one you can send the receiver and the chain id of the destination const userData = web3.eth.abi.encodeParameters( [\"address\", \"uint256\"], [anAccount.toLowerCase(), chains.ETHEREUM_MAIN_NET_CHAIN_ID] ); or you also can send only the destination chain id, and the receiver would be the same as the from parameter const userData = web3.eth.abi.encodeParameters([\"uint256\"], [chains.ETHEREUM_MAIN_NET_CHAIN_ID]);" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unpause()": { + "details": "Called by a pauser to unpause, returns to normal state." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "acceptTransfer(address,address,address,uint256,bytes32,bytes32,uint32,uint256,uint256)": { + "notice": "Accepts the transaction from the other chain that was voted and sent by the Federation contract" + }, + "claim((address,uint256,bytes32,bytes32,uint32,uint256))": { + "notice": "Claims the crossed transaction using the hash, this sends the funds to the address indicated in" + }, + "depositTo(uint256,address)": { + "notice": "Use network currency and cross it." + }, + "receiveTokensTo(uint256,address,address,uint256)": { + "notice": "ERC-20 tokens approve and transferFrom pattern See https://eips.ethereum.org/EIPS/eip-20#transferfrom" + }, + "tokensReceived(address,address,address,uint256,bytes,bytes)": { + "notice": "ERC-777 tokensReceived hook allows to send tokens to a contract and notify it in a single transaction See https://eips.ethereum.org/EIPS/eip-777#motivation for details" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 7372, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "initialized", + "offset": 0, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 7375, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 7415, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "______gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 7441, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "_pausers", + "offset": 0, + "slot": "51", + "type": "t_struct(Role)5204_storage" + }, + { + "astId": 7563, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "_paused", + "offset": 0, + "slot": "52", + "type": "t_bool" + }, + { + "astId": 7661, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "_owner", + "offset": 1, + "slot": "52", + "type": "t_address" + }, + { + "astId": 8296, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "_guardCounter", + "offset": 0, + "slot": "53", + "type": "t_uint256" + }, + { + "astId": 62, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "federation", + "offset": 0, + "slot": "54", + "type": "t_address" + }, + { + "astId": 64, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "feePercentage", + "offset": 0, + "slot": "55", + "type": "t_uint256" + }, + { + "astId": 66, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "deprecatedSymbolPrefix", + "offset": 0, + "slot": "56", + "type": "t_string_storage" + }, + { + "astId": 68, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "domainSeparator", + "offset": 0, + "slot": "57", + "type": "t_bytes32" + }, + { + "astId": 70, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "_deprecatedSpentToday", + "offset": 0, + "slot": "58", + "type": "t_uint256" + }, + { + "astId": 74, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "deprecatedMappedTokens", + "offset": 0, + "slot": "59", + "type": "t_mapping(t_address,t_address)" + }, + { + "astId": 78, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "deprecatedOriginalTokens", + "offset": 0, + "slot": "60", + "type": "t_mapping(t_address,t_address)" + }, + { + "astId": 82, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "deprecatedKnownTokens", + "offset": 0, + "slot": "61", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 86, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "claimed", + "offset": 0, + "slot": "62", + "type": "t_mapping(t_bytes32,t_bool)" + }, + { + "astId": 89, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "allowTokens", + "offset": 0, + "slot": "63", + "type": "t_contract(IAllowTokens)4416" + }, + { + "astId": 92, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "sideTokenFactory", + "offset": 0, + "slot": "64", + "type": "t_contract(ISideTokenFactory)4887" + }, + { + "astId": 94, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "isUpgrading", + "offset": 20, + "slot": "64", + "type": "t_bool" + }, + { + "astId": 105, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "wrappedCurrency", + "offset": 0, + "slot": "65", + "type": "t_contract(IWrapped)4940" + }, + { + "astId": 109, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "transactionsDataHashes", + "offset": 0, + "slot": "66", + "type": "t_mapping(t_bytes32,t_bytes32)" + }, + { + "astId": 113, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "originalTokenAddresses", + "offset": 0, + "slot": "67", + "type": "t_mapping(t_bytes32,t_address)" + }, + { + "astId": 117, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "senderAddresses", + "offset": 0, + "slot": "68", + "type": "t_mapping(t_bytes32,t_address)" + }, + { + "astId": 124, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "nonces", + "offset": 0, + "slot": "69", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 130, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "sideTokenByOriginalTokenByChain", + "offset": 0, + "slot": "70", + "type": "t_mapping(t_uint256,t_mapping(t_address,t_address))" + }, + { + "astId": 135, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "originalTokenBySideToken", + "offset": 0, + "slot": "71", + "type": "t_mapping(t_address,t_struct(OriginalToken)4437_storage)" + }, + { + "astId": 141, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "knownTokenByChain", + "offset": 0, + "slot": "72", + "type": "t_mapping(t_uint256,t_mapping(t_address,t_bool))" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IAllowTokens)4416": { + "encoding": "inplace", + "label": "contract IAllowTokens", + "numberOfBytes": "20" + }, + "t_contract(ISideTokenFactory)4887": { + "encoding": "inplace", + "label": "contract ISideTokenFactory", + "numberOfBytes": "20" + }, + "t_contract(IWrapped)4940": { + "encoding": "inplace", + "label": "contract IWrapped", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_address)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_address,t_struct(OriginalToken)4437_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct IBridge.OriginalToken)", + "numberOfBytes": "32", + "value": "t_struct(OriginalToken)4437_storage" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes32,t_address)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_bytes32,t_bool)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_bytes32,t_bytes32)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bytes32)", + "numberOfBytes": "32", + "value": "t_bytes32" + }, + "t_mapping(t_uint256,t_mapping(t_address,t_address))": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => mapping(address => address))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_address)" + }, + "t_mapping(t_uint256,t_mapping(t_address,t_bool))": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => mapping(address => bool))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_bool)" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(OriginalToken)4437_storage": { + "encoding": "inplace", + "label": "struct IBridge.OriginalToken", + "members": [ + { + "astId": 4434, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "tokenAddress", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 4436, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "originChainId", + "offset": 0, + "slot": "1", + "type": "t_uint256" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Role)5204_storage": { + "encoding": "inplace", + "label": "struct Roles.Role", + "members": [ + { + "astId": 5203, + "contract": "contracts/Bridge/Bridge.sol:Bridge", + "label": "bearer", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_bool)" + } + ], + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/bridge/deployments/goerli/BridgeProxy.json b/bridge/deployments/goerli/BridgeProxy.json new file mode 100644 index 000000000..db1e9b52b --- /dev/null +++ b/bridge/deployments/goerli/BridgeProxy.json @@ -0,0 +1,235 @@ +{ + "address": "0xa3aCF79Aded2DD5E2A8bd2E3D1E9f797E96972d3", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "_admin", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x917a50fef36b393d810a3b1383faf88a65a60f2ed6a9bc0b4d2a09f1ee56c0b7", + "receipt": { + "to": null, + "from": "0xa554d96413FF72E93437C4072438302C38350EE3", + "contractAddress": "0xa3aCF79Aded2DD5E2A8bd2E3D1E9f797E96972d3", + "transactionIndex": 0, + "gasUsed": "773307", + "logsBloom": "0x00000000020000000000000000000000000000000000000000800000000000201000000000000000000000000000002000000000000000000000000000000000000000000080000000000000000000000001000000000000000000000010000000000040020000000000000008000800000010004020000000000000000000400000001000004000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000200801000000000000010000000000000020000000000000000000000000000000000020000020000000000000000000000000000000000000000000001000000000000000000000", + "blockHash": "0xa1acd7949b3fba5b1603e20232f8cf746bb3e1436c20fb757be1b46ea2ff0eb8", + "transactionHash": "0x917a50fef36b393d810a3b1383faf88a65a60f2ed6a9bc0b4d2a09f1ee56c0b7", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 7664850, + "transactionHash": "0x917a50fef36b393d810a3b1383faf88a65a60f2ed6a9bc0b4d2a09f1ee56c0b7", + "address": "0xa3aCF79Aded2DD5E2A8bd2E3D1E9f797E96972d3", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000003cf0eb5b86a2b0e58fa6e088c91feefb71aeca2d" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0xa1acd7949b3fba5b1603e20232f8cf746bb3e1436c20fb757be1b46ea2ff0eb8" + }, + { + "transactionIndex": 0, + "blockNumber": 7664850, + "transactionHash": "0x917a50fef36b393d810a3b1383faf88a65a60f2ed6a9bc0b4d2a09f1ee56c0b7", + "address": "0xa3aCF79Aded2DD5E2A8bd2E3D1E9f797E96972d3", + "topics": [ + "0x6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f8", + "0x0000000000000000000000003cf0eb5b86a2b0e58fa6e088c91feefb71aeca2d" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0xa1acd7949b3fba5b1603e20232f8cf746bb3e1436c20fb757be1b46ea2ff0eb8" + }, + { + "transactionIndex": 0, + "blockNumber": 7664850, + "transactionHash": "0x917a50fef36b393d810a3b1383faf88a65a60f2ed6a9bc0b4d2a09f1ee56c0b7", + "address": "0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24", + "topics": [ + "0x93baa6efbd2244243bfee6ce4cfdd1d04fc4c0e9a786abd3a41313bd352db153", + "0x000000000000000000000000a3acf79aded2dd5e2a8bd2e3d1e9f797e96972d3", + "0xb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b", + "0x000000000000000000000000a3acf79aded2dd5e2a8bd2e3d1e9f797e96972d3" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0xa1acd7949b3fba5b1603e20232f8cf746bb3e1436c20fb757be1b46ea2ff0eb8" + } + ], + "blockNumber": 7664850, + "cumulativeGasUsed": "773307", + "status": 1, + "byzantium": true + }, + "args": [ + "0x5767040f92e6752085fB0FAC19C74557642d0F6E", + "0x39055c999A8528535Af012F4F4CF7B548dD97481", + "0xf8c8765e0000000000000000000000003cf0eb5b86a2b0e58fa6e088c91feefb71aeca2d000000000000000000000000a554d96413ff72e93437c4072438302c38350ee3000000000000000000000000a554d96413ff72e93437c4072438302c38350ee3000000000000000000000000281b8ce947918058cf3341125bba4dccd07172ff" + ], + "numDeployments": 1, + "solcInputHash": "b0b92d5309f21b72c82ad032fd7538bd", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_admin\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Proxies.sol\":\"BridgeProxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/Proxies.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"./zeppelin/upgradable/proxy/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract BridgeProxy is TransparentUpgradeableProxy {\\n // solhint-disable-next-line no-empty-blocks\\n constructor(address _logic, address _admin, bytes memory _data) TransparentUpgradeableProxy(_logic,_admin, _data) payable {}\\n}\\n\\ncontract AllowTokensProxy is TransparentUpgradeableProxy {\\n // solhint-disable-next-line no-empty-blocks\\n constructor(address _logic, address _admin, bytes memory _data) TransparentUpgradeableProxy(_logic,_admin, _data) payable {}\\n}\\n\\ncontract FederationProxy is TransparentUpgradeableProxy {\\n // solhint-disable-next-line no-empty-blocks\\n constructor(address _logic, address _admin, bytes memory _data) TransparentUpgradeableProxy(_logic,_admin, _data) payable {}\\n}\",\"keccak256\":\"0xe54cf19d7ab240930b2786d4c67a88d200ed3c3711c7ac30195aacedc6ccf0e7\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback () external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive () external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {\\n }\\n}\\n\",\"keccak256\":\"0xdc0ebdc6f4ae0b5f9dd0a6c041a2238e4a7a2afbc6cef539437b0004ada42370\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/proxy/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"./UpgradeableProxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is UpgradeableProxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {UpgradeableProxy-constructor}.\\n */\\n constructor(address _logic, address admin_, bytes memory _data) payable UpgradeableProxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _setAdmin(admin_);\\n }\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _admin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _admin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n require(newAdmin != address(0), \\\"TransparentUpgradeableProxy: new admin is the zero address\\\");\\n emit AdminChanged(_admin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external virtual ifAdmin {\\n _upgradeTo(newImplementation);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable virtual ifAdmin {\\n _upgradeTo(newImplementation);\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address adm) {\\n bytes32 slot = _ADMIN_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n adm := sload(slot)\\n }\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n bytes32 slot = _ADMIN_SLOT;\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, newAdmin)\\n }\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _admin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x3327b21f85d71d3b9bad1a89267f08b19966e03446a18d810bd80fe42789ac5f\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/proxy/UpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"./Proxy.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n *\\n * Upgradeability is only provided internally through {_upgradeTo}. For an externally upgradeable proxy see\\n * {TransparentUpgradeableProxy}.\\n */\\ncontract UpgradeableProxy is Proxy {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _setImplementation(_logic);\\n if(_data.length > 0) {\\n Address.functionDelegateCall(_logic, _data);\\n }\\n }\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 private constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n bytes32 slot = _IMPLEMENTATION_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n impl := sload(slot)\\n }\\n }\\n\\n /**\\n * @dev Upgrades the proxy to a new implementation.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal virtual {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"UpgradeableProxy: new implementation is not a contract\\\");\\n\\n bytes32 slot = _IMPLEMENTATION_SLOT;\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, newImplementation)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb54322ec8ec142c149ad1f561aa2f0da6d6ea2d9f45639164088db9e16d5a69d\",\"license\":\"MIT\"},\"contracts/zeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x04801fc2398ee3370f3903f95389ea3a8da65a8df01f24b352e499e44d492e9b\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405162000d9738038062000d9783398101604081905262000026916200036f565b82828282816200005860017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd6200044f565b60008051602062000d508339815191521462000078576200007862000475565b620000838262000118565b805115620000a457620000a28282620001b960201b620003ba1760201c565b505b50620000d4905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61046200044f565b60008051602062000d3083398151915214620000f457620000f462000475565b6200010c8260008051602062000d3083398151915255565b505050505050620004de565b6200012e81620001e860201b620003e61760201c565b620001a65760405162461bcd60e51b815260206004820152603660248201527f5570677261646561626c6550726f78793a206e657720696d706c656d656e746160448201527f74696f6e206973206e6f74206120636f6e74726163740000000000000000000060648201526084015b60405180910390fd5b60008051602062000d5083398151915255565b6060620001e1838360405180606001604052806027815260200162000d7060279139620001ee565b9392505050565b3b151590565b6060833b6200024f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200019d565b600080856001600160a01b0316856040516200026c91906200048b565b600060405180830381855af49150503d8060008114620002a9576040519150601f19603f3d011682016040523d82523d6000602084013e620002ae565b606091505b509092509050620002c1828286620002cb565b9695505050505050565b60608315620002dc575081620001e1565b825115620002ed5782518084602001fd5b8160405162461bcd60e51b81526004016200019d9190620004a9565b80516001600160a01b03811681146200032157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620003595781810151838201526020016200033f565b8381111562000369576000848401525b50505050565b6000806000606084860312156200038557600080fd5b620003908462000309565b9250620003a06020850162000309565b60408501519092506001600160401b0380821115620003be57600080fd5b818601915086601f830112620003d357600080fd5b815181811115620003e857620003e862000326565b604051601f8201601f19908116603f0116810190838211818310171562000413576200041362000326565b816040528281528960208487010111156200042d57600080fd5b620004408360208301602088016200033c565b80955050505050509250925092565b6000828210156200047057634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b600082516200049f8184602087016200033c565b9190910192915050565b6020815260008251806020840152620004ca8160408501602087016200033c565b601f01601f19169190910160400192915050565b61084280620004ee6000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106ac565b610138565b61005b6100933660046106c7565b610175565b3480156100a457600080fd5b506100ad6101fa565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106ac565b61025c565b3480156100f557600080fd5b506100ad610375565b6101066103ec565b6101366101317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b61048e565b565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b0316141561016d5761016a816104b2565b50565b61016a6100fe565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b031614156101ed576101a7836104b2565b6101e78383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103ba92505050565b50505050565b6101f56100fe565b505050565b60006102126000805160206107c68339815191525490565b6001600160a01b0316336001600160a01b0316141561025157507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6102596100fe565b90565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b0316141561016d576001600160a01b0381166103065760405162461bcd60e51b815260206004820152603a60248201527f5472616e73706172656e745570677261646561626c6550726f78793a206e657760448201527f2061646d696e20697320746865207a65726f206164647265737300000000000060648201526084015b60405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61033d6000805160206107c68339815191525490565b604080516001600160a01b03928316815291841660208301520160405180910390a161016a816000805160206107c683398151915255565b600061038d6000805160206107c68339815191525490565b6001600160a01b0316336001600160a01b0316141561025157506000805160206107c68339815191525490565b60606103df83836040518060600160405280602781526020016107e6602791396104f2565b9392505050565b3b151590565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b031614156101365760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4016102fd565b3660008037600080366000845af43d6000803e8080156104ad573d6000f35b3d6000fd5b6104bb816105c6565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060833b6105515760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102fd565b600080856001600160a01b03168560405161056c9190610776565b600060405180830381855af49150503d80600081146105a7576040519150601f19603f3d011682016040523d82523d6000602084013e6105ac565b606091505b50915091506105bc828286610657565b9695505050505050565b803b6106335760405162461bcd60e51b815260206004820152603660248201527f5570677261646561626c6550726f78793a206e657720696d706c656d656e74616044820152751d1a5bdb881a5cc81b9bdd08184818dbdb9d1c9858dd60521b60648201526084016102fd565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b606083156106665750816103df565b8251156106765782518084602001fd5b8160405162461bcd60e51b81526004016102fd9190610792565b80356001600160a01b03811681146106a757600080fd5b919050565b6000602082840312156106be57600080fd5b6103df82610690565b6000806000604084860312156106dc57600080fd5b6106e584610690565b9250602084013567ffffffffffffffff8082111561070257600080fd5b818601915086601f83011261071657600080fd5b81358181111561072557600080fd5b87602082850101111561073757600080fd5b6020830194508093505050509250925092565b60005b8381101561076557818101518382015260200161074d565b838111156101e75750506000910152565b6000825161078881846020870161074a565b9190910192915050565b60208152600082518060208401526107b181604085016020870161074a565b601f01601f1916919091016040019291505056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220342b70add6cfb6a21669078e26fc7a495c3f3ec30ad50633cf8274c15429cb3164736f6c63430008090033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106ac565b610138565b61005b6100933660046106c7565b610175565b3480156100a457600080fd5b506100ad6101fa565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106ac565b61025c565b3480156100f557600080fd5b506100ad610375565b6101066103ec565b6101366101317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b61048e565b565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b0316141561016d5761016a816104b2565b50565b61016a6100fe565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b031614156101ed576101a7836104b2565b6101e78383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103ba92505050565b50505050565b6101f56100fe565b505050565b60006102126000805160206107c68339815191525490565b6001600160a01b0316336001600160a01b0316141561025157507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6102596100fe565b90565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b0316141561016d576001600160a01b0381166103065760405162461bcd60e51b815260206004820152603a60248201527f5472616e73706172656e745570677261646561626c6550726f78793a206e657760448201527f2061646d696e20697320746865207a65726f206164647265737300000000000060648201526084015b60405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61033d6000805160206107c68339815191525490565b604080516001600160a01b03928316815291841660208301520160405180910390a161016a816000805160206107c683398151915255565b600061038d6000805160206107c68339815191525490565b6001600160a01b0316336001600160a01b0316141561025157506000805160206107c68339815191525490565b60606103df83836040518060600160405280602781526020016107e6602791396104f2565b9392505050565b3b151590565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b031614156101365760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4016102fd565b3660008037600080366000845af43d6000803e8080156104ad573d6000f35b3d6000fd5b6104bb816105c6565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060833b6105515760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102fd565b600080856001600160a01b03168560405161056c9190610776565b600060405180830381855af49150503d80600081146105a7576040519150601f19603f3d011682016040523d82523d6000602084013e6105ac565b606091505b50915091506105bc828286610657565b9695505050505050565b803b6106335760405162461bcd60e51b815260206004820152603660248201527f5570677261646561626c6550726f78793a206e657720696d706c656d656e74616044820152751d1a5bdb881a5cc81b9bdd08184818dbdb9d1c9858dd60521b60648201526084016102fd565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b606083156106665750816103df565b8251156106765782518084602001fd5b8160405162461bcd60e51b81526004016102fd9190610792565b80356001600160a01b03811681146106a757600080fd5b919050565b6000602082840312156106be57600080fd5b6103df82610690565b6000806000604084860312156106dc57600080fd5b6106e584610690565b9250602084013567ffffffffffffffff8082111561070257600080fd5b818601915086601f83011261071657600080fd5b81358181111561072557600080fd5b87602082850101111561073757600080fd5b6020830194508093505050509250925092565b60005b8381101561076557818101518382015260200161074d565b838111156101e75750506000910152565b6000825161078881846020870161074a565b9190910192915050565b60208152600082518060208401526107b181604085016020870161074a565b601f01601f1916919091016040019291505056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220342b70add6cfb6a21669078e26fc7a495c3f3ec30ad50633cf8274c15429cb3164736f6c63430008090033", + "devdoc": { + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/bridge/deployments/goerli/Federation.json b/bridge/deployments/goerli/Federation.json new file mode 100644 index 000000000..ee0ac7868 --- /dev/null +++ b/bridge/deployments/goerli/Federation.json @@ -0,0 +1,1117 @@ +{ + "address": "0x623727D544C207fD7b184Fd375854Df356e70ff2", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "bridge", + "type": "address" + } + ], + "name": "BridgeChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "federator", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "transactionHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "transactionId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "originalTokenAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "logIndex", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "originChainId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "destinationChainId", + "type": "uint256" + } + ], + "name": "Executed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentChainId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentBlock", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "fedVersion", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "fedChainsIds", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "fedChainsBlocks", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "string[]", + "name": "fedChainsInfo", + "type": "string[]" + } + ], + "name": "HeartBeat", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + } + ], + "name": "MemberAddition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + } + ], + "name": "MemberRemoval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "required", + "type": "uint256" + } + ], + "name": "RequirementChange", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "federator", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "transactionHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "transactionId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "originalTokenAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "logIndex", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "originChainId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "destinationChainId", + "type": "uint256" + } + ], + "name": "Voted", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_MEMBER_COUNT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newMember", + "type": "address" + } + ], + "name": "addMember", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "bridge", + "outputs": [ + { + "internalType": "contract IBridge", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_required", + "type": "uint256" + } + ], + "name": "changeRequirement", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "fedVersion", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "fedChainsIds", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "fedChainsBlocks", + "type": "uint256[]" + }, + { + "internalType": "string[]", + "name": "fedChainsInfo", + "type": "string[]" + } + ], + "name": "emitHeartbeat", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getMembers", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "transactionId", + "type": "bytes32" + } + ], + "name": "getTransactionCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "originalTokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "transactionHash", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "logIndex", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "originChainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "destinationChainId", + "type": "uint256" + } + ], + "name": "getTransactionId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "transactionId", + "type": "bytes32" + } + ], + "name": "hasVoted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_members", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "_required", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_bridge", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isMember", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isOwner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "transactionId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "transactionIdMultichain", + "type": "bytes32" + } + ], + "name": "isProcessed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "transactionId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "transactionIdMultichain", + "type": "bytes32" + } + ], + "name": "isVoted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "members", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "processed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oldMember", + "type": "address" + } + ], + "name": "removeMember", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "required", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_bridge", + "type": "address" + } + ], + "name": "setBridge", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "transactionId", + "type": "bytes32" + } + ], + "name": "transactionWasProcessed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "originalTokenAddress", + "type": "address" + }, + { + "internalType": "address payable", + "name": "sender", + "type": "address" + }, + { + "internalType": "address payable", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "transactionHash", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "logIndex", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "originChainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "destinationChainId", + "type": "uint256" + } + ], + "name": "voteTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "votes", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x80413412e879da744c8be0d6aa4e7077d9204edd2d1389f7d2fc2d721e85a198", + "receipt": { + "to": null, + "from": "0xa554d96413FF72E93437C4072438302C38350EE3", + "contractAddress": "0x623727D544C207fD7b184Fd375854Df356e70ff2", + "transactionIndex": 0, + "gasUsed": "1780593", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x0f4a988ef2a9493c56f8e05648375c24a0b7157d6f6c71ca7e9fecfa2304d08c", + "transactionHash": "0x80413412e879da744c8be0d6aa4e7077d9204edd2d1389f7d2fc2d721e85a198", + "logs": [], + "blockNumber": 7664852, + "cumulativeGasUsed": "1780593", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "b0b92d5309f21b72c82ad032fd7538bd", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"bridge\",\"type\":\"address\"}],\"name\":\"BridgeChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"federator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"originalTokenAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"logIndex\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"originChainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"destinationChainId\",\"type\":\"uint256\"}],\"name\":\"Executed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"currentChainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"currentBlock\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"fedVersion\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"fedChainsIds\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"fedChainsBlocks\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"string[]\",\"name\":\"fedChainsInfo\",\"type\":\"string[]\"}],\"name\":\"HeartBeat\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"}],\"name\":\"MemberAddition\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"}],\"name\":\"MemberRemoval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"required\",\"type\":\"uint256\"}],\"name\":\"RequirementChange\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"federator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"originalTokenAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"logIndex\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"originChainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"destinationChainId\",\"type\":\"uint256\"}],\"name\":\"Voted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MAX_MEMBER_COUNT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newMember\",\"type\":\"address\"}],\"name\":\"addMember\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bridge\",\"outputs\":[{\"internalType\":\"contract IBridge\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_required\",\"type\":\"uint256\"}],\"name\":\"changeRequirement\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"fedVersion\",\"type\":\"string\"},{\"internalType\":\"uint256[]\",\"name\":\"fedChainsIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"fedChainsBlocks\",\"type\":\"uint256[]\"},{\"internalType\":\"string[]\",\"name\":\"fedChainsInfo\",\"type\":\"string[]\"}],\"name\":\"emitHeartbeat\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMembers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"}],\"name\":\"getTransactionCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"originalTokenAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"transactionHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"logIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"originChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destinationChainId\",\"type\":\"uint256\"}],\"name\":\"getTransactionId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"}],\"name\":\"hasVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_members\",\"type\":\"address[]\"},{\"internalType\":\"uint256\",\"name\":\"_required\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_bridge\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"isMember\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isOwner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"transactionIdMultichain\",\"type\":\"bytes32\"}],\"name\":\"isProcessed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"transactionIdMultichain\",\"type\":\"bytes32\"}],\"name\":\"isVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"members\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"processed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_oldMember\",\"type\":\"address\"}],\"name\":\"removeMember\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"required\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_bridge\",\"type\":\"address\"}],\"name\":\"setBridge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"}],\"name\":\"transactionWasProcessed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"originalTokenAddress\",\"type\":\"address\"},{\"internalType\":\"address payable\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address payable\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"transactionHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"logIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"originChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destinationChainId\",\"type\":\"uint256\"}],\"name\":\"voteTransaction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"votes\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"addMember(address)\":{\"params\":{\"_newMember\":\"address of the new member\"}},\"changeRequirement(uint256)\":{\"details\":\"Emits the RequirementChange event\",\"params\":{\"_required\":\"the number of minimum members to approve an transaction, it has to be bigger than 1\"}},\"emitHeartbeat(string,uint256[],uint256[],string[])\":{\"details\":\"Emits HeartBeat event\"},\"getMembers()\":{\"returns\":{\"_0\":\"Current members\"}},\"getTransactionCount(bytes32)\":{\"params\":{\"transactionId\":\"The transaction hashed from getTransactionId function\"}},\"getTransactionId(address,address,address,uint256,bytes32,bytes32,uint32,uint256,uint256)\":{\"details\":\"It encodes and applies keccak256 to the parameters received in the same order\",\"params\":{\"amount\":\"Could be the amount or the tokenId\",\"blockHash\":\"The block hash in which the transaction with the cross event occurred\",\"destinationChainId\":\"Is chainId of the destination chain\",\"logIndex\":\"Index of the event in the logs\",\"originChainId\":\"Is chainId of the original chain\",\"originalTokenAddress\":\"The address of the token in the origin (main) chain\",\"receiver\":\"Who is going to receive the token in the opposite chain\",\"sender\":\"The address who solicited the cross token\",\"transactionHash\":\"The transaction in which the cross event occurred\"},\"returns\":{\"_0\":\"The hash generated by the parameters.\"}},\"initialize(address)\":{\"details\":\"Initializes the contract setting the deployer as the initial owner.\"},\"isOwner()\":{\"details\":\"Returns true if the caller is the current owner.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"removeMember(address)\":{\"params\":{\"_oldMember\":\"address of the member to be removed from federation\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. > Note: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setBridge(address)\":{\"details\":\"Emits BridgeChanged event\",\"params\":{\"_bridge\":\"the new bridge contract address that should implement the IBridge interface\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"version()\":{\"returns\":{\"_0\":\"version in v{Number}\"}},\"voteTransaction(address,address,address,uint256,bytes32,bytes32,uint32,uint256,uint256)\":{\"params\":{\"blockHash\":\"The block hash in which the transaction with the cross event occurred\",\"destinationChainId\":\"Is chainId of the destination chain\",\"logIndex\":\"Index of the event in the logs\",\"originChainId\":\"Is chainId of the original chain\",\"originalTokenAddress\":\"The address of the token in the origin (main) chain\",\"receiver\":\"Who is going to receive the token in the opposite chain\",\"sender\":\"The address who solicited the cross token\",\"transactionHash\":\"The transaction in which the cross event occurred\",\"value\":\"Amount\"}}},\"stateVariables\":{\"isMember\":{\"details\":\"The address should be a member to vote in transactions\"},\"required\":{\"details\":\"It should have at least the required amount of members\"},\"votes\":{\"details\":\"the members should approve the transaction by 50% + 1\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addMember(address)\":{\"notice\":\"Add a new member to the federation\"},\"changeRequirement(uint256)\":{\"notice\":\"Changes the number of required members to vote and approve an transaction\"},\"emitHeartbeat(string,uint256[],uint256[],string[])\":{\"notice\":\"It emits an HeartBeat like an health check\"},\"getMembers()\":{\"notice\":\"Return all the current members of the federation\"},\"getTransactionCount(bytes32)\":{\"notice\":\"Get the amount of approved votes for that transactionId\"},\"getTransactionId(address,address,address,uint256,bytes32,bytes32,uint32,uint256,uint256)\":{\"notice\":\"Gets the hash of transaction from the following parameters encoded and keccaked\"},\"isMember(address)\":{\"notice\":\"All the addresses that are members of the federation\"},\"processed(bytes32)\":{\"notice\":\"(bytes32) transactionId => (bool) votedCheck if that transaction was already processed\"},\"removeMember(address)\":{\"notice\":\"Remove a member of the federation\"},\"required()\":{\"notice\":\"The minimum amount of votes to approve a transaction\"},\"setBridge(address)\":{\"notice\":\"Sets a new bridge contract\"},\"version()\":{\"notice\":\"Current version of the contract\"},\"voteTransaction(address,address,address,uint256,bytes32,bytes32,uint32,uint256,uint256)\":{\"notice\":\"Vote in a transaction, if it has enough votes it accepts the transfer\"},\"votes(bytes32,address)\":{\"notice\":\"(bytes32) transactionId = keccak256( abi.encodePacked( originalTokenAddress, sender, receiver, amount, blockHash, transactionHash, logIndex ) ) => ( (address) members => (bool) voted )Votes by members by the transaction ID\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Federation/Federation.sol\":\"Federation\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/Federation/Federation.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n// Upgradables\\nimport \\\"../zeppelin/upgradable/Initializable.sol\\\";\\nimport \\\"../zeppelin/upgradable/ownership/UpgradableOwnable.sol\\\";\\n\\nimport \\\"../interface/IBridge.sol\\\";\\nimport \\\"../interface/IFederation.sol\\\";\\ncontract Federation is Initializable, UpgradableOwnable, IFederation {\\n\\tuint constant public MAX_MEMBER_COUNT = 50;\\n\\taddress constant private NULL_ADDRESS = address(0);\\n\\n\\tIBridge public bridge;\\n\\taddress[] public members;\\n\\n\\t/**\\n\\t\\t@notice The minimum amount of votes to approve a transaction\\n\\t\\t@dev It should have at least the required amount of members\\n\\t\\t*/\\n\\tuint public required;\\n\\n\\t/**\\n\\t\\t@notice All the addresses that are members of the federation\\n\\t\\t@dev The address should be a member to vote in transactions\\n\\t\\t*/\\n\\tmapping (address => bool) public isMember;\\n\\n\\t/**\\n\\t\\t(bytes32) transactionId = keccak256(\\n\\t\\t\\tabi.encodePacked(\\n\\t\\t\\t\\toriginalTokenAddress,\\n\\t\\t\\t\\tsender,\\n\\t\\t\\t\\treceiver,\\n\\t\\t\\t\\tamount,\\n\\t\\t\\t\\tblockHash,\\n\\t\\t\\t\\ttransactionHash,\\n\\t\\t\\t\\tlogIndex\\n\\t\\t\\t)\\n\\t\\t) => (\\n\\t\\t\\t(address) members => (bool) voted\\n\\t\\t)\\n\\t\\t@notice Votes by members by the transaction ID\\n\\t\\t@dev the members should approve the transaction by 50% + 1\\n\\t\\t*/\\n\\tmapping (bytes32 => mapping (address => bool)) public votes;\\n\\n\\t/**\\n\\t\\t(bytes32) transactionId => (bool) voted\\n\\t\\t@notice Check if that transaction was already processed\\n\\t*/\\n\\tmapping(bytes32 => bool) public processed;\\n\\n\\tmodifier onlyMember() {\\n\\t\\trequire(isMember[_msgSender()], \\\"Federation: Not Federator\\\");\\n\\t\\t_;\\n\\t}\\n\\n\\tmodifier validRequirement(uint membersCount, uint _required) {\\n\\t\\trequire(_required <= membersCount && _required != 0 && membersCount != 0, \\\"Federation: Invalid requirements\\\");\\n\\t\\t_;\\n\\t}\\n\\n\\tfunction initialize(\\n\\t\\taddress[] calldata _members,\\n\\t\\tuint _required,\\n\\t\\taddress _bridge,\\n\\t\\taddress owner\\n\\t) public validRequirement(_members.length, _required) initializer {\\n\\t\\tUpgradableOwnable.initialize(owner);\\n\\t\\trequire(_members.length <= MAX_MEMBER_COUNT, \\\"Federation: Too many members\\\");\\n\\t\\tmembers = _members;\\n\\t\\tfor (uint i = 0; i < _members.length; i++) {\\n\\t\\t\\trequire(!isMember[_members[i]] && _members[i] != NULL_ADDRESS, \\\"Federation: Invalid members\\\");\\n\\t\\t\\tisMember[_members[i]] = true;\\n\\t\\t\\temit MemberAddition(_members[i]);\\n\\t\\t}\\n\\t\\trequired = _required;\\n\\t\\temit RequirementChange(required);\\n\\t\\t_setBridge(_bridge);\\n\\t}\\n\\n\\t/**\\n\\t\\t@notice Current version of the contract\\n\\t\\t@return version in v{Number}\\n\\t\\t*/\\n\\tfunction version() external pure override returns (string memory) {\\n\\t\\treturn \\\"v3\\\";\\n\\t}\\n\\n\\t/**\\n\\t\\t@notice Sets a new bridge contract\\n\\t\\t@dev Emits BridgeChanged event\\n\\t\\t@param _bridge the new bridge contract address that should implement the IBridge interface\\n\\t\\t*/\\n\\tfunction setBridge(address _bridge) external onlyOwner override {\\n\\t\\t_setBridge(_bridge);\\n\\t}\\n\\n\\tfunction _setBridge(address _bridge) internal {\\n\\t\\trequire(_bridge != NULL_ADDRESS, \\\"Federation: Empty bridge\\\");\\n\\t\\tbridge = IBridge(_bridge);\\n\\t\\temit BridgeChanged(_bridge);\\n\\t}\\n\\n\\tfunction validateTransaction(bytes32 transactionId, bytes32 transactionIdMultichain) internal view returns(bool) {\\n\\t\\tuint256 minimumVotes = getMinimalNumberOfVotes();\\n\\t\\tuint256 amountVotes = 0;\\n\\n for (uint256 i = 0; i < members.length; i++) {\\n if (votes[transactionIdMultichain][members[i]]) {\\n amountVotes += 1;\\n\\t\\t\\t} else if (votes[transactionId][members[i]]) {\\n amountVotes += 1;\\n\\t\\t\\t}\\n\\n\\t\\t\\tif (amountVotes >= minimumVotes && amountVotes >= required) {\\n\\t\\t\\t\\treturn true;\\n\\t\\t\\t}\\n }\\n\\n\\t\\treturn false;\\n\\t}\\n\\n\\tfunction getMinimalNumberOfVotes() internal view returns(uint256) {\\n\\t\\treturn members.length / 2 + 1;\\n\\t}\\n\\n\\tfunction isProcessed(bytes32 transactionId, bytes32 transactionIdMultichain) public view returns(bool) {\\n\\t\\treturn processed[transactionIdMultichain] || processed[transactionId];\\n\\t}\\n\\n\\tfunction isVoted(bytes32 transactionId, bytes32 transactionIdMultichain) public view returns(bool) {\\n\\t\\treturn votes[transactionIdMultichain][_msgSender()] || votes[transactionId][_msgSender()];\\n\\t}\\n\\n\\tfunction shouldBeCurrentChainId(uint256 chainId) internal view {\\n\\t\\trequire(chainId == block.chainid, \\\"Federation: Not block.chainid\\\");\\n\\t}\\n\\n\\t/**\\n\\t\\t@notice Vote in a transaction, if it has enough votes it accepts the transfer\\n\\t\\t@param originalTokenAddress The address of the token in the origin (main) chain\\n\\t\\t@param sender The address who solicited the cross token\\n\\t\\t@param receiver Who is going to receive the token in the opposite chain\\n\\t\\t@param value Amount\\n\\t\\t@param blockHash The block hash in which the transaction with the cross event occurred\\n\\t\\t@param transactionHash The transaction in which the cross event occurred\\n\\t\\t@param logIndex Index of the event in the logs\\n\\t\\t@param originChainId Is chainId of the original chain\\n\\t\\t@param destinationChainId Is chainId of the destination chain\\n\\t\\t*/\\n\\tfunction voteTransaction(\\n\\t\\taddress originalTokenAddress,\\n\\t\\taddress payable sender,\\n\\t\\taddress payable receiver,\\n\\t\\tuint256 value,\\n\\t\\tbytes32 blockHash,\\n\\t\\tbytes32 transactionHash,\\n\\t\\tuint32 logIndex,\\n\\t\\tuint256 originChainId,\\n\\t\\tuint256\\tdestinationChainId\\n\\t) external onlyMember override {\\n\\t\\tshouldBeCurrentChainId(destinationChainId);\\n\\t\\tbytes32 transactionId = keccak256(\\n\\t\\t\\tabi.encodePacked(\\n\\t\\t\\t\\toriginalTokenAddress,\\n\\t\\t\\t\\tsender,\\n\\t\\t\\t\\treceiver,\\n\\t\\t\\t\\tvalue,\\n\\t\\t\\t\\tblockHash,\\n\\t\\t\\t\\ttransactionHash,\\n\\t\\t\\t\\tlogIndex\\n\\t\\t\\t)\\n\\t\\t);\\n\\n\\t\\tbytes32 transactionIdMultichain = getTransactionId(\\n\\t\\t\\toriginalTokenAddress,\\n\\t\\t\\tsender,\\n\\t\\t\\treceiver,\\n\\t\\t\\tvalue,\\n\\t\\t\\tblockHash,\\n\\t\\t\\ttransactionHash,\\n\\t\\t\\tlogIndex,\\n\\t\\t\\toriginChainId,\\n\\t\\t\\tdestinationChainId\\n\\t\\t);\\n\\n\\t\\tif (isProcessed(transactionId, transactionIdMultichain))\\n\\t\\t\\treturn;\\n\\n\\t\\tif (isVoted(transactionId, transactionIdMultichain))\\n\\t\\t\\treturn;\\n\\n\\t\\tvotes[transactionIdMultichain][_msgSender()] = true;\\n\\t\\temit Voted(\\n\\t\\t\\t_msgSender(),\\n\\t\\t\\ttransactionHash,\\n\\t\\t\\ttransactionIdMultichain,\\n\\t\\t\\toriginalTokenAddress,\\n\\t\\t\\tsender,\\n\\t\\t\\treceiver,\\n\\t\\t\\tvalue,\\n\\t\\t\\tblockHash,\\n\\t\\t\\tlogIndex,\\n\\t\\t\\toriginChainId,\\n\\t\\t\\tdestinationChainId\\n\\t\\t);\\n\\n\\t\\tif (validateTransaction(transactionId, transactionIdMultichain)) {\\n\\t\\t\\tprocessed[transactionIdMultichain] = true;\\n\\n\\t\\t\\tacceptTransfer(\\n\\t\\t\\t\\toriginalTokenAddress,\\n\\t\\t\\t\\tsender,\\n\\t\\t\\t\\treceiver,\\n\\t\\t\\t\\tvalue,\\n\\t\\t\\t\\tblockHash,\\n\\t\\t\\t\\ttransactionHash,\\n\\t\\t\\t\\tlogIndex,\\n\\t\\t\\t\\t\\n\\t\\t\\t\\toriginChainId,\\n\\t\\t\\t\\tdestinationChainId\\n\\t\\t\\t);\\n\\n\\t\\t\\temit Executed(\\n\\t\\t\\t\\t_msgSender(),\\n\\t\\t\\t\\ttransactionHash,\\n\\t\\t\\t\\ttransactionIdMultichain,\\n\\t\\t\\t\\toriginalTokenAddress,\\n\\t\\t\\t\\tsender,\\n\\t\\t\\t\\treceiver,\\n\\t\\t\\t\\tvalue,\\n\\t\\t\\t\\tblockHash,\\n\\t\\t\\t\\tlogIndex,\\n\\t\\t\\t\\toriginChainId,\\n\\t\\t\\t\\tdestinationChainId\\n\\t\\t\\t);\\n\\t\\t}\\n\\t}\\n\\n function acceptTransfer(\\n address originalTokenAddress,\\n address payable sender,\\n address payable receiver,\\n uint256 value,\\n bytes32 blockHash,\\n bytes32 transactionHash,\\n uint32 logIndex,\\n\\tuint256 originChainId,\\n\\tuint256\\tdestinationChainId\\n ) internal {\\n\\t bridge.acceptTransfer(\\n\\t\\toriginalTokenAddress,\\n\\t\\tsender,\\n\\t\\treceiver,\\n\\t\\tvalue,\\n\\t\\tblockHash,\\n\\t\\ttransactionHash,\\n\\t\\tlogIndex,\\n\\t\\toriginChainId,\\n\\t\\tdestinationChainId\\n\\t );\\n }\\n\\n /**\\n @notice Get the amount of approved votes for that transactionId\\n @param transactionId The transaction hashed from getTransactionId function\\n */\\n function getTransactionCount(bytes32 transactionId) public view returns(uint) {\\n uint count = 0;\\n for (uint i = 0; i < members.length; i++) {\\n if (votes[transactionId][members[i]])\\n count += 1;\\n }\\n return count;\\n }\\n\\n\\tfunction hasVoted(bytes32 transactionId) external view returns(bool) {\\n\\t\\treturn votes[transactionId][_msgSender()];\\n\\t}\\n\\n\\tfunction transactionWasProcessed(bytes32 transactionId) external view returns(bool) {\\n\\t\\treturn processed[transactionId];\\n\\t}\\n\\n\\t/**\\n\\t\\t@notice Gets the hash of transaction from the following parameters encoded and keccaked\\n\\t\\t@dev It encodes and applies keccak256 to the parameters received in the same order\\n\\t\\t@param originalTokenAddress The address of the token in the origin (main) chain\\n\\t\\t@param sender The address who solicited the cross token\\n\\t\\t@param receiver Who is going to receive the token in the opposite chain\\n\\t\\t@param amount Could be the amount or the tokenId\\n\\t\\t@param blockHash The block hash in which the transaction with the cross event occurred\\n\\t\\t@param transactionHash The transaction in which the cross event occurred\\n\\t\\t@param logIndex Index of the event in the logs\\n\\t\\t@param originChainId Is chainId of the original chain\\n\\t\\t@param destinationChainId Is chainId of the destination chain\\n\\t\\t@return The hash generated by the parameters.\\n\\t*/\\n\\tfunction getTransactionId(\\n\\t\\taddress originalTokenAddress,\\n\\t\\taddress sender,\\n\\t\\taddress receiver,\\n\\t\\tuint256 amount,\\n\\t\\tbytes32 blockHash,\\n\\t\\tbytes32 transactionHash,\\n\\t\\tuint32 logIndex,\\n\\t\\tuint256 originChainId,\\n\\t\\tuint256\\tdestinationChainId\\n\\t) public pure returns(bytes32) {\\n\\t\\treturn keccak256(\\n\\t\\t\\tabi.encodePacked(\\n\\t\\t\\t\\toriginalTokenAddress,\\n\\t\\t\\t\\tsender,\\n\\t\\t\\t\\treceiver,\\n\\t\\t\\t\\tamount,\\n\\t\\t\\t\\tblockHash,\\n\\t\\t\\t\\ttransactionHash,\\n\\t\\t\\t\\tlogIndex,\\n\\t\\t\\t\\toriginChainId,\\n\\t\\t\\t\\tdestinationChainId\\n\\t\\t\\t)\\n\\t\\t);\\n\\t}\\n\\n\\tfunction addMember(address _newMember) external onlyOwner override {\\n\\t\\trequire(_newMember != NULL_ADDRESS, \\\"Federation: Empty member\\\");\\n\\t\\trequire(!isMember[_newMember], \\\"Federation: Member already exists\\\");\\n\\t\\trequire(members.length < MAX_MEMBER_COUNT, \\\"Federation: Max members reached\\\");\\n\\n\\t\\tisMember[_newMember] = true;\\n\\t\\tmembers.push(_newMember);\\n\\t\\temit MemberAddition(_newMember);\\n\\t}\\n\\n\\tfunction removeMember(address _oldMember) external onlyOwner override {\\n\\t\\trequire(_oldMember != NULL_ADDRESS, \\\"Federation: Empty member\\\");\\n\\t\\trequire(isMember[_oldMember], \\\"Federation: Member doesn't exists\\\");\\n\\t\\trequire(members.length > 1, \\\"Federation: Can't remove all the members\\\");\\n\\t\\trequire(members.length - 1 >= required, \\\"Federation: Can't have less than required members\\\");\\n\\n\\t\\tisMember[_oldMember] = false;\\n\\t\\tfor (uint i = 0; i < members.length - 1; i++) {\\n\\t\\t\\tif (members[i] == _oldMember) {\\n\\t\\t\\t\\tmembers[i] = members[members.length - 1];\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tmembers.pop(); // remove an element from the end of the array.\\n\\t\\temit MemberRemoval(_oldMember);\\n\\t}\\n\\n\\t/**\\n\\t\\t@notice Return all the current members of the federation\\n\\t\\t@return Current members\\n\\t\\t*/\\n\\tfunction getMembers() external view override returns (address[] memory) {\\n\\t\\treturn members;\\n\\t}\\n\\n\\t/**\\n\\t\\t@notice Changes the number of required members to vote and approve an transaction\\n\\t\\t@dev Emits the RequirementChange event\\n\\t\\t@param _required the number of minimum members to approve an transaction, it has to be bigger than 1\\n\\t\\t*/\\n\\tfunction changeRequirement(uint _required) external onlyOwner validRequirement(members.length, _required) override {\\n\\t\\trequire(_required >= 2, \\\"Federation: Requires at least 2\\\");\\n\\t\\trequired = _required;\\n\\t\\temit RequirementChange(_required);\\n\\t}\\n\\n\\t/**\\n\\t\\t@notice It emits an HeartBeat like an health check\\n\\t\\t@dev Emits HeartBeat event\\n\\t\\t*/\\n\\tfunction emitHeartbeat(\\n\\t\\tstring calldata fedVersion,\\n\\t\\tuint256[] calldata fedChainsIds,\\n\\t\\tuint256[] calldata fedChainsBlocks,\\n\\t\\tstring[] calldata fedChainsInfo\\n\\t) external onlyMember override {\\n\\t\\trequire(fedChainsIds.length == fedChainsBlocks.length &&\\n\\t\\t\\tfedChainsIds.length == fedChainsInfo.length, \\\"Federation: Length missmatch\\\");\\n\\t\\temit HeartBeat(\\n\\t\\t\\t_msgSender(),\\n\\t\\t\\tblock.chainid,\\n\\t\\t\\tblock.number,\\n\\t\\t\\tfedVersion,\\n\\t\\t\\tfedChainsIds,\\n\\t\\t\\tfedChainsBlocks,\\n\\t\\t\\tfedChainsInfo\\n\\t\\t);\\n\\t}\\n}\\n\",\"keccak256\":\"0x2a10301f1d5d923b68ccb895b7d6e1ec4c41afa204f8466f20b2702665ef8769\",\"license\":\"MIT\"},\"contracts/interface/IBridge.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\ninterface IBridge {\\n\\n\\tstruct ClaimData {\\n\\t\\taddress payable to;\\n\\t\\tuint256 amount;\\n\\t\\tbytes32 blockHash;\\n\\t\\tbytes32 transactionHash;\\n\\t\\tuint32 logIndex;\\n\\t\\tuint256 originChainId;\\n\\t}\\n\\n\\tstruct OriginalToken {\\n\\t\\taddress tokenAddress;\\n\\t\\tuint256 originChainId;\\n\\t}\\n\\t\\n\\tstruct CreateSideTokenStruct {\\n\\t\\tuint256 _typeId;\\n\\t\\taddress _originalTokenAddress;\\n\\t\\tuint8 _originalTokenDecimals;\\n\\t\\tstring _originalTokenSymbol;\\n\\t\\tstring _originalTokenName;\\n\\t\\tuint256 _originChainId;\\n\\t}\\n\\n\\tfunction version() external pure returns (string memory);\\n\\n\\tfunction getFeePercentage() external view returns(uint);\\n\\n\\t/**\\n\\t\\t* ERC-20 tokens approve and transferFrom pattern\\n\\t\\t* See https://eips.ethereum.org/EIPS/eip-20#transferfrom\\n\\t\\t*/\\n\\tfunction receiveTokensTo(uint256 chainId, address tokenToUse, address to, uint256 amount) external;\\n\\n\\t/**\\n\\t\\t* Use network currency and cross it.\\n\\t\\t*/\\n\\tfunction depositTo(uint256 chainId, address to) external payable;\\n\\n\\t/**\\n\\t\\t* ERC-777 tokensReceived hook allows to send tokens to a contract and notify it in a single transaction\\n\\t\\t* See https://eips.ethereum.org/EIPS/eip-777#motivation for details\\n\\t\\t* @param userData it can be 2 options in the first one you can send the receiver and the chain id of the destination\\n\\t\\t* const userData = web3.eth.abi.encodeParameters(\\n * [\\\"address\\\", \\\"uint256\\\"],\\n * [anAccount.toLowerCase(), chains.ETHEREUM_MAIN_NET_CHAIN_ID]\\n * );\\n\\t\\t* or you also can send only the destination chain id, and the receiver would be the same as the from parameter\\n\\t\\t* const userData = web3.eth.abi.encodeParameters([\\\"uint256\\\"], [chains.ETHEREUM_MAIN_NET_CHAIN_ID]);\\n\\t\\t*/\\n\\tfunction tokensReceived (\\n\\t\\taddress operator,\\n\\t\\taddress from,\\n\\t\\taddress to,\\n\\t\\tuint amount,\\n\\t\\tbytes calldata userData,\\n\\t\\tbytes calldata operatorData\\n\\t) external;\\n\\n\\t/**\\n\\t\\t* Accepts the transaction from the other chain that was voted and sent by the Federation contract\\n\\t\\t*/\\n\\tfunction acceptTransfer(\\n\\t\\taddress _originalTokenAddress,\\n\\t\\taddress payable _from,\\n\\t\\taddress payable _to,\\n\\t\\tuint256 _amount,\\n\\t\\tbytes32 _blockHash,\\n\\t\\tbytes32 _transactionHash,\\n\\t\\tuint32 _logIndex,\\n\\t\\tuint256 _originChainId,\\n\\t\\tuint256\\t_destinationChainId\\n\\t) external;\\n\\n\\t/**\\n\\t\\t* Claims the crossed transaction using the hash, this sends the funds to the address indicated in\\n\\t\\t*/\\n\\tfunction claim(ClaimData calldata _claimData) external returns (uint256 receivedAmount);\\n\\n\\tfunction claimFallback(ClaimData calldata _claimData) external returns (uint256 receivedAmount);\\n\\n\\tfunction claimGasless(\\n\\t\\tClaimData calldata _claimData,\\n\\t\\taddress payable _relayer,\\n\\t\\tuint256 _fee,\\n\\t\\tuint256 _deadline,\\n\\t\\tuint8 _v,\\n\\t\\tbytes32 _r,\\n\\t\\tbytes32 _s\\n\\t) external returns (uint256 receivedAmount);\\n\\n\\tfunction createSideToken(\\n\\t\\tuint256 _typeId,\\n\\t\\taddress _originalTokenAddress,\\n\\t\\tuint8 _originalTokenDecimals,\\n\\t\\tstring calldata _originalTokenSymbol,\\n\\t\\tstring calldata _originalTokenName,\\n\\t\\tuint256 _chainId\\n\\t) external;\\n\\n\\tfunction createMultipleSideTokens(\\n\\t\\tCreateSideTokenStruct[] calldata createSideTokenStruct\\n\\t) external;\\n\\n\\tfunction getTransactionDataHash(\\n\\t\\taddress _to,\\n\\t\\tuint256 _amount,\\n\\t\\tbytes32 _blockHash,\\n\\t\\tbytes32 _transactionHash,\\n\\t\\tuint32 _logIndex,\\n\\t\\tuint256 _originChainId,\\n\\t\\tuint256 _destinationChainId\\n\\t) external returns(bytes32);\\n\\n\\tevent Cross(\\n\\t\\taddress indexed _tokenAddress,\\n\\t\\taddress indexed _to,\\n\\t\\tuint256 indexed _destinationChainId,\\n\\t\\taddress _from,\\n\\t\\tuint256 _originChainId,\\n\\t\\tuint256 _amount,\\n\\t\\tbytes _userData\\n\\t);\\n\\n\\tevent NewSideToken(\\n\\t\\taddress indexed _newSideTokenAddress,\\n\\t\\taddress indexed _originalTokenAddress,\\n\\t\\tstring _newSymbol,\\n\\t\\tuint256 _granularity,\\n\\t\\tuint256 _chainId\\n\\t);\\n\\tevent AcceptedCrossTransfer(\\n\\t\\tbytes32 indexed _transactionHash,\\n\\t\\taddress indexed _originalTokenAddress,\\n\\t\\taddress indexed _to,\\n\\t\\taddress _from,\\n\\t\\tuint256 _amount,\\n\\t\\tbytes32 _blockHash,\\n\\t\\tuint256 _logIndex,\\n\\t\\tuint256 _originChainId,\\n\\t\\tuint256\\t_destinationChainId\\n\\t);\\n\\tevent FeePercentageChanged(uint256 _amount);\\n\\tevent Claimed(\\n\\t\\tbytes32 indexed _transactionHash,\\n\\t\\taddress indexed _originalTokenAddress,\\n\\t\\taddress indexed _to,\\n\\t\\taddress _sender,\\n\\t\\tuint256 _amount,\\n\\t\\tbytes32 _blockHash,\\n\\t\\tuint256 _logIndex,\\n\\t\\taddress _reciever,\\n\\t\\taddress _relayer,\\n\\t\\tuint256 _fee,\\n\\t\\tuint256 _destinationChainId,\\n\\t\\tuint256 _originChainId\\n\\t);\\n}\",\"keccak256\":\"0x1c5d6422edd509f1abc62bc29b41b1c6f80df08235ca289da81c661b8aa33044\",\"license\":\"MIT\"},\"contracts/interface/IFederation.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\ninterface IFederation {\\n\\n /**\\n @notice Current version of the contract\\n @return version in v{Number}\\n */\\n function version() external pure returns (string memory);\\n\\n /**\\n @notice Sets a new bridge contract\\n @param _bridge the new bridge contract address that should implement the IBridge interface\\n */\\n function setBridge(address _bridge) external;\\n\\n /**\\n @notice Vote in a transaction, if it has enough votes it accepts the transfer\\n @param originalTokenAddress The address of the token in the origin (main) chain\\n @param sender The address who solicited the cross token\\n @param receiver Who is going to receive the token in the opposite chain\\n @param value Amount\\n @param blockHash The block hash in which the transaction with the cross event occurred\\n @param transactionHash The transaction in which the cross event occurred\\n @param logIndex Index of the event in the logs\\n\\t\\t@param originChainId Is chainId of the original chain\\n\\t\\t@param destinationChainId Is chainId of the destination chain\\n */\\n function voteTransaction(\\n address originalTokenAddress,\\n address payable sender,\\n address payable receiver,\\n uint256 value,\\n bytes32 blockHash,\\n bytes32 transactionHash,\\n uint32 logIndex,\\n\\t uint256 originChainId,\\n\\t uint256\\tdestinationChainId\\n ) external;\\n\\n /**\\n @notice Add a new member to the federation\\n @param _newMember address of the new member\\n */\\n function addMember(address _newMember) external;\\n\\n /**\\n @notice Remove a member of the federation\\n @param _oldMember address of the member to be removed from federation\\n */\\n function removeMember(address _oldMember) external;\\n\\n /**\\n @notice Return all the current members of the federation\\n @return Current members\\n */\\n function getMembers() external view returns (address[] memory);\\n\\n /**\\n @notice Changes the number of required members to vote and approve an transaction\\n @param _required the number of minimum members to approve an transaction, it has to be bigger than 1\\n */\\n function changeRequirement(uint _required) external;\\n\\n /**\\n @notice It emmits an HeartBeat like an healthy check\\n */\\n function emitHeartbeat(\\n string calldata federatorVersion,\\n\\t\\tuint256[] calldata fedChainsIds,\\n\\t\\tuint256[] calldata fedChainsBlocks,\\n\\t\\tstring[] calldata fedChainsInfo\\n ) external;\\n\\n event Executed(\\n address indexed federator,\\n bytes32 indexed transactionHash,\\n bytes32 indexed transactionId,\\n address originalTokenAddress,\\n address sender,\\n address receiver,\\n uint256 amount,\\n bytes32 blockHash,\\n uint32 logIndex,\\n\\t\\tuint256 originChainId,\\n\\t\\tuint256\\tdestinationChainId\\n );\\n event MemberAddition(address indexed member);\\n event MemberRemoval(address indexed member);\\n event RequirementChange(uint required);\\n event BridgeChanged(address bridge);\\n event Voted(\\n address indexed federator,\\n bytes32 indexed transactionHash,\\n bytes32 indexed transactionId,\\n address originalTokenAddress,\\n address sender,\\n address receiver,\\n uint256 amount,\\n bytes32 blockHash,\\n uint32 logIndex,\\n uint256 originChainId,\\n\\t\\tuint256\\tdestinationChainId\\n );\\n event HeartBeat(\\n address indexed sender,\\n uint256 currentChainId,\\n uint256 currentBlock,\\n string fedVersion,\\n uint256[] fedChainsIds,\\n\\t\\tuint256[] fedChainsBlocks,\\n\\t\\tstring[] fedChainsInfo\\n );\\n\\n}\\n\",\"keccak256\":\"0x22ef32d3798dc52fcf55286858f0a12e0f99fb9c1f0d35c6cfbc3e99b70b0744\",\"license\":\"MIT\"},\"contracts/zeppelin/GSN/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n\\n function _msgSender() internal view returns (address payable) {\\n return payable(msg.sender);\\n }\\n\\n function _msgData() internal view returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x6f3f274a2270bfe073339370edfa2485e2d515a2656039937f6b972fae96d297\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @title Initializable\\n *\\n * @dev Helper contract to support initializer functions. To use it, replace\\n * the constructor with a function that has the `initializer` modifier.\\n * WARNING: Unlike constructors, initializer functions must be manually\\n * invoked. This applies both to deploying an Initializable contract, as well\\n * as extending an Initializable contract via inheritance.\\n * WARNING: When used with inheritance, manual care must be taken to not invoke\\n * a parent initializer twice, or ensure that all initializers are idempotent,\\n * because this is not dealt with automatically as with constructors.\\n */\\ncontract Initializable {\\n\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private initializing;\\n\\n /**\\n * @dev Modifier to use in the initializer function of a contract.\\n */\\n modifier initializer() {\\n require(initializing || !initialized, \\\"Contract instance is already initialized\\\");\\n\\n bool isTopLevelCall = !initializing;\\n if (isTopLevelCall) {\\n initializing = true;\\n initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n initializing = false;\\n }\\n }\\n\\n // Reserved storage space to allow for layout changes in the future.\\n uint256[50] private ______gap;\\n}\",\"keccak256\":\"0x14063a689bff5eecf0f36cb519feb575f60349ecf0d425ead5b931b77dd599d4\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/ownership/UpgradableOwnable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"../Initializable.sol\\\";\\n\\nimport \\\"../../GSN/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be aplied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract UpgradableOwnable is Initializable, Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function initialize(address sender) public initializer {\\n _owner = sender;\\n emit OwnershipTransferred(address(0), _owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(isOwner(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the caller is the current owner.\\n */\\n function isOwner() public view returns (bool) {\\n return _msgSender() == _owner;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * > Note: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public onlyOwner {\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n */\\n function _transferOwnership(address newOwner) internal {\\n require(newOwner != address(0), \\\"Ownable: new owner is zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n\\n}\\n\",\"keccak256\":\"0xdf439a167ae82e7e3dd241ea0c831a1bb0329432ceb4fa889778d1f2d196ce00\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50611f3f806100206000396000f3fe608060405234801561001057600080fd5b50600436106101a95760003560e01c80639386775a116100f9578063c1b4a1e311610097578063ca6d56dc11610071578063ca6d56dc14610401578063dc8452cd14610414578063e78cea921461041d578063f2fde38b1461043057600080fd5b8063c1b4a1e3146103b8578063c1f0808a146103cb578063c4d66de8146103ee57600080fd5b8063a1fb4acb116100d3578063a1fb4acb1461034c578063a230c5241461035f578063a93585f014610382578063ba51a6df146103a557600080fd5b80639386775a146102f65780639dc8f9c8146103245780639eab52531461033757600080fd5b8063681fc921116101665780637b6d343a116101405780637b6d343a146102ac5780638da5cb5b146102bf5780638dd14802146102d05780638f32d59b146102e357600080fd5b8063681fc9211461027b578063715018a61461029157806379d9ee721461029957600080fd5b806309c69cfa146101ae5780630b1ca49a146101d65780631b4613cb146101eb5780633f78f0691461021957806354fd4d501461022c5780635daf08ca14610250575b600080fd5b6101c16101bc3660046118ac565b610443565b60405190151581526020015b60405180910390f35b6101e96101e43660046118e3565b61048d565b005b6101c16101f9366004611907565b600090815260386020908152604080832033845290915290205460ff1690565b6101e9610227366004611939565b6107cb565b6040805180820182526002815261763360f01b602082015290516101cd91906119c4565b61026361025e366004611907565b610a0b565b6040516001600160a01b0390911681526020016101cd565b610283603281565b6040519081526020016101cd565b6101e9610a35565b6101e96102a7366004611a65565b610aa9565b6101c16102ba3660046118ac565b610bbb565b6033546001600160a01b0316610263565b6101e96102de3660046118e3565b610bea565b6033546001600160a01b031633146101c1565b6101c1610304366004611b54565b603860209081526000928352604080842090915290825290205460ff1681565b610283610332366004611939565b610c20565b61033f610cad565b6040516101cd9190611b84565b61028361035a366004611907565b610d0f565b6101c161036d3660046118e3565b60376020526000908152604090205460ff1681565b6101c1610390366004611907565b60009081526039602052604090205460ff1690565b6101e96103b3366004611907565b610d97565b6101e96103c6366004611bd1565b610eb9565b6101c16103d9366004611907565b60396020526000908152604090205460ff1681565b6101e96103fc3660046118e3565b6111dc565b6101e961040f3660046118e3565b611292565b61028360365481565b603454610263906001600160a01b031681565b6101e961043e3660046118e3565b61145e565b600081815260386020908152604080832033845290915281205460ff16806104845750600083815260386020908152604080832033845290915290205460ff165b90505b92915050565b6033546001600160a01b031633146104c05760405162461bcd60e51b81526004016104b790611c45565b60405180910390fd5b6001600160a01b0381166105115760405162461bcd60e51b81526020600482015260186024820152772332b232b930ba34b7b71d1022b6b83a3c9036b2b6b132b960411b60448201526064016104b7565b6001600160a01b03811660009081526037602052604090205460ff166105835760405162461bcd60e51b815260206004820152602160248201527f46656465726174696f6e3a204d656d62657220646f65736e27742065786973746044820152607360f81b60648201526084016104b7565b6035546001106105e65760405162461bcd60e51b815260206004820152602860248201527f46656465726174696f6e3a2043616e27742072656d6f766520616c6c20746865604482015267206d656d6265727360c01b60648201526084016104b7565b6036546035546105f890600190611c90565b10156106605760405162461bcd60e51b815260206004820152603160248201527f46656465726174696f6e3a2043616e27742068617665206c657373207468616e604482015270207265717569726564206d656d6265727360781b60648201526084016104b7565b6001600160a01b0381166000908152603760205260408120805460ff191690555b60355461069090600190611c90565b81101561076057816001600160a01b0316603582815481106106b4576106b4611ca7565b6000918252602090912001546001600160a01b0316141561074e57603580546106df90600190611c90565b815481106106ef576106ef611ca7565b600091825260209091200154603580546001600160a01b03909216918390811061071b5761071b611ca7565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550610760565b8061075881611cbd565b915050610681565b50603580548061077257610772611cd8565b600082815260208120820160001990810180546001600160a01b03191690559091019091556040516001600160a01b038316917f270bfc616dd36d5cb6b35aac93e6ef22b089c34e6f6ad6f0892797424840897b91a250565b3360009081526037602052604090205460ff166108265760405162461bcd60e51b81526020600482015260196024820152782332b232b930ba34b7b71d102737ba102332b232b930ba37b960391b60448201526064016104b7565b61082f81611491565b6040516bffffffffffffffffffffffff1960608b811b821660208401528a811b8216603484015289901b166048820152605c8101879052607c8101869052609c81018590526001600160e01b031960e085901b1660bc82015260009060c00160405160208183030381529060405280519060200120905060006108b98b8b8b8b8b8b8b8b8b610c20565b90506108c58282610bbb565b156108d1575050610a00565b6108db8282610443565b156108e7575050610a00565b6000818152603860205260408120600191336001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558086336001600160a01b03167fa7be469662a3e5b2343dce0cefce9d3e114875d7334d8d724d3838cf629c5b108e8e8e8e8e8d8d8d60405161096a989796959493929190611cee565b60405180910390a461097c82826114e0565b156109fd576000818152603960205260409020805460ff191660011790556109ab8b8b8b8b8b8b8b8b8b611600565b8086336001600160a01b03167f0fe3e5a751f4df1a701ea5d318482623b6a6b59ece98cb64169279b44219355e8e8e8e8e8e8d8d8d6040516109f4989796959493929190611cee565b60405180910390a45b50505b505050505050505050565b60358181548110610a1b57600080fd5b6000918252602090912001546001600160a01b0316905081565b6033546001600160a01b03163314610a5f5760405162461bcd60e51b81526004016104b790611c45565b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b3360009081526037602052604090205460ff16610b045760405162461bcd60e51b81526020600482015260196024820152782332b232b930ba34b7b71d102737ba102332b232b930ba37b960391b60448201526064016104b7565b8483148015610b1257508481145b610b5e5760405162461bcd60e51b815260206004820152601c60248201527f46656465726174696f6e3a204c656e677468206d6973736d617463680000000060448201526064016104b7565b336001600160a01b03167f909659508bf1f4c0ad9b406809f943832e107af28b0b436d9b7d56d3993c77f146438b8b8b8b8b8b8b8b604051610ba99a99989796959493929190611d9a565b60405180910390a25050505050505050565b60008181526039602052604081205460ff16806104845750505060009081526039602052604090205460ff1690565b6033546001600160a01b03163314610c145760405162461bcd60e51b81526004016104b790611c45565b610c1d816116ab565b50565b604080516bffffffffffffffffffffffff1960609b8c1b81166020808401919091529a8c1b8116603483015298909a1b90971660488a0152605c890195909552607c880193909352609c8701919091526001600160e01b031960e091821b1660bc87015260c086019190915280850191909152815180850390910181526101009093019052815191012090565b60606035805480602002602001604051908101604052809291908181526020018280548015610d0557602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ce7575b5050505050905090565b600080805b603554811015610d905760008481526038602052604081206035805491929184908110610d4357610d43611ca7565b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff1615610d7e57610d7b600183611e87565b91505b80610d8881611cbd565b915050610d14565b5092915050565b6033546001600160a01b03163314610dc15760405162461bcd60e51b81526004016104b790611c45565b60355481818111801590610dd457508015155b8015610ddf57508115155b610e2b5760405162461bcd60e51b815260206004820181905260248201527f46656465726174696f6e3a20496e76616c696420726571756972656d656e747360448201526064016104b7565b6002831015610e7c5760405162461bcd60e51b815260206004820152601f60248201527f46656465726174696f6e3a205265717569726573206174206c6561737420320060448201526064016104b7565b60368390556040518381527fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9060200160405180910390a1505050565b8383818111801590610eca57508015155b8015610ed557508115155b610f215760405162461bcd60e51b815260206004820181905260248201527f46656465726174696f6e3a20496e76616c696420726571756972656d656e747360448201526064016104b7565b600054610100900460ff1680610f3a575060005460ff16155b610f565760405162461bcd60e51b81526004016104b790611e9f565b600054610100900460ff16158015610f78576000805461ffff19166101011790555b610f81846111dc565b6032871115610fd25760405162461bcd60e51b815260206004820152601c60248201527f46656465726174696f6e3a20546f6f206d616e79206d656d626572730000000060448201526064016104b7565b610fde60358989611834565b5060005b8781101561117e57603760008a8a8481811061100057611000611ca7565b905060200201602081019061101591906118e3565b6001600160a01b0316815260208101919091526040016000205460ff1615801561106f5750600089898381811061104e5761104e611ca7565b905060200201602081019061106391906118e3565b6001600160a01b031614155b6110bb5760405162461bcd60e51b815260206004820152601b60248201527f46656465726174696f6e3a20496e76616c6964206d656d62657273000000000060448201526064016104b7565b6001603760008b8b858181106110d3576110d3611ca7565b90506020020160208101906110e891906118e3565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905588888281811061112257611122611ca7565b905060200201602081019061113791906118e3565b6001600160a01b03167f72114e270de66b9d2710ecf140403e5e99b1574767d6a8197bdc8d807a46e7c760405160405180910390a28061117681611cbd565b915050610fe2565b5060368690556040518681527fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9060200160405180910390a16111c0856116ab565b80156111d2576000805461ff00191690555b5050505050505050565b600054610100900460ff16806111f5575060005460ff16155b6112115760405162461bcd60e51b81526004016104b790611e9f565b600054610100900460ff16158015611233576000805461ffff19166101011790555b603380546001600160a01b0319166001600160a01b0384169081179091556040516000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3801561128e576000805461ff00191690555b5050565b6033546001600160a01b031633146112bc5760405162461bcd60e51b81526004016104b790611c45565b6001600160a01b03811661130d5760405162461bcd60e51b81526020600482015260186024820152772332b232b930ba34b7b71d1022b6b83a3c9036b2b6b132b960411b60448201526064016104b7565b6001600160a01b03811660009081526037602052604090205460ff16156113805760405162461bcd60e51b815260206004820152602160248201527f46656465726174696f6e3a204d656d62657220616c72656164792065786973746044820152607360f81b60648201526084016104b7565b6035546032116113d25760405162461bcd60e51b815260206004820152601f60248201527f46656465726174696f6e3a204d6178206d656d6265727320726561636865640060448201526064016104b7565b6001600160a01b038116600081815260376020526040808220805460ff1916600190811790915560358054918201815583527fcfa4bec1d3298408bb5afcfcd9c430549c5b31f8aa5c5848151c0a55f473c34d0180546001600160a01b03191684179055517f72114e270de66b9d2710ecf140403e5e99b1574767d6a8197bdc8d807a46e7c79190a250565b6033546001600160a01b031633146114885760405162461bcd60e51b81526004016104b790611c45565b610c1d81611755565b468114610c1d5760405162461bcd60e51b815260206004820152601d60248201527f46656465726174696f6e3a204e6f7420626c6f636b2e636861696e696400000060448201526064016104b7565b6000806114eb611812565b90506000805b6035548110156115f4576000858152603860205260408120603580549192918490811061152057611520611ca7565b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff161561155f57611558600183611e87565b91506115bf565b6000868152603860205260408120603580549192918490811061158457611584611ca7565b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff16156115bf576115bc600183611e87565b91505b8282101580156115d157506036548210155b156115e25760019350505050610487565b806115ec81611cbd565b9150506114f1565b50600095945050505050565b60345460405163048aa97560e21b81526001600160a01b038b811660048301528a811660248301528981166044830152606482018990526084820188905260a4820187905263ffffffff861660c483015260e4820185905261010482018490529091169063122aa5d49061012401600060405180830381600087803b15801561168857600080fd5b505af115801561169c573d6000803e3d6000fd5b50505050505050505050505050565b6001600160a01b0381166117015760405162461bcd60e51b815260206004820152601860248201527f46656465726174696f6e3a20456d70747920627269646765000000000000000060448201526064016104b7565b603480546001600160a01b0319166001600160a01b0383169081179091556040519081527f9775531310b2880b61484ed85cbb0b491c8fde3a07f289c63b925517827944979060200160405180910390a150565b6001600160a01b0381166117b65760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a206e6577206f776e6572206973207a65726f206164647265604482015261737360f01b60648201526084016104b7565b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b60355460009061182490600290611ee7565b61182f906001611e87565b905090565b828054828255906000526020600020908101928215611887579160200282015b828111156118875781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190611854565b50611893929150611897565b5090565b5b808211156118935760008155600101611898565b600080604083850312156118bf57600080fd5b50508035926020909101359150565b6001600160a01b0381168114610c1d57600080fd5b6000602082840312156118f557600080fd5b8135611900816118ce565b9392505050565b60006020828403121561191957600080fd5b5035919050565b803563ffffffff8116811461193457600080fd5b919050565b60008060008060008060008060006101208a8c03121561195857600080fd5b8935611963816118ce565b985060208a0135611973816118ce565b975060408a0135611983816118ce565b965060608a0135955060808a0135945060a08a013593506119a660c08b01611920565b925060e08a013591506101008a013590509295985092959850929598565b600060208083528351808285015260005b818110156119f1578581018301518582016040015282016119d5565b81811115611a03576000604083870101525b50601f01601f1916929092016040019392505050565b60008083601f840112611a2b57600080fd5b50813567ffffffffffffffff811115611a4357600080fd5b6020830191508360208260051b8501011115611a5e57600080fd5b9250929050565b6000806000806000806000806080898b031215611a8157600080fd5b883567ffffffffffffffff80821115611a9957600080fd5b818b0191508b601f830112611aad57600080fd5b813581811115611abc57600080fd5b8c6020828501011115611ace57600080fd5b60209283019a509850908a01359080821115611ae957600080fd5b611af58c838d01611a19565b909850965060408b0135915080821115611b0e57600080fd5b611b1a8c838d01611a19565b909650945060608b0135915080821115611b3357600080fd5b50611b408b828c01611a19565b999c989b5096995094979396929594505050565b60008060408385031215611b6757600080fd5b823591506020830135611b79816118ce565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b81811015611bc55783516001600160a01b031683529284019291840191600101611ba0565b50909695505050505050565b600080600080600060808688031215611be957600080fd5b853567ffffffffffffffff811115611c0057600080fd5b611c0c88828901611a19565b909650945050602086013592506040860135611c27816118ce565b91506060860135611c37816118ce565b809150509295509295909350565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015611ca257611ca2611c7a565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611cd157611cd1611c7a565b5060010190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03988916815296881660208801529490961660408601526060850192909252608084015263ffffffff1660a083015260c082019290925260e08101919091526101000190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b81835260006001600160fb1b03831115611d7d57600080fd5b8260051b8083602087013760009401602001938452509192915050565b8a8152600060208b8184015260c06040840152611dbb60c084018b8d611d3b565b8381036060850152611dce818a8c611d64565b90508381036080850152611de381888a611d64565b84810360a08601528581529050818101600586901b820183018760005b88811015611e6f57848303601f190184528135368b9003601e19018112611e2657600080fd5b8a01803567ffffffffffffffff811115611e3f57600080fd5b8036038c1315611e4e57600080fd5b611e5b85828a8501611d3b565b958801959450505090850190600101611e00565b5050809450505050509b9a5050505050505050505050565b60008219821115611e9a57611e9a611c7a565b500190565b60208082526028908201527f436f6e747261637420696e7374616e636520697320616c726561647920696e696040820152671d1a585b1a5e995960c21b606082015260800190565b600082611f0457634e487b7160e01b600052601260045260246000fd5b50049056fea264697066735822122080da2d173e8a3678490d1bba1778aecda04e4b4a98d863e10c49639aad6d265d64736f6c63430008090033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101a95760003560e01c80639386775a116100f9578063c1b4a1e311610097578063ca6d56dc11610071578063ca6d56dc14610401578063dc8452cd14610414578063e78cea921461041d578063f2fde38b1461043057600080fd5b8063c1b4a1e3146103b8578063c1f0808a146103cb578063c4d66de8146103ee57600080fd5b8063a1fb4acb116100d3578063a1fb4acb1461034c578063a230c5241461035f578063a93585f014610382578063ba51a6df146103a557600080fd5b80639386775a146102f65780639dc8f9c8146103245780639eab52531461033757600080fd5b8063681fc921116101665780637b6d343a116101405780637b6d343a146102ac5780638da5cb5b146102bf5780638dd14802146102d05780638f32d59b146102e357600080fd5b8063681fc9211461027b578063715018a61461029157806379d9ee721461029957600080fd5b806309c69cfa146101ae5780630b1ca49a146101d65780631b4613cb146101eb5780633f78f0691461021957806354fd4d501461022c5780635daf08ca14610250575b600080fd5b6101c16101bc3660046118ac565b610443565b60405190151581526020015b60405180910390f35b6101e96101e43660046118e3565b61048d565b005b6101c16101f9366004611907565b600090815260386020908152604080832033845290915290205460ff1690565b6101e9610227366004611939565b6107cb565b6040805180820182526002815261763360f01b602082015290516101cd91906119c4565b61026361025e366004611907565b610a0b565b6040516001600160a01b0390911681526020016101cd565b610283603281565b6040519081526020016101cd565b6101e9610a35565b6101e96102a7366004611a65565b610aa9565b6101c16102ba3660046118ac565b610bbb565b6033546001600160a01b0316610263565b6101e96102de3660046118e3565b610bea565b6033546001600160a01b031633146101c1565b6101c1610304366004611b54565b603860209081526000928352604080842090915290825290205460ff1681565b610283610332366004611939565b610c20565b61033f610cad565b6040516101cd9190611b84565b61028361035a366004611907565b610d0f565b6101c161036d3660046118e3565b60376020526000908152604090205460ff1681565b6101c1610390366004611907565b60009081526039602052604090205460ff1690565b6101e96103b3366004611907565b610d97565b6101e96103c6366004611bd1565b610eb9565b6101c16103d9366004611907565b60396020526000908152604090205460ff1681565b6101e96103fc3660046118e3565b6111dc565b6101e961040f3660046118e3565b611292565b61028360365481565b603454610263906001600160a01b031681565b6101e961043e3660046118e3565b61145e565b600081815260386020908152604080832033845290915281205460ff16806104845750600083815260386020908152604080832033845290915290205460ff165b90505b92915050565b6033546001600160a01b031633146104c05760405162461bcd60e51b81526004016104b790611c45565b60405180910390fd5b6001600160a01b0381166105115760405162461bcd60e51b81526020600482015260186024820152772332b232b930ba34b7b71d1022b6b83a3c9036b2b6b132b960411b60448201526064016104b7565b6001600160a01b03811660009081526037602052604090205460ff166105835760405162461bcd60e51b815260206004820152602160248201527f46656465726174696f6e3a204d656d62657220646f65736e27742065786973746044820152607360f81b60648201526084016104b7565b6035546001106105e65760405162461bcd60e51b815260206004820152602860248201527f46656465726174696f6e3a2043616e27742072656d6f766520616c6c20746865604482015267206d656d6265727360c01b60648201526084016104b7565b6036546035546105f890600190611c90565b10156106605760405162461bcd60e51b815260206004820152603160248201527f46656465726174696f6e3a2043616e27742068617665206c657373207468616e604482015270207265717569726564206d656d6265727360781b60648201526084016104b7565b6001600160a01b0381166000908152603760205260408120805460ff191690555b60355461069090600190611c90565b81101561076057816001600160a01b0316603582815481106106b4576106b4611ca7565b6000918252602090912001546001600160a01b0316141561074e57603580546106df90600190611c90565b815481106106ef576106ef611ca7565b600091825260209091200154603580546001600160a01b03909216918390811061071b5761071b611ca7565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550610760565b8061075881611cbd565b915050610681565b50603580548061077257610772611cd8565b600082815260208120820160001990810180546001600160a01b03191690559091019091556040516001600160a01b038316917f270bfc616dd36d5cb6b35aac93e6ef22b089c34e6f6ad6f0892797424840897b91a250565b3360009081526037602052604090205460ff166108265760405162461bcd60e51b81526020600482015260196024820152782332b232b930ba34b7b71d102737ba102332b232b930ba37b960391b60448201526064016104b7565b61082f81611491565b6040516bffffffffffffffffffffffff1960608b811b821660208401528a811b8216603484015289901b166048820152605c8101879052607c8101869052609c81018590526001600160e01b031960e085901b1660bc82015260009060c00160405160208183030381529060405280519060200120905060006108b98b8b8b8b8b8b8b8b8b610c20565b90506108c58282610bbb565b156108d1575050610a00565b6108db8282610443565b156108e7575050610a00565b6000818152603860205260408120600191336001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558086336001600160a01b03167fa7be469662a3e5b2343dce0cefce9d3e114875d7334d8d724d3838cf629c5b108e8e8e8e8e8d8d8d60405161096a989796959493929190611cee565b60405180910390a461097c82826114e0565b156109fd576000818152603960205260409020805460ff191660011790556109ab8b8b8b8b8b8b8b8b8b611600565b8086336001600160a01b03167f0fe3e5a751f4df1a701ea5d318482623b6a6b59ece98cb64169279b44219355e8e8e8e8e8e8d8d8d6040516109f4989796959493929190611cee565b60405180910390a45b50505b505050505050505050565b60358181548110610a1b57600080fd5b6000918252602090912001546001600160a01b0316905081565b6033546001600160a01b03163314610a5f5760405162461bcd60e51b81526004016104b790611c45565b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b3360009081526037602052604090205460ff16610b045760405162461bcd60e51b81526020600482015260196024820152782332b232b930ba34b7b71d102737ba102332b232b930ba37b960391b60448201526064016104b7565b8483148015610b1257508481145b610b5e5760405162461bcd60e51b815260206004820152601c60248201527f46656465726174696f6e3a204c656e677468206d6973736d617463680000000060448201526064016104b7565b336001600160a01b03167f909659508bf1f4c0ad9b406809f943832e107af28b0b436d9b7d56d3993c77f146438b8b8b8b8b8b8b8b604051610ba99a99989796959493929190611d9a565b60405180910390a25050505050505050565b60008181526039602052604081205460ff16806104845750505060009081526039602052604090205460ff1690565b6033546001600160a01b03163314610c145760405162461bcd60e51b81526004016104b790611c45565b610c1d816116ab565b50565b604080516bffffffffffffffffffffffff1960609b8c1b81166020808401919091529a8c1b8116603483015298909a1b90971660488a0152605c890195909552607c880193909352609c8701919091526001600160e01b031960e091821b1660bc87015260c086019190915280850191909152815180850390910181526101009093019052815191012090565b60606035805480602002602001604051908101604052809291908181526020018280548015610d0557602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ce7575b5050505050905090565b600080805b603554811015610d905760008481526038602052604081206035805491929184908110610d4357610d43611ca7565b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff1615610d7e57610d7b600183611e87565b91505b80610d8881611cbd565b915050610d14565b5092915050565b6033546001600160a01b03163314610dc15760405162461bcd60e51b81526004016104b790611c45565b60355481818111801590610dd457508015155b8015610ddf57508115155b610e2b5760405162461bcd60e51b815260206004820181905260248201527f46656465726174696f6e3a20496e76616c696420726571756972656d656e747360448201526064016104b7565b6002831015610e7c5760405162461bcd60e51b815260206004820152601f60248201527f46656465726174696f6e3a205265717569726573206174206c6561737420320060448201526064016104b7565b60368390556040518381527fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9060200160405180910390a1505050565b8383818111801590610eca57508015155b8015610ed557508115155b610f215760405162461bcd60e51b815260206004820181905260248201527f46656465726174696f6e3a20496e76616c696420726571756972656d656e747360448201526064016104b7565b600054610100900460ff1680610f3a575060005460ff16155b610f565760405162461bcd60e51b81526004016104b790611e9f565b600054610100900460ff16158015610f78576000805461ffff19166101011790555b610f81846111dc565b6032871115610fd25760405162461bcd60e51b815260206004820152601c60248201527f46656465726174696f6e3a20546f6f206d616e79206d656d626572730000000060448201526064016104b7565b610fde60358989611834565b5060005b8781101561117e57603760008a8a8481811061100057611000611ca7565b905060200201602081019061101591906118e3565b6001600160a01b0316815260208101919091526040016000205460ff1615801561106f5750600089898381811061104e5761104e611ca7565b905060200201602081019061106391906118e3565b6001600160a01b031614155b6110bb5760405162461bcd60e51b815260206004820152601b60248201527f46656465726174696f6e3a20496e76616c6964206d656d62657273000000000060448201526064016104b7565b6001603760008b8b858181106110d3576110d3611ca7565b90506020020160208101906110e891906118e3565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905588888281811061112257611122611ca7565b905060200201602081019061113791906118e3565b6001600160a01b03167f72114e270de66b9d2710ecf140403e5e99b1574767d6a8197bdc8d807a46e7c760405160405180910390a28061117681611cbd565b915050610fe2565b5060368690556040518681527fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9060200160405180910390a16111c0856116ab565b80156111d2576000805461ff00191690555b5050505050505050565b600054610100900460ff16806111f5575060005460ff16155b6112115760405162461bcd60e51b81526004016104b790611e9f565b600054610100900460ff16158015611233576000805461ffff19166101011790555b603380546001600160a01b0319166001600160a01b0384169081179091556040516000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3801561128e576000805461ff00191690555b5050565b6033546001600160a01b031633146112bc5760405162461bcd60e51b81526004016104b790611c45565b6001600160a01b03811661130d5760405162461bcd60e51b81526020600482015260186024820152772332b232b930ba34b7b71d1022b6b83a3c9036b2b6b132b960411b60448201526064016104b7565b6001600160a01b03811660009081526037602052604090205460ff16156113805760405162461bcd60e51b815260206004820152602160248201527f46656465726174696f6e3a204d656d62657220616c72656164792065786973746044820152607360f81b60648201526084016104b7565b6035546032116113d25760405162461bcd60e51b815260206004820152601f60248201527f46656465726174696f6e3a204d6178206d656d6265727320726561636865640060448201526064016104b7565b6001600160a01b038116600081815260376020526040808220805460ff1916600190811790915560358054918201815583527fcfa4bec1d3298408bb5afcfcd9c430549c5b31f8aa5c5848151c0a55f473c34d0180546001600160a01b03191684179055517f72114e270de66b9d2710ecf140403e5e99b1574767d6a8197bdc8d807a46e7c79190a250565b6033546001600160a01b031633146114885760405162461bcd60e51b81526004016104b790611c45565b610c1d81611755565b468114610c1d5760405162461bcd60e51b815260206004820152601d60248201527f46656465726174696f6e3a204e6f7420626c6f636b2e636861696e696400000060448201526064016104b7565b6000806114eb611812565b90506000805b6035548110156115f4576000858152603860205260408120603580549192918490811061152057611520611ca7565b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff161561155f57611558600183611e87565b91506115bf565b6000868152603860205260408120603580549192918490811061158457611584611ca7565b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff16156115bf576115bc600183611e87565b91505b8282101580156115d157506036548210155b156115e25760019350505050610487565b806115ec81611cbd565b9150506114f1565b50600095945050505050565b60345460405163048aa97560e21b81526001600160a01b038b811660048301528a811660248301528981166044830152606482018990526084820188905260a4820187905263ffffffff861660c483015260e4820185905261010482018490529091169063122aa5d49061012401600060405180830381600087803b15801561168857600080fd5b505af115801561169c573d6000803e3d6000fd5b50505050505050505050505050565b6001600160a01b0381166117015760405162461bcd60e51b815260206004820152601860248201527f46656465726174696f6e3a20456d70747920627269646765000000000000000060448201526064016104b7565b603480546001600160a01b0319166001600160a01b0383169081179091556040519081527f9775531310b2880b61484ed85cbb0b491c8fde3a07f289c63b925517827944979060200160405180910390a150565b6001600160a01b0381166117b65760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a206e6577206f776e6572206973207a65726f206164647265604482015261737360f01b60648201526084016104b7565b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b60355460009061182490600290611ee7565b61182f906001611e87565b905090565b828054828255906000526020600020908101928215611887579160200282015b828111156118875781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190611854565b50611893929150611897565b5090565b5b808211156118935760008155600101611898565b600080604083850312156118bf57600080fd5b50508035926020909101359150565b6001600160a01b0381168114610c1d57600080fd5b6000602082840312156118f557600080fd5b8135611900816118ce565b9392505050565b60006020828403121561191957600080fd5b5035919050565b803563ffffffff8116811461193457600080fd5b919050565b60008060008060008060008060006101208a8c03121561195857600080fd5b8935611963816118ce565b985060208a0135611973816118ce565b975060408a0135611983816118ce565b965060608a0135955060808a0135945060a08a013593506119a660c08b01611920565b925060e08a013591506101008a013590509295985092959850929598565b600060208083528351808285015260005b818110156119f1578581018301518582016040015282016119d5565b81811115611a03576000604083870101525b50601f01601f1916929092016040019392505050565b60008083601f840112611a2b57600080fd5b50813567ffffffffffffffff811115611a4357600080fd5b6020830191508360208260051b8501011115611a5e57600080fd5b9250929050565b6000806000806000806000806080898b031215611a8157600080fd5b883567ffffffffffffffff80821115611a9957600080fd5b818b0191508b601f830112611aad57600080fd5b813581811115611abc57600080fd5b8c6020828501011115611ace57600080fd5b60209283019a509850908a01359080821115611ae957600080fd5b611af58c838d01611a19565b909850965060408b0135915080821115611b0e57600080fd5b611b1a8c838d01611a19565b909650945060608b0135915080821115611b3357600080fd5b50611b408b828c01611a19565b999c989b5096995094979396929594505050565b60008060408385031215611b6757600080fd5b823591506020830135611b79816118ce565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b81811015611bc55783516001600160a01b031683529284019291840191600101611ba0565b50909695505050505050565b600080600080600060808688031215611be957600080fd5b853567ffffffffffffffff811115611c0057600080fd5b611c0c88828901611a19565b909650945050602086013592506040860135611c27816118ce565b91506060860135611c37816118ce565b809150509295509295909350565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015611ca257611ca2611c7a565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611cd157611cd1611c7a565b5060010190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03988916815296881660208801529490961660408601526060850192909252608084015263ffffffff1660a083015260c082019290925260e08101919091526101000190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b81835260006001600160fb1b03831115611d7d57600080fd5b8260051b8083602087013760009401602001938452509192915050565b8a8152600060208b8184015260c06040840152611dbb60c084018b8d611d3b565b8381036060850152611dce818a8c611d64565b90508381036080850152611de381888a611d64565b84810360a08601528581529050818101600586901b820183018760005b88811015611e6f57848303601f190184528135368b9003601e19018112611e2657600080fd5b8a01803567ffffffffffffffff811115611e3f57600080fd5b8036038c1315611e4e57600080fd5b611e5b85828a8501611d3b565b958801959450505090850190600101611e00565b5050809450505050509b9a5050505050505050505050565b60008219821115611e9a57611e9a611c7a565b500190565b60208082526028908201527f436f6e747261637420696e7374616e636520697320616c726561647920696e696040820152671d1a585b1a5e995960c21b606082015260800190565b600082611f0457634e487b7160e01b600052601260045260246000fd5b50049056fea264697066735822122080da2d173e8a3678490d1bba1778aecda04e4b4a98d863e10c49639aad6d265d64736f6c63430008090033", + "devdoc": { + "kind": "dev", + "methods": { + "addMember(address)": { + "params": { + "_newMember": "address of the new member" + } + }, + "changeRequirement(uint256)": { + "details": "Emits the RequirementChange event", + "params": { + "_required": "the number of minimum members to approve an transaction, it has to be bigger than 1" + } + }, + "emitHeartbeat(string,uint256[],uint256[],string[])": { + "details": "Emits HeartBeat event" + }, + "getMembers()": { + "returns": { + "_0": "Current members" + } + }, + "getTransactionCount(bytes32)": { + "params": { + "transactionId": "The transaction hashed from getTransactionId function" + } + }, + "getTransactionId(address,address,address,uint256,bytes32,bytes32,uint32,uint256,uint256)": { + "details": "It encodes and applies keccak256 to the parameters received in the same order", + "params": { + "amount": "Could be the amount or the tokenId", + "blockHash": "The block hash in which the transaction with the cross event occurred", + "destinationChainId": "Is chainId of the destination chain", + "logIndex": "Index of the event in the logs", + "originChainId": "Is chainId of the original chain", + "originalTokenAddress": "The address of the token in the origin (main) chain", + "receiver": "Who is going to receive the token in the opposite chain", + "sender": "The address who solicited the cross token", + "transactionHash": "The transaction in which the cross event occurred" + }, + "returns": { + "_0": "The hash generated by the parameters." + } + }, + "initialize(address)": { + "details": "Initializes the contract setting the deployer as the initial owner." + }, + "isOwner()": { + "details": "Returns true if the caller is the current owner." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "removeMember(address)": { + "params": { + "_oldMember": "address of the member to be removed from federation" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. > Note: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setBridge(address)": { + "details": "Emits BridgeChanged event", + "params": { + "_bridge": "the new bridge contract address that should implement the IBridge interface" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "version()": { + "returns": { + "_0": "version in v{Number}" + } + }, + "voteTransaction(address,address,address,uint256,bytes32,bytes32,uint32,uint256,uint256)": { + "params": { + "blockHash": "The block hash in which the transaction with the cross event occurred", + "destinationChainId": "Is chainId of the destination chain", + "logIndex": "Index of the event in the logs", + "originChainId": "Is chainId of the original chain", + "originalTokenAddress": "The address of the token in the origin (main) chain", + "receiver": "Who is going to receive the token in the opposite chain", + "sender": "The address who solicited the cross token", + "transactionHash": "The transaction in which the cross event occurred", + "value": "Amount" + } + } + }, + "stateVariables": { + "isMember": { + "details": "The address should be a member to vote in transactions" + }, + "required": { + "details": "It should have at least the required amount of members" + }, + "votes": { + "details": "the members should approve the transaction by 50% + 1" + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "addMember(address)": { + "notice": "Add a new member to the federation" + }, + "changeRequirement(uint256)": { + "notice": "Changes the number of required members to vote and approve an transaction" + }, + "emitHeartbeat(string,uint256[],uint256[],string[])": { + "notice": "It emits an HeartBeat like an health check" + }, + "getMembers()": { + "notice": "Return all the current members of the federation" + }, + "getTransactionCount(bytes32)": { + "notice": "Get the amount of approved votes for that transactionId" + }, + "getTransactionId(address,address,address,uint256,bytes32,bytes32,uint32,uint256,uint256)": { + "notice": "Gets the hash of transaction from the following parameters encoded and keccaked" + }, + "isMember(address)": { + "notice": "All the addresses that are members of the federation" + }, + "processed(bytes32)": { + "notice": "(bytes32) transactionId => (bool) votedCheck if that transaction was already processed" + }, + "removeMember(address)": { + "notice": "Remove a member of the federation" + }, + "required()": { + "notice": "The minimum amount of votes to approve a transaction" + }, + "setBridge(address)": { + "notice": "Sets a new bridge contract" + }, + "version()": { + "notice": "Current version of the contract" + }, + "voteTransaction(address,address,address,uint256,bytes32,bytes32,uint32,uint256,uint256)": { + "notice": "Vote in a transaction, if it has enough votes it accepts the transfer" + }, + "votes(bytes32,address)": { + "notice": "(bytes32) transactionId = keccak256( abi.encodePacked( originalTokenAddress, sender, receiver, amount, blockHash, transactionHash, logIndex ) ) => ( (address) members => (bool) voted )Votes by members by the transaction ID" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 7372, + "contract": "contracts/Federation/Federation.sol:Federation", + "label": "initialized", + "offset": 0, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 7375, + "contract": "contracts/Federation/Federation.sol:Federation", + "label": "initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 7415, + "contract": "contracts/Federation/Federation.sol:Federation", + "label": "______gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 7661, + "contract": "contracts/Federation/Federation.sol:Federation", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 2042, + "contract": "contracts/Federation/Federation.sol:Federation", + "label": "bridge", + "offset": 0, + "slot": "52", + "type": "t_contract(IBridge)4675" + }, + { + "astId": 2045, + "contract": "contracts/Federation/Federation.sol:Federation", + "label": "members", + "offset": 0, + "slot": "53", + "type": "t_array(t_address)dyn_storage" + }, + { + "astId": 2048, + "contract": "contracts/Federation/Federation.sol:Federation", + "label": "required", + "offset": 0, + "slot": "54", + "type": "t_uint256" + }, + { + "astId": 2053, + "contract": "contracts/Federation/Federation.sol:Federation", + "label": "isMember", + "offset": 0, + "slot": "55", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 2060, + "contract": "contracts/Federation/Federation.sol:Federation", + "label": "votes", + "offset": 0, + "slot": "56", + "type": "t_mapping(t_bytes32,t_mapping(t_address,t_bool))" + }, + { + "astId": 2065, + "contract": "contracts/Federation/Federation.sol:Federation", + "label": "processed", + "offset": 0, + "slot": "57", + "type": "t_mapping(t_bytes32,t_bool)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_address)dyn_storage": { + "base": "t_address", + "encoding": "dynamic_array", + "label": "address[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IBridge)4675": { + "encoding": "inplace", + "label": "contract IBridge", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_bytes32,t_bool)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_bytes32,t_mapping(t_address,t_bool))": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => mapping(address => bool))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_bool)" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/bridge/deployments/goerli/FederationProxy.json b/bridge/deployments/goerli/FederationProxy.json new file mode 100644 index 000000000..b7ee78284 --- /dev/null +++ b/bridge/deployments/goerli/FederationProxy.json @@ -0,0 +1,258 @@ +{ + "address": "0xF687a27475B2B7Ec363d2705CF94A067aEB248f6", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xb6e2c1e41431abd9b0de70d2136eba16636c6c26a30b88e98e3e7496f9e63794", + "receipt": { + "to": null, + "from": "0xa554d96413FF72E93437C4072438302C38350EE3", + "contractAddress": "0xF687a27475B2B7Ec363d2705CF94A067aEB248f6", + "transactionIndex": 1, + "gasUsed": "745225", + "logsBloom": "0x00020000000000000001000000000000000100000000000000800000000000000000000000000000000000000000000000000000000000000080000000000000000000800000000000000000000000100001000000000000000000000010000000000040020000000000000000000800000000000000000000000000000000400000000000004000000000008000000000000000000000000000000000200000000001000000000000000000000000000000008000008000000000000000000000000040000000000000000000000000000000000000000000000000000020000010000000000000000000000000000100000000000000000800000000000000", + "blockHash": "0xfd9b098e396b7ceeb95bc04de80634e12d56330747f5064647b51085308bea61", + "transactionHash": "0xb6e2c1e41431abd9b0de70d2136eba16636c6c26a30b88e98e3e7496f9e63794", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 7664853, + "transactionHash": "0xb6e2c1e41431abd9b0de70d2136eba16636c6c26a30b88e98e3e7496f9e63794", + "address": "0xF687a27475B2B7Ec363d2705CF94A067aEB248f6", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000003cf0eb5b86a2b0e58fa6e088c91feefb71aeca2d" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0xfd9b098e396b7ceeb95bc04de80634e12d56330747f5064647b51085308bea61" + }, + { + "transactionIndex": 1, + "blockNumber": 7664853, + "transactionHash": "0xb6e2c1e41431abd9b0de70d2136eba16636c6c26a30b88e98e3e7496f9e63794", + "address": "0xF687a27475B2B7Ec363d2705CF94A067aEB248f6", + "topics": [ + "0x72114e270de66b9d2710ecf140403e5e99b1574767d6a8197bdc8d807a46e7c7", + "0x0000000000000000000000008f397ff074ff190fc650e5cab4da039a8163e12a" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0xfd9b098e396b7ceeb95bc04de80634e12d56330747f5064647b51085308bea61" + }, + { + "transactionIndex": 1, + "blockNumber": 7664853, + "transactionHash": "0xb6e2c1e41431abd9b0de70d2136eba16636c6c26a30b88e98e3e7496f9e63794", + "address": "0xF687a27475B2B7Ec363d2705CF94A067aEB248f6", + "topics": [ + "0xa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 3, + "blockHash": "0xfd9b098e396b7ceeb95bc04de80634e12d56330747f5064647b51085308bea61" + }, + { + "transactionIndex": 1, + "blockNumber": 7664853, + "transactionHash": "0xb6e2c1e41431abd9b0de70d2136eba16636c6c26a30b88e98e3e7496f9e63794", + "address": "0xF687a27475B2B7Ec363d2705CF94A067aEB248f6", + "topics": [ + "0x9775531310b2880b61484ed85cbb0b491c8fde3a07f289c63b92551782794497" + ], + "data": "0x000000000000000000000000a3acf79aded2dd5e2a8bd2e3d1e9f797e96972d3", + "logIndex": 4, + "blockHash": "0xfd9b098e396b7ceeb95bc04de80634e12d56330747f5064647b51085308bea61" + } + ], + "blockNumber": 7664853, + "cumulativeGasUsed": "796801", + "status": 1, + "byzantium": true + }, + "args": [ + "0x623727D544C207fD7b184Fd375854Df356e70ff2", + "0x39055c999A8528535Af012F4F4CF7B548dD97481", + "0xc1b4a1e300000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a3acf79aded2dd5e2a8bd2e3d1e9f797e96972d30000000000000000000000003cf0eb5b86a2b0e58fa6e088c91feefb71aeca2d00000000000000000000000000000000000000000000000000000000000000010000000000000000000000008f397ff074ff190fc650e5cab4da039a8163e12a" + ], + "numDeployments": 1, + "solcInputHash": "caeb40de80c8668828546c6b3fb7fad2", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emitted when the admin account has changed.\"}},\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {UpgradeableProxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"stateVariables\":{\"_ADMIN_SLOT\":{\"details\":\"Storage slot with the admin of the contract. This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is validated in the constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/zeppelin/upgradable/proxy/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/zeppelin/upgradable/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback () external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive () external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {\\n }\\n}\\n\",\"keccak256\":\"0xdc0ebdc6f4ae0b5f9dd0a6c041a2238e4a7a2afbc6cef539437b0004ada42370\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/proxy/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"./UpgradeableProxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is UpgradeableProxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {UpgradeableProxy-constructor}.\\n */\\n constructor(address _logic, address admin_, bytes memory _data) payable UpgradeableProxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _setAdmin(admin_);\\n }\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _admin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _admin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n require(newAdmin != address(0), \\\"TransparentUpgradeableProxy: new admin is the zero address\\\");\\n emit AdminChanged(_admin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external virtual ifAdmin {\\n _upgradeTo(newImplementation);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable virtual ifAdmin {\\n _upgradeTo(newImplementation);\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address adm) {\\n bytes32 slot = _ADMIN_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n adm := sload(slot)\\n }\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n bytes32 slot = _ADMIN_SLOT;\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, newAdmin)\\n }\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _admin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x3327b21f85d71d3b9bad1a89267f08b19966e03446a18d810bd80fe42789ac5f\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/proxy/UpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"./Proxy.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n *\\n * Upgradeability is only provided internally through {_upgradeTo}. For an externally upgradeable proxy see\\n * {TransparentUpgradeableProxy}.\\n */\\ncontract UpgradeableProxy is Proxy {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _setImplementation(_logic);\\n if(_data.length > 0) {\\n Address.functionDelegateCall(_logic, _data);\\n }\\n }\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 private constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n bytes32 slot = _IMPLEMENTATION_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n impl := sload(slot)\\n }\\n }\\n\\n /**\\n * @dev Upgrades the proxy to a new implementation.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal virtual {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"UpgradeableProxy: new implementation is not a contract\\\");\\n\\n bytes32 slot = _IMPLEMENTATION_SLOT;\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, newImplementation)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb54322ec8ec142c149ad1f561aa2f0da6d6ea2d9f45639164088db9e16d5a69d\",\"license\":\"MIT\"},\"contracts/zeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x04801fc2398ee3370f3903f95389ea3a8da65a8df01f24b352e499e44d492e9b\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405162000d9138038062000d91833981016040819052620000269162000369565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd62000449565b60008051602062000d4a833981519152146200007557620000756200046f565b620000808262000112565b805115620000a1576200009f8282620001b360201b620003ba1760201c565b505b50620000d1905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610462000449565b60008051602062000d2a83398151915214620000f157620000f16200046f565b620001098260008051602062000d2a83398151915255565b505050620004d8565b6200012881620001e260201b620003e61760201c565b620001a05760405162461bcd60e51b815260206004820152603660248201527f5570677261646561626c6550726f78793a206e657720696d706c656d656e746160448201527f74696f6e206973206e6f74206120636f6e74726163740000000000000000000060648201526084015b60405180910390fd5b60008051602062000d4a83398151915255565b6060620001db838360405180606001604052806027815260200162000d6a60279139620001e8565b9392505050565b3b151590565b6060833b620002495760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840162000197565b600080856001600160a01b03168560405162000266919062000485565b600060405180830381855af49150503d8060008114620002a3576040519150601f19603f3d011682016040523d82523d6000602084013e620002a8565b606091505b509092509050620002bb828286620002c5565b9695505050505050565b60608315620002d6575081620001db565b825115620002e75782518084602001fd5b8160405162461bcd60e51b8152600401620001979190620004a3565b80516001600160a01b03811681146200031b57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035357818101518382015260200162000339565b8381111562000363576000848401525b50505050565b6000806000606084860312156200037f57600080fd5b6200038a8462000303565b92506200039a6020850162000303565b60408501519092506001600160401b0380821115620003b857600080fd5b818601915086601f830112620003cd57600080fd5b815181811115620003e257620003e262000320565b604051601f8201601f19908116603f011681019083821181831017156200040d576200040d62000320565b816040528281528960208487010111156200042757600080fd5b6200043a83602083016020880162000336565b80955050505050509250925092565b6000828210156200046a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b600082516200049981846020870162000336565b9190910192915050565b6020815260008251806020840152620004c481604085016020870162000336565b601f01601f19169190910160400192915050565b61084280620004e86000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106ac565b610138565b61005b6100933660046106c7565b610175565b3480156100a457600080fd5b506100ad6101fa565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106ac565b61025c565b3480156100f557600080fd5b506100ad610375565b6101066103ec565b6101366101317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b61048e565b565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b0316141561016d5761016a816104b2565b50565b61016a6100fe565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b031614156101ed576101a7836104b2565b6101e78383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103ba92505050565b50505050565b6101f56100fe565b505050565b60006102126000805160206107c68339815191525490565b6001600160a01b0316336001600160a01b0316141561025157507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6102596100fe565b90565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b0316141561016d576001600160a01b0381166103065760405162461bcd60e51b815260206004820152603a60248201527f5472616e73706172656e745570677261646561626c6550726f78793a206e657760448201527f2061646d696e20697320746865207a65726f206164647265737300000000000060648201526084015b60405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61033d6000805160206107c68339815191525490565b604080516001600160a01b03928316815291841660208301520160405180910390a161016a816000805160206107c683398151915255565b600061038d6000805160206107c68339815191525490565b6001600160a01b0316336001600160a01b0316141561025157506000805160206107c68339815191525490565b60606103df83836040518060600160405280602781526020016107e6602791396104f2565b9392505050565b3b151590565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b031614156101365760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4016102fd565b3660008037600080366000845af43d6000803e8080156104ad573d6000f35b3d6000fd5b6104bb816105c6565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060833b6105515760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102fd565b600080856001600160a01b03168560405161056c9190610776565b600060405180830381855af49150503d80600081146105a7576040519150601f19603f3d011682016040523d82523d6000602084013e6105ac565b606091505b50915091506105bc828286610657565b9695505050505050565b803b6106335760405162461bcd60e51b815260206004820152603660248201527f5570677261646561626c6550726f78793a206e657720696d706c656d656e74616044820152751d1a5bdb881a5cc81b9bdd08184818dbdb9d1c9858dd60521b60648201526084016102fd565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b606083156106665750816103df565b8251156106765782518084602001fd5b8160405162461bcd60e51b81526004016102fd9190610792565b80356001600160a01b03811681146106a757600080fd5b919050565b6000602082840312156106be57600080fd5b6103df82610690565b6000806000604084860312156106dc57600080fd5b6106e584610690565b9250602084013567ffffffffffffffff8082111561070257600080fd5b818601915086601f83011261071657600080fd5b81358181111561072557600080fd5b87602082850101111561073757600080fd5b6020830194508093505050509250925092565b60005b8381101561076557818101518382015260200161074d565b838111156101e75750506000910152565b6000825161078881846020870161074a565b9190910192915050565b60208152600082518060208401526107b181604085016020870161074a565b601f01601f1916919091016040019291505056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122001f23e5e5d70499e22926447138d9a73085390bf4c2f13e017a1d16843ca77ac64736f6c63430008090033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106ac565b610138565b61005b6100933660046106c7565b610175565b3480156100a457600080fd5b506100ad6101fa565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106ac565b61025c565b3480156100f557600080fd5b506100ad610375565b6101066103ec565b6101366101317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b61048e565b565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b0316141561016d5761016a816104b2565b50565b61016a6100fe565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b031614156101ed576101a7836104b2565b6101e78383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103ba92505050565b50505050565b6101f56100fe565b505050565b60006102126000805160206107c68339815191525490565b6001600160a01b0316336001600160a01b0316141561025157507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6102596100fe565b90565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b0316141561016d576001600160a01b0381166103065760405162461bcd60e51b815260206004820152603a60248201527f5472616e73706172656e745570677261646561626c6550726f78793a206e657760448201527f2061646d696e20697320746865207a65726f206164647265737300000000000060648201526084015b60405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61033d6000805160206107c68339815191525490565b604080516001600160a01b03928316815291841660208301520160405180910390a161016a816000805160206107c683398151915255565b600061038d6000805160206107c68339815191525490565b6001600160a01b0316336001600160a01b0316141561025157506000805160206107c68339815191525490565b60606103df83836040518060600160405280602781526020016107e6602791396104f2565b9392505050565b3b151590565b6000805160206107c6833981519152546001600160a01b0316336001600160a01b031614156101365760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4016102fd565b3660008037600080366000845af43d6000803e8080156104ad573d6000f35b3d6000fd5b6104bb816105c6565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060833b6105515760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102fd565b600080856001600160a01b03168560405161056c9190610776565b600060405180830381855af49150503d80600081146105a7576040519150601f19603f3d011682016040523d82523d6000602084013e6105ac565b606091505b50915091506105bc828286610657565b9695505050505050565b803b6106335760405162461bcd60e51b815260206004820152603660248201527f5570677261646561626c6550726f78793a206e657720696d706c656d656e74616044820152751d1a5bdb881a5cc81b9bdd08184818dbdb9d1c9858dd60521b60648201526084016102fd565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b606083156106665750816103df565b8251156106765782518084602001fd5b8160405162461bcd60e51b81526004016102fd9190610792565b80356001600160a01b03811681146106a757600080fd5b919050565b6000602082840312156106be57600080fd5b6103df82610690565b6000806000604084860312156106dc57600080fd5b6106e584610690565b9250602084013567ffffffffffffffff8082111561070257600080fd5b818601915086601f83011261071657600080fd5b81358181111561072557600080fd5b87602082850101111561073757600080fd5b6020830194508093505050509250925092565b60005b8381101561076557818101518382015260200161074d565b838111156101e75750506000910152565b6000825161078881846020870161074a565b9190910192915050565b60208152600082518060208401526107b181604085016020870161074a565b601f01601f1916919091016040019291505056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122001f23e5e5d70499e22926447138d9a73085390bf4c2f13e017a1d16843ca77ac64736f6c63430008090033", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "events": { + "AdminChanged(address,address)": { + "details": "Emitted when the admin account has changed." + } + }, + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {UpgradeableProxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "stateVariables": { + "_ADMIN_SLOT": { + "details": "Storage slot with the admin of the contract. This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is validated in the constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/bridge/deployments/goerli/MultiSigWallet.json b/bridge/deployments/goerli/MultiSigWallet.json new file mode 100644 index 000000000..4e3ed1686 --- /dev/null +++ b/bridge/deployments/goerli/MultiSigWallet.json @@ -0,0 +1,844 @@ +{ + "address": "0x3Cf0EB5B86a2B0e58Fa6e088c91FEEFb71aEca2d", + "abi": [ + { + "inputs": [ + { + "internalType": "address[]", + "name": "_owners", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "_required", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "transactionId", + "type": "uint256" + } + ], + "name": "Confirmation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "transactionId", + "type": "uint256" + } + ], + "name": "Execution", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "transactionId", + "type": "uint256" + } + ], + "name": "ExecutionFailure", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnerAddition", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnerRemoval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "required", + "type": "uint256" + } + ], + "name": "RequirementChange", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "transactionId", + "type": "uint256" + } + ], + "name": "Revocation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "transactionId", + "type": "uint256" + } + ], + "name": "Submission", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_OWNER_COUNT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "addOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_required", + "type": "uint256" + } + ], + "name": "changeRequirement", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "transactionId", + "type": "uint256" + } + ], + "name": "confirmTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "confirmations", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "transactionId", + "type": "uint256" + } + ], + "name": "executeTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "transactionId", + "type": "uint256" + } + ], + "name": "getConfirmationCount", + "outputs": [ + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "transactionId", + "type": "uint256" + } + ], + "name": "getConfirmations", + "outputs": [ + { + "internalType": "address[]", + "name": "_confirmations", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getOwners", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "pending", + "type": "bool" + }, + { + "internalType": "bool", + "name": "executed", + "type": "bool" + } + ], + "name": "getTransactionCount", + "outputs": [ + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "from", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "to", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "pending", + "type": "bool" + }, + { + "internalType": "bool", + "name": "executed", + "type": "bool" + } + ], + "name": "getTransactionIds", + "outputs": [ + { + "internalType": "uint256[]", + "name": "_transactionIds", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "transactionId", + "type": "uint256" + } + ], + "name": "isConfirmed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isOwner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "owners", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "removeOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "replaceOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "required", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "transactionId", + "type": "uint256" + } + ], + "name": "revokeConfirmation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "submitTransaction", + "outputs": [ + { + "internalType": "uint256", + "name": "transactionId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "transactionCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "transactions", + "outputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "executed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x2d373a748f7cfc0abbc4f29f05ba9ea46952347307d9ff4028ffac84249179de", + "receipt": { + "to": null, + "from": "0xa554d96413FF72E93437C4072438302C38350EE3", + "contractAddress": "0x3Cf0EB5B86a2B0e58Fa6e088c91FEEFb71aEca2d", + "transactionIndex": 0, + "gasUsed": "1753939", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x1d7c280eb292faefc9fb7573fdac838f7b9ab5576a0fb2333b66e3f9f1666803", + "transactionHash": "0x2d373a748f7cfc0abbc4f29f05ba9ea46952347307d9ff4028ffac84249179de", + "logs": [], + "blockNumber": 7664841, + "cumulativeGasUsed": "1753939", + "status": 1, + "byzantium": true + }, + "args": [ + [ + "0xa554d96413FF72E93437C4072438302C38350EE3" + ], + 1 + ], + "numDeployments": 1, + "solcInputHash": "b0b92d5309f21b72c82ad032fd7538bd", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_owners\",\"type\":\"address[]\"},{\"internalType\":\"uint256\",\"name\":\"_required\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"transactionId\",\"type\":\"uint256\"}],\"name\":\"Confirmation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"transactionId\",\"type\":\"uint256\"}],\"name\":\"Execution\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"transactionId\",\"type\":\"uint256\"}],\"name\":\"ExecutionFailure\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnerAddition\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnerRemoval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"required\",\"type\":\"uint256\"}],\"name\":\"RequirementChange\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"transactionId\",\"type\":\"uint256\"}],\"name\":\"Revocation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"transactionId\",\"type\":\"uint256\"}],\"name\":\"Submission\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MAX_OWNER_COUNT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"addOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_required\",\"type\":\"uint256\"}],\"name\":\"changeRequirement\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"transactionId\",\"type\":\"uint256\"}],\"name\":\"confirmTransaction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"confirmations\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"transactionId\",\"type\":\"uint256\"}],\"name\":\"executeTransaction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"transactionId\",\"type\":\"uint256\"}],\"name\":\"getConfirmationCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"count\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"transactionId\",\"type\":\"uint256\"}],\"name\":\"getConfirmations\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"_confirmations\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOwners\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"pending\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"executed\",\"type\":\"bool\"}],\"name\":\"getTransactionCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"count\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"from\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"to\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"pending\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"executed\",\"type\":\"bool\"}],\"name\":\"getTransactionIds\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"_transactionIds\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"transactionId\",\"type\":\"uint256\"}],\"name\":\"isConfirmed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"isOwner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"owners\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"removeOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"replaceOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"required\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"transactionId\",\"type\":\"uint256\"}],\"name\":\"revokeConfirmation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"submitTransaction\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"transactionId\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"transactionCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"transactions\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"executed\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Stefan George - \",\"kind\":\"dev\",\"methods\":{\"addOwner(address)\":{\"details\":\"Allows to add a new owner. Transaction has to be sent by wallet.\",\"params\":{\"owner\":\"Address of new owner.\"}},\"changeRequirement(uint256)\":{\"details\":\"Allows to change the number of required confirmations. Transaction has to be sent by wallet.\",\"params\":{\"_required\":\"Number of required confirmations.\"}},\"confirmTransaction(uint256)\":{\"details\":\"Allows an owner to confirm a transaction.\",\"params\":{\"transactionId\":\"Transaction ID.\"}},\"constructor\":{\"details\":\"Contract constructor sets initial owners and required number of confirmations.\",\"params\":{\"_owners\":\"List of initial owners.\",\"_required\":\"Number of required confirmations.\"}},\"executeTransaction(uint256)\":{\"details\":\"Allows anyone to execute a confirmed transaction.\",\"params\":{\"transactionId\":\"Transaction ID.\"}},\"getConfirmationCount(uint256)\":{\"details\":\"Returns number of confirmations of a transaction.\",\"params\":{\"transactionId\":\"Transaction ID.\"},\"returns\":{\"count\":\"Number of confirmations.\"}},\"getConfirmations(uint256)\":{\"details\":\"Returns array with owner addresses, which confirmed transaction.\",\"params\":{\"transactionId\":\"Transaction ID.\"},\"returns\":{\"_confirmations\":\"Returns array of owner addresses.\"}},\"getOwners()\":{\"details\":\"Returns list of owners.\",\"returns\":{\"_0\":\"List of owner addresses.\"}},\"getTransactionCount(bool,bool)\":{\"details\":\"Returns total number of transactions after filers are applied.\",\"params\":{\"executed\":\"Include executed transactions.\",\"pending\":\"Include pending transactions.\"},\"returns\":{\"count\":\"Total number of transactions after filters are applied.\"}},\"getTransactionIds(uint256,uint256,bool,bool)\":{\"details\":\"Returns list of transaction IDs in defined range.\",\"params\":{\"executed\":\"Include executed transactions.\",\"from\":\"Index start position of transaction array.\",\"pending\":\"Include pending transactions.\",\"to\":\"Index end position of transaction array.\"},\"returns\":{\"_transactionIds\":\"Returns array of transaction IDs.\"}},\"isConfirmed(uint256)\":{\"details\":\"Returns the confirmation status of a transaction.\",\"params\":{\"transactionId\":\"Transaction ID.\"},\"returns\":{\"_0\":\"Confirmation status.\"}},\"removeOwner(address)\":{\"details\":\"Allows to remove an owner. Transaction has to be sent by wallet.\",\"params\":{\"owner\":\"Address of owner.\"}},\"replaceOwner(address,address)\":{\"details\":\"Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\",\"params\":{\"newOwner\":\"Address of new owner.\",\"owner\":\"Address of owner to be replaced.\"}},\"revokeConfirmation(uint256)\":{\"details\":\"Allows an owner to revoke a confirmation for a transaction.\",\"params\":{\"transactionId\":\"Transaction ID.\"}},\"submitTransaction(address,uint256,bytes)\":{\"details\":\"Allows an owner to submit and confirm a transaction.\",\"params\":{\"data\":\"Transaction data payload.\",\"destination\":\"Transaction target address.\",\"value\":\"Transaction ether value.\"},\"returns\":{\"transactionId\":\"Returns transaction ID.\"}}},\"title\":\"Multisignature wallet - Allows multiple parties to agree on transactions before execution.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/MultiSigWallet.sol\":\"MultiSigWallet\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/MultiSigWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\\n/// @author Stefan George - \\ncontract MultiSigWallet {\\n\\n /*\\n * Events\\n */\\n event Confirmation(address indexed sender, uint indexed transactionId);\\n event Revocation(address indexed sender, uint indexed transactionId);\\n event Submission(uint indexed transactionId);\\n event Execution(uint indexed transactionId);\\n event ExecutionFailure(uint indexed transactionId);\\n event Deposit(address indexed sender, uint value);\\n event OwnerAddition(address indexed owner);\\n event OwnerRemoval(address indexed owner);\\n event RequirementChange(uint required);\\n\\n /*\\n * views\\n */\\n uint constant public MAX_OWNER_COUNT = 50;\\n\\n /*\\n * Storage\\n */\\n mapping (uint => Transaction) public transactions;\\n mapping (uint => mapping (address => bool)) public confirmations;\\n mapping (address => bool) public isOwner;\\n address[] public owners;\\n uint public required;\\n uint public transactionCount;\\n\\n struct Transaction {\\n address destination;\\n uint value;\\n bytes data;\\n bool executed;\\n }\\n\\n /*\\n * Modifiers\\n */\\n modifier onlyWallet() {\\n require(msg.sender == address(this), \\\"Only wallet allowed\\\");\\n _;\\n }\\n\\n modifier ownerDoesNotExist(address owner) {\\n require(!isOwner[owner], \\\"The owner already exists\\\");\\n _;\\n }\\n\\n modifier ownerExists(address owner) {\\n require(isOwner[owner], \\\"The owner does not exist\\\");\\n _;\\n }\\n\\n modifier transactionExists(uint transactionId) {\\n require(transactions[transactionId].destination != address(0), \\\"Transaction does not exist\\\");\\n _;\\n }\\n\\n modifier confirmed(uint transactionId, address owner) {\\n require(confirmations[transactionId][owner], \\\"Transaction is not confirmed by owner\\\");\\n _;\\n }\\n\\n modifier notConfirmed(uint transactionId, address owner) {\\n require(!confirmations[transactionId][owner], \\\"Transaction is already confirmed by owner\\\");\\n _;\\n }\\n\\n modifier notExecuted(uint transactionId) {\\n require(!transactions[transactionId].executed, \\\"Transaction was already executed\\\");\\n _;\\n }\\n\\n modifier notNull(address _address) {\\n require(_address != address(0), \\\"Address cannot be empty\\\");\\n _;\\n }\\n\\n modifier validRequirement(uint ownerCount, uint _required) {\\n // solium-disable-next-line max-len\\n require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0, \\\"Required value is invalid for the current owners count\\\");\\n _;\\n }\\n\\n /// @dev Fallback function allows to deposit ether.\\n receive ()\\n external\\n payable\\n {\\n if (msg.value > 0)\\n emit Deposit(msg.sender, msg.value);\\n }\\n\\n /*\\n * Public functions\\n */\\n /// @dev Contract constructor sets initial owners and required number of confirmations.\\n /// @param _owners List of initial owners.\\n /// @param _required Number of required confirmations.\\n constructor(address[] memory _owners, uint _required)\\n validRequirement(_owners.length, _required)\\n {\\n for (uint i = 0; i < _owners.length; i++) {\\n require(!isOwner[_owners[i]] && _owners[i] != address(0), \\\"Owners addresses are invalid\\\");\\n isOwner[_owners[i]] = true;\\n }\\n owners = _owners;\\n required = _required;\\n }\\n\\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\\n /// @param owner Address of new owner.\\n function addOwner(address owner)\\n public\\n onlyWallet\\n ownerDoesNotExist(owner)\\n notNull(owner)\\n validRequirement(owners.length + 1, required)\\n {\\n isOwner[owner] = true;\\n owners.push(owner);\\n emit OwnerAddition(owner);\\n }\\n\\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\\n /// @param owner Address of owner.\\n function removeOwner(address owner)\\n public\\n onlyWallet\\n ownerExists(owner)\\n {\\n isOwner[owner] = false;\\n for (uint i = 0; i < owners.length - 1; i++)\\n if (owners[i] == owner) {\\n owners[i] = owners[owners.length - 1];\\n break;\\n }\\n owners.pop(); // remove an element from the end of the array.\\n if (required > owners.length)\\n changeRequirement(owners.length);\\n emit OwnerRemoval(owner);\\n }\\n\\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\\n /// @param owner Address of owner to be replaced.\\n /// @param newOwner Address of new owner.\\n function replaceOwner(address owner, address newOwner)\\n public\\n onlyWallet\\n ownerExists(owner)\\n ownerDoesNotExist(newOwner)\\n {\\n for (uint i = 0; i < owners.length; i++)\\n if (owners[i] == owner) {\\n owners[i] = newOwner;\\n break;\\n }\\n isOwner[owner] = false;\\n isOwner[newOwner] = true;\\n emit OwnerRemoval(owner);\\n emit OwnerAddition(newOwner);\\n }\\n\\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\\n /// @param _required Number of required confirmations.\\n function changeRequirement(uint _required)\\n public\\n onlyWallet\\n validRequirement(owners.length, _required)\\n {\\n required = _required;\\n emit RequirementChange(_required);\\n }\\n\\n /// @dev Allows an owner to submit and confirm a transaction.\\n /// @param destination Transaction target address.\\n /// @param value Transaction ether value.\\n /// @param data Transaction data payload.\\n /// @return transactionId Returns transaction ID.\\n function submitTransaction(address destination, uint value, bytes memory data)\\n public\\n returns (uint transactionId)\\n {\\n transactionId = addTransaction(destination, value, data);\\n confirmTransaction(transactionId);\\n }\\n\\n /// @dev Allows an owner to confirm a transaction.\\n /// @param transactionId Transaction ID.\\n function confirmTransaction(uint transactionId)\\n public\\n ownerExists(msg.sender)\\n transactionExists(transactionId)\\n notConfirmed(transactionId, msg.sender)\\n {\\n confirmations[transactionId][msg.sender] = true;\\n emit Confirmation(msg.sender, transactionId);\\n executeTransaction(transactionId);\\n }\\n\\n /// @dev Allows an owner to revoke a confirmation for a transaction.\\n /// @param transactionId Transaction ID.\\n function revokeConfirmation(uint transactionId)\\n public\\n ownerExists(msg.sender)\\n confirmed(transactionId, msg.sender)\\n notExecuted(transactionId)\\n {\\n confirmations[transactionId][msg.sender] = false;\\n emit Revocation(msg.sender, transactionId);\\n }\\n\\n /// @dev Allows anyone to execute a confirmed transaction.\\n /// @param transactionId Transaction ID.\\n function executeTransaction(uint transactionId)\\n public\\n ownerExists(msg.sender)\\n confirmed(transactionId, msg.sender)\\n notExecuted(transactionId)\\n {\\n if (isConfirmed(transactionId)) {\\n Transaction storage txn = transactions[transactionId];\\n txn.executed = true;\\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\\n emit Execution(transactionId);\\n else {\\n emit ExecutionFailure(transactionId);\\n txn.executed = false;\\n }\\n }\\n }\\n\\n // call has been separated into its own function in order to take advantage\\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\\n function external_call(address destination, uint value, uint dataLength, bytes memory data) internal returns (bool) {\\n bool result;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n let x := mload(0x40) // \\\"Allocate\\\" memory for output (0x40 is where \\\"free memory\\\" pointer is stored by convention)\\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\\n result := call(\\n sub(gas(), 34710), // 34710 is the value that solidity is currently emitting\\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\\n destination,\\n value,\\n d,\\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\\n x,\\n 0 // Output is ignored, therefore the output size is zero\\n )\\n }\\n return result;\\n }\\n\\n /// @dev Returns the confirmation status of a transaction.\\n /// @param transactionId Transaction ID.\\n /// @return Confirmation status.\\n function isConfirmed(uint transactionId)\\n public\\n view\\n returns (bool)\\n {\\n uint count = 0;\\n for (uint i = 0; i < owners.length; i++) {\\n if (confirmations[transactionId][owners[i]])\\n count += 1;\\n if (count == required)\\n return true;\\n }\\n return false;\\n }\\n\\n /*\\n * Internal functions\\n */\\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\\n /// @param destination Transaction target address.\\n /// @param value Transaction ether value.\\n /// @param data Transaction data payload.\\n /// @return transactionId Returns transaction ID.\\n function addTransaction(address destination, uint value, bytes memory data)\\n internal\\n notNull(destination)\\n returns (uint transactionId)\\n {\\n transactionId = transactionCount;\\n transactions[transactionId] = Transaction({\\n destination: destination,\\n value: value,\\n data: data,\\n executed: false\\n });\\n transactionCount += 1;\\n emit Submission(transactionId);\\n }\\n\\n /*\\n * Web3 call functions\\n */\\n /// @dev Returns number of confirmations of a transaction.\\n /// @param transactionId Transaction ID.\\n /// @return count Number of confirmations.\\n function getConfirmationCount(uint transactionId)\\n public\\n view\\n returns (uint count)\\n {\\n for (uint i = 0; i < owners.length; i++) {\\n if (confirmations[transactionId][owners[i]]) {\\n count += 1;\\n }\\n }\\n }\\n\\n /// @dev Returns total number of transactions after filers are applied.\\n /// @param pending Include pending transactions.\\n /// @param executed Include executed transactions.\\n /// @return count Total number of transactions after filters are applied.\\n function getTransactionCount(bool pending, bool executed)\\n public\\n view\\n returns (uint count)\\n {\\n for (uint i = 0; i < transactionCount; i++) {\\n if ( pending && !transactions[i].executed || executed && transactions[i].executed) {\\n count += 1;\\n }\\n }\\n }\\n\\n /// @dev Returns list of owners.\\n /// @return List of owner addresses.\\n function getOwners()\\n public\\n view\\n returns (address[] memory)\\n {\\n return owners;\\n }\\n\\n /// @dev Returns array with owner addresses, which confirmed transaction.\\n /// @param transactionId Transaction ID.\\n /// @return _confirmations Returns array of owner addresses.\\n function getConfirmations(uint transactionId)\\n public\\n view\\n returns (address[] memory _confirmations)\\n {\\n address[] memory confirmationsTemp = new address[](owners.length);\\n uint count = 0;\\n uint i;\\n for (i = 0; i < owners.length; i++)\\n if (confirmations[transactionId][owners[i]]) {\\n confirmationsTemp[count] = owners[i];\\n count += 1;\\n }\\n _confirmations = new address[](count);\\n for (i = 0; i < count; i++)\\n _confirmations[i] = confirmationsTemp[i];\\n }\\n\\n /// @dev Returns list of transaction IDs in defined range.\\n /// @param from Index start position of transaction array.\\n /// @param to Index end position of transaction array.\\n /// @param pending Include pending transactions.\\n /// @param executed Include executed transactions.\\n /// @return _transactionIds Returns array of transaction IDs.\\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\\n public\\n view\\n returns (uint[] memory _transactionIds)\\n {\\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\\n uint count = 0;\\n uint i;\\n for (i = 0; i < transactionCount; i++)\\n if ( pending && !transactions[i].executed || executed && transactions[i].executed)\\n {\\n transactionIdsTemp[count] = i;\\n count += 1;\\n }\\n _transactionIds = new uint[](to - from);\\n for (i = from; i < to; i++)\\n _transactionIds[i - from] = transactionIdsTemp[i];\\n }\\n}\",\"keccak256\":\"0xc6e314b2e8c409a74c57fa484ae2f4ffc2d75df97cf4cd83f3d3eb50cbd348c3\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b50604051620020ec380380620020ec8339810160408190526200003491620002ea565b81518160328211158015620000495750818111155b80156200005557508015155b80156200006157508115155b620000d95760405162461bcd60e51b815260206004820152603660248201527f52657175697265642076616c756520697320696e76616c696420666f7220746860448201527f652063757272656e74206f776e65727320636f756e740000000000000000000060648201526084015b60405180910390fd5b60005b8451811015620002135760026000868381518110620000ff57620000ff620003c4565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff1615801562000163575060006001600160a01b03168582815181106200014f576200014f620003c4565b60200260200101516001600160a01b031614155b620001b15760405162461bcd60e51b815260206004820152601c60248201527f4f776e657273206164647265737365732061726520696e76616c6964000000006044820152606401620000d0565b600160026000878481518110620001cc57620001cc620003c4565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806200020a81620003da565b915050620000dc565b5083516200022990600390602087019062000236565b5050506004555062000404565b8280548282559060005260206000209081019282156200028e579160200282015b828111156200028e57825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000257565b506200029c929150620002a0565b5090565b5b808211156200029c5760008155600101620002a1565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b0381168114620002e557600080fd5b919050565b60008060408385031215620002fe57600080fd5b82516001600160401b03808211156200031657600080fd5b818501915085601f8301126200032b57600080fd5b8151602082821115620003425762000342620002b7565b8160051b604051601f19603f830116810181811086821117156200036a576200036a620002b7565b6040529283528183019350848101820192898411156200038957600080fd5b948201945b83861015620003b257620003a286620002cd565b855294820194938201936200038e565b97909101519698969750505050505050565b634e487b7160e01b600052603260045260246000fd5b6000600019821415620003fd57634e487b7160e01b600052601160045260246000fd5b5060010190565b611cd880620004146000396000f3fe60806040526004361061012e5760003560e01c8063a0e67e2b116100ab578063c01a8c841161006f578063c01a8c84146103d1578063c6427474146103f1578063d74f8edd14610411578063dc8452cd14610426578063e20056e61461043c578063ee22610b1461045c57600080fd5b8063a0e67e2b1461032c578063a8abe69a1461034e578063b5dc40c31461037b578063b77bf6001461039b578063ba51a6df146103b157600080fd5b806354741525116100f2578063547415251461026e5780637065cb481461029c578063784547a7146102bc5780638b51d13f146102dc5780639ace38c2146102fc57600080fd5b8063025e7c2714610176578063173825d9146101b357806320ea8d86146101d35780632f54bf6e146101f35780633411c81c1461023357600080fd5b3661017157341561016f5760405134815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a25b005b600080fd5b34801561018257600080fd5b506101966101913660046117da565b61047c565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101bf57600080fd5b5061016f6101ce36600461180f565b6104a6565b3480156101df57600080fd5b5061016f6101ee3660046117da565b61068c565b3480156101ff57600080fd5b5061022361020e36600461180f565b60026020526000908152604090205460ff1681565b60405190151581526020016101aa565b34801561023f57600080fd5b5061022361024e36600461182a565b600160209081526000928352604080842090915290825290205460ff1681565b34801561027a57600080fd5b5061028e610289366004611866565b6107ab565b6040519081526020016101aa565b3480156102a857600080fd5b5061016f6102b736600461180f565b610828565b3480156102c857600080fd5b506102236102d73660046117da565b6109e2565b3480156102e857600080fd5b5061028e6102f73660046117da565b610a81565b34801561030857600080fd5b5061031c6103173660046117da565b610b07565b6040516101aa9493929190611890565b34801561033857600080fd5b50610341610bc5565b6040516101aa919061190c565b34801561035a57600080fd5b5061036e610369366004611959565b610c27565b6040516101aa919061199f565b34801561038757600080fd5b506103416103963660046117da565b610dbf565b3480156103a757600080fd5b5061028e60055481565b3480156103bd57600080fd5b5061016f6103cc3660046117da565b610f97565b3480156103dd57600080fd5b5061016f6103ec3660046117da565b61103a565b3480156103fd57600080fd5b5061028e61040c3660046119ed565b6111ac565b34801561041d57600080fd5b5061028e603281565b34801561043257600080fd5b5061028e60045481565b34801561044857600080fd5b5061016f610457366004611ab8565b6111cb565b34801561046857600080fd5b5061016f6104773660046117da565b6113c2565b6003818154811061048c57600080fd5b6000918252602090912001546001600160a01b0316905081565b3330146104ce5760405162461bcd60e51b81526004016104c590611ae2565b60405180910390fd5b6001600160a01b038116600090815260026020526040902054819060ff166105085760405162461bcd60e51b81526004016104c590611b0f565b6001600160a01b0382166000908152600260205260408120805460ff191690555b60035461053890600190611b5c565b81101561060857826001600160a01b03166003828154811061055c5761055c611b73565b6000918252602090912001546001600160a01b031614156105f6576003805461058790600190611b5c565b8154811061059757610597611b73565b600091825260209091200154600380546001600160a01b0390921691839081106105c3576105c3611b73565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550610608565b8061060081611b89565b915050610529565b50600380548061061a5761061a611ba4565b600082815260209020810160001990810180546001600160a01b031916905501905560035460045411156106545760035461065490610f97565b6040516001600160a01b038316907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a25050565b3360008181526002602052604090205460ff166106bb5760405162461bcd60e51b81526004016104c590611b0f565b60008281526001602090815260408083203380855292529091205483919060ff166106f85760405162461bcd60e51b81526004016104c590611bba565b600084815260208190526040902060030154849060ff161561075c5760405162461bcd60e51b815260206004820181905260248201527f5472616e73616374696f6e2077617320616c726561647920657865637574656460448201526064016104c5565b6000858152600160209081526040808320338085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b6000805b600554811015610821578380156107d8575060008181526020819052604090206003015460ff16155b806107fc57508280156107fc575060008181526020819052604090206003015460ff165b1561080f5761080c600183611bff565b91505b8061081981611b89565b9150506107af565b5092915050565b3330146108475760405162461bcd60e51b81526004016104c590611ae2565b6001600160a01b038116600090815260026020526040902054819060ff16156108ad5760405162461bcd60e51b8152602060048201526018602482015277546865206f776e657220616c72656164792065786973747360401b60448201526064016104c5565b816001600160a01b0381166108fe5760405162461bcd60e51b8152602060048201526017602482015276416464726573732063616e6e6f7420626520656d70747960481b60448201526064016104c5565b60035461090c906001611bff565b600454603282111580156109205750818111155b801561092b57508015155b801561093657508115155b6109525760405162461bcd60e51b81526004016104c590611c17565b6001600160a01b038516600081815260026020526040808220805460ff1916600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b03191684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b600354811015610a775760008481526001602052604081206003805491929184908110610a1657610a16611b73565b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff1615610a5157610a4e600183611bff565b91505b600454821415610a65575060019392505050565b80610a6f81611b89565b9150506109e7565b5060009392505050565b6000805b600354811015610b015760008381526001602052604081206003805491929184908110610ab457610ab4611b73565b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff1615610aef57610aec600183611bff565b91505b80610af981611b89565b915050610a85565b50919050565b6000602081905290815260409020805460018201546002830180546001600160a01b03909316939192610b3990611c6d565b80601f0160208091040260200160405190810160405280929190818152602001828054610b6590611c6d565b8015610bb25780601f10610b8757610100808354040283529160200191610bb2565b820191906000526020600020905b815481529060010190602001808311610b9557829003601f168201915b5050506003909301549192505060ff1684565b60606003805480602002602001604051908101604052809291908181526020018280548015610c1d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610bff575b5050505050905090565b6060600060055467ffffffffffffffff811115610c4657610c466119d7565b604051908082528060200260200182016040528015610c6f578160200160208202803683370190505b5090506000805b600554811015610d0657858015610c9f575060008181526020819052604090206003015460ff16155b80610cc35750848015610cc3575060008181526020819052604090206003015460ff165b15610cf45780838381518110610cdb57610cdb611b73565b6020908102919091010152610cf1600183611bff565b91505b80610cfe81611b89565b915050610c76565b610d108888611b5c565b67ffffffffffffffff811115610d2857610d286119d7565b604051908082528060200260200182016040528015610d51578160200160208202803683370190505b5093508790505b86811015610db457828181518110610d7257610d72611b73565b6020026020010151848983610d879190611b5c565b81518110610d9757610d97611b73565b602090810291909101015280610dac81611b89565b915050610d58565b505050949350505050565b60035460609060009067ffffffffffffffff811115610de057610de06119d7565b604051908082528060200260200182016040528015610e09578160200160208202803683370190505b5090506000805b600354811015610ee75760008581526001602052604081206003805491929184908110610e3f57610e3f611b73565b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff1615610ed55760038181548110610e7f57610e7f611b73565b9060005260206000200160009054906101000a90046001600160a01b0316838381518110610eaf57610eaf611b73565b6001600160a01b0390921660209283029190910190910152610ed2600183611bff565b91505b80610edf81611b89565b915050610e10565b8167ffffffffffffffff811115610f0057610f006119d7565b604051908082528060200260200182016040528015610f29578160200160208202803683370190505b509350600090505b81811015610f8f57828181518110610f4b57610f4b611b73565b6020026020010151848281518110610f6557610f65611b73565b6001600160a01b039092166020928302919091019091015280610f8781611b89565b915050610f31565b505050919050565b333014610fb65760405162461bcd60e51b81526004016104c590611ae2565b6003548160328211801590610fcb5750818111155b8015610fd657508015155b8015610fe157508115155b610ffd5760405162461bcd60e51b81526004016104c590611c17565b60048390556040518381527fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9060200160405180910390a1505050565b3360008181526002602052604090205460ff166110695760405162461bcd60e51b81526004016104c590611b0f565b60008281526020819052604090205482906001600160a01b03166110cf5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20646f6573206e6f7420657869737400000000000060448201526064016104c5565b60008381526001602090815260408083203380855292529091205484919060ff161561114f5760405162461bcd60e51b815260206004820152602960248201527f5472616e73616374696f6e20697320616c726561647920636f6e6669726d656460448201526810313c9037bbb732b960b91b60648201526084016104c5565b6000858152600160208181526040808420338086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a36111a5856113c2565b5050505050565b60006111b98484846115ee565b90506111c48161103a565b9392505050565b3330146111ea5760405162461bcd60e51b81526004016104c590611ae2565b6001600160a01b038216600090815260026020526040902054829060ff166112245760405162461bcd60e51b81526004016104c590611b0f565b6001600160a01b038216600090815260026020526040902054829060ff161561128a5760405162461bcd60e51b8152602060048201526018602482015277546865206f776e657220616c72656164792065786973747360401b60448201526064016104c5565b60005b60035481101561132857846001600160a01b0316600382815481106112b4576112b4611b73565b6000918252602090912001546001600160a01b031614156113165783600382815481106112e3576112e3611b73565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550611328565b8061132081611b89565b91505061128d565b506001600160a01b03808516600081815260026020526040808220805460ff1990811690915593871682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a26040516001600160a01b038416907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a250505050565b3360008181526002602052604090205460ff166113f15760405162461bcd60e51b81526004016104c590611b0f565b60008281526001602090815260408083203380855292529091205483919060ff1661142e5760405162461bcd60e51b81526004016104c590611bba565b600084815260208190526040902060030154849060ff16156114925760405162461bcd60e51b815260206004820181905260248201527f5472616e73616374696f6e2077617320616c726561647920657865637574656460448201526064016104c5565b61149b856109e2565b156111a557600085815260208190526040902060038101805460ff19166001908117909155815490820154600283018054611579936001600160a01b03169291906114e590611c6d565b90508460020180546114f690611c6d565b80601f016020809104026020016040519081016040528092919081815260200182805461152290611c6d565b801561156f5780601f106115445761010080835404028352916020019161156f565b820191906000526020600020905b81548152906001019060200180831161155257829003601f168201915b505050505061171e565b156115ae5760405186907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a26115e6565b60405186907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a260038101805460ff191690555b505050505050565b6000836001600160a01b0381166116415760405162461bcd60e51b8152602060048201526017602482015276416464726573732063616e6e6f7420626520656d70747960481b60448201526064016104c5565b600554604080516080810182526001600160a01b038881168252602080830189815283850189815260006060860181905287815280845295909520845181546001600160a01b031916941693909317835551600183015592518051949650919390926116b4926002850192910190611741565b50606091909101516003909101805460ff191691151591909117905560058054600191906000906116e6908490611bff565b909155505060405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b6000806040516020840160008287838a8c6187965a03f198975050505050505050565b82805461174d90611c6d565b90600052602060002090601f01602090048101928261176f57600085556117b5565b82601f1061178857805160ff19168380011785556117b5565b828001600101855582156117b5579182015b828111156117b557825182559160200191906001019061179a565b506117c19291506117c5565b5090565b5b808211156117c157600081556001016117c6565b6000602082840312156117ec57600080fd5b5035919050565b80356001600160a01b038116811461180a57600080fd5b919050565b60006020828403121561182157600080fd5b6111c4826117f3565b6000806040838503121561183d57600080fd5b8235915061184d602084016117f3565b90509250929050565b8035801515811461180a57600080fd5b6000806040838503121561187957600080fd5b61188283611856565b915061184d60208401611856565b60018060a01b038516815260006020858184015260806040840152845180608085015260005b818110156118d25786810183015185820160a0015282016118b6565b818111156118e457600060a083870101525b50601f01601f1916830160a00191506119039050606083018415159052565b95945050505050565b6020808252825182820181905260009190848201906040850190845b8181101561194d5783516001600160a01b031683529284019291840191600101611928565b50909695505050505050565b6000806000806080858703121561196f57600080fd5b843593506020850135925061198660408601611856565b915061199460608601611856565b905092959194509250565b6020808252825182820181905260009190848201906040850190845b8181101561194d578351835292840192918401916001016119bb565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215611a0257600080fd5b611a0b846117f3565b925060208401359150604084013567ffffffffffffffff80821115611a2f57600080fd5b818601915086601f830112611a4357600080fd5b813581811115611a5557611a556119d7565b604051601f8201601f19908116603f01168101908382118183101715611a7d57611a7d6119d7565b81604052828152896020848701011115611a9657600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60008060408385031215611acb57600080fd5b611ad4836117f3565b915061184d602084016117f3565b60208082526013908201527213db9b1e481dd85b1b195d08185b1b1bddd959606a1b604082015260600190565b60208082526018908201527f546865206f776e657220646f6573206e6f742065786973740000000000000000604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015611b6e57611b6e611b46565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611b9d57611b9d611b46565b5060010190565b634e487b7160e01b600052603160045260246000fd5b60208082526025908201527f5472616e73616374696f6e206973206e6f7420636f6e6669726d65642062792060408201526437bbb732b960d91b606082015260800190565b60008219821115611c1257611c12611b46565b500190565b60208082526036908201527f52657175697265642076616c756520697320696e76616c696420666f72207468604082015275194818dd5c9c995b9d081bdddb995c9cc818dbdd5b9d60521b606082015260800190565b600181811c90821680611c8157607f821691505b60208210811415610b0157634e487b7160e01b600052602260045260246000fdfea2646970667358221220921cad4137d40902f6f9f0aa02156d6a38cad7dd31edfec06d50325b288c677e64736f6c63430008090033", + "deployedBytecode": "0x60806040526004361061012e5760003560e01c8063a0e67e2b116100ab578063c01a8c841161006f578063c01a8c84146103d1578063c6427474146103f1578063d74f8edd14610411578063dc8452cd14610426578063e20056e61461043c578063ee22610b1461045c57600080fd5b8063a0e67e2b1461032c578063a8abe69a1461034e578063b5dc40c31461037b578063b77bf6001461039b578063ba51a6df146103b157600080fd5b806354741525116100f2578063547415251461026e5780637065cb481461029c578063784547a7146102bc5780638b51d13f146102dc5780639ace38c2146102fc57600080fd5b8063025e7c2714610176578063173825d9146101b357806320ea8d86146101d35780632f54bf6e146101f35780633411c81c1461023357600080fd5b3661017157341561016f5760405134815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a25b005b600080fd5b34801561018257600080fd5b506101966101913660046117da565b61047c565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101bf57600080fd5b5061016f6101ce36600461180f565b6104a6565b3480156101df57600080fd5b5061016f6101ee3660046117da565b61068c565b3480156101ff57600080fd5b5061022361020e36600461180f565b60026020526000908152604090205460ff1681565b60405190151581526020016101aa565b34801561023f57600080fd5b5061022361024e36600461182a565b600160209081526000928352604080842090915290825290205460ff1681565b34801561027a57600080fd5b5061028e610289366004611866565b6107ab565b6040519081526020016101aa565b3480156102a857600080fd5b5061016f6102b736600461180f565b610828565b3480156102c857600080fd5b506102236102d73660046117da565b6109e2565b3480156102e857600080fd5b5061028e6102f73660046117da565b610a81565b34801561030857600080fd5b5061031c6103173660046117da565b610b07565b6040516101aa9493929190611890565b34801561033857600080fd5b50610341610bc5565b6040516101aa919061190c565b34801561035a57600080fd5b5061036e610369366004611959565b610c27565b6040516101aa919061199f565b34801561038757600080fd5b506103416103963660046117da565b610dbf565b3480156103a757600080fd5b5061028e60055481565b3480156103bd57600080fd5b5061016f6103cc3660046117da565b610f97565b3480156103dd57600080fd5b5061016f6103ec3660046117da565b61103a565b3480156103fd57600080fd5b5061028e61040c3660046119ed565b6111ac565b34801561041d57600080fd5b5061028e603281565b34801561043257600080fd5b5061028e60045481565b34801561044857600080fd5b5061016f610457366004611ab8565b6111cb565b34801561046857600080fd5b5061016f6104773660046117da565b6113c2565b6003818154811061048c57600080fd5b6000918252602090912001546001600160a01b0316905081565b3330146104ce5760405162461bcd60e51b81526004016104c590611ae2565b60405180910390fd5b6001600160a01b038116600090815260026020526040902054819060ff166105085760405162461bcd60e51b81526004016104c590611b0f565b6001600160a01b0382166000908152600260205260408120805460ff191690555b60035461053890600190611b5c565b81101561060857826001600160a01b03166003828154811061055c5761055c611b73565b6000918252602090912001546001600160a01b031614156105f6576003805461058790600190611b5c565b8154811061059757610597611b73565b600091825260209091200154600380546001600160a01b0390921691839081106105c3576105c3611b73565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550610608565b8061060081611b89565b915050610529565b50600380548061061a5761061a611ba4565b600082815260209020810160001990810180546001600160a01b031916905501905560035460045411156106545760035461065490610f97565b6040516001600160a01b038316907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a25050565b3360008181526002602052604090205460ff166106bb5760405162461bcd60e51b81526004016104c590611b0f565b60008281526001602090815260408083203380855292529091205483919060ff166106f85760405162461bcd60e51b81526004016104c590611bba565b600084815260208190526040902060030154849060ff161561075c5760405162461bcd60e51b815260206004820181905260248201527f5472616e73616374696f6e2077617320616c726561647920657865637574656460448201526064016104c5565b6000858152600160209081526040808320338085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b6000805b600554811015610821578380156107d8575060008181526020819052604090206003015460ff16155b806107fc57508280156107fc575060008181526020819052604090206003015460ff165b1561080f5761080c600183611bff565b91505b8061081981611b89565b9150506107af565b5092915050565b3330146108475760405162461bcd60e51b81526004016104c590611ae2565b6001600160a01b038116600090815260026020526040902054819060ff16156108ad5760405162461bcd60e51b8152602060048201526018602482015277546865206f776e657220616c72656164792065786973747360401b60448201526064016104c5565b816001600160a01b0381166108fe5760405162461bcd60e51b8152602060048201526017602482015276416464726573732063616e6e6f7420626520656d70747960481b60448201526064016104c5565b60035461090c906001611bff565b600454603282111580156109205750818111155b801561092b57508015155b801561093657508115155b6109525760405162461bcd60e51b81526004016104c590611c17565b6001600160a01b038516600081815260026020526040808220805460ff1916600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b03191684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b600354811015610a775760008481526001602052604081206003805491929184908110610a1657610a16611b73565b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff1615610a5157610a4e600183611bff565b91505b600454821415610a65575060019392505050565b80610a6f81611b89565b9150506109e7565b5060009392505050565b6000805b600354811015610b015760008381526001602052604081206003805491929184908110610ab457610ab4611b73565b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff1615610aef57610aec600183611bff565b91505b80610af981611b89565b915050610a85565b50919050565b6000602081905290815260409020805460018201546002830180546001600160a01b03909316939192610b3990611c6d565b80601f0160208091040260200160405190810160405280929190818152602001828054610b6590611c6d565b8015610bb25780601f10610b8757610100808354040283529160200191610bb2565b820191906000526020600020905b815481529060010190602001808311610b9557829003601f168201915b5050506003909301549192505060ff1684565b60606003805480602002602001604051908101604052809291908181526020018280548015610c1d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610bff575b5050505050905090565b6060600060055467ffffffffffffffff811115610c4657610c466119d7565b604051908082528060200260200182016040528015610c6f578160200160208202803683370190505b5090506000805b600554811015610d0657858015610c9f575060008181526020819052604090206003015460ff16155b80610cc35750848015610cc3575060008181526020819052604090206003015460ff165b15610cf45780838381518110610cdb57610cdb611b73565b6020908102919091010152610cf1600183611bff565b91505b80610cfe81611b89565b915050610c76565b610d108888611b5c565b67ffffffffffffffff811115610d2857610d286119d7565b604051908082528060200260200182016040528015610d51578160200160208202803683370190505b5093508790505b86811015610db457828181518110610d7257610d72611b73565b6020026020010151848983610d879190611b5c565b81518110610d9757610d97611b73565b602090810291909101015280610dac81611b89565b915050610d58565b505050949350505050565b60035460609060009067ffffffffffffffff811115610de057610de06119d7565b604051908082528060200260200182016040528015610e09578160200160208202803683370190505b5090506000805b600354811015610ee75760008581526001602052604081206003805491929184908110610e3f57610e3f611b73565b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff1615610ed55760038181548110610e7f57610e7f611b73565b9060005260206000200160009054906101000a90046001600160a01b0316838381518110610eaf57610eaf611b73565b6001600160a01b0390921660209283029190910190910152610ed2600183611bff565b91505b80610edf81611b89565b915050610e10565b8167ffffffffffffffff811115610f0057610f006119d7565b604051908082528060200260200182016040528015610f29578160200160208202803683370190505b509350600090505b81811015610f8f57828181518110610f4b57610f4b611b73565b6020026020010151848281518110610f6557610f65611b73565b6001600160a01b039092166020928302919091019091015280610f8781611b89565b915050610f31565b505050919050565b333014610fb65760405162461bcd60e51b81526004016104c590611ae2565b6003548160328211801590610fcb5750818111155b8015610fd657508015155b8015610fe157508115155b610ffd5760405162461bcd60e51b81526004016104c590611c17565b60048390556040518381527fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9060200160405180910390a1505050565b3360008181526002602052604090205460ff166110695760405162461bcd60e51b81526004016104c590611b0f565b60008281526020819052604090205482906001600160a01b03166110cf5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20646f6573206e6f7420657869737400000000000060448201526064016104c5565b60008381526001602090815260408083203380855292529091205484919060ff161561114f5760405162461bcd60e51b815260206004820152602960248201527f5472616e73616374696f6e20697320616c726561647920636f6e6669726d656460448201526810313c9037bbb732b960b91b60648201526084016104c5565b6000858152600160208181526040808420338086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a36111a5856113c2565b5050505050565b60006111b98484846115ee565b90506111c48161103a565b9392505050565b3330146111ea5760405162461bcd60e51b81526004016104c590611ae2565b6001600160a01b038216600090815260026020526040902054829060ff166112245760405162461bcd60e51b81526004016104c590611b0f565b6001600160a01b038216600090815260026020526040902054829060ff161561128a5760405162461bcd60e51b8152602060048201526018602482015277546865206f776e657220616c72656164792065786973747360401b60448201526064016104c5565b60005b60035481101561132857846001600160a01b0316600382815481106112b4576112b4611b73565b6000918252602090912001546001600160a01b031614156113165783600382815481106112e3576112e3611b73565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550611328565b8061132081611b89565b91505061128d565b506001600160a01b03808516600081815260026020526040808220805460ff1990811690915593871682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a26040516001600160a01b038416907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a250505050565b3360008181526002602052604090205460ff166113f15760405162461bcd60e51b81526004016104c590611b0f565b60008281526001602090815260408083203380855292529091205483919060ff1661142e5760405162461bcd60e51b81526004016104c590611bba565b600084815260208190526040902060030154849060ff16156114925760405162461bcd60e51b815260206004820181905260248201527f5472616e73616374696f6e2077617320616c726561647920657865637574656460448201526064016104c5565b61149b856109e2565b156111a557600085815260208190526040902060038101805460ff19166001908117909155815490820154600283018054611579936001600160a01b03169291906114e590611c6d565b90508460020180546114f690611c6d565b80601f016020809104026020016040519081016040528092919081815260200182805461152290611c6d565b801561156f5780601f106115445761010080835404028352916020019161156f565b820191906000526020600020905b81548152906001019060200180831161155257829003601f168201915b505050505061171e565b156115ae5760405186907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a26115e6565b60405186907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a260038101805460ff191690555b505050505050565b6000836001600160a01b0381166116415760405162461bcd60e51b8152602060048201526017602482015276416464726573732063616e6e6f7420626520656d70747960481b60448201526064016104c5565b600554604080516080810182526001600160a01b038881168252602080830189815283850189815260006060860181905287815280845295909520845181546001600160a01b031916941693909317835551600183015592518051949650919390926116b4926002850192910190611741565b50606091909101516003909101805460ff191691151591909117905560058054600191906000906116e6908490611bff565b909155505060405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b6000806040516020840160008287838a8c6187965a03f198975050505050505050565b82805461174d90611c6d565b90600052602060002090601f01602090048101928261176f57600085556117b5565b82601f1061178857805160ff19168380011785556117b5565b828001600101855582156117b5579182015b828111156117b557825182559160200191906001019061179a565b506117c19291506117c5565b5090565b5b808211156117c157600081556001016117c6565b6000602082840312156117ec57600080fd5b5035919050565b80356001600160a01b038116811461180a57600080fd5b919050565b60006020828403121561182157600080fd5b6111c4826117f3565b6000806040838503121561183d57600080fd5b8235915061184d602084016117f3565b90509250929050565b8035801515811461180a57600080fd5b6000806040838503121561187957600080fd5b61188283611856565b915061184d60208401611856565b60018060a01b038516815260006020858184015260806040840152845180608085015260005b818110156118d25786810183015185820160a0015282016118b6565b818111156118e457600060a083870101525b50601f01601f1916830160a00191506119039050606083018415159052565b95945050505050565b6020808252825182820181905260009190848201906040850190845b8181101561194d5783516001600160a01b031683529284019291840191600101611928565b50909695505050505050565b6000806000806080858703121561196f57600080fd5b843593506020850135925061198660408601611856565b915061199460608601611856565b905092959194509250565b6020808252825182820181905260009190848201906040850190845b8181101561194d578351835292840192918401916001016119bb565b634e487b7160e01b600052604160045260246000fd5b600080600060608486031215611a0257600080fd5b611a0b846117f3565b925060208401359150604084013567ffffffffffffffff80821115611a2f57600080fd5b818601915086601f830112611a4357600080fd5b813581811115611a5557611a556119d7565b604051601f8201601f19908116603f01168101908382118183101715611a7d57611a7d6119d7565b81604052828152896020848701011115611a9657600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60008060408385031215611acb57600080fd5b611ad4836117f3565b915061184d602084016117f3565b60208082526013908201527213db9b1e481dd85b1b195d08185b1b1bddd959606a1b604082015260600190565b60208082526018908201527f546865206f776e657220646f6573206e6f742065786973740000000000000000604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015611b6e57611b6e611b46565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611b9d57611b9d611b46565b5060010190565b634e487b7160e01b600052603160045260246000fd5b60208082526025908201527f5472616e73616374696f6e206973206e6f7420636f6e6669726d65642062792060408201526437bbb732b960d91b606082015260800190565b60008219821115611c1257611c12611b46565b500190565b60208082526036908201527f52657175697265642076616c756520697320696e76616c696420666f72207468604082015275194818dd5c9c995b9d081bdddb995c9cc818dbdd5b9d60521b606082015260800190565b600181811c90821680611c8157607f821691505b60208210811415610b0157634e487b7160e01b600052602260045260246000fdfea2646970667358221220921cad4137d40902f6f9f0aa02156d6a38cad7dd31edfec06d50325b288c677e64736f6c63430008090033", + "devdoc": { + "author": "Stefan George - ", + "kind": "dev", + "methods": { + "addOwner(address)": { + "details": "Allows to add a new owner. Transaction has to be sent by wallet.", + "params": { + "owner": "Address of new owner." + } + }, + "changeRequirement(uint256)": { + "details": "Allows to change the number of required confirmations. Transaction has to be sent by wallet.", + "params": { + "_required": "Number of required confirmations." + } + }, + "confirmTransaction(uint256)": { + "details": "Allows an owner to confirm a transaction.", + "params": { + "transactionId": "Transaction ID." + } + }, + "constructor": { + "details": "Contract constructor sets initial owners and required number of confirmations.", + "params": { + "_owners": "List of initial owners.", + "_required": "Number of required confirmations." + } + }, + "executeTransaction(uint256)": { + "details": "Allows anyone to execute a confirmed transaction.", + "params": { + "transactionId": "Transaction ID." + } + }, + "getConfirmationCount(uint256)": { + "details": "Returns number of confirmations of a transaction.", + "params": { + "transactionId": "Transaction ID." + }, + "returns": { + "count": "Number of confirmations." + } + }, + "getConfirmations(uint256)": { + "details": "Returns array with owner addresses, which confirmed transaction.", + "params": { + "transactionId": "Transaction ID." + }, + "returns": { + "_confirmations": "Returns array of owner addresses." + } + }, + "getOwners()": { + "details": "Returns list of owners.", + "returns": { + "_0": "List of owner addresses." + } + }, + "getTransactionCount(bool,bool)": { + "details": "Returns total number of transactions after filers are applied.", + "params": { + "executed": "Include executed transactions.", + "pending": "Include pending transactions." + }, + "returns": { + "count": "Total number of transactions after filters are applied." + } + }, + "getTransactionIds(uint256,uint256,bool,bool)": { + "details": "Returns list of transaction IDs in defined range.", + "params": { + "executed": "Include executed transactions.", + "from": "Index start position of transaction array.", + "pending": "Include pending transactions.", + "to": "Index end position of transaction array." + }, + "returns": { + "_transactionIds": "Returns array of transaction IDs." + } + }, + "isConfirmed(uint256)": { + "details": "Returns the confirmation status of a transaction.", + "params": { + "transactionId": "Transaction ID." + }, + "returns": { + "_0": "Confirmation status." + } + }, + "removeOwner(address)": { + "details": "Allows to remove an owner. Transaction has to be sent by wallet.", + "params": { + "owner": "Address of owner." + } + }, + "replaceOwner(address,address)": { + "details": "Allows to replace an owner with a new owner. Transaction has to be sent by wallet.", + "params": { + "newOwner": "Address of new owner.", + "owner": "Address of owner to be replaced." + } + }, + "revokeConfirmation(uint256)": { + "details": "Allows an owner to revoke a confirmation for a transaction.", + "params": { + "transactionId": "Transaction ID." + } + }, + "submitTransaction(address,uint256,bytes)": { + "details": "Allows an owner to submit and confirm a transaction.", + "params": { + "data": "Transaction data payload.", + "destination": "Transaction target address.", + "value": "Transaction ether value." + }, + "returns": { + "transactionId": "Returns transaction ID." + } + } + }, + "title": "Multisignature wallet - Allows multiple parties to agree on transactions before execution.", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 2938, + "contract": "contracts/MultiSigWallet.sol:MultiSigWallet", + "label": "transactions", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_uint256,t_struct(Transaction)2964_storage)" + }, + { + "astId": 2944, + "contract": "contracts/MultiSigWallet.sol:MultiSigWallet", + "label": "confirmations", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint256,t_mapping(t_address,t_bool))" + }, + { + "astId": 2948, + "contract": "contracts/MultiSigWallet.sol:MultiSigWallet", + "label": "isOwner", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 2951, + "contract": "contracts/MultiSigWallet.sol:MultiSigWallet", + "label": "owners", + "offset": 0, + "slot": "3", + "type": "t_array(t_address)dyn_storage" + }, + { + "astId": 2953, + "contract": "contracts/MultiSigWallet.sol:MultiSigWallet", + "label": "required", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 2955, + "contract": "contracts/MultiSigWallet.sol:MultiSigWallet", + "label": "transactionCount", + "offset": 0, + "slot": "5", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_address)dyn_storage": { + "base": "t_address", + "encoding": "dynamic_array", + "label": "address[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_uint256,t_mapping(t_address,t_bool))": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => mapping(address => bool))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_bool)" + }, + "t_mapping(t_uint256,t_struct(Transaction)2964_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct MultiSigWallet.Transaction)", + "numberOfBytes": "32", + "value": "t_struct(Transaction)2964_storage" + }, + "t_struct(Transaction)2964_storage": { + "encoding": "inplace", + "label": "struct MultiSigWallet.Transaction", + "members": [ + { + "astId": 2957, + "contract": "contracts/MultiSigWallet.sol:MultiSigWallet", + "label": "destination", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 2959, + "contract": "contracts/MultiSigWallet.sol:MultiSigWallet", + "label": "value", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 2961, + "contract": "contracts/MultiSigWallet.sol:MultiSigWallet", + "label": "data", + "offset": 0, + "slot": "2", + "type": "t_bytes_storage" + }, + { + "astId": 2963, + "contract": "contracts/MultiSigWallet.sol:MultiSigWallet", + "label": "executed", + "offset": 0, + "slot": "3", + "type": "t_bool" + } + ], + "numberOfBytes": "128" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/bridge/deployments/goerli/ProxyAdmin.json b/bridge/deployments/goerli/ProxyAdmin.json new file mode 100644 index 000000000..376e85ff0 --- /dev/null +++ b/bridge/deployments/goerli/ProxyAdmin.json @@ -0,0 +1,262 @@ +{ + "address": "0x39055c999A8528535Af012F4F4CF7B548dD97481", + "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": "isOwner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "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" + } + ], + "transactionHash": "0x3f8e06f4916cbf471209df6775cb68b1eccde45a4db96d9ccc191f44e00edec7", + "receipt": { + "to": null, + "from": "0xa554d96413FF72E93437C4072438302C38350EE3", + "contractAddress": "0x39055c999A8528535Af012F4F4CF7B548dD97481", + "transactionIndex": 0, + "gasUsed": "499842", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000040000000000000000000000080000000000000000000000000000000000000000000000000800001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002002000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000002000000000000000000000000000000000000000000000000", + "blockHash": "0x2b126ec043cd5192047290e84ca2657ad512143be1d4cca615b1969d6f201232", + "transactionHash": "0x3f8e06f4916cbf471209df6775cb68b1eccde45a4db96d9ccc191f44e00edec7", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 7664843, + "transactionHash": "0x3f8e06f4916cbf471209df6775cb68b1eccde45a4db96d9ccc191f44e00edec7", + "address": "0x39055c999A8528535Af012F4F4CF7B548dD97481", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000a554d96413ff72e93437c4072438302c38350ee3" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x2b126ec043cd5192047290e84ca2657ad512143be1d4cca615b1969d6f201232" + } + ], + "blockNumber": 7664843, + "cumulativeGasUsed": "499842", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "b0b92d5309f21b72c82ad032fd7538bd", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"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\":\"isOwner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\"}],\"devdoc\":{\"details\":\"This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.\",\"kind\":\"dev\",\"methods\":{\"changeProxyAdmin(address,address)\":{\"details\":\"Changes the admin of `proxy` to `newAdmin`. Requirements: - This contract must be the current admin of `proxy`.\"},\"getProxyAdmin(address)\":{\"details\":\"Returns the current admin of `proxy`. Requirements: - This contract must be the admin of `proxy`.\"},\"getProxyImplementation(address)\":{\"details\":\"Returns the current implementation of `proxy`. Requirements: - This contract must be the admin of `proxy`.\"},\"isOwner()\":{\"details\":\"Returns true if the caller is the current owner.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"upgrade(address,address)\":{\"details\":\"Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}. Requirements: - This contract must be the admin of `proxy`.\"},\"upgradeAndCall(address,address,bytes)\":{\"details\":\"Upgrades `proxy` to `implementation` and calls a function on the new implementation. See {TransparentUpgradeableProxy-upgradeToAndCall}. Requirements: - This contract must be the admin of `proxy`.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/zeppelin/upgradable/proxy/ProxyAdmin.sol\":\"ProxyAdmin\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/zeppelin/GSN/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n\\n function _msgSender() internal view returns (address payable) {\\n return payable(msg.sender);\\n }\\n\\n function _msgData() internal view returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x6f3f274a2270bfe073339370edfa2485e2d515a2656039937f6b972fae96d297\",\"license\":\"MIT\"},\"contracts/zeppelin/ownership/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"../GSN/Context.sol\\\";\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () {\\n _owner = _msgSender();\\n emit OwnershipTransferred(address(0), _owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(isOwner(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the caller is the current owner.\\n */\\n function isOwner() public view returns (bool) {\\n return _msgSender() == _owner;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public onlyOwner {\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n */\\n function _transferOwnership(address newOwner) internal {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xc28d491022a7b7df51c1fb08998589daa944635b758dcd14b5cfb95739446cce\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 { revert(0, returndatasize()) }\\n default { return(0, returndatasize()) }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback () external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive () external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {\\n }\\n}\\n\",\"keccak256\":\"0xdc0ebdc6f4ae0b5f9dd0a6c041a2238e4a7a2afbc6cef539437b0004ada42370\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/proxy/ProxyAdmin.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"../../ownership/Ownable.sol\\\";\\nimport \\\"./TransparentUpgradeableProxy.sol\\\";\\n\\n/**\\n * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an\\n * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.\\n */\\ncontract ProxyAdmin is Ownable {\\n\\n /**\\n * @dev Returns the current implementation of `proxy`.\\n *\\n * Requirements:\\n *\\n * - This contract must be the admin of `proxy`.\\n */\\n function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\\n // We need to manually run the static call since the getter cannot be flagged as view\\n // bytes4(keccak256(\\\"implementation()\\\")) == 0x5c60da1b\\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\\\"5c60da1b\\\");\\n require(success);\\n return abi.decode(returndata, (address));\\n }\\n\\n /**\\n * @dev Returns the current admin of `proxy`.\\n *\\n * Requirements:\\n *\\n * - This contract must be the admin of `proxy`.\\n */\\n function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\\n // We need to manually run the static call since the getter cannot be flagged as view\\n // bytes4(keccak256(\\\"admin()\\\")) == 0xf851a440\\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\\\"f851a440\\\");\\n require(success);\\n return abi.decode(returndata, (address));\\n }\\n\\n /**\\n * @dev Changes the admin of `proxy` to `newAdmin`.\\n *\\n * Requirements:\\n *\\n * - This contract must be the current admin of `proxy`.\\n */\\n function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {\\n proxy.changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.\\n *\\n * Requirements:\\n *\\n * - This contract must be the admin of `proxy`.\\n */\\n function upgrade(TransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {\\n proxy.upgradeTo(implementation);\\n }\\n\\n /**\\n * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. See\\n * {TransparentUpgradeableProxy-upgradeToAndCall}.\\n *\\n * Requirements:\\n *\\n * - This contract must be the admin of `proxy`.\\n */\\n function upgradeAndCall(TransparentUpgradeableProxy proxy, address implementation, bytes memory data) public payable virtual onlyOwner {\\n proxy.upgradeToAndCall{value: msg.value}(implementation, data);\\n }\\n}\\n\",\"keccak256\":\"0xa9722406bcf07157885f323c5d0db1ec2c6869548086e94e9f16180f58ed2ee6\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/proxy/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"./UpgradeableProxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is UpgradeableProxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {UpgradeableProxy-constructor}.\\n */\\n constructor(address _logic, address admin_, bytes memory _data) payable UpgradeableProxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _setAdmin(admin_);\\n }\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _admin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _admin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n require(newAdmin != address(0), \\\"TransparentUpgradeableProxy: new admin is the zero address\\\");\\n emit AdminChanged(_admin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external virtual ifAdmin {\\n _upgradeTo(newImplementation);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable virtual ifAdmin {\\n _upgradeTo(newImplementation);\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address adm) {\\n bytes32 slot = _ADMIN_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n adm := sload(slot)\\n }\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n bytes32 slot = _ADMIN_SLOT;\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, newAdmin)\\n }\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _admin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x3327b21f85d71d3b9bad1a89267f08b19966e03446a18d810bd80fe42789ac5f\",\"license\":\"MIT\"},\"contracts/zeppelin/upgradable/proxy/UpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"./Proxy.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n *\\n * Upgradeability is only provided internally through {_upgradeTo}. For an externally upgradeable proxy see\\n * {TransparentUpgradeableProxy}.\\n */\\ncontract UpgradeableProxy is Proxy {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _setImplementation(_logic);\\n if(_data.length > 0) {\\n Address.functionDelegateCall(_logic, _data);\\n }\\n }\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 private constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n bytes32 slot = _IMPLEMENTATION_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n impl := sload(slot)\\n }\\n }\\n\\n /**\\n * @dev Upgrades the proxy to a new implementation.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal virtual {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"UpgradeableProxy: new implementation is not a contract\\\");\\n\\n bytes32 slot = _IMPLEMENTATION_SLOT;\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, newImplementation)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb54322ec8ec142c149ad1f561aa2f0da6d6ea2d9f45639164088db9e16d5a69d\",\"license\":\"MIT\"},\"contracts/zeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x04801fc2398ee3370f3903f95389ea3a8da65a8df01f24b352e499e44d492e9b\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50600080546001600160a01b0319163390811782556040519091907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a36107a38061005f6000396000f3fe6080604052600436106100865760003560e01c80638f32d59b116100595780638f32d59b1461011d5780639623609d1461014857806399a88ec41461015b578063f2fde38b1461017b578063f3b7dead1461019b57600080fd5b8063204e1c7a1461008b578063715018a6146100c85780637eff275e146100df5780638da5cb5b146100ff575b600080fd5b34801561009757600080fd5b506100ab6100a636600461056d565b6101bb565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100d457600080fd5b506100dd61024c565b005b3480156100eb57600080fd5b506100dd6100fa366004610591565b6102c9565b34801561010b57600080fd5b506000546001600160a01b03166100ab565b34801561012957600080fd5b506000546001600160a01b0316331460405190151581526020016100bf565b6100dd6101563660046105e0565b610353565b34801561016757600080fd5b506100dd610176366004610591565b6103e4565b34801561018757600080fd5b506100dd61019636600461056d565b61043c565b3480156101a757600080fd5b506100ab6101b636600461056d565b610472565b6000806000836001600160a01b03166040516101e190635c60da1b60e01b815260040190565b600060405180830381855afa9150503d806000811461021c576040519150601f19603f3d011682016040523d82523d6000602084013e610221565b606091505b50915091508161023057600080fd5b8080602001905181019061024491906106b6565b949350505050565b6000546001600160a01b0316331461027f5760405162461bcd60e51b8152600401610276906106d3565b60405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146102f35760405162461bcd60e51b8152600401610276906106d3565b6040516308f2839760e41b81526001600160a01b038281166004830152831690638f283970906024015b600060405180830381600087803b15801561033757600080fd5b505af115801561034b573d6000803e3d6000fd5b505050505050565b6000546001600160a01b0316331461037d5760405162461bcd60e51b8152600401610276906106d3565b60405163278f794360e11b81526001600160a01b03841690634f1ef2869034906103ad9086908690600401610708565b6000604051808303818588803b1580156103c657600080fd5b505af11580156103da573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b0316331461040e5760405162461bcd60e51b8152600401610276906106d3565b604051631b2ce7f360e11b81526001600160a01b038281166004830152831690633659cfe69060240161031d565b6000546001600160a01b031633146104665760405162461bcd60e51b8152600401610276906106d3565b61046f81610498565b50565b6000806000836001600160a01b03166040516101e1906303e1469160e61b815260040190565b6001600160a01b0381166104fd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610276565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038116811461046f57600080fd5b60006020828403121561057f57600080fd5b813561058a81610558565b9392505050565b600080604083850312156105a457600080fd5b82356105af81610558565b915060208301356105bf81610558565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156105f557600080fd5b833561060081610558565b9250602084013561061081610558565b9150604084013567ffffffffffffffff8082111561062d57600080fd5b818601915086601f83011261064157600080fd5b813581811115610653576106536105ca565b604051601f8201601f19908116603f0116810190838211818310171561067b5761067b6105ca565b8160405282815289602084870101111561069457600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b6000602082840312156106c857600080fd5b815161058a81610558565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60018060a01b038316815260006020604081840152835180604085015260005b8181101561074457858101830151858201606001528201610728565b81811115610756576000606083870101525b50601f01601f19169290920160600194935050505056fea264697066735822122045e18dca6316824bc6fe9886dc5a9881d3200b5e741a07e9f5d029c728cdcbd664736f6c63430008090033", + "deployedBytecode": "0x6080604052600436106100865760003560e01c80638f32d59b116100595780638f32d59b1461011d5780639623609d1461014857806399a88ec41461015b578063f2fde38b1461017b578063f3b7dead1461019b57600080fd5b8063204e1c7a1461008b578063715018a6146100c85780637eff275e146100df5780638da5cb5b146100ff575b600080fd5b34801561009757600080fd5b506100ab6100a636600461056d565b6101bb565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100d457600080fd5b506100dd61024c565b005b3480156100eb57600080fd5b506100dd6100fa366004610591565b6102c9565b34801561010b57600080fd5b506000546001600160a01b03166100ab565b34801561012957600080fd5b506000546001600160a01b0316331460405190151581526020016100bf565b6100dd6101563660046105e0565b610353565b34801561016757600080fd5b506100dd610176366004610591565b6103e4565b34801561018757600080fd5b506100dd61019636600461056d565b61043c565b3480156101a757600080fd5b506100ab6101b636600461056d565b610472565b6000806000836001600160a01b03166040516101e190635c60da1b60e01b815260040190565b600060405180830381855afa9150503d806000811461021c576040519150601f19603f3d011682016040523d82523d6000602084013e610221565b606091505b50915091508161023057600080fd5b8080602001905181019061024491906106b6565b949350505050565b6000546001600160a01b0316331461027f5760405162461bcd60e51b8152600401610276906106d3565b60405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146102f35760405162461bcd60e51b8152600401610276906106d3565b6040516308f2839760e41b81526001600160a01b038281166004830152831690638f283970906024015b600060405180830381600087803b15801561033757600080fd5b505af115801561034b573d6000803e3d6000fd5b505050505050565b6000546001600160a01b0316331461037d5760405162461bcd60e51b8152600401610276906106d3565b60405163278f794360e11b81526001600160a01b03841690634f1ef2869034906103ad9086908690600401610708565b6000604051808303818588803b1580156103c657600080fd5b505af11580156103da573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b0316331461040e5760405162461bcd60e51b8152600401610276906106d3565b604051631b2ce7f360e11b81526001600160a01b038281166004830152831690633659cfe69060240161031d565b6000546001600160a01b031633146104665760405162461bcd60e51b8152600401610276906106d3565b61046f81610498565b50565b6000806000836001600160a01b03166040516101e1906303e1469160e61b815260040190565b6001600160a01b0381166104fd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610276565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038116811461046f57600080fd5b60006020828403121561057f57600080fd5b813561058a81610558565b9392505050565b600080604083850312156105a457600080fd5b82356105af81610558565b915060208301356105bf81610558565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156105f557600080fd5b833561060081610558565b9250602084013561061081610558565b9150604084013567ffffffffffffffff8082111561062d57600080fd5b818601915086601f83011261064157600080fd5b813581811115610653576106536105ca565b604051601f8201601f19908116603f0116810190838211818310171561067b5761067b6105ca565b8160405282815289602084870101111561069457600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b6000602082840312156106c857600080fd5b815161058a81610558565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60018060a01b038316815260006020604081840152835180604085015260005b8181101561074457858101830151858201606001528201610728565b81811115610756576000606083870101525b50601f01601f19169290920160600194935050505056fea264697066735822122045e18dca6316824bc6fe9886dc5a9881d3200b5e741a07e9f5d029c728cdcbd664736f6c63430008090033", + "devdoc": { + "details": "This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.", + "kind": "dev", + "methods": { + "changeProxyAdmin(address,address)": { + "details": "Changes the admin of `proxy` to `newAdmin`. Requirements: - This contract must be the current admin of `proxy`." + }, + "getProxyAdmin(address)": { + "details": "Returns the current admin of `proxy`. Requirements: - This contract must be the admin of `proxy`." + }, + "getProxyImplementation(address)": { + "details": "Returns the current implementation of `proxy`. Requirements: - This contract must be the admin of `proxy`." + }, + "isOwner()": { + "details": "Returns true if the caller is the current owner." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "upgrade(address,address)": { + "details": "Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}. Requirements: - This contract must be the admin of `proxy`." + }, + "upgradeAndCall(address,address,bytes)": { + "details": "Upgrades `proxy` to `implementation` and calls a function on the new implementation. See {TransparentUpgradeableProxy-upgradeToAndCall}. Requirements: - This contract must be the admin of `proxy`." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 5582, + "contract": "contracts/zeppelin/upgradable/proxy/ProxyAdmin.sol:ProxyAdmin", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + } + } + } +} \ No newline at end of file diff --git a/bridge/deployments/goerli/SideTokenFactory.json b/bridge/deployments/goerli/SideTokenFactory.json new file mode 100644 index 000000000..190eb7835 --- /dev/null +++ b/bridge/deployments/goerli/SideTokenFactory.json @@ -0,0 +1,174 @@ +{ + "address": "0x281B8cE947918058cf3341125Bba4dCCd07172FF", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "PrimaryTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sideToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "granularity", + "type": "uint256" + } + ], + "name": "SideTokenCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "granularity", + "type": "uint256" + } + ], + "name": "createSideToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "primary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "transferPrimary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x430326ef8d122d2741c54443a06fc0de7d2803d9e4e972164b890d758c257c68", + "receipt": { + "to": null, + "from": "0xa554d96413FF72E93437C4072438302C38350EE3", + "contractAddress": "0x281B8cE947918058cf3341125Bba4dCCd07172FF", + "transactionIndex": 0, + "gasUsed": "2527394", + "logsBloom": "0x00000000000000000000000000000000000800000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0xc23f71ca1bb2ae8d39ec48f0ad578265664e344205dbeb6f4c1a193c81076ff6", + "transactionHash": "0x430326ef8d122d2741c54443a06fc0de7d2803d9e4e972164b890d758c257c68", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 7664846, + "transactionHash": "0x430326ef8d122d2741c54443a06fc0de7d2803d9e4e972164b890d758c257c68", + "address": "0x281B8cE947918058cf3341125Bba4dCCd07172FF", + "topics": [ + "0x4101e71e974f68df5e9730cc223280b41654676bbb052cdcc735c3337e64d2d9" + ], + "data": "0x000000000000000000000000a554d96413ff72e93437c4072438302c38350ee3", + "logIndex": 0, + "blockHash": "0xc23f71ca1bb2ae8d39ec48f0ad578265664e344205dbeb6f4c1a193c81076ff6" + } + ], + "blockNumber": 7664846, + "cumulativeGasUsed": "2527394", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "b0b92d5309f21b72c82ad032fd7538bd", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"PrimaryTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sideToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"granularity\",\"type\":\"uint256\"}],\"name\":\"SideTokenCreated\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"granularity\",\"type\":\"uint256\"}],\"name\":\"createSideToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"primary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"transferPrimary\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"primary()\":{\"returns\":{\"_0\":\"the address of the primary.\"}},\"transferPrimary(address)\":{\"details\":\"Transfers contract to a new primary.\",\"params\":{\"recipient\":\"The address of new primary.\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/SideTokenFactory/SideTokenFactory.sol\":\"SideTokenFactory\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/SideToken/SideToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"../zeppelin/token/ERC777/ERC777.sol\\\";\\nimport \\\"../interface/IERC677Receiver.sol\\\";\\nimport \\\"../interface/ISideToken.sol\\\";\\nimport \\\"../lib/LibEIP712.sol\\\";\\n\\ncontract SideToken is ISideToken, ERC777 {\\n using SafeMath for uint256;\\n\\n address public minter;\\n uint256 private _granularity;\\n\\n // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2612.md\\n bytes32 public domainSeparator;\\n // keccak256(\\\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\\\");\\n bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;\\n mapping(address => uint) public nonces;\\n\\n // ERC677 Transfer Event\\n event Transfer(address,address,uint256,bytes);\\n\\n constructor(string memory _tokenName, string memory _tokenSymbol, address _minterAddr, uint256 _newGranularity)\\n ERC777(_tokenName, _tokenSymbol, new address[](0)) {\\n require(_minterAddr != address(0), \\\"SideToken: Empty Minter\\\");\\n require(_newGranularity >= 1, \\\"SideToken: Granularity < 1\\\");\\n minter = _minterAddr;\\n _granularity = _newGranularity;\\n\\n domainSeparator = LibEIP712.hashEIP712Domain(\\n name(),\\n \\\"1\\\",\\n block.chainid,\\n address(this)\\n );\\n }\\n\\n modifier onlyMinter() {\\n require(_msgSender() == minter, \\\"SideToken: Caller is not the minter\\\");\\n _;\\n }\\n\\n function mint(\\n address account,\\n uint256 amount,\\n bytes calldata userData,\\n bytes calldata operatorData\\n )\\n external onlyMinter override\\n {\\n _mint(_msgSender(), account, amount, userData, operatorData);\\n }\\n\\n /**\\n * @dev ERC677 transfer token with additional data if the recipient is a contact.\\n * @param recipient The address to transfer to.\\n * @param amount The amount to be transferred.\\n * @param data The extra data to be passed to the receiving contract.\\n */\\n function transferAndCall(address recipient, uint amount, bytes calldata data)\\n external returns (bool success)\\n {\\n address from = _msgSender();\\n\\n _send(from, from, recipient, amount, data, \\\"\\\", false);\\n emit Transfer(from, recipient, amount, data);\\n IERC677Receiver(recipient).onTokenTransfer(from, amount, data);\\n return true;\\n }\\n\\n function granularity() public view override returns (uint256) {\\n return _granularity;\\n }\\n\\n // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2612.md\\n function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {\\n require(deadline >= block.timestamp, \\\"SideToken: EXPIRED\\\"); // solhint-disable-line not-rely-on-time\\n bytes32 digest = LibEIP712.hashEIP712Message(\\n domainSeparator,\\n keccak256(\\n abi.encode(\\n PERMIT_TYPEHASH,\\n owner,\\n spender,\\n value,\\n nonces[owner]++,\\n deadline\\n )\\n )\\n );\\n address recoveredAddress = ecrecover(digest, v, r, s);\\n require(recoveredAddress != address(0) && recoveredAddress == owner, \\\"SideToken: INVALID_SIGNATURE\\\");\\n _approve(owner, spender, value);\\n }\\n\\n}\",\"keccak256\":\"0x7b96a4cf24ea53026929e98f2f91a3a220f20e7e9c9fe1bb5ac2a159bdec9c9e\",\"license\":\"MIT\"},\"contracts/SideTokenFactory/SideTokenFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"../zeppelin/ownership/Secondary.sol\\\";\\nimport \\\"../interface/ISideTokenFactory.sol\\\";\\nimport \\\"../SideToken/SideToken.sol\\\";\\n\\ncontract SideTokenFactory is ISideTokenFactory, Secondary {\\n\\n function createSideToken(string calldata name, string calldata symbol, uint256 granularity)\\n external onlyPrimary override returns(address) {\\n address sideToken = address(new SideToken(name, symbol, primary(), granularity));\\n emit SideTokenCreated(sideToken, symbol, granularity);\\n return sideToken;\\n }\\n}\",\"keccak256\":\"0x93e8d0df38e0455155d2658bce959075aa0c7ca0c45b4fd0516f3eeeacb2a9e7\",\"license\":\"MIT\"},\"contracts/interface/IERC677Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\ninterface IERC677Receiver {\\n function onTokenTransfer(address _sender, uint _value, bytes calldata _data) external;\\n}\",\"keccak256\":\"0x1f3de30ddf0428f1ff17a0424cc2396e78883a31bc286e31bcbb5f873ab04d2a\",\"license\":\"MIT\"},\"contracts/interface/ISideToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\ninterface ISideToken {\\n function mint(address account, uint256 amount, bytes calldata userData, bytes calldata operatorData) external;\\n}\",\"keccak256\":\"0x43d96442dcb622e7efbad6ff3fcfe109d9f881c18415b571511f326b39d7a70e\",\"license\":\"MIT\"},\"contracts/interface/ISideTokenFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\ninterface ISideTokenFactory {\\n\\n function createSideToken(string calldata name, string calldata symbol, uint256 granularity) external returns(address);\\n\\n event SideTokenCreated(address indexed sideToken, string symbol, uint256 granularity);\\n}\",\"keccak256\":\"0x5c3c0db3ad07c2cb9933ea8a37e01b83d4ec77c7bc0ac684de87f6b1e09d25dc\",\"license\":\"MIT\"},\"contracts/lib/LibEIP712.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n// https://github.com/0xProject/0x-monorepo/blob/development/contracts/utils/contracts/src/LibEIP712.sol\\nlibrary LibEIP712 {\\n\\n // Hash of the EIP712 Domain Separator Schema\\n // keccak256(abi.encodePacked(\\n // \\\"EIP712Domain(\\\",\\n // \\\"string name,\\\",\\n // \\\"string version,\\\",\\n // \\\"uint256 chainId,\\\",\\n // \\\"address verifyingContract\\\",\\n // \\\")\\\"\\n // ))\\n bytes32 constant internal _EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f;\\n\\n /// @dev Calculates a EIP712 domain separator.\\n /// @param name The EIP712 domain name.\\n /// @param version The EIP712 domain version.\\n /// @param verifyingContract The EIP712 verifying contract.\\n /// @return result EIP712 domain separator.\\n function hashEIP712Domain(\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract\\n )\\n internal\\n pure\\n returns (bytes32 result)\\n {\\n bytes32 schemaHash = _EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH;\\n\\n // Assembly for more efficient computing:\\n // keccak256(abi.encodePacked(\\n // _EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\\n // keccak256(bytes(name)),\\n // keccak256(bytes(version)),\\n // chainId,\\n // uint256(verifyingContract)\\n // ))\\n\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n // Calculate hashes of dynamic data\\n let nameHash := keccak256(add(name, 32), mload(name))\\n let versionHash := keccak256(add(version, 32), mload(version))\\n\\n // Load free memory pointer\\n let memPtr := mload(64)\\n\\n // Store params in memory\\n mstore(memPtr, schemaHash)\\n mstore(add(memPtr, 32), nameHash)\\n mstore(add(memPtr, 64), versionHash)\\n mstore(add(memPtr, 96), chainId)\\n mstore(add(memPtr, 128), verifyingContract)\\n\\n // Compute hash\\n result := keccak256(memPtr, 160)\\n }\\n return result;\\n }\\n\\n /// @dev Calculates EIP712 encoding for a hash struct with a given domain hash.\\n /// @param eip712DomainHash Hash of the domain domain separator data, computed\\n /// with getDomainHash().\\n /// @param hashStruct The EIP712 hash struct.\\n /// @return result EIP712 hash applied to the given EIP712 Domain.\\n function hashEIP712Message(bytes32 eip712DomainHash, bytes32 hashStruct)\\n internal\\n pure\\n returns (bytes32 result)\\n {\\n // Assembly for more efficient computing:\\n // keccak256(abi.encodePacked(\\n // EIP191_HEADER,\\n // EIP712_DOMAIN_HASH,\\n // hashStruct\\n // ));\\n\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n // Load free memory pointer\\n let memPtr := mload(64)\\n\\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\\n\\n // Compute hash\\n result := keccak256(memPtr, 66)\\n }\\n return result;\\n }\\n}\",\"keccak256\":\"0x0314f8cfcab5979a2d713b4863bf5783b1181151ac144091d23f802d3f8ac7c5\",\"license\":\"MIT\"},\"contracts/zeppelin/GSN/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n\\n function _msgSender() internal view returns (address payable) {\\n return payable(msg.sender);\\n }\\n\\n function _msgData() internal view returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x6f3f274a2270bfe073339370edfa2485e2d515a2656039937f6b972fae96d297\",\"license\":\"MIT\"},\"contracts/zeppelin/introspection/IERC1820Registry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev Interface of the global ERC1820 Registry, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-1820[EIP]. Accounts may register\\n * implementers for interfaces in this registry, as well as query support.\\n *\\n * Implementers may be shared by multiple accounts, and can also implement more\\n * than a single interface for each account. Contracts can implement interfaces\\n * for themselves, but externally-owned accounts (EOA) must delegate this to a\\n * contract.\\n *\\n * {IERC165} interfaces can also be queried via the registry.\\n *\\n * For an in-depth explanation and source code analysis, see the EIP text.\\n */\\ninterface IERC1820Registry {\\n /**\\n * @dev Sets `newManager` as the manager for `account`. A manager of an\\n * account is able to set interface implementers for it.\\n *\\n * By default, each account is its own manager. Passing a value of `0x0` in\\n * `newManager` will reset the manager to this initial state.\\n *\\n * Emits a {ManagerChanged} event.\\n *\\n * Requirements:\\n *\\n * - the caller must be the current manager for `account`.\\n */\\n function setManager(address account, address newManager) external;\\n\\n /**\\n * @dev Returns the manager for `account`.\\n *\\n * See {setManager}.\\n */\\n function getManager(address account) external view returns (address);\\n\\n /**\\n * @dev Sets the `implementer` contract as `account`'s implementer for\\n * `interfaceHash`.\\n *\\n * `account` being the zero address is an alias for the caller's address.\\n * The zero address can also be used in `implementer` to remove an old one.\\n *\\n * See {interfaceHash} to learn how these are created.\\n *\\n * Emits an {InterfaceImplementerSet} event.\\n *\\n * Requirements:\\n *\\n * - the caller must be the current manager for `_account`.\\n * - `_interfaceHash` must not be an {IERC165} interface id (i.e. it must not\\n * end in 28 zeroes).\\n * - `_implementer` must implement {IERC1820Implementer} and return true when\\n * queried for support, unless `implementer` is the caller. See\\n * {IERC1820Implementer-canImplementInterfaceForAddress}.\\n */\\n function setInterfaceImplementer(address _account, bytes32 _interfaceHash, address _implementer) external;\\n\\n /**\\n * @dev Returns the implementer of `_interfaceHash` for `_account`. If no such\\n * implementer is registered, returns the zero address.\\n *\\n * If `_interfaceHash` is an {IERC165} interface id (i.e. it ends with 28\\n * zeroes), `_account` will be queried for support of it.\\n *\\n * `account` being the zero address is an alias for the caller's address.\\n */\\n function getInterfaceImplementer(address _account, bytes32 _interfaceHash) external view returns (address);\\n\\n /**\\n * @dev Returns the interface hash for an `interfaceName`, as defined in the\\n * corresponding\\n * https://eips.ethereum.org/EIPS/eip-1820#interface-name[section of the EIP].\\n */\\n function interfaceHash(string calldata interfaceName) external pure returns (bytes32);\\n\\n /**\\n * @notice Updates the cache with whether the contract implements an ERC165 interface or not.\\n * @param account Address of the contract for which to update the cache.\\n * @param interfaceId ERC165 interface for which to update the cache.\\n */\\n function updateERC165Cache(address account, bytes4 interfaceId) external;\\n\\n /**\\n * @notice Checks whether a contract implements an ERC165 interface or not.\\n * If the result is not cached a direct lookup on the contract address is performed.\\n * If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling\\n * {updateERC165Cache} with the contract address.\\n * @param account Address of the contract to check.\\n * @param interfaceId ERC165 interface to check.\\n * @return True if `account` implements `interfaceId`, false otherwise.\\n */\\n function implementsERC165Interface(address account, bytes4 interfaceId) external view returns (bool);\\n\\n /**\\n * @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache.\\n * @param account Address of the contract to check.\\n * @param interfaceId ERC165 interface to check.\\n * @return True if `account` implements `interfaceId`, false otherwise.\\n */\\n function implementsERC165InterfaceNoCache(address account, bytes4 interfaceId) external view returns (bool);\\n\\n event InterfaceImplementerSet(address indexed account, bytes32 indexed interfaceHash, address indexed implementer);\\n\\n event ManagerChanged(address indexed account, address indexed newManager);\\n}\\n\",\"keccak256\":\"0x8877787cbe99ab8e2dcb85e9b22066b7e62bcea328091c1ff9ae462e54afa66e\",\"license\":\"MIT\"},\"contracts/zeppelin/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n return sub(a, b, \\\"SafeMath: subtraction overflow\\\");\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n * - Subtraction cannot overflow.\\n *\\n * _Available since v2.4.0._\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers. Reverts on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n return div(a, b, \\\"SafeMath: division by zero\\\");\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers. Reverts with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n *\\n * _Available since v2.4.0._\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n // Solidity only automatically asserts when dividing by 0\\n require(b > 0, errorMessage);\\n uint256 c = a / b;\\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * Reverts when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n return mod(a, b, \\\"SafeMath: modulo by zero\\\");\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * Reverts with custom message when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n *\\n * _Available since v2.4.0._\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b != 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0x8038a6eca31e013b0c7f248c7a4eb5846ab0d52bb3f7636fafcf00b075643afe\",\"license\":\"MIT\"},\"contracts/zeppelin/ownership/Secondary.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"../GSN/Context.sol\\\";\\n/**\\n * @dev A Secondary contract can only be used by its primary account (the one that created it).\\n */\\nabstract contract Secondary is Context {\\n address private _primary;\\n\\n /**\\n * @dev Emitted when the primary contract changes.\\n */\\n event PrimaryTransferred(\\n address recipient\\n );\\n\\n /**\\n * @dev Sets the primary account to the one that is creating the Secondary contract.\\n */\\n constructor () {\\n _primary = _msgSender();\\n emit PrimaryTransferred(_primary);\\n }\\n\\n /**\\n * @dev Reverts if called from any account other than the primary.\\n */\\n modifier onlyPrimary() {\\n require(_msgSender() == _primary, \\\"Secondary: caller is not the primary account\\\");\\n _;\\n }\\n\\n /**\\n * @return the address of the primary.\\n */\\n function primary() public view returns (address) {\\n return _primary;\\n }\\n\\n /**\\n * @dev Transfers contract to a new primary.\\n * @param recipient The address of new primary.\\n */\\n function transferPrimary(address recipient) public onlyPrimary {\\n require(recipient != address(0), \\\"Secondary: new primary is the zero address\\\");\\n _primary = recipient;\\n emit PrimaryTransferred(_primary);\\n }\\n}\\n\",\"keccak256\":\"0xdab039c15e9fd9764351f7bddcd94710bb3cc358c9e78e6fa30f9b6f4373754d\",\"license\":\"MIT\"},\"contracts/zeppelin/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP. Does not include\\n * the optional functions; to access them see {ERC20Detailed}.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0xdb194e173849ac56dbc15eaf0c01848361748ff8e4679985c3d11013ee4fa4b6\",\"license\":\"MIT\"},\"contracts/zeppelin/token/ERC777/ERC777.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\nimport \\\"../../GSN/Context.sol\\\";\\nimport \\\"./IERC777.sol\\\";\\nimport \\\"./IERC777Recipient.sol\\\";\\nimport \\\"./IERC777Sender.sol\\\";\\nimport \\\"../../token/ERC20/IERC20.sol\\\";\\nimport \\\"../../math/SafeMath.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../introspection/IERC1820Registry.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC777} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n *\\n * Support for ERC20 is included in this contract, as specified by the EIP: both\\n * the ERC777 and ERC20 interfaces can be safely used when interacting with it.\\n * Both {IERC777-Sent} and {IERC20-Transfer} events are emitted on token\\n * movements.\\n *\\n * Additionally, the {IERC777-granularity} value is hard-coded to `1`, meaning that there\\n * are no special restrictions in the amount of tokens that created, moved, or\\n * destroyed. This makes integration with ERC20 applications seamless.\\n */\\ncontract ERC777 is Context, IERC777, IERC20 {\\n using SafeMath for uint256;\\n using Address for address;\\n\\n IERC1820Registry constant private _erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);\\n\\n mapping(address => uint256) private _balances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n // We inline the result of the following hashes because Solidity doesn't resolve them at compile time.\\n // See https://github.com/ethereum/solidity/issues/4024.\\n\\n // keccak256(\\\"ERC777TokensSender\\\")\\n bytes32 constant private TOKENS_SENDER_INTERFACE_HASH =\\n 0x29ddb589b1fb5fc7cf394961c1adf5f8c6454761adf795e67fe149f658abe895;\\n\\n // keccak256(\\\"ERC777TokensRecipient\\\")\\n bytes32 constant private TOKENS_RECIPIENT_INTERFACE_HASH =\\n 0xb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b;\\n\\n // This isn't ever read from - it's only used to respond to the defaultOperators query.\\n address[] private _defaultOperatorsArray;\\n\\n // Immutable, but accounts may revoke them (tracked in __revokedDefaultOperators).\\n mapping(address => bool) private _defaultOperators;\\n\\n // For each account, a mapping of its operators and revoked default operators.\\n mapping(address => mapping(address => bool)) private _operators;\\n mapping(address => mapping(address => bool)) private _revokedDefaultOperators;\\n\\n // ERC20-allowances\\n mapping (address => mapping (address => uint256)) private _allowances;\\n\\n /**\\n * @dev `defaultOperators` may be an empty array.\\n */\\n constructor(\\n string memory aName,\\n string memory aSymbol,\\n address[] memory theDefaultOperators\\n ) {\\n _name = aName;\\n _symbol = aSymbol;\\n\\n _defaultOperatorsArray = theDefaultOperators;\\n for (uint256 i = 0; i < _defaultOperatorsArray.length; i++) {\\n _defaultOperators[_defaultOperatorsArray[i]] = true;\\n }\\n\\n // register interfaces\\n _erc1820.setInterfaceImplementer(address(this), keccak256(\\\"ERC777Token\\\"), address(this));\\n _erc1820.setInterfaceImplementer(address(this), keccak256(\\\"ERC20Token\\\"), address(this));\\n }\\n\\n /**\\n * @dev See {IERC777-name}.\\n */\\n function name() public view override(IERC777) returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev See {IERC777-symbol}.\\n */\\n function symbol() public view override(IERC777) returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev See {ERC20Detailed-decimals}.\\n *\\n * Always returns 18, as per the\\n * [ERC777 EIP](https://eips.ethereum.org/EIPS/eip-777#backward-compatibility).\\n */\\n function decimals() public pure override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC777-granularity}.\\n *\\n * This implementation always returns `1`.\\n */\\n function granularity() public view virtual override(IERC777) returns (uint256) {\\n return 1;\\n }\\n\\n /**\\n * @dev See {IERC777-totalSupply}.\\n */\\n function totalSupply() public view override(IERC20, IERC777) returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev Returns the amount of tokens owned by an account (`tokenHolder`).\\n */\\n function balanceOf(address tokenHolder) public view override(IERC20, IERC777) returns (uint256) {\\n return _balances[tokenHolder];\\n }\\n\\n /**\\n * @dev See {IERC777-send}.\\n *\\n * Also emits a {Transfer} event for ERC20 compatibility.\\n */\\n function send(address recipient, uint256 amount, bytes calldata data) external override(IERC777) {\\n _send(_msgSender(), _msgSender(), recipient, amount, data, \\\"\\\", true);\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Unlike `send`, `recipient` is _not_ required to implement the {IERC777Recipient}\\n * interface if it is a contract.\\n *\\n * Also emits a {Sent} event.\\n */\\n function transfer(address recipient, uint256 amount) external override(IERC20) returns (bool) {\\n require(recipient != address(0), \\\"ERC777: transfer to zero address\\\");\\n\\n address from = _msgSender();\\n\\n _callTokensToSend(from, from, recipient, amount, \\\"\\\", \\\"\\\");\\n\\n _move(from, from, recipient, amount, \\\"\\\", \\\"\\\");\\n\\n _callTokensReceived(from, from, recipient, amount, \\\"\\\", \\\"\\\", false);\\n\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC777-burn}.\\n *\\n * Also emits a {Transfer} event for ERC20 compatibility.\\n */\\n function burn(uint256 amount, bytes calldata data) external override(IERC777) {\\n _burn(_msgSender(), _msgSender(), amount, data, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IERC777-isOperatorFor}.\\n */\\n function isOperatorFor(\\n address operator,\\n address tokenHolder\\n ) public view override(IERC777) returns (bool) {\\n return operator == tokenHolder ||\\n (_defaultOperators[operator] && !_revokedDefaultOperators[tokenHolder][operator]) ||\\n _operators[tokenHolder][operator];\\n }\\n\\n /**\\n * @dev See {IERC777-authorizeOperator}.\\n */\\n function authorizeOperator(address operator) external override(IERC777) {\\n require(_msgSender() != operator, \\\"ERC777: authorizing self as operator\\\");\\n\\n if (_defaultOperators[operator]) {\\n delete _revokedDefaultOperators[_msgSender()][operator];\\n } else {\\n _operators[_msgSender()][operator] = true;\\n }\\n\\n emit AuthorizedOperator(operator, _msgSender());\\n }\\n\\n /**\\n * @dev See {IERC777-revokeOperator}.\\n */\\n function revokeOperator(address operator) external override(IERC777) {\\n require(operator != _msgSender(), \\\"ERC777: revoking self as operator\\\");\\n\\n if (_defaultOperators[operator]) {\\n _revokedDefaultOperators[_msgSender()][operator] = true;\\n } else {\\n delete _operators[_msgSender()][operator];\\n }\\n\\n emit RevokedOperator(operator, _msgSender());\\n }\\n\\n /**\\n * @dev See {IERC777-defaultOperators}.\\n */\\n function defaultOperators() public view override(IERC777) returns (address[] memory) {\\n return _defaultOperatorsArray;\\n }\\n\\n /**\\n * @dev See {IERC777-operatorSend}.\\n *\\n * Emits {Sent} and {Transfer} events.\\n */\\n function operatorSend(\\n address sender,\\n address recipient,\\n uint256 amount,\\n bytes calldata data,\\n bytes calldata operatorData\\n )\\n external override(IERC777)\\n {\\n require(isOperatorFor(_msgSender(), sender), \\\"ERC777: caller is not an operator\\\");\\n _send(_msgSender(), sender, recipient, amount, data, operatorData, true);\\n }\\n\\n /**\\n * @dev See {IERC777-operatorBurn}.\\n *\\n * Emits {Burned} and {Transfer} events.\\n */\\n function operatorBurn(address account, uint256 amount, bytes calldata data, bytes calldata operatorData)\\n external override(IERC777) {\\n require(isOperatorFor(_msgSender(), account), \\\"ERC777: caller is not an operator\\\");\\n _burn(_msgSender(), account, amount, data, operatorData);\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n *\\n * Note that operator and allowance concepts are orthogonal: operators may\\n * not have allowance, and accounts with allowance may not be operators\\n * themselves.\\n */\\n function allowance(address holder, address spender)\\n public view override(IERC20) returns (uint256) {\\n return _allowances[holder][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * Note that accounts cannot have allowance issued by their operators.\\n */\\n function approve(address spender, uint256 value) external override(IERC20) returns (bool) {\\n address holder = _msgSender();\\n _approve(holder, spender, value);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Note that operator and allowance concepts are orthogonal: operators cannot\\n * call `transferFrom` (unless they have allowance), and accounts with\\n * allowance cannot call `operatorSend` (unless they are operators).\\n *\\n * Emits {Sent}, {Transfer} and {Approval} events.\\n */\\n function transferFrom(address holder, address recipient, uint256 amount)\\n external override(IERC20) returns (bool) {\\n require(recipient != address(0), \\\"ERC777: transfer to zero address\\\");\\n require(holder != address(0), \\\"ERC777: transfer from zero address\\\");\\n\\n address spender = _msgSender();\\n\\n _callTokensToSend(spender, holder, recipient, amount, \\\"\\\", \\\"\\\");\\n\\n _move(spender, holder, recipient, amount, \\\"\\\", \\\"\\\");\\n _approve(holder, spender, _allowances[holder][spender].sub(amount, \\\"ERC777: transfer amount exceeds allowance\\\"));\\n\\n _callTokensReceived(spender, holder, recipient, amount, \\\"\\\", \\\"\\\", false);\\n\\n return true;\\n }\\n\\n /**\\n * @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * If a send hook is registered for `account`, the corresponding function\\n * will be called with `operator`, `data` and `operatorData`.\\n *\\n * See {IERC777Sender} and {IERC777Recipient}.\\n *\\n * Emits {Minted} and {Transfer} events.\\n *\\n * Requirements\\n *\\n * - `account` cannot be the zero address.\\n * - if `account` is a contract, it must implement the {IERC777Recipient}\\n * interface.\\n */\\n function _mint(\\n address operator,\\n address account,\\n uint256 amount,\\n bytes memory userData,\\n bytes memory operatorData\\n )\\n internal\\n {\\n require(account != address(0), \\\"ERC777: mint to zero address\\\");\\n\\n // Update state variables\\n _totalSupply = _totalSupply.add(amount);\\n _balances[account] = _balances[account].add(amount);\\n\\n _callTokensReceived(operator, address(0), account, amount, userData, operatorData, true);\\n\\n emit Minted(operator, account, amount, userData, operatorData);\\n emit Transfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Send tokens\\n * @param operator address operator requesting the transfer\\n * @param from address token holder address\\n * @param to address recipient address\\n * @param amount uint256 amount of tokens to transfer\\n * @param userData bytes extra information provided by the token holder (if any)\\n * @param operatorData bytes extra information provided by the operator (if any)\\n * @param requireReceptionAck if true, contract recipients are required to implement ERC777TokensRecipient\\n */\\n function _send(\\n address operator,\\n address from,\\n address to,\\n uint256 amount,\\n bytes memory userData,\\n bytes memory operatorData,\\n bool requireReceptionAck\\n )\\n internal\\n {\\n require(from != address(0), \\\"ERC777: send from zero address\\\");\\n require(to != address(0), \\\"ERC777: send to zero address\\\");\\n\\n _callTokensToSend(operator, from, to, amount, userData, operatorData);\\n\\n _move(operator, from, to, amount, userData, operatorData);\\n\\n _callTokensReceived(operator, from, to, amount, userData, operatorData, requireReceptionAck);\\n }\\n\\n /**\\n * @dev Burn tokens\\n * @param operator address operator requesting the operation\\n * @param from address token holder address\\n * @param amount uint256 amount of tokens to burn\\n * @param data bytes extra information provided by the token holder\\n * @param operatorData bytes extra information provided by the operator (if any)\\n */\\n function _burn(\\n address operator,\\n address from,\\n uint256 amount,\\n bytes memory data,\\n bytes memory operatorData\\n )\\n internal\\n {\\n require(from != address(0), \\\"ERC777: burn from zero address\\\");\\n\\n _callTokensToSend(operator, from, address(0), amount, data, operatorData);\\n\\n // Update state variables\\n _balances[from] = _balances[from].sub(amount, \\\"ERC777: burn amount exceeds balance\\\");\\n _totalSupply = _totalSupply.sub(amount);\\n\\n emit Burned(operator, from, amount, data, operatorData);\\n emit Transfer(from, address(0), amount);\\n }\\n\\n function _move(\\n address operator,\\n address from,\\n address to,\\n uint256 amount,\\n bytes memory userData,\\n bytes memory operatorData\\n )\\n internal\\n {\\n _balances[from] = _balances[from].sub(amount, \\\"ERC777: transfer amount exceeds balance\\\");\\n _balances[to] = _balances[to].add(amount);\\n\\n emit Sent(operator, from, to, amount, userData, operatorData);\\n emit Transfer(from, to, amount);\\n }\\n\\n function _approve(address holder, address spender, uint256 value) internal {\\n // TODO: restore this require statement if this function becomes internal, or is called at a new callsite. It is\\n // currently unnecessary.\\n //require(holder != address(0), \\\"ERC777: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC777: approve to zero address\\\");\\n\\n _allowances[holder][spender] = value;\\n emit Approval(holder, spender, value);\\n }\\n\\n /**\\n * @dev Call from.tokensToSend() if the interface is registered\\n * @param operator address operator requesting the transfer\\n * @param from address token holder address\\n * @param to address recipient address\\n * @param amount uint256 amount of tokens to transfer\\n * @param userData bytes extra information provided by the token holder (if any)\\n * @param operatorData bytes extra information provided by the operator (if any)\\n */\\n function _callTokensToSend(\\n address operator,\\n address from,\\n address to,\\n uint256 amount,\\n bytes memory userData,\\n bytes memory operatorData\\n )\\n internal\\n {\\n address implementer = _erc1820.getInterfaceImplementer(from, TOKENS_SENDER_INTERFACE_HASH);\\n if (implementer != address(0)) {\\n IERC777Sender(implementer).tokensToSend(operator, from, to, amount, userData, operatorData);\\n }\\n }\\n\\n /**\\n * @dev Call to.tokensReceived() if the interface is registered. Reverts if the recipient is a contract but\\n * tokensReceived() was not registered for the recipient\\n * @param operator address operator requesting the transfer\\n * @param from address token holder address\\n * @param to address recipient address\\n * @param amount uint256 amount of tokens to transfer\\n * @param userData bytes extra information provided by the token holder (if any)\\n * @param operatorData bytes extra information provided by the operator (if any)\\n * @param requireReceptionAck if true, contract recipients are required to implement ERC777TokensRecipient\\n */\\n function _callTokensReceived(\\n address operator,\\n address from,\\n address to,\\n uint256 amount,\\n bytes memory userData,\\n bytes memory operatorData,\\n bool requireReceptionAck\\n )\\n private\\n {\\n address implementer = _erc1820.getInterfaceImplementer(to, TOKENS_RECIPIENT_INTERFACE_HASH);\\n if (implementer != address(0)) {\\n IERC777Recipient(implementer).tokensReceived(operator, from, to, amount, userData, operatorData);\\n } else if (requireReceptionAck) {\\n require(!to.isContract(), \\\"ERC777: token recipient contract has no implementer for ERC777TokensRecipient\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf18fbdee798b2c3dd6b87d4e9e3d1486b7ab03a2380b253026db9ada3114fe4a\",\"license\":\"MIT\"},\"contracts/zeppelin/token/ERC777/IERC777.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev Interface of the ERC777Token standard as defined in the EIP.\\n *\\n * This contract uses the\\n * [ERC1820 registry standard](https://eips.ethereum.org/EIPS/eip-1820) to let\\n * token holders and recipients react to token movements by using setting implementers\\n * for the associated interfaces in said registry. See `IERC1820Registry` and\\n * `ERC1820Implementer`.\\n */\\ninterface IERC777 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the smallest part of the token that is not divisible. This\\n * means all token operations (creation, movement and destruction) must have\\n * amounts that are a multiple of this number.\\n *\\n * For most token contracts, this value will equal 1.\\n */\\n function granularity() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by an account (`owner`).\\n */\\n function balanceOf(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * If send or receive hooks are registered for the caller and `recipient`,\\n * the corresponding functions will be called with `data` and empty\\n * `operatorData`. See `IERC777Sender` and `IERC777Recipient`.\\n *\\n * Emits a `Sent` event.\\n *\\n * Requirements\\n *\\n * - the caller must have at least `amount` tokens.\\n * - `recipient` cannot be the zero address.\\n * - if `recipient` is a contract, it must implement the `tokensReceived`\\n * interface.\\n */\\n function send(address recipient, uint256 amount, bytes calldata data) external;\\n\\n /**\\n * @dev Destroys `amount` tokens from the caller's account, reducing the\\n * total supply.\\n *\\n * If a send hook is registered for the caller, the corresponding function\\n * will be called with `data` and empty `operatorData`. See `IERC777Sender`.\\n *\\n * Emits a `Burned` event.\\n *\\n * Requirements\\n *\\n * - the caller must have at least `amount` tokens.\\n */\\n function burn(uint256 amount, bytes calldata data) external;\\n\\n /**\\n * @dev Returns true if an account is an operator of `tokenHolder`.\\n * Operators can send and burn tokens on behalf of their owners. All\\n * accounts are their own operator.\\n *\\n * See `operatorSend` and `operatorBurn`.\\n */\\n function isOperatorFor(address operator, address tokenHolder) external view returns (bool);\\n\\n /**\\n * @dev Make an account an operator of the caller.\\n *\\n * See `isOperatorFor`.\\n *\\n * Emits an `AuthorizedOperator` event.\\n *\\n * Requirements\\n *\\n * - `operator` cannot be calling address.\\n */\\n function authorizeOperator(address operator) external;\\n\\n /**\\n * @dev Make an account an operator of the caller.\\n *\\n * See `isOperatorFor` and `defaultOperators`.\\n *\\n * Emits a `RevokedOperator` event.\\n *\\n * Requirements\\n *\\n * - `operator` cannot be calling address.\\n */\\n function revokeOperator(address operator) external;\\n\\n /**\\n * @dev Returns the list of default operators. These accounts are operators\\n * for all token holders, even if `authorizeOperator` was never called on\\n * them.\\n *\\n * This list is immutable, but individual holders may revoke these via\\n * `revokeOperator`, in which case `isOperatorFor` will return false.\\n */\\n function defaultOperators() external view returns (address[] memory);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient`. The caller must\\n * be an operator of `sender`.\\n *\\n * If send or receive hooks are registered for `sender` and `recipient`,\\n * the corresponding functions will be called with `data` and\\n * `operatorData`. See `IERC777Sender` and `IERC777Recipient`.\\n *\\n * Emits a `Sent` event.\\n *\\n * Requirements\\n *\\n * - `sender` cannot be the zero address.\\n * - `sender` must have at least `amount` tokens.\\n * - the caller must be an operator for `sender`.\\n * - `recipient` cannot be the zero address.\\n * - if `recipient` is a contract, it must implement the `tokensReceived`\\n * interface.\\n */\\n function operatorSend(\\n address sender,\\n address recipient,\\n uint256 amount,\\n bytes calldata data,\\n bytes calldata operatorData\\n ) external;\\n\\n /**\\n * @dev Destoys `amount` tokens from `account`, reducing the total supply.\\n * The caller must be an operator of `account`.\\n *\\n * If a send hook is registered for `account`, the corresponding function\\n * will be called with `data` and `operatorData`. See `IERC777Sender`.\\n *\\n * Emits a `Burned` event.\\n *\\n * Requirements\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n * - the caller must be an operator for `account`.\\n */\\n function operatorBurn(\\n address account,\\n uint256 amount,\\n bytes calldata data,\\n bytes calldata operatorData\\n ) external;\\n\\n event Sent(\\n address indexed operator,\\n address indexed from,\\n address indexed to,\\n uint256 amount,\\n bytes data,\\n bytes operatorData\\n );\\n\\n function decimals() external returns (uint8);\\n\\n event Minted(address indexed operator, address indexed to, uint256 amount, bytes data, bytes operatorData);\\n\\n event Burned(address indexed operator, address indexed from, uint256 amount, bytes data, bytes operatorData);\\n\\n event AuthorizedOperator(address indexed operator, address indexed tokenHolder);\\n\\n event RevokedOperator(address indexed operator, address indexed tokenHolder);\\n}\\n\",\"keccak256\":\"0xd8fb2f5bda9acc32af1bc5ed8a64c67a42ac7f32dd1195387535e8e148d40421\",\"license\":\"MIT\"},\"contracts/zeppelin/token/ERC777/IERC777Recipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev Interface of the ERC777TokensRecipient standard as defined in the EIP.\\n *\\n * Accounts can be notified of `IERC777` tokens being sent to them by having a\\n * contract implement this interface (contract holders can be their own\\n * implementer) and registering it on the\\n * [ERC1820 global registry](https://eips.ethereum.org/EIPS/eip-1820).\\n *\\n * See `IERC1820Registry` and `ERC1820Implementer`.\\n */\\ninterface IERC777Recipient {\\n /**\\n * @dev Called by an `IERC777` token contract whenever tokens are being\\n * moved or created into a registered account (`to`). The type of operation\\n * is conveyed by `from` being the zero address or not.\\n *\\n * This call occurs _after_ the token contract's state is updated, so\\n * `IERC777.balanceOf`, etc., can be used to query the post-operation state.\\n *\\n * This function may revert to prevent the operation from being executed.\\n */\\n function tokensReceived(\\n address operator,\\n address from,\\n address to,\\n uint amount,\\n bytes calldata userData,\\n bytes calldata operatorData\\n ) external;\\n}\\n\",\"keccak256\":\"0xc1e6f2d257d4973a27a86e590e01a3289317bd4b44ea040a622b4823c7793875\",\"license\":\"MIT\"},\"contracts/zeppelin/token/ERC777/IERC777Sender.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev Interface of the ERC777TokensSender standard as defined in the EIP.\\n *\\n * `IERC777` Token holders can be notified of operations performed on their\\n * tokens by having a contract implement this interface (contract holders can be\\n * their own implementer) and registering it on the\\n * [ERC1820 global registry](https://eips.ethereum.org/EIPS/eip-1820).\\n *\\n * See `IERC1820Registry` and `ERC1820Implementer`.\\n */\\ninterface IERC777Sender {\\n /**\\n * @dev Called by an `IERC777` token contract whenever a registered holder's\\n * (`from`) tokens are about to be moved or destroyed. The type of operation\\n * is conveyed by `to` being the zero address or not.\\n *\\n * This call occurs _before_ the token contract's state is updated, so\\n * `IERC777.balanceOf`, etc., can be used to query the pre-operation state.\\n *\\n * This function may revert to prevent the operation from being executed.\\n */\\n function tokensToSend(\\n address operator,\\n address from,\\n address to,\\n uint amount,\\n bytes calldata userData,\\n bytes calldata operatorData\\n ) external;\\n}\\n\",\"keccak256\":\"0x8707e3440e84839e68a5ff455f9fbd74f6a313111197493911fd100f436f1937\",\"license\":\"MIT\"},\"contracts/zeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n // solhint-disable-next-line no-inline-assembly\\n assembly { size := extcodesize(account) }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{ value: amount }(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain`call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return _verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x04801fc2398ee3370f3903f95389ea3a8da65a8df01f24b352e499e44d492e9b\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50600080546001600160a01b0319163390811790915560408051918252517f4101e71e974f68df5e9730cc223280b41654676bbb052cdcc735c3337e64d2d99181900360200190a1612c5a806100676000396000f3fe60806040523480156200001157600080fd5b5060043610620000465760003560e01c80632348238c146200004b57806326d9e9631462000064578063c6dbdf611462000097575b600080fd5b620000626200005c36600462000296565b620000a9565b005b6200007b6200007536600462000314565b620001a7565b6040516001600160a01b03909116815260200160405180910390f35b6000546001600160a01b03166200007b565b6000546001600160a01b0316336001600160a01b031614620000e85760405162461bcd60e51b8152600401620000df906200038f565b60405180910390fd5b6001600160a01b038116620001535760405162461bcd60e51b815260206004820152602a60248201527f5365636f6e646172793a206e6577207072696d61727920697320746865207a65604482015269726f206164647265737360b01b6064820152608401620000df565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f4101e71e974f68df5e9730cc223280b41654676bbb052cdcc735c3337e64d2d99060200160405180910390a150565b600080546001600160a01b0316336001600160a01b031614620001de5760405162461bcd60e51b8152600401620000df906200038f565b600086868686620001f76000546001600160a01b031690565b87604051620002069062000288565b620002179695949392919062000404565b604051809103906000f08015801562000234573d6000803e3d6000fd5b509050806001600160a01b03167ff57d2ded8330a4affd2fa52378069be534fe22288536537d1a1cfc061518450786868660405162000276939291906200044e565b60405180910390a29695505050505050565b6127b0806200047583390190565b600060208284031215620002a957600080fd5b81356001600160a01b0381168114620002c157600080fd5b9392505050565b60008083601f840112620002db57600080fd5b50813567ffffffffffffffff811115620002f457600080fd5b6020830191508360208285010111156200030d57600080fd5b9250929050565b6000806000806000606086880312156200032d57600080fd5b853567ffffffffffffffff808211156200034657600080fd5b6200035489838a01620002c8565b909750955060208801359150808211156200036e57600080fd5b506200037d88828901620002c8565b96999598509660400135949350505050565b6020808252602c908201527f5365636f6e646172793a2063616c6c6572206973206e6f74207468652070726960408201526b1b585c9e481858d8dbdd5b9d60a21b606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6080815260006200041a60808301888a620003db565b82810360208401526200042f818789620003db565b6001600160a01b03959095166040840152505060600152949350505050565b60408152600062000464604083018587620003db565b905082602083015294935050505056fe60806040523480156200001157600080fd5b50604051620027b0380380620027b08339810160408190526200003491620005ff565b60408051600081526020808201909252855186928692916200005d916002919086019062000434565b5081516200007390600390602085019062000434565b50805162000089906004906020840190620004c3565b5060005b600454811015620000fd5760016005600060048481548110620000b457620000b462000692565b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff191691151591909117905580620000f481620006a8565b9150506200008d565b506040516329965a1d60e01b815230600482018190527fac7fbab5f54a3ca8194167523c6753bfeb96a445279294b6125b68cce217705460248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad24906329965a1d90606401600060405180830381600087803b1580156200017857600080fd5b505af11580156200018d573d6000803e3d6000fd5b50506040516329965a1d60e01b815230600482018190527faea199e31a596269b42cdafd93407f14436db6e4cad65417994c2eb37381e05a60248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad2492506329965a1d9150606401600060405180830381600087803b1580156200020b57600080fd5b505af115801562000220573d6000803e3d6000fd5b50505050506001600160a01b038416151591506200028790505760405162461bcd60e51b815260206004820152601760248201527f53696465546f6b656e3a20456d707479204d696e74657200000000000000000060448201526064015b60405180910390fd5b6001811015620002da5760405162461bcd60e51b815260206004820152601a60248201527f53696465546f6b656e3a204772616e756c6172697479203c203100000000000060448201526064016200027e565b600980546001600160a01b0319166001600160a01b038416179055600a819055620003356200030862000343565b604051806040016040528060018152602001603160f81b8152504630620003dd60201b620010201760201c565b600b55506200070f92505050565b6060600280546200035490620006d2565b80601f01602080910402602001604051908101604052809291908181526020018280546200038290620006d2565b8015620003d35780601f10620003a757610100808354040283529160200191620003d3565b820191906000526020600020905b815481529060010190602001808311620003b557829003601f168201915b5050505050905090565b8351602094850120835193850193909320604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f815295860194909452928401929092526060830152608082015260a0902090565b8280546200044290620006d2565b90600052602060002090601f016020900481019282620004665760008555620004b1565b82601f106200048157805160ff1916838001178555620004b1565b82800160010185558215620004b1579182015b82811115620004b157825182559160200191906001019062000494565b50620004bf9291506200051b565b5090565b828054828255906000526020600020908101928215620004b1579160200282015b82811115620004b157825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620004e4565b5b80821115620004bf57600081556001016200051c565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200055a57600080fd5b81516001600160401b038082111562000577576200057762000532565b604051601f8301601f19908116603f01168101908282118183101715620005a257620005a262000532565b81604052838152602092508683858801011115620005bf57600080fd5b600091505b83821015620005e35785820183015181830184015290820190620005c4565b83821115620005f55760008385830101525b9695505050505050565b600080600080608085870312156200061657600080fd5b84516001600160401b03808211156200062e57600080fd5b6200063c8883890162000548565b955060208701519150808211156200065357600080fd5b50620006628782880162000548565b604087015190945090506001600160a01b03811681146200068257600080fd5b6060959095015193969295505050565b634e487b7160e01b600052603260045260246000fd5b6000600019821415620006cb57634e487b7160e01b600052601160045260246000fd5b5060010190565b600181811c90821680620006e757607f821691505b602082108114156200070957634e487b7160e01b600052602260045260246000fd5b50919050565b612091806200071f6000396000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c80637ecebe00116100de578063d95b637111610097578063f698da2511610071578063f698da2514610380578063fad8b32a14610389578063fc673c4f1461039c578063fe9d9303146103af57600080fd5b8063d95b637114610321578063dcdc7dd014610334578063dd62ed3e1461034757600080fd5b80637ecebe00146102ad578063959b8c3f146102cd57806395d89b41146102e05780639bd9bbc6146102e8578063a9059cbb146102fb578063d505accf1461030e57600080fd5b806330adf81f1161013057806330adf81f1461021e578063313ce567146102455780634000aea014610254578063556f0dc71461026757806362ad1b831461026f57806370a082311461028457600080fd5b806306e485381461017857806306fdde031461019657806307546172146101ab578063095ea7b3146101d657806318160ddd146101f957806323b872dd1461020b575b600080fd5b6101806103c2565b60405161018d91906119b5565b60405180910390f35b61019e610424565b60405161018d9190611a4f565b6009546101be906001600160a01b031681565b6040516001600160a01b03909116815260200161018d565b6101e96101e4366004611a7a565b6104ad565b604051901515815260200161018d565b6001545b60405190815260200161018d565b6101e9610219366004611aa6565b6104c5565b6101fd7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b6040516012815260200161018d565b6101e9610262366004611b30565b61066d565b600a546101fd565b61028261027d366004611b8c565b610774565b005b6101fd610292366004611c2b565b6001600160a01b031660009081526020819052604090205490565b6101fd6102bb366004611c2b565b600c6020526000908152604090205481565b6102826102db366004611c2b565b61081d565b61019e61093b565b6102826102f6366004611b30565b61094a565b6101e9610309366004611a7a565b6109a4565b61028261031c366004611c48565b610a87565b6101e961032f366004611cbf565b610c84565b610282610342366004611cf8565b610d26565b6101fd610355366004611cbf565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b6101fd600b5481565b610282610397366004611c2b565b610e13565b6102826103aa366004611cf8565b610f2f565b6102826103bd366004611d84565b610fcb565b6060600480548060200260200160405190810160405280929190818152602001828054801561041a57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116103fc575b5050505050905090565b60606002805461043390611dd0565b80601f016020809104026020016040519081016040528092919081815260200182805461045f90611dd0565b801561041a5780601f106104815761010080835404028352916020019161041a565b820191906000526020600020905b81548152906001019060200180831161048f57509395945050505050565b6000336104bb818585611077565b5060019392505050565b60006001600160a01b0383166105225760405162461bcd60e51b815260206004820181905260248201527f4552433737373a207472616e7366657220746f207a65726f206164647265737360448201526064015b60405180910390fd5b6001600160a01b0384166105835760405162461bcd60e51b815260206004820152602260248201527f4552433737373a207472616e736665722066726f6d207a65726f206164647265604482015261737360f01b6064820152608401610519565b60003390506105b481868686604051806020016040528060008152506040518060200160405280600081525061112e565b6105e0818686866040518060200160405280600081525060405180602001604052806000815250611264565b610634858261062f86604051806060016040528060298152602001612010602991396001600160a01b03808c166000908152600860209081526040808320938b16835292905220549190611386565b611077565b61066281868686604051806020016040528060008152506040518060200160405280600081525060006113c0565b506001949350505050565b6000803390506106c58182888888888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052506040805160208101909152818152935091506115949050565b7fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1681878787876040516106fc959493929190611e34565b60405180910390a1604051635260769b60e11b81526001600160a01b0387169063a4c0ed3690610736908490899089908990600401611e73565b600060405180830381600087803b15801561075057600080fd5b505af1158015610764573d6000803e3d6000fd5b5060019998505050505050505050565b61077e3388610c84565b61079a5760405162461bcd60e51b815260040161051990611ea5565b6108143388888888888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8c018190048102820181019092528a815292508a915089908190840183828082843760009201919091525060019250611594915050565b50505050505050565b336001600160a01b03821614156108825760405162461bcd60e51b8152602060048201526024808201527f4552433737373a20617574686f72697a696e672073656c66206173206f70657260448201526330ba37b960e11b6064820152608401610519565b6001600160a01b03811660009081526005602052604090205460ff16156108d3573360009081526007602090815260408083206001600160a01b03851684529091529020805460ff19169055610902565b3360009081526006602090815260408083206001600160a01b03851684529091529020805460ff191660011790555b60405133906001600160a01b038316907ff4caeb2d6ca8932a215a353d0703c326ec2d81fc68170f320eb2ab49e9df61f990600090a350565b60606003805461043390611dd0565b61099e3333868686868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525060408051602081019091529081529250600191506115949050565b50505050565b60006001600160a01b0383166109fc5760405162461bcd60e51b815260206004820181905260248201527f4552433737373a207472616e7366657220746f207a65726f20616464726573736044820152606401610519565b6000339050610a2d81828686604051806020016040528060008152506040518060200160405280600081525061112e565b610a59818286866040518060200160405280600081525060405180602001604052806000815250611264565b6104bb81828686604051806020016040528060008152506040518060200160405280600081525060006113c0565b42841015610acc5760405162461bcd60e51b815260206004820152601260248201527114da5919551bdad95b8e881156141254915160721b6044820152606401610519565b600b546001600160a01b0388166000908152600c6020526040812080549192610b949290917f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918c918c918c9188610b2383611efc565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810188905260e0016040516020818303038152906040528051906020012060405161190160f01b8152600281019290925260228201526042902090565b6040805160008082526020820180845284905260ff88169282019290925260608101869052608081018590529192509060019060a0016020604051602081039080840390855afa158015610bec573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590610c225750886001600160a01b0316816001600160a01b0316145b610c6e5760405162461bcd60e51b815260206004820152601c60248201527f53696465546f6b656e3a20494e56414c49445f5349474e4154555245000000006044820152606401610519565b610c79898989611077565b505050505050505050565b6000816001600160a01b0316836001600160a01b03161480610cef57506001600160a01b03831660009081526005602052604090205460ff168015610cef57506001600160a01b0380831660009081526007602090815260408083209387168352929052205460ff16155b80610d1f57506001600160a01b0380831660009081526006602090815260408083209387168352929052205460ff165b9392505050565b6009546001600160a01b0316336001600160a01b031614610d955760405162461bcd60e51b815260206004820152602360248201527f53696465546f6b656e3a2043616c6c6572206973206e6f7420746865206d696e6044820152623a32b960e91b6064820152608401610519565b610e0b33878787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b01819004810282018101909252898152925089915088908190840183828082843760009201919091525061166b92505050565b505050505050565b6001600160a01b038116331415610e765760405162461bcd60e51b815260206004820152602160248201527f4552433737373a207265766f6b696e672073656c66206173206f70657261746f6044820152603960f91b6064820152608401610519565b6001600160a01b03811660009081526005602052604090205460ff1615610eca573360009081526007602090815260408083206001600160a01b03851684529091529020805460ff19166001179055610ef6565b3360009081526006602090815260408083206001600160a01b03851684529091529020805460ff191690555b60405133906001600160a01b038316907f50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa190600090a350565b610f393387610c84565b610f555760405162461bcd60e51b815260040161051990611ea5565b610e0b33878787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b0181900481028201810190925289815292508991508890819084018382808284376000920191909152506117b992505050565b61101b33338585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516020810190915290815292506117b9915050565b505050565b8351602094850120835193850193909320604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f815295860194909452928401929092526060830152608082015260a0902090565b6001600160a01b0382166110cd5760405162461bcd60e51b815260206004820152601f60248201527f4552433737373a20617070726f766520746f207a65726f2061646472657373006044820152606401610519565b6001600160a01b0383811660008181526008602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60405163555ddc6560e11b81526001600160a01b03861660048201527f29ddb589b1fb5fc7cf394961c1adf5f8c6454761adf795e67fe149f658abe8956024820152600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b1580156111aa57600080fd5b505afa1580156111be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e29190611f17565b90506001600160a01b0381161561081457604051633ad5cbc160e11b81526001600160a01b038216906375ab978290611229908a908a908a908a908a908a90600401611f34565b600060405180830381600087803b15801561124357600080fd5b505af1158015611257573d6000803e3d6000fd5b5050505050505050505050565b6112a183604051806060016040528060278152602001611fe9602791396001600160a01b0388166000908152602081905260409020549190611386565b6001600160a01b0380871660009081526020819052604080822093909355908616815220546112d09084611914565b6001600160a01b0380861660008181526020819052604090819020939093559151878216918916907f06b541ddaa720db2b10a4d0cdac39b8d360425fc073085fac19bc826146779879061132990889088908890611f8e565b60405180910390a4836001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161137691815260200190565b60405180910390a3505050505050565b600081848411156113aa5760405162461bcd60e51b81526004016105199190611a4f565b5060006113b78486611fb9565b95945050505050565b60405163555ddc6560e11b81526001600160a01b03861660048201527fb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b6024820152600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b15801561143c57600080fd5b505afa158015611450573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114749190611f17565b90506001600160a01b038116156114f0576040516223de2960e01b81526001600160a01b038216906223de29906114b9908b908b908b908b908b908b90600401611f34565b600060405180830381600087803b1580156114d357600080fd5b505af11580156114e7573d6000803e3d6000fd5b5050505061158a565b811561158a576001600160a01b0386163b1561158a5760405162461bcd60e51b815260206004820152604d60248201527f4552433737373a20746f6b656e20726563697069656e7420636f6e747261637460448201527f20686173206e6f20696d706c656d656e74657220666f7220455243373737546f60648201526c1ad95b9cd49958da5c1a595b9d609a1b608482015260a401610519565b5050505050505050565b6001600160a01b0386166115ea5760405162461bcd60e51b815260206004820152601e60248201527f4552433737373a2073656e642066726f6d207a65726f206164647265737300006044820152606401610519565b6001600160a01b0385166116405760405162461bcd60e51b815260206004820152601c60248201527f4552433737373a2073656e6420746f207a65726f2061646472657373000000006044820152606401610519565b61164e87878787878761112e565b61165c878787878787611264565b610814878787878787876113c0565b6001600160a01b0384166116c15760405162461bcd60e51b815260206004820152601c60248201527f4552433737373a206d696e7420746f207a65726f2061646472657373000000006044820152606401610519565b6001546116ce9084611914565b6001556001600160a01b0384166000908152602081905260409020546116f49084611914565b6001600160a01b0385166000908152602081905260408120919091556117219086908686868660016113c0565b836001600160a01b0316856001600160a01b03167f2fe5be0146f74c5bce36c0b80911af6c7d86ff27e89d5cfa61fc681327954e5d85858560405161176893929190611f8e565b60405180910390a36040518381526001600160a01b038516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a35050505050565b6001600160a01b03841661180f5760405162461bcd60e51b815260206004820152601e60248201527f4552433737373a206275726e2066726f6d207a65726f206164647265737300006044820152606401610519565b61181e8585600086868661112e565b61185b83604051806060016040528060238152602001612039602391396001600160a01b0387166000908152602081905260409020549190611386565b6001600160a01b0385166000908152602081905260409020556001546118819084611973565b600181905550836001600160a01b0316856001600160a01b03167fa78a9be3a7b862d26933ad85fb11d80ef66b8f972d7cbba06621d583943a40988585856040516118ce93929190611f8e565b60405180910390a36040518381526000906001600160a01b038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016117aa565b6000806119218385611fd0565b905083811015610d1f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610519565b6000610d1f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611386565b6020808252825182820181905260009190848201906040850190845b818110156119f65783516001600160a01b0316835292840192918401916001016119d1565b50909695505050505050565b6000815180845260005b81811015611a2857602081850181015186830182015201611a0c565b81811115611a3a576000602083870101525b50601f01601f19169290920160200192915050565b602081526000610d1f6020830184611a02565b6001600160a01b0381168114611a7757600080fd5b50565b60008060408385031215611a8d57600080fd5b8235611a9881611a62565b946020939093013593505050565b600080600060608486031215611abb57600080fd5b8335611ac681611a62565b92506020840135611ad681611a62565b929592945050506040919091013590565b60008083601f840112611af957600080fd5b50813567ffffffffffffffff811115611b1157600080fd5b602083019150836020828501011115611b2957600080fd5b9250929050565b60008060008060608587031215611b4657600080fd5b8435611b5181611a62565b935060208501359250604085013567ffffffffffffffff811115611b7457600080fd5b611b8087828801611ae7565b95989497509550505050565b600080600080600080600060a0888a031215611ba757600080fd5b8735611bb281611a62565b96506020880135611bc281611a62565b955060408801359450606088013567ffffffffffffffff80821115611be657600080fd5b611bf28b838c01611ae7565b909650945060808a0135915080821115611c0b57600080fd5b50611c188a828b01611ae7565b989b979a50959850939692959293505050565b600060208284031215611c3d57600080fd5b8135610d1f81611a62565b600080600080600080600060e0888a031215611c6357600080fd5b8735611c6e81611a62565b96506020880135611c7e81611a62565b95506040880135945060608801359350608088013560ff81168114611ca257600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215611cd257600080fd5b8235611cdd81611a62565b91506020830135611ced81611a62565b809150509250929050565b60008060008060008060808789031215611d1157600080fd5b8635611d1c81611a62565b955060208701359450604087013567ffffffffffffffff80821115611d4057600080fd5b611d4c8a838b01611ae7565b90965094506060890135915080821115611d6557600080fd5b50611d7289828a01611ae7565b979a9699509497509295939492505050565b600080600060408486031215611d9957600080fd5b83359250602084013567ffffffffffffffff811115611db757600080fd5b611dc386828701611ae7565b9497909650939450505050565b600181811c90821680611de457607f821691505b60208210811415611e0557634e487b7160e01b600052602260045260246000fd5b50919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b0386811682528516602082015260408101849052608060608201819052600090611e689083018486611e0b565b979650505050505050565b60018060a01b0385168152836020820152606060408201526000611e9b606083018486611e0b565b9695505050505050565b60208082526021908201527f4552433737373a2063616c6c6572206973206e6f7420616e206f70657261746f6040820152603960f91b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b6000600019821415611f1057611f10611ee6565b5060010190565b600060208284031215611f2957600080fd5b8151610d1f81611a62565b6001600160a01b0387811682528681166020830152851660408201526060810184905260c060808201819052600090611f6f90830185611a02565b82810360a0840152611f818185611a02565b9998505050505050505050565b838152606060208201526000611fa76060830185611a02565b8281036040840152611e9b8185611a02565b600082821015611fcb57611fcb611ee6565b500390565b60008219821115611fe357611fe3611ee6565b50019056fe4552433737373a207472616e7366657220616d6f756e7420657863656564732062616c616e63654552433737373a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654552433737373a206275726e20616d6f756e7420657863656564732062616c616e6365a2646970667358221220d07cf24bc38047afdcc3c8d903ba34d15e81bcd0f38e12f84e15c87101aa436764736f6c63430008090033a2646970667358221220b32b8153fcd4189df904df49b98b5eab16be2d5867bd8abb9f6074ce91e7320c64736f6c63430008090033", + "deployedBytecode": "0x60806040523480156200001157600080fd5b5060043610620000465760003560e01c80632348238c146200004b57806326d9e9631462000064578063c6dbdf611462000097575b600080fd5b620000626200005c36600462000296565b620000a9565b005b6200007b6200007536600462000314565b620001a7565b6040516001600160a01b03909116815260200160405180910390f35b6000546001600160a01b03166200007b565b6000546001600160a01b0316336001600160a01b031614620000e85760405162461bcd60e51b8152600401620000df906200038f565b60405180910390fd5b6001600160a01b038116620001535760405162461bcd60e51b815260206004820152602a60248201527f5365636f6e646172793a206e6577207072696d61727920697320746865207a65604482015269726f206164647265737360b01b6064820152608401620000df565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f4101e71e974f68df5e9730cc223280b41654676bbb052cdcc735c3337e64d2d99060200160405180910390a150565b600080546001600160a01b0316336001600160a01b031614620001de5760405162461bcd60e51b8152600401620000df906200038f565b600086868686620001f76000546001600160a01b031690565b87604051620002069062000288565b620002179695949392919062000404565b604051809103906000f08015801562000234573d6000803e3d6000fd5b509050806001600160a01b03167ff57d2ded8330a4affd2fa52378069be534fe22288536537d1a1cfc061518450786868660405162000276939291906200044e565b60405180910390a29695505050505050565b6127b0806200047583390190565b600060208284031215620002a957600080fd5b81356001600160a01b0381168114620002c157600080fd5b9392505050565b60008083601f840112620002db57600080fd5b50813567ffffffffffffffff811115620002f457600080fd5b6020830191508360208285010111156200030d57600080fd5b9250929050565b6000806000806000606086880312156200032d57600080fd5b853567ffffffffffffffff808211156200034657600080fd5b6200035489838a01620002c8565b909750955060208801359150808211156200036e57600080fd5b506200037d88828901620002c8565b96999598509660400135949350505050565b6020808252602c908201527f5365636f6e646172793a2063616c6c6572206973206e6f74207468652070726960408201526b1b585c9e481858d8dbdd5b9d60a21b606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6080815260006200041a60808301888a620003db565b82810360208401526200042f818789620003db565b6001600160a01b03959095166040840152505060600152949350505050565b60408152600062000464604083018587620003db565b905082602083015294935050505056fe60806040523480156200001157600080fd5b50604051620027b0380380620027b08339810160408190526200003491620005ff565b60408051600081526020808201909252855186928692916200005d916002919086019062000434565b5081516200007390600390602085019062000434565b50805162000089906004906020840190620004c3565b5060005b600454811015620000fd5760016005600060048481548110620000b457620000b462000692565b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff191691151591909117905580620000f481620006a8565b9150506200008d565b506040516329965a1d60e01b815230600482018190527fac7fbab5f54a3ca8194167523c6753bfeb96a445279294b6125b68cce217705460248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad24906329965a1d90606401600060405180830381600087803b1580156200017857600080fd5b505af11580156200018d573d6000803e3d6000fd5b50506040516329965a1d60e01b815230600482018190527faea199e31a596269b42cdafd93407f14436db6e4cad65417994c2eb37381e05a60248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad2492506329965a1d9150606401600060405180830381600087803b1580156200020b57600080fd5b505af115801562000220573d6000803e3d6000fd5b50505050506001600160a01b038416151591506200028790505760405162461bcd60e51b815260206004820152601760248201527f53696465546f6b656e3a20456d707479204d696e74657200000000000000000060448201526064015b60405180910390fd5b6001811015620002da5760405162461bcd60e51b815260206004820152601a60248201527f53696465546f6b656e3a204772616e756c6172697479203c203100000000000060448201526064016200027e565b600980546001600160a01b0319166001600160a01b038416179055600a819055620003356200030862000343565b604051806040016040528060018152602001603160f81b8152504630620003dd60201b620010201760201c565b600b55506200070f92505050565b6060600280546200035490620006d2565b80601f01602080910402602001604051908101604052809291908181526020018280546200038290620006d2565b8015620003d35780601f10620003a757610100808354040283529160200191620003d3565b820191906000526020600020905b815481529060010190602001808311620003b557829003601f168201915b5050505050905090565b8351602094850120835193850193909320604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f815295860194909452928401929092526060830152608082015260a0902090565b8280546200044290620006d2565b90600052602060002090601f016020900481019282620004665760008555620004b1565b82601f106200048157805160ff1916838001178555620004b1565b82800160010185558215620004b1579182015b82811115620004b157825182559160200191906001019062000494565b50620004bf9291506200051b565b5090565b828054828255906000526020600020908101928215620004b1579160200282015b82811115620004b157825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620004e4565b5b80821115620004bf57600081556001016200051c565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200055a57600080fd5b81516001600160401b038082111562000577576200057762000532565b604051601f8301601f19908116603f01168101908282118183101715620005a257620005a262000532565b81604052838152602092508683858801011115620005bf57600080fd5b600091505b83821015620005e35785820183015181830184015290820190620005c4565b83821115620005f55760008385830101525b9695505050505050565b600080600080608085870312156200061657600080fd5b84516001600160401b03808211156200062e57600080fd5b6200063c8883890162000548565b955060208701519150808211156200065357600080fd5b50620006628782880162000548565b604087015190945090506001600160a01b03811681146200068257600080fd5b6060959095015193969295505050565b634e487b7160e01b600052603260045260246000fd5b6000600019821415620006cb57634e487b7160e01b600052601160045260246000fd5b5060010190565b600181811c90821680620006e757607f821691505b602082108114156200070957634e487b7160e01b600052602260045260246000fd5b50919050565b612091806200071f6000396000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c80637ecebe00116100de578063d95b637111610097578063f698da2511610071578063f698da2514610380578063fad8b32a14610389578063fc673c4f1461039c578063fe9d9303146103af57600080fd5b8063d95b637114610321578063dcdc7dd014610334578063dd62ed3e1461034757600080fd5b80637ecebe00146102ad578063959b8c3f146102cd57806395d89b41146102e05780639bd9bbc6146102e8578063a9059cbb146102fb578063d505accf1461030e57600080fd5b806330adf81f1161013057806330adf81f1461021e578063313ce567146102455780634000aea014610254578063556f0dc71461026757806362ad1b831461026f57806370a082311461028457600080fd5b806306e485381461017857806306fdde031461019657806307546172146101ab578063095ea7b3146101d657806318160ddd146101f957806323b872dd1461020b575b600080fd5b6101806103c2565b60405161018d91906119b5565b60405180910390f35b61019e610424565b60405161018d9190611a4f565b6009546101be906001600160a01b031681565b6040516001600160a01b03909116815260200161018d565b6101e96101e4366004611a7a565b6104ad565b604051901515815260200161018d565b6001545b60405190815260200161018d565b6101e9610219366004611aa6565b6104c5565b6101fd7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b6040516012815260200161018d565b6101e9610262366004611b30565b61066d565b600a546101fd565b61028261027d366004611b8c565b610774565b005b6101fd610292366004611c2b565b6001600160a01b031660009081526020819052604090205490565b6101fd6102bb366004611c2b565b600c6020526000908152604090205481565b6102826102db366004611c2b565b61081d565b61019e61093b565b6102826102f6366004611b30565b61094a565b6101e9610309366004611a7a565b6109a4565b61028261031c366004611c48565b610a87565b6101e961032f366004611cbf565b610c84565b610282610342366004611cf8565b610d26565b6101fd610355366004611cbf565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b6101fd600b5481565b610282610397366004611c2b565b610e13565b6102826103aa366004611cf8565b610f2f565b6102826103bd366004611d84565b610fcb565b6060600480548060200260200160405190810160405280929190818152602001828054801561041a57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116103fc575b5050505050905090565b60606002805461043390611dd0565b80601f016020809104026020016040519081016040528092919081815260200182805461045f90611dd0565b801561041a5780601f106104815761010080835404028352916020019161041a565b820191906000526020600020905b81548152906001019060200180831161048f57509395945050505050565b6000336104bb818585611077565b5060019392505050565b60006001600160a01b0383166105225760405162461bcd60e51b815260206004820181905260248201527f4552433737373a207472616e7366657220746f207a65726f206164647265737360448201526064015b60405180910390fd5b6001600160a01b0384166105835760405162461bcd60e51b815260206004820152602260248201527f4552433737373a207472616e736665722066726f6d207a65726f206164647265604482015261737360f01b6064820152608401610519565b60003390506105b481868686604051806020016040528060008152506040518060200160405280600081525061112e565b6105e0818686866040518060200160405280600081525060405180602001604052806000815250611264565b610634858261062f86604051806060016040528060298152602001612010602991396001600160a01b03808c166000908152600860209081526040808320938b16835292905220549190611386565b611077565b61066281868686604051806020016040528060008152506040518060200160405280600081525060006113c0565b506001949350505050565b6000803390506106c58182888888888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052506040805160208101909152818152935091506115949050565b7fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1681878787876040516106fc959493929190611e34565b60405180910390a1604051635260769b60e11b81526001600160a01b0387169063a4c0ed3690610736908490899089908990600401611e73565b600060405180830381600087803b15801561075057600080fd5b505af1158015610764573d6000803e3d6000fd5b5060019998505050505050505050565b61077e3388610c84565b61079a5760405162461bcd60e51b815260040161051990611ea5565b6108143388888888888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8c018190048102820181019092528a815292508a915089908190840183828082843760009201919091525060019250611594915050565b50505050505050565b336001600160a01b03821614156108825760405162461bcd60e51b8152602060048201526024808201527f4552433737373a20617574686f72697a696e672073656c66206173206f70657260448201526330ba37b960e11b6064820152608401610519565b6001600160a01b03811660009081526005602052604090205460ff16156108d3573360009081526007602090815260408083206001600160a01b03851684529091529020805460ff19169055610902565b3360009081526006602090815260408083206001600160a01b03851684529091529020805460ff191660011790555b60405133906001600160a01b038316907ff4caeb2d6ca8932a215a353d0703c326ec2d81fc68170f320eb2ab49e9df61f990600090a350565b60606003805461043390611dd0565b61099e3333868686868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525060408051602081019091529081529250600191506115949050565b50505050565b60006001600160a01b0383166109fc5760405162461bcd60e51b815260206004820181905260248201527f4552433737373a207472616e7366657220746f207a65726f20616464726573736044820152606401610519565b6000339050610a2d81828686604051806020016040528060008152506040518060200160405280600081525061112e565b610a59818286866040518060200160405280600081525060405180602001604052806000815250611264565b6104bb81828686604051806020016040528060008152506040518060200160405280600081525060006113c0565b42841015610acc5760405162461bcd60e51b815260206004820152601260248201527114da5919551bdad95b8e881156141254915160721b6044820152606401610519565b600b546001600160a01b0388166000908152600c6020526040812080549192610b949290917f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918c918c918c9188610b2383611efc565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810188905260e0016040516020818303038152906040528051906020012060405161190160f01b8152600281019290925260228201526042902090565b6040805160008082526020820180845284905260ff88169282019290925260608101869052608081018590529192509060019060a0016020604051602081039080840390855afa158015610bec573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590610c225750886001600160a01b0316816001600160a01b0316145b610c6e5760405162461bcd60e51b815260206004820152601c60248201527f53696465546f6b656e3a20494e56414c49445f5349474e4154555245000000006044820152606401610519565b610c79898989611077565b505050505050505050565b6000816001600160a01b0316836001600160a01b03161480610cef57506001600160a01b03831660009081526005602052604090205460ff168015610cef57506001600160a01b0380831660009081526007602090815260408083209387168352929052205460ff16155b80610d1f57506001600160a01b0380831660009081526006602090815260408083209387168352929052205460ff165b9392505050565b6009546001600160a01b0316336001600160a01b031614610d955760405162461bcd60e51b815260206004820152602360248201527f53696465546f6b656e3a2043616c6c6572206973206e6f7420746865206d696e6044820152623a32b960e91b6064820152608401610519565b610e0b33878787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b01819004810282018101909252898152925089915088908190840183828082843760009201919091525061166b92505050565b505050505050565b6001600160a01b038116331415610e765760405162461bcd60e51b815260206004820152602160248201527f4552433737373a207265766f6b696e672073656c66206173206f70657261746f6044820152603960f91b6064820152608401610519565b6001600160a01b03811660009081526005602052604090205460ff1615610eca573360009081526007602090815260408083206001600160a01b03851684529091529020805460ff19166001179055610ef6565b3360009081526006602090815260408083206001600160a01b03851684529091529020805460ff191690555b60405133906001600160a01b038316907f50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa190600090a350565b610f393387610c84565b610f555760405162461bcd60e51b815260040161051990611ea5565b610e0b33878787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b0181900481028201810190925289815292508991508890819084018382808284376000920191909152506117b992505050565b61101b33338585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516020810190915290815292506117b9915050565b505050565b8351602094850120835193850193909320604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f815295860194909452928401929092526060830152608082015260a0902090565b6001600160a01b0382166110cd5760405162461bcd60e51b815260206004820152601f60248201527f4552433737373a20617070726f766520746f207a65726f2061646472657373006044820152606401610519565b6001600160a01b0383811660008181526008602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60405163555ddc6560e11b81526001600160a01b03861660048201527f29ddb589b1fb5fc7cf394961c1adf5f8c6454761adf795e67fe149f658abe8956024820152600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b1580156111aa57600080fd5b505afa1580156111be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e29190611f17565b90506001600160a01b0381161561081457604051633ad5cbc160e11b81526001600160a01b038216906375ab978290611229908a908a908a908a908a908a90600401611f34565b600060405180830381600087803b15801561124357600080fd5b505af1158015611257573d6000803e3d6000fd5b5050505050505050505050565b6112a183604051806060016040528060278152602001611fe9602791396001600160a01b0388166000908152602081905260409020549190611386565b6001600160a01b0380871660009081526020819052604080822093909355908616815220546112d09084611914565b6001600160a01b0380861660008181526020819052604090819020939093559151878216918916907f06b541ddaa720db2b10a4d0cdac39b8d360425fc073085fac19bc826146779879061132990889088908890611f8e565b60405180910390a4836001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161137691815260200190565b60405180910390a3505050505050565b600081848411156113aa5760405162461bcd60e51b81526004016105199190611a4f565b5060006113b78486611fb9565b95945050505050565b60405163555ddc6560e11b81526001600160a01b03861660048201527fb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b6024820152600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b15801561143c57600080fd5b505afa158015611450573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114749190611f17565b90506001600160a01b038116156114f0576040516223de2960e01b81526001600160a01b038216906223de29906114b9908b908b908b908b908b908b90600401611f34565b600060405180830381600087803b1580156114d357600080fd5b505af11580156114e7573d6000803e3d6000fd5b5050505061158a565b811561158a576001600160a01b0386163b1561158a5760405162461bcd60e51b815260206004820152604d60248201527f4552433737373a20746f6b656e20726563697069656e7420636f6e747261637460448201527f20686173206e6f20696d706c656d656e74657220666f7220455243373737546f60648201526c1ad95b9cd49958da5c1a595b9d609a1b608482015260a401610519565b5050505050505050565b6001600160a01b0386166115ea5760405162461bcd60e51b815260206004820152601e60248201527f4552433737373a2073656e642066726f6d207a65726f206164647265737300006044820152606401610519565b6001600160a01b0385166116405760405162461bcd60e51b815260206004820152601c60248201527f4552433737373a2073656e6420746f207a65726f2061646472657373000000006044820152606401610519565b61164e87878787878761112e565b61165c878787878787611264565b610814878787878787876113c0565b6001600160a01b0384166116c15760405162461bcd60e51b815260206004820152601c60248201527f4552433737373a206d696e7420746f207a65726f2061646472657373000000006044820152606401610519565b6001546116ce9084611914565b6001556001600160a01b0384166000908152602081905260409020546116f49084611914565b6001600160a01b0385166000908152602081905260408120919091556117219086908686868660016113c0565b836001600160a01b0316856001600160a01b03167f2fe5be0146f74c5bce36c0b80911af6c7d86ff27e89d5cfa61fc681327954e5d85858560405161176893929190611f8e565b60405180910390a36040518381526001600160a01b038516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a35050505050565b6001600160a01b03841661180f5760405162461bcd60e51b815260206004820152601e60248201527f4552433737373a206275726e2066726f6d207a65726f206164647265737300006044820152606401610519565b61181e8585600086868661112e565b61185b83604051806060016040528060238152602001612039602391396001600160a01b0387166000908152602081905260409020549190611386565b6001600160a01b0385166000908152602081905260409020556001546118819084611973565b600181905550836001600160a01b0316856001600160a01b03167fa78a9be3a7b862d26933ad85fb11d80ef66b8f972d7cbba06621d583943a40988585856040516118ce93929190611f8e565b60405180910390a36040518381526000906001600160a01b038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016117aa565b6000806119218385611fd0565b905083811015610d1f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610519565b6000610d1f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611386565b6020808252825182820181905260009190848201906040850190845b818110156119f65783516001600160a01b0316835292840192918401916001016119d1565b50909695505050505050565b6000815180845260005b81811015611a2857602081850181015186830182015201611a0c565b81811115611a3a576000602083870101525b50601f01601f19169290920160200192915050565b602081526000610d1f6020830184611a02565b6001600160a01b0381168114611a7757600080fd5b50565b60008060408385031215611a8d57600080fd5b8235611a9881611a62565b946020939093013593505050565b600080600060608486031215611abb57600080fd5b8335611ac681611a62565b92506020840135611ad681611a62565b929592945050506040919091013590565b60008083601f840112611af957600080fd5b50813567ffffffffffffffff811115611b1157600080fd5b602083019150836020828501011115611b2957600080fd5b9250929050565b60008060008060608587031215611b4657600080fd5b8435611b5181611a62565b935060208501359250604085013567ffffffffffffffff811115611b7457600080fd5b611b8087828801611ae7565b95989497509550505050565b600080600080600080600060a0888a031215611ba757600080fd5b8735611bb281611a62565b96506020880135611bc281611a62565b955060408801359450606088013567ffffffffffffffff80821115611be657600080fd5b611bf28b838c01611ae7565b909650945060808a0135915080821115611c0b57600080fd5b50611c188a828b01611ae7565b989b979a50959850939692959293505050565b600060208284031215611c3d57600080fd5b8135610d1f81611a62565b600080600080600080600060e0888a031215611c6357600080fd5b8735611c6e81611a62565b96506020880135611c7e81611a62565b95506040880135945060608801359350608088013560ff81168114611ca257600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215611cd257600080fd5b8235611cdd81611a62565b91506020830135611ced81611a62565b809150509250929050565b60008060008060008060808789031215611d1157600080fd5b8635611d1c81611a62565b955060208701359450604087013567ffffffffffffffff80821115611d4057600080fd5b611d4c8a838b01611ae7565b90965094506060890135915080821115611d6557600080fd5b50611d7289828a01611ae7565b979a9699509497509295939492505050565b600080600060408486031215611d9957600080fd5b83359250602084013567ffffffffffffffff811115611db757600080fd5b611dc386828701611ae7565b9497909650939450505050565b600181811c90821680611de457607f821691505b60208210811415611e0557634e487b7160e01b600052602260045260246000fd5b50919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b0386811682528516602082015260408101849052608060608201819052600090611e689083018486611e0b565b979650505050505050565b60018060a01b0385168152836020820152606060408201526000611e9b606083018486611e0b565b9695505050505050565b60208082526021908201527f4552433737373a2063616c6c6572206973206e6f7420616e206f70657261746f6040820152603960f91b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b6000600019821415611f1057611f10611ee6565b5060010190565b600060208284031215611f2957600080fd5b8151610d1f81611a62565b6001600160a01b0387811682528681166020830152851660408201526060810184905260c060808201819052600090611f6f90830185611a02565b82810360a0840152611f818185611a02565b9998505050505050505050565b838152606060208201526000611fa76060830185611a02565b8281036040840152611e9b8185611a02565b600082821015611fcb57611fcb611ee6565b500390565b60008219821115611fe357611fe3611ee6565b50019056fe4552433737373a207472616e7366657220616d6f756e7420657863656564732062616c616e63654552433737373a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654552433737373a206275726e20616d6f756e7420657863656564732062616c616e6365a2646970667358221220d07cf24bc38047afdcc3c8d903ba34d15e81bcd0f38e12f84e15c87101aa436764736f6c63430008090033a2646970667358221220b32b8153fcd4189df904df49b98b5eab16be2d5867bd8abb9f6074ce91e7320c64736f6c63430008090033", + "devdoc": { + "kind": "dev", + "methods": { + "primary()": { + "returns": { + "_0": "the address of the primary." + } + }, + "transferPrimary(address)": { + "details": "Transfers contract to a new primary.", + "params": { + "recipient": "The address of new primary." + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 5709, + "contract": "contracts/SideTokenFactory/SideTokenFactory.sol:SideTokenFactory", + "label": "_primary", + "offset": 0, + "slot": "0", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + } + } + } +} \ No newline at end of file diff --git a/bridge/deployments/goerli/WRBTC.json b/bridge/deployments/goerli/WRBTC.json new file mode 100644 index 000000000..11f97276b --- /dev/null +++ b/bridge/deployments/goerli/WRBTC.json @@ -0,0 +1,401 @@ +{ + "address": "0x64D3251296DF05bD3Cb42D910b113F7EdAc08610", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "guy", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "wad", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "wad", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "wad", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "wad", + "type": "uint256" + } + ], + "name": "Withdrawal", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guy", + "type": "address" + }, + { + "internalType": "uint256", + "name": "wad", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "deposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "wad", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "wad", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "wad", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xe4ddab85bb13bdce48099a09856acaefe205b0cad01009297e86f8a6141071d1", + "receipt": { + "to": null, + "from": "0xa554d96413FF72E93437C4072438302C38350EE3", + "contractAddress": "0x64D3251296DF05bD3Cb42D910b113F7EdAc08610", + "transactionIndex": 1, + "gasUsed": "623235", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x466f28d088c604153c03b2db5335852083dfdf951c75663bbacd5a7155c3b7d0", + "transactionHash": "0xe4ddab85bb13bdce48099a09856acaefe205b0cad01009297e86f8a6141071d1", + "logs": [], + "blockNumber": 7664918, + "cumulativeGasUsed": "691247", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "caeb40de80c8668828546c6b3fb7fad2", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"guy\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"guy\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"wad\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/test/WRBTC.sol\":\"WRBTC\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/interface/IWrapped.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\npragma abicoder v2;\\ninterface IWrapped {\\n function balanceOf(address) external returns(uint);\\n\\n function deposit() external payable;\\n\\n function withdraw(uint wad) external;\\n\\n function totalSupply() external view returns (uint);\\n\\n function approve(address guy, uint wad) external returns (bool);\\n\\n function transfer(address dst, uint wad) external returns (bool);\\n\\n function transferFrom(address src, address dst, uint wad)\\n external\\n returns (bool);\\n}\",\"keccak256\":\"0xea9894370181d2b7a43d973e033d1ceb8d8d229fed2b775d267ca23b58836e7f\",\"license\":\"MIT\"},\"contracts/test/WRBTC.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../interface/IWrapped.sol\\\";\\n\\ncontract WRBTC is IWrapped {\\n string public name = \\\"Wrapped RBTC\\\";\\n string public symbol = \\\"WRBTC\\\";\\n uint8 public decimals = 18;\\n\\n event Approval(address indexed src, address indexed guy, uint wad);\\n event Transfer(address indexed src, address indexed dst, uint wad);\\n event Deposit(address indexed dst, uint wad);\\n event Withdrawal(address indexed src, uint wad);\\n\\n mapping (address => uint) override public balanceOf;\\n mapping (address => mapping (address => uint)) public allowance;\\n\\n receive () external payable {\\n deposit();\\n }\\n function deposit() override public payable {\\n balanceOf[msg.sender] += msg.value;\\n emit Deposit(msg.sender, msg.value);\\n }\\n function withdraw(uint wad) override public {\\n require(balanceOf[msg.sender] >= wad, \\\"WRBTC: Balance less than wad\\\");\\n balanceOf[msg.sender] -= wad;\\n (bool success, ) = msg.sender.call{value:wad, gas:23000}(\\\"\\\");\\n require(success, \\\"WRBTC: transfer fail\\\");\\n emit Withdrawal(msg.sender, wad);\\n }\\n\\n function totalSupply() override public view returns (uint) {\\n return address(this).balance;\\n }\\n\\n function approve(address guy, uint wad) override public returns (bool) {\\n allowance[msg.sender][guy] = wad;\\n emit Approval(msg.sender, guy, wad);\\n return true;\\n }\\n\\n function transfer(address dst, uint wad) override public returns (bool) {\\n return transferFrom(msg.sender, dst, wad);\\n }\\n\\n function transferFrom(address src, address dst, uint wad)\\n override public\\n returns (bool)\\n {\\n require(balanceOf[src] >= wad, \\\"WRBTC: Balance less than wad\\\");\\n\\n if (src != msg.sender && allowance[src][msg.sender] != type(uint).max) {\\n require(allowance[src][msg.sender] >= wad, \\\"WRBTC: Allowance less than wad\\\");\\n allowance[src][msg.sender] -= wad;\\n }\\n\\n balanceOf[src] -= wad;\\n balanceOf[dst] += wad;\\n\\n emit Transfer(src, dst, wad);\\n\\n return true;\\n }\\n}\",\"keccak256\":\"0xda8ebc12d9e4ac105425a4a80001d057daad0fdcf9bda4fd7139c93d1704f868\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60c0604052600c60808190526b57726170706564205242544360a01b60a090815261002d916000919061007a565b5060408051808201909152600580825264575242544360d81b602090920191825261005a9160019161007a565b506002805460ff1916601217905534801561007457600080fd5b5061014e565b82805461008690610113565b90600052602060002090601f0160209004810192826100a857600085556100ee565b82601f106100c157805160ff19168380011785556100ee565b828001600101855582156100ee579182015b828111156100ee5782518255916020019190600101906100d3565b506100fa9291506100fe565b5090565b5b808211156100fa57600081556001016100ff565b600181811c9082168061012757607f821691505b6020821081141561014857634e487b7160e01b600052602260045260246000fd5b50919050565b6109038061015d6000396000f3fe6080604052600436106100a05760003560e01c8063313ce56711610064578063313ce5671461016c57806370a082311461019857806395d89b41146101c5578063a9059cbb146101da578063d0e30db0146101fa578063dd62ed3e1461020257600080fd5b806306fdde03146100b4578063095ea7b3146100df57806318160ddd1461010f57806323b872dd1461012c5780632e1a7d4d1461014c57600080fd5b366100af576100ad61023a565b005b600080fd5b3480156100c057600080fd5b506100c9610295565b6040516100d6919061070f565b60405180910390f35b3480156100eb57600080fd5b506100ff6100fa366004610780565b610323565b60405190151581526020016100d6565b34801561011b57600080fd5b50475b6040519081526020016100d6565b34801561013857600080fd5b506100ff6101473660046107aa565b61038f565b34801561015857600080fd5b506100ad6101673660046107e6565b61059e565b34801561017857600080fd5b506002546101869060ff1681565b60405160ff90911681526020016100d6565b3480156101a457600080fd5b5061011e6101b33660046107ff565b60036020526000908152604090205481565b3480156101d157600080fd5b506100c96106ee565b3480156101e657600080fd5b506100ff6101f5366004610780565b6106fb565b6100ad61023a565b34801561020e57600080fd5b5061011e61021d36600461081a565b600460209081526000928352604080842090915290825290205481565b3360009081526003602052604081208054349290610259908490610863565b909155505060405134815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a2565b600080546102a29061087b565b80601f01602080910402602001604051908101604052809291908181526020018280546102ce9061087b565b801561031b5780601f106102f05761010080835404028352916020019161031b565b820191906000526020600020905b8154815290600101906020018083116102fe57829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061037e9086815260200190565b60405180910390a350600192915050565b6001600160a01b0383166000908152600360205260408120548211156103fc5760405162461bcd60e51b815260206004820152601c60248201527f57524254433a2042616c616e6365206c657373207468616e207761640000000060448201526064015b60405180910390fd5b6001600160a01b038416331480159061043a57506001600160a01b038416600090815260046020908152604080832033845290915290205460001914155b156104eb576001600160a01b03841660009081526004602090815260408083203384529091529020548211156104b25760405162461bcd60e51b815260206004820152601e60248201527f57524254433a20416c6c6f77616e6365206c657373207468616e20776164000060448201526064016103f3565b6001600160a01b0384166000908152600460209081526040808320338452909152812080548492906104e59084906108b6565b90915550505b6001600160a01b038416600090815260036020526040812080548492906105139084906108b6565b90915550506001600160a01b03831660009081526003602052604081208054849290610540908490610863565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161058c91815260200190565b60405180910390a35060019392505050565b336000908152600360205260409020548111156105fd5760405162461bcd60e51b815260206004820152601c60248201527f57524254433a2042616c616e6365206c657373207468616e207761640000000060448201526064016103f3565b336000908152600360205260408120805483929061061c9084906108b6565b909155505060405160009033906159d890849084818181858888f193505050503d8060008114610668576040519150601f19603f3d011682016040523d82523d6000602084013e61066d565b606091505b50509050806106b55760405162461bcd60e51b815260206004820152601460248201527315d4909510ce881d1c985b9cd9995c8819985a5b60621b60448201526064016103f3565b60405182815233907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a25050565b600180546102a29061087b565b600061070833848461038f565b9392505050565b600060208083528351808285015260005b8181101561073c57858101830151858201604001528201610720565b8181111561074e576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461077b57600080fd5b919050565b6000806040838503121561079357600080fd5b61079c83610764565b946020939093013593505050565b6000806000606084860312156107bf57600080fd5b6107c884610764565b92506107d660208501610764565b9150604084013590509250925092565b6000602082840312156107f857600080fd5b5035919050565b60006020828403121561081157600080fd5b61070882610764565b6000806040838503121561082d57600080fd5b61083683610764565b915061084460208401610764565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b600082198211156108765761087661084d565b500190565b600181811c9082168061088f57607f821691505b602082108114156108b057634e487b7160e01b600052602260045260246000fd5b50919050565b6000828210156108c8576108c861084d565b50039056fea264697066735822122095f1e47b3d11cf2ecf8b2ba554dce34c0a14ba6fa3d4baa56bd97cb235a8fa0b64736f6c63430008090033", + "deployedBytecode": "0x6080604052600436106100a05760003560e01c8063313ce56711610064578063313ce5671461016c57806370a082311461019857806395d89b41146101c5578063a9059cbb146101da578063d0e30db0146101fa578063dd62ed3e1461020257600080fd5b806306fdde03146100b4578063095ea7b3146100df57806318160ddd1461010f57806323b872dd1461012c5780632e1a7d4d1461014c57600080fd5b366100af576100ad61023a565b005b600080fd5b3480156100c057600080fd5b506100c9610295565b6040516100d6919061070f565b60405180910390f35b3480156100eb57600080fd5b506100ff6100fa366004610780565b610323565b60405190151581526020016100d6565b34801561011b57600080fd5b50475b6040519081526020016100d6565b34801561013857600080fd5b506100ff6101473660046107aa565b61038f565b34801561015857600080fd5b506100ad6101673660046107e6565b61059e565b34801561017857600080fd5b506002546101869060ff1681565b60405160ff90911681526020016100d6565b3480156101a457600080fd5b5061011e6101b33660046107ff565b60036020526000908152604090205481565b3480156101d157600080fd5b506100c96106ee565b3480156101e657600080fd5b506100ff6101f5366004610780565b6106fb565b6100ad61023a565b34801561020e57600080fd5b5061011e61021d36600461081a565b600460209081526000928352604080842090915290825290205481565b3360009081526003602052604081208054349290610259908490610863565b909155505060405134815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a2565b600080546102a29061087b565b80601f01602080910402602001604051908101604052809291908181526020018280546102ce9061087b565b801561031b5780601f106102f05761010080835404028352916020019161031b565b820191906000526020600020905b8154815290600101906020018083116102fe57829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061037e9086815260200190565b60405180910390a350600192915050565b6001600160a01b0383166000908152600360205260408120548211156103fc5760405162461bcd60e51b815260206004820152601c60248201527f57524254433a2042616c616e6365206c657373207468616e207761640000000060448201526064015b60405180910390fd5b6001600160a01b038416331480159061043a57506001600160a01b038416600090815260046020908152604080832033845290915290205460001914155b156104eb576001600160a01b03841660009081526004602090815260408083203384529091529020548211156104b25760405162461bcd60e51b815260206004820152601e60248201527f57524254433a20416c6c6f77616e6365206c657373207468616e20776164000060448201526064016103f3565b6001600160a01b0384166000908152600460209081526040808320338452909152812080548492906104e59084906108b6565b90915550505b6001600160a01b038416600090815260036020526040812080548492906105139084906108b6565b90915550506001600160a01b03831660009081526003602052604081208054849290610540908490610863565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161058c91815260200190565b60405180910390a35060019392505050565b336000908152600360205260409020548111156105fd5760405162461bcd60e51b815260206004820152601c60248201527f57524254433a2042616c616e6365206c657373207468616e207761640000000060448201526064016103f3565b336000908152600360205260408120805483929061061c9084906108b6565b909155505060405160009033906159d890849084818181858888f193505050503d8060008114610668576040519150601f19603f3d011682016040523d82523d6000602084013e61066d565b606091505b50509050806106b55760405162461bcd60e51b815260206004820152601460248201527315d4909510ce881d1c985b9cd9995c8819985a5b60621b60448201526064016103f3565b60405182815233907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a25050565b600180546102a29061087b565b600061070833848461038f565b9392505050565b600060208083528351808285015260005b8181101561073c57858101830151858201604001528201610720565b8181111561074e576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461077b57600080fd5b919050565b6000806040838503121561079357600080fd5b61079c83610764565b946020939093013593505050565b6000806000606084860312156107bf57600080fd5b6107c884610764565b92506107d660208501610764565b9150604084013590509250925092565b6000602082840312156107f857600080fd5b5035919050565b60006020828403121561081157600080fd5b61070882610764565b6000806040838503121561082d57600080fd5b61083683610764565b915061084460208401610764565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b600082198211156108765761087661084d565b500190565b600181811c9082168061088f57607f821691505b602082108114156108b057634e487b7160e01b600052602260045260246000fd5b50919050565b6000828210156108c8576108c861084d565b50039056fea264697066735822122095f1e47b3d11cf2ecf8b2ba554dce34c0a14ba6fa3d4baa56bd97cb235a8fa0b64736f6c63430008090033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 9228, + "contract": "contracts/test/WRBTC.sol:WRBTC", + "label": "name", + "offset": 0, + "slot": "0", + "type": "t_string_storage" + }, + { + "astId": 9231, + "contract": "contracts/test/WRBTC.sol:WRBTC", + "label": "symbol", + "offset": 0, + "slot": "1", + "type": "t_string_storage" + }, + { + "astId": 9234, + "contract": "contracts/test/WRBTC.sol:WRBTC", + "label": "decimals", + "offset": 0, + "slot": "2", + "type": "t_uint8" + }, + { + "astId": 9267, + "contract": "contracts/test/WRBTC.sol:WRBTC", + "label": "balanceOf", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 9273, + "contract": "contracts/test/WRBTC.sol:WRBTC", + "label": "allowance", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/bridge/deployments/goerli/solcInputs/b0b92d5309f21b72c82ad032fd7538bd.json b/bridge/deployments/goerli/solcInputs/b0b92d5309f21b72c82ad032fd7538bd.json new file mode 100644 index 000000000..032577462 --- /dev/null +++ b/bridge/deployments/goerli/solcInputs/b0b92d5309f21b72c82ad032fd7538bd.json @@ -0,0 +1,144 @@ +{ + "language": "Solidity", + "sources": { + "contracts/Bridge/Bridge.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n// import \"hardhat/console.sol\";\n// Import base Initializable contract\nimport \"../zeppelin/upgradable/Initializable.sol\";\n// Import interface and library from OpenZeppelin contracts\nimport \"../zeppelin/upgradable/utils/ReentrancyGuard.sol\";\nimport \"../zeppelin/upgradable/lifecycle/UpgradablePausable.sol\";\nimport \"../zeppelin/upgradable/ownership/UpgradableOwnable.sol\";\n\nimport \"../zeppelin/introspection/IERC1820Registry.sol\";\nimport \"../zeppelin/token/ERC777/IERC777Recipient.sol\";\nimport \"../zeppelin/token/ERC20/IERC20.sol\";\nimport \"../zeppelin/token/ERC20/SafeERC20.sol\";\nimport \"../zeppelin/utils/Address.sol\";\nimport \"../zeppelin/math/SafeMath.sol\";\nimport \"../zeppelin/token/ERC777/IERC777.sol\";\n\nimport \"../lib/LibEIP712.sol\";\nimport \"../lib/LibUtils.sol\";\n\nimport \"../interface/IBridge.sol\";\nimport \"../interface/ISideToken.sol\";\nimport \"../interface/ISideTokenFactory.sol\";\nimport \"../interface/IAllowTokens.sol\";\nimport \"../interface/IWrapped.sol\";\n\n// solhint-disable-next-line max-states-count\ncontract Bridge is Initializable, IBridge, IERC777Recipient, UpgradablePausable, UpgradableOwnable, ReentrancyGuard {\n\tusing SafeMath for uint256;\n\tusing SafeERC20 for IERC20;\n\tusing Address for address;\n\n\taddress constant internal NULL_ADDRESS = address(0);\n\tbytes32 constant internal NULL_HASH = bytes32(0);\n\tIERC1820Registry constant internal ERC1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);\n\n\taddress internal federation;\n\tuint256 internal feePercentage;\n\tstring public deprecatedSymbolPrefix;\n\t// domainSeparator replaces uint256 internal _depprecatedLastDay;\n\tbytes32 public domainSeparator;\n\tuint256 internal _deprecatedSpentToday;\n\n\tmapping (address => address) public deprecatedMappedTokens; // OriginalToken => SideToken\n\tmapping (address => address) public deprecatedOriginalTokens; // SideToken => OriginalToken\n\tmapping (address => bool) public deprecatedKnownTokens; // OriginalToken => true\n\n\t// claimed can use the same of bytes32\n\tmapping (bytes32 => bool) public claimed; // transactionDataHash => true // previously named processed\n\n\tIAllowTokens public allowTokens;\n\tISideTokenFactory public sideTokenFactory;\n\t//Bridge_v1 variables\n\tbool public isUpgrading;\n\t// Percentage with up to 2 decimals\n\tuint256 constant public feePercentageDivider = 10000; // solhint-disable-line const-name-snakecase\n\t//Bridge_v2 variables\n\tbytes32 constant internal _erc777Interface = keccak256(\"ERC777Token\"); // solhint-disable-line const-name-snakecase\n\tIWrapped public wrappedCurrency;\n\tmapping (bytes32 => bytes32) public transactionsDataHashes; // transactionHash => transactionDataHash\n\tmapping (bytes32 => address) public originalTokenAddresses; // transactionHash => originalTokenAddress\n\tmapping (bytes32 => address) public senderAddresses; // transactionHash => senderAddress\n\n\t// keccak256(\"Claim(address to,uint256 amount,bytes32 transactionHash,uint256 originChainId,address relayer,uint256 fee,uint256 nonce,uint256 deadline)\");\n\tbytes32 public constant CLAIM_TYPEHASH = 0xaf3ac34fea9cc1b1def33a9bdc482d988feb61b5015ae4a55e2a62bb3600d54c;\n\tmapping(address => uint) public nonces;\n\n\t//Bridge_v3 variables multichain\n\tmapping (uint256 => mapping(address => address)) public sideTokenByOriginalTokenByChain; // chainId => OriginalToken Address => SideToken Address\n\tmapping (address => OriginalToken) public originalTokenBySideToken; // SideTokenAddress => struct {}\n\tmapping (uint256 => mapping(address => bool)) public knownTokenByChain; // chainId => OriginalToken Address => Know\n\n\tevent AllowTokensChanged(address _newAllowTokens);\n\tevent FederationChanged(address _newFederation);\n\tevent SideTokenFactoryChanged(address _newSideTokenFactory);\n\tevent Upgrading(bool _isUpgrading);\n\tevent WrappedCurrencyChanged(address _wrappedCurrency);\n\n\tfunction initialize(\n\t\taddress _manager,\n\t\taddress _federation,\n\t\taddress _allowTokens,\n\t\taddress _sideTokenFactory\n\t) public initializer {\n\t\tUpgradableOwnable.initialize(_manager);\n\t\tUpgradablePausable.__Pausable_init(_manager);\n\t\tallowTokens = IAllowTokens(_allowTokens);\n\t\tsideTokenFactory = ISideTokenFactory(_sideTokenFactory);\n\t\tfederation = _federation;\n\t\t//keccak256(\"ERC777TokensRecipient\")\n\t\tERC1820.setInterfaceImplementer(address(this), 0xb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b, address(this));\n\t\tinitDomainSeparator();\n\t}\n\n\treceive () external payable {\n\t\t// The fallback function is needed to use WRBTC\n\t\trequire(_msgSender() == address(wrappedCurrency), \"Bridge: not wrappedCurrency\");\n\t}\n\n\tfunction version() override external pure returns (string memory) {\n\t\treturn \"v4\";\n\t}\n\n\tfunction initDomainSeparator() public {\n\t\tdomainSeparator = LibEIP712.hashEIP712Domain(\n\t\t\t\"RSK Token Bridge\",\n\t\t\t\"1\",\n\t\t\tblock.chainid,\n\t\t\taddress(this)\n\t\t);\n\t}\n\n\tmodifier whenNotUpgrading() {\n\t\trequire(!isUpgrading, \"Bridge: Upgrading\");\n\t\t_;\n\t}\n\n\tfunction shouldBeCurrentChainId(uint256 chainId) internal view {\n\t\trequire(chainId == block.chainid, \"Bridge: Not block.chainid\");\n\t}\n\n\tfunction sideTokenByOriginalToken(uint256 chainId, address originalToken) public view returns(address) {\n\t\taddress sideTokenAddr = sideTokenByOriginalTokenByChain[chainId][originalToken];\n\n\t\tif (sideTokenAddr != NULL_ADDRESS) {\n\t\t\treturn sideTokenAddr;\n\t\t}\n\n\t\t// specification for retrocompatibility\n\t\treturn deprecatedMappedTokens[originalToken];\n\t}\n\n\tfunction setSideTokenByOriginalAddressByChain(uint256 chainId, address originalToken, address sideToken) public onlyOwner {\n\t\tsideTokenByOriginalTokenByChain[chainId][originalToken] = sideToken;\n\t}\n\n\tfunction getOriginalTokenBySideToken(address sideToken) public view returns(OriginalToken memory originalToken) {\n\t\toriginalToken = originalTokenBySideToken[sideToken];\n\t\tif (originalToken.tokenAddress != NULL_ADDRESS) {\n\t\t\treturn originalToken;\n\t\t}\n\n\t\t// specification for retrocompatibility\n\t\toriginalToken.originChainId = 1; // ethereum main chain id\n\t\toriginalToken.tokenAddress = deprecatedOriginalTokens[sideToken];\n\t\treturn originalToken;\n\t}\n\n\tfunction setOriginalTokenBySideTokenByChain(address sideToken, OriginalToken memory originalToken) public onlyOwner {\n\t\toriginalTokenBySideToken[sideToken] = originalToken;\n\t}\n\n\tfunction knownToken(uint256 chainId, address originalToken) public view returns(bool) {\n\t\tbool knowToken = knownTokenByChain[chainId][originalToken];\n\t\tif (knowToken) {\n\t\t\treturn knowToken;\n\t\t}\n\n\t\t// specification for retrocompatibility\n\t\treturn deprecatedKnownTokens[originalToken];\n\t}\n\n\tfunction _setKnownTokenByChain(uint256 chainId, address originalToken, bool knownTokenValue) internal {\n\t\tknownTokenByChain[chainId][originalToken] = knownTokenValue;\n\t}\n\n\tfunction acceptTransfer(\n\t\taddress _originalTokenAddress,\n\t\taddress payable _from,\n\t\taddress payable _to,\n\t\tuint256 _amount,\n\t\tbytes32 _blockHash,\n\t\tbytes32 _transactionHash,\n\t\tuint32 _logIndex,\n\t\tuint256 _originChainId,\n\t\tuint256\t_destinationChainId\n\t) external whenNotPaused nonReentrant override {\n\t\trequire(_msgSender() == federation, \"Bridge: Not Federation\");\n\t\tcheckChainId(_originChainId);\n\t\tshouldBeCurrentChainId(_destinationChainId);\n\t\trequire(knownToken(_originChainId, _originalTokenAddress) ||\n\t\t\tsideTokenByOriginalToken(_originChainId, _originalTokenAddress) != NULL_ADDRESS,\n\t\t\t\"Bridge: Unknown token\"\n\t\t);\n\t\trequire(_to != NULL_ADDRESS, \"Bridge: Null To\");\n\t\trequire(_amount > 0, \"Bridge: Amount 0\");\n\t\trequire(_blockHash != NULL_HASH, \"Bridge: Null BlockHash\");\n\t\trequire(_transactionHash != NULL_HASH, \"Bridge: Null TxHash\");\n\t\trequire(transactionsDataHashes[_transactionHash] == bytes32(0), \"Bridge: Already accepted\");\n\n\t\tbytes32 _transactionDataHash = getTransactionDataHash(\n\t\t\t_to,\n\t\t\t_amount,\n\t\t\t_blockHash,\n\t\t\t_transactionHash,\n\t\t\t_logIndex\n\t\t);\n\n\t\tbytes32 _transactionDataHashMultichain = getTransactionDataHash(\n\t\t\t_to,\n\t\t\t_amount,\n\t\t\t_blockHash,\n\t\t\t_transactionHash,\n\t\t\t_logIndex,\n\t\t\t_originChainId,\n\t\t\t_destinationChainId\n\t\t);\n\t\t// Do not remove, claimed also has the previously processed using the older bridge version\n\t\t// https://github.com/rsksmart/tokenbridge/blob/TOKENBRIDGE-1.2.0/bridge/contracts/Bridge.sol#L41\n\t\trequire(!isClaimed(_transactionDataHash, _transactionDataHashMultichain), \"Bridge: Already claimed\");\n\n\t\ttransactionsDataHashes[_transactionHash] = _transactionDataHashMultichain;\n\t\toriginalTokenAddresses[_transactionHash] = _originalTokenAddress;\n\t\tsenderAddresses[_transactionHash] = _from;\n\n\t\temit AcceptedCrossTransfer(\n\t\t\t_transactionHash,\n\t\t\t_originalTokenAddress,\n\t\t\t_to,\n\t\t\t_from,\n\t\t\t_amount,\n\t\t\t_blockHash,\n\t\t\t_logIndex,\n\t\t\t_originChainId,\n\t\t\t_destinationChainId\n\t\t);\n\t}\n\n\tfunction checkChainId(uint256 chainId) internal pure {\n\t\trequire(chainId > 0, \"Bridge: ChainId is 0\");\n\t}\n\n\tfunction _createSideToken(\n\t\tuint256 _typeId,\n\t\taddress _originalTokenAddress,\n\t\tuint8 _originalTokenDecimals,\n\t\tstring calldata _tokenSymbol,\n\t\tstring calldata _tokenName,\n\t\tuint256 _originChainId\n\t) internal {\n\t\trequire(_originalTokenAddress != NULL_ADDRESS, \"Bridge: Null token\");\n\t\tcheckChainId(_originChainId);\n\t\taddress sideToken = sideTokenByOriginalToken(_originChainId, _originalTokenAddress);\n\t\trequire(sideToken == NULL_ADDRESS, \"Bridge: Already exists\");\n\n\t\tuint256 granularity = LibUtils.decimalsToGranularity(_originalTokenDecimals);\n\n\t\t// Create side token\n\t\tsideToken = sideTokenFactory.createSideToken(_tokenName, _tokenSymbol, granularity);\n\n\t\tsetSideTokenByOriginalAddressByChain(_originChainId, _originalTokenAddress, sideToken);\n\n\t\tOriginalToken memory originalToken;\n\t\toriginalToken.originChainId = _originChainId;\n\t\toriginalToken.tokenAddress = _originalTokenAddress;\n\t\tsetOriginalTokenBySideTokenByChain(sideToken, originalToken);\n\t\tallowTokens.setToken(sideToken, _typeId);\n\n\t\temit NewSideToken(sideToken, _originalTokenAddress, _tokenSymbol, granularity, _originChainId);\n\t}\n\n\tfunction createSideToken(\n\t\tuint256 _typeId,\n\t\taddress _originalTokenAddress,\n\t\tuint8 _originalTokenDecimals,\n\t\tstring calldata _tokenSymbol,\n\t\tstring calldata _tokenName,\n\t\tuint256 _originChainId\n\t) external onlyOwner override {\n\t\t_createSideToken(\n\t\t\t_typeId,\n\t\t\t_originalTokenAddress,\n\t\t\t_originalTokenDecimals,\n\t\t\t_tokenSymbol,\n\t\t\t_tokenName,\n\t\t\t_originChainId\n\t\t);\n\t}\n\n\tfunction createMultipleSideTokens(\n\t\tCreateSideTokenStruct[] calldata createSideTokenStruct\n\t) external onlyOwner {\n\t\tfor(uint256 i = 0; i < createSideTokenStruct.length; i++) {\n\t\t\t_createSideToken(\n\t\t\t\tcreateSideTokenStruct[i]._typeId,\n\t\t\t\tcreateSideTokenStruct[i]._originalTokenAddress,\n\t\t\t\tcreateSideTokenStruct[i]._originalTokenDecimals,\n\t\t\t\tcreateSideTokenStruct[i]._originalTokenSymbol,\n\t\t\t\tcreateSideTokenStruct[i]._originalTokenName,\n\t\t\t\tcreateSideTokenStruct[i]._originChainId\n\t\t\t);\n\t\t}\n\t}\n\n\tfunction claim(ClaimData calldata _claimData) external override returns (uint256 receivedAmount) {\n\t\treceivedAmount = _claim(\n\t\t\t_claimData,\n\t\t\t_claimData.to,\n\t\t\tpayable(address(0)),\n\t\t\t0\n\t\t);\n\t\treturn receivedAmount;\n\t}\n\n\tfunction claimFallback(ClaimData calldata _claimData) external override returns (uint256 receivedAmount) {\n\t\trequire(_msgSender() == senderAddresses[_claimData.transactionHash],\"Bridge: invalid sender\");\n\t\treceivedAmount = _claim(\n\t\t\t_claimData,\n\t\t\t_msgSender(),\n\t\t\tpayable(address(0)),\n\t\t\t0\n\t\t);\n\t\treturn receivedAmount;\n\t}\n\n\tfunction getDigest(\n\t\tClaimData memory _claimData,\n\t\taddress payable _relayer,\n\t\tuint256 _fee,\n\t\tuint256 _deadline\n\t) internal returns (bytes32) {\n\t\treturn LibEIP712.hashEIP712Message(\n\t\t\tdomainSeparator,\n\t\t\tkeccak256(\n\t\t\t\tabi.encode(\n\t\t\t\t\tCLAIM_TYPEHASH,\n\t\t\t\t\t_claimData.to,\n\t\t\t\t\t_claimData.amount,\n\t\t\t\t\t_claimData.transactionHash,\n\t\t\t\t\t_claimData.originChainId,\n\t\t\t\t\t_relayer,\n\t\t\t\t\t_fee,\n\t\t\t\t\tnonces[_claimData.to]++,\n\t\t\t\t\t_deadline\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}\n\n\t// Inspired by https://github.com/dapphub/ds-dach/blob/master/src/dach.sol\n\tfunction claimGasless(\n\t\tClaimData calldata _claimData,\n\t\taddress payable _relayer,\n\t\tuint256 _fee,\n\t\tuint256 _deadline,\n\t\tuint8 _v,\n\t\tbytes32 _r,\n\t\tbytes32 _s\n\t) external override returns (uint256 receivedAmount) {\n\t\trequire(_deadline >= block.timestamp, \"Bridge: EXPIRED\"); // solhint-disable-line not-rely-on-time\n\n\t\tbytes32 digest = getDigest(_claimData, _relayer, _fee, _deadline);\n\t\taddress recoveredAddress = ecrecover(digest, _v, _r, _s);\n\t\trequire(_claimData.to != address(0) && recoveredAddress == _claimData.to, \"Bridge: INVALID_SIGNATURE\");\n\n\t\treturn _claim(\n\t\t\t_claimData,\n\t\t\t_claimData.to,\n\t\t\t_relayer,\n\t\t\t_fee\n\t\t);\n\t}\n\n\tfunction isClaimed(bytes32 transactionDataHash, bytes32 transactionDataHashMultichain) public view returns(bool) {\n\t\treturn claimed[transactionDataHash] || claimed[transactionDataHashMultichain];\n\t}\n\n\tfunction isClaimed(ClaimData calldata _claimData, bytes32 transactionDataHashMultichain) public view returns(bool) {\n\t\tbytes32 transactionDataHash = getTransactionDataHash(\n\t\t\t_claimData.to,\n\t\t\t_claimData.amount,\n\t\t\t_claimData.blockHash,\n\t\t\t_claimData.transactionHash,\n\t\t\t_claimData.logIndex\n\t\t);\n\n\t\treturn claimed[transactionDataHash] || claimed[transactionDataHashMultichain];\n\t}\n\n\tfunction _claim(\n\t\tClaimData calldata _claimData,\n\t\taddress payable _reciever,\n\t\taddress payable _relayer,\n\t\tuint256 _fee\n\t) internal nonReentrant returns (uint256 receivedAmount) {\n\t\taddress originalTokenAddress = originalTokenAddresses[_claimData.transactionHash];\n\t\trequire(originalTokenAddress != NULL_ADDRESS, \"Bridge: Tx not crossed\");\n\n\t\tbytes32 transactionDataHash = getTransactionDataHash(\n\t\t\t_claimData.to,\n\t\t\t_claimData.amount,\n\t\t\t_claimData.blockHash,\n\t\t\t_claimData.transactionHash,\n\t\t\t_claimData.logIndex,\n\t\t\t_claimData.originChainId,\n\t\t\tblock.chainid\n\t\t);\n\n\t\trequire(transactionsDataHashes[_claimData.transactionHash] == transactionDataHash, \"Bridge: Wrong transactionDataHash\");\n\t\trequire(!isClaimed(_claimData, transactionDataHash), \"Bridge: Already claimed\");\n\t\tclaimed[transactionDataHash] = true;\n\n\t\treceivedAmount = _claimCross(\n\t\t\t_claimData.originChainId,\n\t\t\toriginalTokenAddress,\n\t\t\t_reciever,\n\t\t\t_claimData.amount,\n\t\t\t_relayer,\n\t\t\t_fee\n\t\t);\n\n\t\temitClaimed(_claimData, originalTokenAddress, _reciever, _relayer, _fee);\n\t\treturn receivedAmount;\n\t}\n\n\tfunction emitClaimed(\n\t\tClaimData calldata _claimData,\n\t\taddress _originalTokenAddress,\n\t\taddress payable _reciever,\n\t\taddress payable _relayer,\n\t\tuint256 _fee\n\t) internal {\n\t\temit Claimed(\n\t\t\t_claimData.transactionHash,\n\t\t\t_originalTokenAddress,\n\t\t\t_claimData.to,\n\t\t\tsenderAddresses[_claimData.transactionHash],\n\t\t\t_claimData.amount,\n\t\t\t_claimData.blockHash,\n\t\t\t_claimData.logIndex,\n\t\t\t_reciever,\n\t\t\t_relayer,\n\t\t\t_fee,\n\t\t\t_claimData.originChainId,\n\t\t\tblock.chainid\n\t\t);\n\t}\n\n\tfunction _claimCross(\n\t\tuint256 _originalChainId,\n\t\taddress _originalTokenAddress,\n\t\taddress payable _reciever,\n\t\tuint256 _amount,\n\t\taddress payable _relayer,\n\t\tuint256 _fee\n\t) internal returns (uint256) {\n\t\tcheckChainId(_originalChainId);\n\t\tif (knownToken(_originalChainId, _originalTokenAddress)) {\n\t\t\treturn _claimCrossBackToToken(\n\t\t\t\t_originalTokenAddress,\n\t\t\t\t_reciever,\n\t\t\t\t_amount,\n\t\t\t\t_relayer,\n\t\t\t\t_fee\n\t\t\t);\n\t\t}\n\n\t\treturn _claimCrossToSideToken(\n\t\t\tsideTokenByOriginalToken(_originalChainId, _originalTokenAddress),\n\t\t\t_reciever,\n\t\t\t_amount,\n\t\t\t_relayer,\n\t\t\t_fee\n\t\t);\n\t}\n\n\tfunction _claimCrossToSideToken(\n\t\taddress _sideToken,\n\t\taddress payable _receiver,\n\t\tuint256 _amount,\n\t\taddress payable _relayer,\n\t\tuint256 _fee\n\t) internal returns (uint256 receivedAmount) {\n\t\trequire(_sideToken != NULL_ADDRESS, \"Bridge: side token is null\");\n\t\tuint256 granularity = IERC777(_sideToken).granularity();\n\t\tuint256 formattedAmount = _amount.mul(granularity);\n\t\trequire(_fee <= formattedAmount, \"Bridge: fee too high\");\n\t\treceivedAmount = formattedAmount.sub(_fee);\n\t\tISideToken(_sideToken).mint(_receiver, receivedAmount, \"\", \"\");\n\t\tif (_fee > 0) {\n\t\t\tISideToken(_sideToken).mint(_relayer, _fee, \"\", \"relayer fee\");\n\t\t}\n\t\treturn receivedAmount;\n\t}\n\n\tfunction _claimCrossBackToToken(\n\t\taddress _originalTokenAddress,\n\t\taddress payable _receiver,\n\t\tuint256 _amount,\n\t\taddress payable _relayer,\n\t\tuint256 _fee\n\t) internal returns (uint256 receivedAmount) {\n\t\tuint256 decimals = LibUtils.getDecimals(_originalTokenAddress);\n\t\t//As side tokens are ERC777 they will always have 18 decimals\n\t\tuint256 formattedAmount = _amount.div(uint256(10) ** (18 - decimals));\n\t\trequire(_fee <= formattedAmount, \"Bridge: fee too high\");\n\t\treceivedAmount = formattedAmount.sub(_fee);\n\t\tif (address(wrappedCurrency) == _originalTokenAddress) {\n\t\t\twrappedCurrency.withdraw(formattedAmount);\n\t\t\t_receiver.transfer(receivedAmount);\n\t\t\tif(_fee > 0) {\n\t\t\t\t_relayer.transfer(_fee);\n\t\t\t}\n\t\t} else {\n\t\t\tIERC20(_originalTokenAddress).safeTransfer(_receiver, receivedAmount);\n\t\t\tif(_fee > 0) {\n\t\t\t\tIERC20(_originalTokenAddress).safeTransfer(_relayer, _fee);\n\t\t\t}\n\t\t}\n\t\treturn receivedAmount;\n\t}\n\n\t/**\n\t\t* ERC-20 tokens approve and transferFrom pattern\n\t\t* See https://eips.ethereum.org/EIPS/eip-20#transferfrom\n\t\t*/\n\tfunction receiveTokensTo(uint256 destinationChainId, address tokenToUse, address to, uint256 amount) external override {\n\t\taddress sender = _msgSender();\n\t\t//Transfer the tokens on IERC20, they should be already Approved for the bridge Address to use them\n\t\tIERC20(tokenToUse).safeTransferFrom(sender, address(this), amount);\n\t\tcrossTokens(tokenToUse, sender, to, amount, \"\", destinationChainId);\n\t}\n\n\t/**\n\t\t* Use network currency and cross it.\n\t\t*/\n\tfunction depositTo(uint256 chainId, address to) external payable override {\n\t\taddress sender = _msgSender();\n\t\trequire(address(wrappedCurrency) != NULL_ADDRESS, \"Bridge: wrappedCurrency empty\");\n\t\twrappedCurrency.deposit{ value: msg.value }();\n\t\tcrossTokens(address(wrappedCurrency), sender, to, msg.value, \"\", chainId);\n\t}\n\n\t/**\n\t\t* ERC-777 tokensReceived hook allows to send tokens to a contract and notify it in a single transaction\n\t\t* See https://eips.ethereum.org/EIPS/eip-777#motivation for details\n\t\t* @param userData it can be 2 options in the first one you can send the receiver and the chain id of the destination\n\t\t* const userData = web3.eth.abi.encodeParameters(\n * [\"address\", \"uint256\"],\n * [anAccount.toLowerCase(), chains.ETHEREUM_MAIN_NET_CHAIN_ID]\n * );\n\t\t* or you also can send only the destination chain id, and the receiver would be the same as the from parameter\n\t\t* const userData = web3.eth.abi.encodeParameters([\"uint256\"], [chains.ETHEREUM_MAIN_NET_CHAIN_ID]);\n\t\t*/\n\tfunction tokensReceived(\n\t\taddress operator,\n\t\taddress from,\n\t\taddress to,\n\t\tuint amount,\n\t\tbytes calldata userData, // [address,uint256] user addrest receiver, destinationChainId || [uint256] same as from, destinationChainId\n\t\tbytes calldata\n\t) external override(IBridge, IERC777Recipient) {\n\t\t//Hook from ERC777address\n\t\tif(operator == address(this)) return; // Avoid loop from bridge calling to ERC77transferFrom\n\t\trequire(to == address(this), \"Bridge: Not to this address\");\n\t\taddress tokenToUse = _msgSender();\n\t\trequire(ERC1820.getInterfaceImplementer(tokenToUse, _erc777Interface) != NULL_ADDRESS, \"Bridge: Not ERC777 token\");\n\t\trequire(userData.length >= 32, \"Bridge: user data with at least the destinationChainId\");\n\t\trequire(userData.length == 64 || !from.isContract(), \"Bridge: Specify receiver address in data\");\n\t\taddress receiver = userData.length == 32 ? from : LibUtils.toAddress(userData, 12);\n\t\tuint256 destinationChainId = LibUtils.toUint256(userData, userData.length - 32);\n\t\tcrossTokens(tokenToUse, from, receiver, amount, userData, destinationChainId);\n\t}\n\n\tfunction crossTokens(\n\t\taddress tokenToUse,\n\t\taddress from,\n\t\taddress to,\n\t\tuint256 amount,\n\t\tbytes memory userData,\n\t\tuint256 destinationChainId\n\t) internal whenNotUpgrading whenNotPaused nonReentrant {\n\t\trequire(block.chainid != destinationChainId, \"Bridge: destination chain id equal current chain id\");\n\t\tcheckChainId(destinationChainId);\n\t\t_setKnownTokenByChain(destinationChainId, tokenToUse, true);\n\t\tuint256 fee = amount.mul(feePercentage).div(feePercentageDivider);\n\t\tuint256 amountMinusFees = amount.sub(fee);\n\t\tuint8 decimals = LibUtils.getDecimals(tokenToUse);\n\t\tuint formattedAmount = amount;\n\t\tif (decimals != 18) {\n\t\t\tformattedAmount = amount.mul(uint256(10)**(18-decimals));\n\t\t}\n\t\t// We consider the amount before fees converted to 18 decimals to check the limits\n\t\t// updateTokenTransfer revert if token not allowed\n\t\tallowTokens.updateTokenTransfer(tokenToUse, formattedAmount);\n\n\t\tOriginalToken memory sideToken = getOriginalTokenBySideToken(tokenToUse);\n\t\tif (sideToken.tokenAddress != NULL_ADDRESS) {\n\t\t\t// Side Token Crossing back\n\t\t\t{ // Created scope to avoid stack too deep\n\t\t\t\tuint256 granularity = LibUtils.getGranularity(tokenToUse);\n\t\t\t\tuint256 modulo = amountMinusFees.mod(granularity);\n\t\t\t\tfee = fee.add(modulo);\n\t\t\t\tamountMinusFees = amountMinusFees.sub(modulo);\n\t\t\t\tIERC777(tokenToUse).burn(amountMinusFees, userData);\n\t\t\t}\n\t\t\temit Cross(\n\t\t\t\tsideToken.tokenAddress,\n\t\t\t\tto,\n\t\t\t\tdestinationChainId,\n\t\t\t\tfrom,\n\t\t\t\tblock.chainid,\n\t\t\t\tamountMinusFees,\n\t\t\t\tuserData\n\t\t\t);\n\t\t} else {\n\t\t\temit Cross(\n\t\t\t\ttokenToUse,\n\t\t\t\tto,\n\t\t\t\tdestinationChainId,\n\t\t\t\tfrom,\n\t\t\t\tblock.chainid,\n\t\t\t\tamountMinusFees,\n\t\t\t\tuserData\n\t\t\t);\n\t\t}\n\n\t\tif (fee > 0) {\n\t\t\t//Send the payment to the MultiSig of the Federation\n\t\t\tIERC20(tokenToUse).safeTransfer(owner(), fee);\n\t\t}\n\t}\n\n\t// function for retrocompatibility\n\tfunction getTransactionDataHash(\n\t\taddress _to,\n\t\tuint256 _amount,\n\t\tbytes32 _blockHash,\n\t\tbytes32 _transactionHash,\n\t\tuint32 _logIndex\n\t) internal pure returns(bytes32) {\n\t\treturn keccak256(abi.encodePacked(_blockHash, _transactionHash, _to, _amount, _logIndex));\n\t}\n\n\tfunction getTransactionDataHash(\n\t\taddress _to,\n\t\tuint256 _amount,\n\t\tbytes32 _blockHash,\n\t\tbytes32 _transactionHash,\n\t\tuint32 _logIndex,\n\t\tuint256 _originChainId,\n\t\tuint256\t_destinationChainId\n\t) public pure override returns(bytes32) {\n\t\treturn keccak256(abi.encodePacked(_blockHash, _transactionHash, _to, _amount, _logIndex, _originChainId, _destinationChainId));\n\t}\n\n\tfunction setFeePercentage(uint amount) external onlyOwner {\n\t\trequire(amount < (feePercentageDivider/10), \"Bridge: bigger than 10%\");\n\t\tfeePercentage = amount;\n\t\temit FeePercentageChanged(feePercentage);\n\t}\n\n\tfunction getFeePercentage() external view override returns(uint) {\n\t\treturn feePercentage;\n\t}\n\n\tfunction changeFederation(address newFederation) external onlyOwner {\n\t\trequire(newFederation != NULL_ADDRESS, \"Bridge: Federation is empty\");\n\t\tfederation = newFederation;\n\t\temit FederationChanged(federation);\n\t}\n\n\tfunction changeAllowTokens(address newAllowTokens) external onlyOwner {\n\t\trequire(newAllowTokens != NULL_ADDRESS, \"Bridge: AllowTokens is empty\");\n\t\tallowTokens = IAllowTokens(newAllowTokens);\n\t\temit AllowTokensChanged(newAllowTokens);\n\t}\n\n\tfunction getFederation() external view returns(address) {\n\t\treturn federation;\n\t}\n\n\tfunction changeSideTokenFactory(address newSideTokenFactory) external onlyOwner {\n\t\trequire(newSideTokenFactory != NULL_ADDRESS, \"Bridge: SideTokenFactory is empty\");\n\t\tsideTokenFactory = ISideTokenFactory(newSideTokenFactory);\n\t\temit SideTokenFactoryChanged(newSideTokenFactory);\n\t}\n\n\tfunction setUpgrading(bool _isUpgrading) external onlyOwner {\n\t\tisUpgrading = _isUpgrading;\n\t\temit Upgrading(isUpgrading);\n\t}\n\n\tfunction setWrappedCurrency(address _wrappedCurrency) external onlyOwner {\n\t\trequire(_wrappedCurrency != NULL_ADDRESS, \"Bridge: wrapp is empty\");\n\t\twrappedCurrency = IWrapped(_wrappedCurrency);\n\t\temit WrappedCurrencyChanged(_wrappedCurrency);\n\t}\n\n\tfunction hasCrossed(bytes32 transactionHash) public view returns (bool) {\n\t\treturn transactionsDataHashes[transactionHash] != bytes32(0);\n\t}\n\n\tfunction hasBeenClaimed(bytes32 transactionHash) public view returns (bool) {\n\t\treturn claimed[transactionsDataHashes[transactionHash]];\n\t}\n\n}\n" + }, + "contracts/zeppelin/upgradable/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @title Initializable\n *\n * @dev Helper contract to support initializer functions. To use it, replace\n * the constructor with a function that has the `initializer` modifier.\n * WARNING: Unlike constructors, initializer functions must be manually\n * invoked. This applies both to deploying an Initializable contract, as well\n * as extending an Initializable contract via inheritance.\n * WARNING: When used with inheritance, manual care must be taken to not invoke\n * a parent initializer twice, or ensure that all initializers are idempotent,\n * because this is not dealt with automatically as with constructors.\n */\ncontract Initializable {\n\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private initializing;\n\n /**\n * @dev Modifier to use in the initializer function of a contract.\n */\n modifier initializer() {\n require(initializing || !initialized, \"Contract instance is already initialized\");\n\n bool isTopLevelCall = !initializing;\n if (isTopLevelCall) {\n initializing = true;\n initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n initializing = false;\n }\n }\n\n // Reserved storage space to allow for layout changes in the future.\n uint256[50] private ______gap;\n}" + }, + "contracts/zeppelin/upgradable/utils/ReentrancyGuard.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../Initializable.sol\";\n\n/**\n * @title Helps contracts guard against reentrancy attacks.\n * @author Remco Bloemen , Eenae \n * @dev If you mark a function `nonReentrant`, you should also\n * mark it `external`.\n */\ncontract ReentrancyGuard is Initializable {\n /// @dev counter to allow mutex lock with only one SSTORE operation\n uint256 private _guardCounter;\n\n function initialize() public initializer {\n // The counter starts at one to prevent changing it from zero to a non-zero\n // value, which is a more expensive operation.\n _guardCounter = 1;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _guardCounter += 1;\n uint256 localCounter = _guardCounter;\n _;\n require(localCounter == _guardCounter, \"ReentrancyGuard: no reentrant allowed\");\n }\n}" + }, + "contracts/zeppelin/upgradable/lifecycle/UpgradablePausable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../Initializable.sol\";\n\nimport \"../../GSN/Context.sol\";\nimport \"../access/roles/UpgradablePauserRole.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\ncontract UpgradablePausable is Initializable, Context, UpgradablePauserRole {\n /**\n * @dev Emitted when the pause is triggered by a pauser (`account`).\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by a pauser (`account`).\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state. Assigns the Pauser role\n * to the deployer.\n */\n function __Pausable_init(address sender) public initializer {\n UpgradablePauserRole.__PauserRol_init(sender);\n\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n */\n modifier whenNotPaused() {\n require(!_paused, \"Pausable: paused\");\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n */\n modifier whenPaused() {\n require(_paused, \"Pausable: not paused\");\n _;\n }\n\n /**\n * @dev Called by a pauser to pause, triggers stopped state.\n */\n function pause() public onlyPauser whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Called by a pauser to unpause, returns to normal state.\n */\n function unpause() public onlyPauser whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" + }, + "contracts/zeppelin/upgradable/ownership/UpgradableOwnable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../Initializable.sol\";\n\nimport \"../../GSN/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be aplied to your functions to restrict their use to\n * the owner.\n */\ncontract UpgradableOwnable is Initializable, Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function initialize(address sender) public initializer {\n _owner = sender;\n emit OwnershipTransferred(address(0), _owner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(isOwner(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Returns true if the caller is the current owner.\n */\n function isOwner() public view returns (bool) {\n return _msgSender() == _owner;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * > Note: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public onlyOwner {\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n */\n function _transferOwnership(address newOwner) internal {\n require(newOwner != address(0), \"Ownable: new owner is zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n\n}\n" + }, + "contracts/zeppelin/introspection/IERC1820Registry.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @dev Interface of the global ERC1820 Registry, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1820[EIP]. Accounts may register\n * implementers for interfaces in this registry, as well as query support.\n *\n * Implementers may be shared by multiple accounts, and can also implement more\n * than a single interface for each account. Contracts can implement interfaces\n * for themselves, but externally-owned accounts (EOA) must delegate this to a\n * contract.\n *\n * {IERC165} interfaces can also be queried via the registry.\n *\n * For an in-depth explanation and source code analysis, see the EIP text.\n */\ninterface IERC1820Registry {\n /**\n * @dev Sets `newManager` as the manager for `account`. A manager of an\n * account is able to set interface implementers for it.\n *\n * By default, each account is its own manager. Passing a value of `0x0` in\n * `newManager` will reset the manager to this initial state.\n *\n * Emits a {ManagerChanged} event.\n *\n * Requirements:\n *\n * - the caller must be the current manager for `account`.\n */\n function setManager(address account, address newManager) external;\n\n /**\n * @dev Returns the manager for `account`.\n *\n * See {setManager}.\n */\n function getManager(address account) external view returns (address);\n\n /**\n * @dev Sets the `implementer` contract as `account`'s implementer for\n * `interfaceHash`.\n *\n * `account` being the zero address is an alias for the caller's address.\n * The zero address can also be used in `implementer` to remove an old one.\n *\n * See {interfaceHash} to learn how these are created.\n *\n * Emits an {InterfaceImplementerSet} event.\n *\n * Requirements:\n *\n * - the caller must be the current manager for `_account`.\n * - `_interfaceHash` must not be an {IERC165} interface id (i.e. it must not\n * end in 28 zeroes).\n * - `_implementer` must implement {IERC1820Implementer} and return true when\n * queried for support, unless `implementer` is the caller. See\n * {IERC1820Implementer-canImplementInterfaceForAddress}.\n */\n function setInterfaceImplementer(address _account, bytes32 _interfaceHash, address _implementer) external;\n\n /**\n * @dev Returns the implementer of `_interfaceHash` for `_account`. If no such\n * implementer is registered, returns the zero address.\n *\n * If `_interfaceHash` is an {IERC165} interface id (i.e. it ends with 28\n * zeroes), `_account` will be queried for support of it.\n *\n * `account` being the zero address is an alias for the caller's address.\n */\n function getInterfaceImplementer(address _account, bytes32 _interfaceHash) external view returns (address);\n\n /**\n * @dev Returns the interface hash for an `interfaceName`, as defined in the\n * corresponding\n * https://eips.ethereum.org/EIPS/eip-1820#interface-name[section of the EIP].\n */\n function interfaceHash(string calldata interfaceName) external pure returns (bytes32);\n\n /**\n * @notice Updates the cache with whether the contract implements an ERC165 interface or not.\n * @param account Address of the contract for which to update the cache.\n * @param interfaceId ERC165 interface for which to update the cache.\n */\n function updateERC165Cache(address account, bytes4 interfaceId) external;\n\n /**\n * @notice Checks whether a contract implements an ERC165 interface or not.\n * If the result is not cached a direct lookup on the contract address is performed.\n * If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling\n * {updateERC165Cache} with the contract address.\n * @param account Address of the contract to check.\n * @param interfaceId ERC165 interface to check.\n * @return True if `account` implements `interfaceId`, false otherwise.\n */\n function implementsERC165Interface(address account, bytes4 interfaceId) external view returns (bool);\n\n /**\n * @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache.\n * @param account Address of the contract to check.\n * @param interfaceId ERC165 interface to check.\n * @return True if `account` implements `interfaceId`, false otherwise.\n */\n function implementsERC165InterfaceNoCache(address account, bytes4 interfaceId) external view returns (bool);\n\n event InterfaceImplementerSet(address indexed account, bytes32 indexed interfaceHash, address indexed implementer);\n\n event ManagerChanged(address indexed account, address indexed newManager);\n}\n" + }, + "contracts/zeppelin/token/ERC777/IERC777Recipient.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @dev Interface of the ERC777TokensRecipient standard as defined in the EIP.\n *\n * Accounts can be notified of `IERC777` tokens being sent to them by having a\n * contract implement this interface (contract holders can be their own\n * implementer) and registering it on the\n * [ERC1820 global registry](https://eips.ethereum.org/EIPS/eip-1820).\n *\n * See `IERC1820Registry` and `ERC1820Implementer`.\n */\ninterface IERC777Recipient {\n /**\n * @dev Called by an `IERC777` token contract whenever tokens are being\n * moved or created into a registered account (`to`). The type of operation\n * is conveyed by `from` being the zero address or not.\n *\n * This call occurs _after_ the token contract's state is updated, so\n * `IERC777.balanceOf`, etc., can be used to query the post-operation state.\n *\n * This function may revert to prevent the operation from being executed.\n */\n function tokensReceived(\n address operator,\n address from,\n address to,\n uint amount,\n bytes calldata userData,\n bytes calldata operatorData\n ) external;\n}\n" + }, + "contracts/zeppelin/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP. Does not include\n * the optional functions; to access them see {ERC20Detailed}.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n" + }, + "contracts/zeppelin/token/ERC20/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using SafeMath for uint256;\n using Address for address;\n\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n // solhint-disable-next-line max-line-length\n require((value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve non-zero to non-zero allowance\"\n );\n callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\n callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves.\n\n // A Solidity high level call has three parts:\n // 1. The target address is checked to verify it contains contract code\n // 2. The call itself is made, and success asserted\n // 3. The return value is decoded, which in turn checks the size of the returned data.\n // solhint-disable-next-line max-line-length\n require(address(token).isContract(), \"SafeERC20: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = address(token).call(data);\n require(success, \"SafeERC20: low-level call failed\");\n\n if (returndata.length > 0) { // Return data is optional\n // solhint-disable-next-line max-line-length\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" + }, + "contracts/zeppelin/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "contracts/zeppelin/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return sub(a, b, \"SafeMath: subtraction overflow\");\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n * - Subtraction cannot overflow.\n *\n * _Available since v2.4.0._\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers. Reverts on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n return div(a, b, \"SafeMath: division by zero\");\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers. Reverts with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n * - The divisor cannot be zero.\n *\n * _Available since v2.4.0._\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n // Solidity only automatically asserts when dividing by 0\n require(b > 0, errorMessage);\n uint256 c = a / b;\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\n\n return c;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * Reverts when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return mod(a, b, \"SafeMath: modulo by zero\");\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * Reverts with custom message when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n * - The divisor cannot be zero.\n *\n * _Available since v2.4.0._\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b != 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "contracts/zeppelin/token/ERC777/IERC777.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @dev Interface of the ERC777Token standard as defined in the EIP.\n *\n * This contract uses the\n * [ERC1820 registry standard](https://eips.ethereum.org/EIPS/eip-1820) to let\n * token holders and recipients react to token movements by using setting implementers\n * for the associated interfaces in said registry. See `IERC1820Registry` and\n * `ERC1820Implementer`.\n */\ninterface IERC777 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the smallest part of the token that is not divisible. This\n * means all token operations (creation, movement and destruction) must have\n * amounts that are a multiple of this number.\n *\n * For most token contracts, this value will equal 1.\n */\n function granularity() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by an account (`owner`).\n */\n function balanceOf(address owner) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * If send or receive hooks are registered for the caller and `recipient`,\n * the corresponding functions will be called with `data` and empty\n * `operatorData`. See `IERC777Sender` and `IERC777Recipient`.\n *\n * Emits a `Sent` event.\n *\n * Requirements\n *\n * - the caller must have at least `amount` tokens.\n * - `recipient` cannot be the zero address.\n * - if `recipient` is a contract, it must implement the `tokensReceived`\n * interface.\n */\n function send(address recipient, uint256 amount, bytes calldata data) external;\n\n /**\n * @dev Destroys `amount` tokens from the caller's account, reducing the\n * total supply.\n *\n * If a send hook is registered for the caller, the corresponding function\n * will be called with `data` and empty `operatorData`. See `IERC777Sender`.\n *\n * Emits a `Burned` event.\n *\n * Requirements\n *\n * - the caller must have at least `amount` tokens.\n */\n function burn(uint256 amount, bytes calldata data) external;\n\n /**\n * @dev Returns true if an account is an operator of `tokenHolder`.\n * Operators can send and burn tokens on behalf of their owners. All\n * accounts are their own operator.\n *\n * See `operatorSend` and `operatorBurn`.\n */\n function isOperatorFor(address operator, address tokenHolder) external view returns (bool);\n\n /**\n * @dev Make an account an operator of the caller.\n *\n * See `isOperatorFor`.\n *\n * Emits an `AuthorizedOperator` event.\n *\n * Requirements\n *\n * - `operator` cannot be calling address.\n */\n function authorizeOperator(address operator) external;\n\n /**\n * @dev Make an account an operator of the caller.\n *\n * See `isOperatorFor` and `defaultOperators`.\n *\n * Emits a `RevokedOperator` event.\n *\n * Requirements\n *\n * - `operator` cannot be calling address.\n */\n function revokeOperator(address operator) external;\n\n /**\n * @dev Returns the list of default operators. These accounts are operators\n * for all token holders, even if `authorizeOperator` was never called on\n * them.\n *\n * This list is immutable, but individual holders may revoke these via\n * `revokeOperator`, in which case `isOperatorFor` will return false.\n */\n function defaultOperators() external view returns (address[] memory);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient`. The caller must\n * be an operator of `sender`.\n *\n * If send or receive hooks are registered for `sender` and `recipient`,\n * the corresponding functions will be called with `data` and\n * `operatorData`. See `IERC777Sender` and `IERC777Recipient`.\n *\n * Emits a `Sent` event.\n *\n * Requirements\n *\n * - `sender` cannot be the zero address.\n * - `sender` must have at least `amount` tokens.\n * - the caller must be an operator for `sender`.\n * - `recipient` cannot be the zero address.\n * - if `recipient` is a contract, it must implement the `tokensReceived`\n * interface.\n */\n function operatorSend(\n address sender,\n address recipient,\n uint256 amount,\n bytes calldata data,\n bytes calldata operatorData\n ) external;\n\n /**\n * @dev Destoys `amount` tokens from `account`, reducing the total supply.\n * The caller must be an operator of `account`.\n *\n * If a send hook is registered for `account`, the corresponding function\n * will be called with `data` and `operatorData`. See `IERC777Sender`.\n *\n * Emits a `Burned` event.\n *\n * Requirements\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n * - the caller must be an operator for `account`.\n */\n function operatorBurn(\n address account,\n uint256 amount,\n bytes calldata data,\n bytes calldata operatorData\n ) external;\n\n event Sent(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256 amount,\n bytes data,\n bytes operatorData\n );\n\n function decimals() external returns (uint8);\n\n event Minted(address indexed operator, address indexed to, uint256 amount, bytes data, bytes operatorData);\n\n event Burned(address indexed operator, address indexed from, uint256 amount, bytes data, bytes operatorData);\n\n event AuthorizedOperator(address indexed operator, address indexed tokenHolder);\n\n event RevokedOperator(address indexed operator, address indexed tokenHolder);\n}\n" + }, + "contracts/lib/LibEIP712.sol": { + "content": "//SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n// https://github.com/0xProject/0x-monorepo/blob/development/contracts/utils/contracts/src/LibEIP712.sol\nlibrary LibEIP712 {\n\n // Hash of the EIP712 Domain Separator Schema\n // keccak256(abi.encodePacked(\n // \"EIP712Domain(\",\n // \"string name,\",\n // \"string version,\",\n // \"uint256 chainId,\",\n // \"address verifyingContract\",\n // \")\"\n // ))\n bytes32 constant internal _EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f;\n\n /// @dev Calculates a EIP712 domain separator.\n /// @param name The EIP712 domain name.\n /// @param version The EIP712 domain version.\n /// @param verifyingContract The EIP712 verifying contract.\n /// @return result EIP712 domain separator.\n function hashEIP712Domain(\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = _EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // _EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n // keccak256(bytes(name)),\n // keccak256(bytes(version)),\n // chainId,\n // uint256(verifyingContract)\n // ))\n\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n // Calculate hashes of dynamic data\n let nameHash := keccak256(add(name, 32), mload(name))\n let versionHash := keccak256(add(version, 32), mload(version))\n\n // Load free memory pointer\n let memPtr := mload(64)\n\n // Store params in memory\n mstore(memPtr, schemaHash)\n mstore(add(memPtr, 32), nameHash)\n mstore(add(memPtr, 64), versionHash)\n mstore(add(memPtr, 96), chainId)\n mstore(add(memPtr, 128), verifyingContract)\n\n // Compute hash\n result := keccak256(memPtr, 160)\n }\n return result;\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct with a given domain hash.\n /// @param eip712DomainHash Hash of the domain domain separator data, computed\n /// with getDomainHash().\n /// @param hashStruct The EIP712 hash struct.\n /// @return result EIP712 hash applied to the given EIP712 Domain.\n function hashEIP712Message(bytes32 eip712DomainHash, bytes32 hashStruct)\n internal\n pure\n returns (bytes32 result)\n {\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct\n // ));\n\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}" + }, + "contracts/lib/LibUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nlibrary LibUtils {\n\n function decimalsToGranularity(uint8 decimals) internal pure returns (uint256) {\n require(decimals <= 18, \"LibUtils: Decimals not <= 18\");\n return uint256(10)**(18-decimals);\n }\n\n function getDecimals(address tokenToUse) internal view returns (uint8) {\n //support decimals as uint256 or uint8\n (bool success, bytes memory data) = tokenToUse.staticcall(abi.encodeWithSignature(\"decimals()\"));\n require(success, \"LibUtils: No decimals\");\n // uint: enc(X) is the big-endian encoding of X,\n //padded on the higher-order (left) side with zero-bytes such that the length is 32 bytes.\n return uint8(abi.decode(data, (uint256)));\n }\n\n function getGranularity(address tokenToUse) internal view returns (uint256) {\n //support granularity if ERC777\n (bool success, bytes memory data) = tokenToUse.staticcall(abi.encodeWithSignature(\"granularity()\"));\n require(success, \"LibUtils: No granularity\");\n\n return abi.decode(data, (uint256));\n }\n\n function bytesToAddress(bytes memory bys) internal pure returns (address addr) {\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n addr := mload(add(bys,20))\n }\n }\n\n function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {\n require(_bytes.length >= _start + 20, \"LibUtils: toAddress_outOfBounds\");\n address tempAddress;\n\n assembly {\n tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\n }\n\n return tempAddress;\n }\n\n function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {\n require(_bytes.length >= _start + 16, \"LibUtils: toUint128_outOfBounds\");\n uint128 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x10), _start))\n }\n\n return tempUint;\n }\n\n function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {\n\t\trequire(_bytes.length >= _start + 32, \"LibUtils: toUint256_outOfBounds\");\n\t\tuint256 tempUint;\n\n // solium-disable-next-line security/no-inline-assembly\n\t\tassembly {\n\t\t\ttempUint := mload(add(add(_bytes, 0x20), _start))\n\t\t}\n\n\t\treturn tempUint;\n\t}\n}\n" + }, + "contracts/interface/IBridge.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\ninterface IBridge {\n\n\tstruct ClaimData {\n\t\taddress payable to;\n\t\tuint256 amount;\n\t\tbytes32 blockHash;\n\t\tbytes32 transactionHash;\n\t\tuint32 logIndex;\n\t\tuint256 originChainId;\n\t}\n\n\tstruct OriginalToken {\n\t\taddress tokenAddress;\n\t\tuint256 originChainId;\n\t}\n\t\n\tstruct CreateSideTokenStruct {\n\t\tuint256 _typeId;\n\t\taddress _originalTokenAddress;\n\t\tuint8 _originalTokenDecimals;\n\t\tstring _originalTokenSymbol;\n\t\tstring _originalTokenName;\n\t\tuint256 _originChainId;\n\t}\n\n\tfunction version() external pure returns (string memory);\n\n\tfunction getFeePercentage() external view returns(uint);\n\n\t/**\n\t\t* ERC-20 tokens approve and transferFrom pattern\n\t\t* See https://eips.ethereum.org/EIPS/eip-20#transferfrom\n\t\t*/\n\tfunction receiveTokensTo(uint256 chainId, address tokenToUse, address to, uint256 amount) external;\n\n\t/**\n\t\t* Use network currency and cross it.\n\t\t*/\n\tfunction depositTo(uint256 chainId, address to) external payable;\n\n\t/**\n\t\t* ERC-777 tokensReceived hook allows to send tokens to a contract and notify it in a single transaction\n\t\t* See https://eips.ethereum.org/EIPS/eip-777#motivation for details\n\t\t* @param userData it can be 2 options in the first one you can send the receiver and the chain id of the destination\n\t\t* const userData = web3.eth.abi.encodeParameters(\n * [\"address\", \"uint256\"],\n * [anAccount.toLowerCase(), chains.ETHEREUM_MAIN_NET_CHAIN_ID]\n * );\n\t\t* or you also can send only the destination chain id, and the receiver would be the same as the from parameter\n\t\t* const userData = web3.eth.abi.encodeParameters([\"uint256\"], [chains.ETHEREUM_MAIN_NET_CHAIN_ID]);\n\t\t*/\n\tfunction tokensReceived (\n\t\taddress operator,\n\t\taddress from,\n\t\taddress to,\n\t\tuint amount,\n\t\tbytes calldata userData,\n\t\tbytes calldata operatorData\n\t) external;\n\n\t/**\n\t\t* Accepts the transaction from the other chain that was voted and sent by the Federation contract\n\t\t*/\n\tfunction acceptTransfer(\n\t\taddress _originalTokenAddress,\n\t\taddress payable _from,\n\t\taddress payable _to,\n\t\tuint256 _amount,\n\t\tbytes32 _blockHash,\n\t\tbytes32 _transactionHash,\n\t\tuint32 _logIndex,\n\t\tuint256 _originChainId,\n\t\tuint256\t_destinationChainId\n\t) external;\n\n\t/**\n\t\t* Claims the crossed transaction using the hash, this sends the funds to the address indicated in\n\t\t*/\n\tfunction claim(ClaimData calldata _claimData) external returns (uint256 receivedAmount);\n\n\tfunction claimFallback(ClaimData calldata _claimData) external returns (uint256 receivedAmount);\n\n\tfunction claimGasless(\n\t\tClaimData calldata _claimData,\n\t\taddress payable _relayer,\n\t\tuint256 _fee,\n\t\tuint256 _deadline,\n\t\tuint8 _v,\n\t\tbytes32 _r,\n\t\tbytes32 _s\n\t) external returns (uint256 receivedAmount);\n\n\tfunction createSideToken(\n\t\tuint256 _typeId,\n\t\taddress _originalTokenAddress,\n\t\tuint8 _originalTokenDecimals,\n\t\tstring calldata _originalTokenSymbol,\n\t\tstring calldata _originalTokenName,\n\t\tuint256 _chainId\n\t) external;\n\n\tfunction createMultipleSideTokens(\n\t\tCreateSideTokenStruct[] calldata createSideTokenStruct\n\t) external;\n\n\tfunction getTransactionDataHash(\n\t\taddress _to,\n\t\tuint256 _amount,\n\t\tbytes32 _blockHash,\n\t\tbytes32 _transactionHash,\n\t\tuint32 _logIndex,\n\t\tuint256 _originChainId,\n\t\tuint256 _destinationChainId\n\t) external returns(bytes32);\n\n\tevent Cross(\n\t\taddress indexed _tokenAddress,\n\t\taddress indexed _to,\n\t\tuint256 indexed _destinationChainId,\n\t\taddress _from,\n\t\tuint256 _originChainId,\n\t\tuint256 _amount,\n\t\tbytes _userData\n\t);\n\n\tevent NewSideToken(\n\t\taddress indexed _newSideTokenAddress,\n\t\taddress indexed _originalTokenAddress,\n\t\tstring _newSymbol,\n\t\tuint256 _granularity,\n\t\tuint256 _chainId\n\t);\n\tevent AcceptedCrossTransfer(\n\t\tbytes32 indexed _transactionHash,\n\t\taddress indexed _originalTokenAddress,\n\t\taddress indexed _to,\n\t\taddress _from,\n\t\tuint256 _amount,\n\t\tbytes32 _blockHash,\n\t\tuint256 _logIndex,\n\t\tuint256 _originChainId,\n\t\tuint256\t_destinationChainId\n\t);\n\tevent FeePercentageChanged(uint256 _amount);\n\tevent Claimed(\n\t\tbytes32 indexed _transactionHash,\n\t\taddress indexed _originalTokenAddress,\n\t\taddress indexed _to,\n\t\taddress _sender,\n\t\tuint256 _amount,\n\t\tbytes32 _blockHash,\n\t\tuint256 _logIndex,\n\t\taddress _reciever,\n\t\taddress _relayer,\n\t\tuint256 _fee,\n\t\tuint256 _destinationChainId,\n\t\tuint256 _originChainId\n\t);\n}" + }, + "contracts/interface/ISideToken.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\ninterface ISideToken {\n function mint(address account, uint256 amount, bytes calldata userData, bytes calldata operatorData) external;\n}" + }, + "contracts/interface/ISideTokenFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\ninterface ISideTokenFactory {\n\n function createSideToken(string calldata name, string calldata symbol, uint256 granularity) external returns(address);\n\n event SideTokenCreated(address indexed sideToken, string symbol, uint256 granularity);\n}" + }, + "contracts/interface/IAllowTokens.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\ninterface IAllowTokens {\n\n\tstruct Limits {\n\t\tuint256 min;\n\t\tuint256 max;\n\t\tuint256 daily;\n\t\tuint256 mediumAmount;\n\t\tuint256 largeAmount;\n\t}\n\n\tstruct TokenInfo {\n\t\tbool allowed;\n\t\tuint256 typeId;\n\t\tuint256 spentToday;\n\t\tuint256 lastDay;\n\t}\n\n\tstruct TypeInfo {\n\t\tstring description;\n\t\tLimits limits;\n\t}\n\n\tstruct TokensAndType {\n\t\taddress token;\n\t\tuint256 typeId;\n\t}\n\n\tfunction version() external pure returns (string memory);\n\n\tfunction getInfoAndLimits(address token) external view returns (TokenInfo memory info, Limits memory limit);\n\n\tfunction calcMaxWithdraw(address token) external view returns (uint256 maxWithdraw);\n\n\tfunction getTypesLimits() external view returns(Limits[] memory limits);\n\n\tfunction getTypeDescriptionsLength() external view returns(uint256);\n\n\tfunction getTypeDescriptions() external view returns(string[] memory descriptions);\n\n\tfunction setToken(address token, uint256 typeId) external;\n\n\tfunction getConfirmations() external view returns (uint256 smallAmount, uint256 mediumAmount, uint256 largeAmount);\n\n\tfunction isTokenAllowed(address token) external view returns (bool);\n\n\tfunction updateTokenTransfer(address token, uint256 amount) external;\n}" + }, + "contracts/interface/IWrapped.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\ninterface IWrapped {\n function balanceOf(address) external returns(uint);\n\n function deposit() external payable;\n\n function withdraw(uint wad) external;\n\n function totalSupply() external view returns (uint);\n\n function approve(address guy, uint wad) external returns (bool);\n\n function transfer(address dst, uint wad) external returns (bool);\n\n function transferFrom(address src, address dst, uint wad)\n external\n returns (bool);\n}" + }, + "contracts/zeppelin/GSN/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n\n function _msgSender() internal view returns (address payable) {\n return payable(msg.sender);\n }\n\n function _msgData() internal view returns (bytes memory) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n" + }, + "contracts/zeppelin/upgradable/access/roles/UpgradablePauserRole.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../../Initializable.sol\";\n\nimport \"../../../GSN/Context.sol\";\nimport \"../../../access/Roles.sol\";\n\ncontract UpgradablePauserRole is Initializable, Context {\n using Roles for Roles.Role;\n\n event PauserAdded(address indexed account);\n event PauserRemoved(address indexed account);\n\n Roles.Role private _pausers;\n\n function __PauserRol_init(address sender) public initializer {\n if (!isPauser(sender)) {\n _addPauser(sender);\n }\n }\n\n modifier onlyPauser() {\n require(isPauser(_msgSender()), \"PauserRole: caller doesn't have the role\");\n _;\n }\n\n function isPauser(address account) public view returns (bool) {\n return _pausers.has(account);\n }\n\n function addPauser(address account) public onlyPauser {\n _addPauser(account);\n }\n\n function renouncePauser() public {\n _removePauser(_msgSender());\n }\n\n function _addPauser(address account) internal {\n _pausers.add(account);\n emit PauserAdded(account);\n }\n\n function _removePauser(address account) internal {\n _pausers.remove(account);\n emit PauserRemoved(account);\n }\n}\n" + }, + "contracts/zeppelin/access/Roles.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @title Roles\n * @dev Library for managing addresses assigned to a Role.\n */\nlibrary Roles {\n struct Role {\n mapping (address => bool) bearer;\n }\n\n /**\n * @dev Give an account access to this role.\n */\n function add(Role storage role, address account) internal {\n require(!has(role, account), \"Roles: account already has role\");\n role.bearer[account] = true;\n }\n\n /**\n * @dev Remove an account's access to this role.\n */\n function remove(Role storage role, address account) internal {\n require(has(role, account), \"Roles: account doesn't have role\");\n role.bearer[account] = false;\n }\n\n /**\n * @dev Check if an account has this role.\n * @return bool\n */\n function has(Role storage role, address account) internal view returns (bool) {\n require(account != address(0), \"Roles: account is the zero address\");\n return role.bearer[account];\n }\n}\n" + }, + "contracts/SideTokenFactory/SideTokenFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../zeppelin/ownership/Secondary.sol\";\nimport \"../interface/ISideTokenFactory.sol\";\nimport \"../SideToken/SideToken.sol\";\n\ncontract SideTokenFactory is ISideTokenFactory, Secondary {\n\n function createSideToken(string calldata name, string calldata symbol, uint256 granularity)\n external onlyPrimary override returns(address) {\n address sideToken = address(new SideToken(name, symbol, primary(), granularity));\n emit SideTokenCreated(sideToken, symbol, granularity);\n return sideToken;\n }\n}" + }, + "contracts/zeppelin/ownership/Secondary.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../GSN/Context.sol\";\n/**\n * @dev A Secondary contract can only be used by its primary account (the one that created it).\n */\nabstract contract Secondary is Context {\n address private _primary;\n\n /**\n * @dev Emitted when the primary contract changes.\n */\n event PrimaryTransferred(\n address recipient\n );\n\n /**\n * @dev Sets the primary account to the one that is creating the Secondary contract.\n */\n constructor () {\n _primary = _msgSender();\n emit PrimaryTransferred(_primary);\n }\n\n /**\n * @dev Reverts if called from any account other than the primary.\n */\n modifier onlyPrimary() {\n require(_msgSender() == _primary, \"Secondary: caller is not the primary account\");\n _;\n }\n\n /**\n * @return the address of the primary.\n */\n function primary() public view returns (address) {\n return _primary;\n }\n\n /**\n * @dev Transfers contract to a new primary.\n * @param recipient The address of new primary.\n */\n function transferPrimary(address recipient) public onlyPrimary {\n require(recipient != address(0), \"Secondary: new primary is the zero address\");\n _primary = recipient;\n emit PrimaryTransferred(_primary);\n }\n}\n" + }, + "contracts/SideToken/SideToken.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../zeppelin/token/ERC777/ERC777.sol\";\nimport \"../interface/IERC677Receiver.sol\";\nimport \"../interface/ISideToken.sol\";\nimport \"../lib/LibEIP712.sol\";\n\ncontract SideToken is ISideToken, ERC777 {\n using SafeMath for uint256;\n\n address public minter;\n uint256 private _granularity;\n\n // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2612.md\n bytes32 public domainSeparator;\n // keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");\n bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;\n mapping(address => uint) public nonces;\n\n // ERC677 Transfer Event\n event Transfer(address,address,uint256,bytes);\n\n constructor(string memory _tokenName, string memory _tokenSymbol, address _minterAddr, uint256 _newGranularity)\n ERC777(_tokenName, _tokenSymbol, new address[](0)) {\n require(_minterAddr != address(0), \"SideToken: Empty Minter\");\n require(_newGranularity >= 1, \"SideToken: Granularity < 1\");\n minter = _minterAddr;\n _granularity = _newGranularity;\n\n domainSeparator = LibEIP712.hashEIP712Domain(\n name(),\n \"1\",\n block.chainid,\n address(this)\n );\n }\n\n modifier onlyMinter() {\n require(_msgSender() == minter, \"SideToken: Caller is not the minter\");\n _;\n }\n\n function mint(\n address account,\n uint256 amount,\n bytes calldata userData,\n bytes calldata operatorData\n )\n external onlyMinter override\n {\n _mint(_msgSender(), account, amount, userData, operatorData);\n }\n\n /**\n * @dev ERC677 transfer token with additional data if the recipient is a contact.\n * @param recipient The address to transfer to.\n * @param amount The amount to be transferred.\n * @param data The extra data to be passed to the receiving contract.\n */\n function transferAndCall(address recipient, uint amount, bytes calldata data)\n external returns (bool success)\n {\n address from = _msgSender();\n\n _send(from, from, recipient, amount, data, \"\", false);\n emit Transfer(from, recipient, amount, data);\n IERC677Receiver(recipient).onTokenTransfer(from, amount, data);\n return true;\n }\n\n function granularity() public view override returns (uint256) {\n return _granularity;\n }\n\n // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2612.md\n function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {\n require(deadline >= block.timestamp, \"SideToken: EXPIRED\"); // solhint-disable-line not-rely-on-time\n bytes32 digest = LibEIP712.hashEIP712Message(\n domainSeparator,\n keccak256(\n abi.encode(\n PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n nonces[owner]++,\n deadline\n )\n )\n );\n address recoveredAddress = ecrecover(digest, v, r, s);\n require(recoveredAddress != address(0) && recoveredAddress == owner, \"SideToken: INVALID_SIGNATURE\");\n _approve(owner, spender, value);\n }\n\n}" + }, + "contracts/zeppelin/token/ERC777/ERC777.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../../GSN/Context.sol\";\nimport \"./IERC777.sol\";\nimport \"./IERC777Recipient.sol\";\nimport \"./IERC777Sender.sol\";\nimport \"../../token/ERC20/IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../introspection/IERC1820Registry.sol\";\n\n/**\n * @dev Implementation of the {IERC777} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n *\n * Support for ERC20 is included in this contract, as specified by the EIP: both\n * the ERC777 and ERC20 interfaces can be safely used when interacting with it.\n * Both {IERC777-Sent} and {IERC20-Transfer} events are emitted on token\n * movements.\n *\n * Additionally, the {IERC777-granularity} value is hard-coded to `1`, meaning that there\n * are no special restrictions in the amount of tokens that created, moved, or\n * destroyed. This makes integration with ERC20 applications seamless.\n */\ncontract ERC777 is Context, IERC777, IERC20 {\n using SafeMath for uint256;\n using Address for address;\n\n IERC1820Registry constant private _erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);\n\n mapping(address => uint256) private _balances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n // We inline the result of the following hashes because Solidity doesn't resolve them at compile time.\n // See https://github.com/ethereum/solidity/issues/4024.\n\n // keccak256(\"ERC777TokensSender\")\n bytes32 constant private TOKENS_SENDER_INTERFACE_HASH =\n 0x29ddb589b1fb5fc7cf394961c1adf5f8c6454761adf795e67fe149f658abe895;\n\n // keccak256(\"ERC777TokensRecipient\")\n bytes32 constant private TOKENS_RECIPIENT_INTERFACE_HASH =\n 0xb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b;\n\n // This isn't ever read from - it's only used to respond to the defaultOperators query.\n address[] private _defaultOperatorsArray;\n\n // Immutable, but accounts may revoke them (tracked in __revokedDefaultOperators).\n mapping(address => bool) private _defaultOperators;\n\n // For each account, a mapping of its operators and revoked default operators.\n mapping(address => mapping(address => bool)) private _operators;\n mapping(address => mapping(address => bool)) private _revokedDefaultOperators;\n\n // ERC20-allowances\n mapping (address => mapping (address => uint256)) private _allowances;\n\n /**\n * @dev `defaultOperators` may be an empty array.\n */\n constructor(\n string memory aName,\n string memory aSymbol,\n address[] memory theDefaultOperators\n ) {\n _name = aName;\n _symbol = aSymbol;\n\n _defaultOperatorsArray = theDefaultOperators;\n for (uint256 i = 0; i < _defaultOperatorsArray.length; i++) {\n _defaultOperators[_defaultOperatorsArray[i]] = true;\n }\n\n // register interfaces\n _erc1820.setInterfaceImplementer(address(this), keccak256(\"ERC777Token\"), address(this));\n _erc1820.setInterfaceImplementer(address(this), keccak256(\"ERC20Token\"), address(this));\n }\n\n /**\n * @dev See {IERC777-name}.\n */\n function name() public view override(IERC777) returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC777-symbol}.\n */\n function symbol() public view override(IERC777) returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {ERC20Detailed-decimals}.\n *\n * Always returns 18, as per the\n * [ERC777 EIP](https://eips.ethereum.org/EIPS/eip-777#backward-compatibility).\n */\n function decimals() public pure override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC777-granularity}.\n *\n * This implementation always returns `1`.\n */\n function granularity() public view virtual override(IERC777) returns (uint256) {\n return 1;\n }\n\n /**\n * @dev See {IERC777-totalSupply}.\n */\n function totalSupply() public view override(IERC20, IERC777) returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev Returns the amount of tokens owned by an account (`tokenHolder`).\n */\n function balanceOf(address tokenHolder) public view override(IERC20, IERC777) returns (uint256) {\n return _balances[tokenHolder];\n }\n\n /**\n * @dev See {IERC777-send}.\n *\n * Also emits a {Transfer} event for ERC20 compatibility.\n */\n function send(address recipient, uint256 amount, bytes calldata data) external override(IERC777) {\n _send(_msgSender(), _msgSender(), recipient, amount, data, \"\", true);\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Unlike `send`, `recipient` is _not_ required to implement the {IERC777Recipient}\n * interface if it is a contract.\n *\n * Also emits a {Sent} event.\n */\n function transfer(address recipient, uint256 amount) external override(IERC20) returns (bool) {\n require(recipient != address(0), \"ERC777: transfer to zero address\");\n\n address from = _msgSender();\n\n _callTokensToSend(from, from, recipient, amount, \"\", \"\");\n\n _move(from, from, recipient, amount, \"\", \"\");\n\n _callTokensReceived(from, from, recipient, amount, \"\", \"\", false);\n\n return true;\n }\n\n /**\n * @dev See {IERC777-burn}.\n *\n * Also emits a {Transfer} event for ERC20 compatibility.\n */\n function burn(uint256 amount, bytes calldata data) external override(IERC777) {\n _burn(_msgSender(), _msgSender(), amount, data, \"\");\n }\n\n /**\n * @dev See {IERC777-isOperatorFor}.\n */\n function isOperatorFor(\n address operator,\n address tokenHolder\n ) public view override(IERC777) returns (bool) {\n return operator == tokenHolder ||\n (_defaultOperators[operator] && !_revokedDefaultOperators[tokenHolder][operator]) ||\n _operators[tokenHolder][operator];\n }\n\n /**\n * @dev See {IERC777-authorizeOperator}.\n */\n function authorizeOperator(address operator) external override(IERC777) {\n require(_msgSender() != operator, \"ERC777: authorizing self as operator\");\n\n if (_defaultOperators[operator]) {\n delete _revokedDefaultOperators[_msgSender()][operator];\n } else {\n _operators[_msgSender()][operator] = true;\n }\n\n emit AuthorizedOperator(operator, _msgSender());\n }\n\n /**\n * @dev See {IERC777-revokeOperator}.\n */\n function revokeOperator(address operator) external override(IERC777) {\n require(operator != _msgSender(), \"ERC777: revoking self as operator\");\n\n if (_defaultOperators[operator]) {\n _revokedDefaultOperators[_msgSender()][operator] = true;\n } else {\n delete _operators[_msgSender()][operator];\n }\n\n emit RevokedOperator(operator, _msgSender());\n }\n\n /**\n * @dev See {IERC777-defaultOperators}.\n */\n function defaultOperators() public view override(IERC777) returns (address[] memory) {\n return _defaultOperatorsArray;\n }\n\n /**\n * @dev See {IERC777-operatorSend}.\n *\n * Emits {Sent} and {Transfer} events.\n */\n function operatorSend(\n address sender,\n address recipient,\n uint256 amount,\n bytes calldata data,\n bytes calldata operatorData\n )\n external override(IERC777)\n {\n require(isOperatorFor(_msgSender(), sender), \"ERC777: caller is not an operator\");\n _send(_msgSender(), sender, recipient, amount, data, operatorData, true);\n }\n\n /**\n * @dev See {IERC777-operatorBurn}.\n *\n * Emits {Burned} and {Transfer} events.\n */\n function operatorBurn(address account, uint256 amount, bytes calldata data, bytes calldata operatorData)\n external override(IERC777) {\n require(isOperatorFor(_msgSender(), account), \"ERC777: caller is not an operator\");\n _burn(_msgSender(), account, amount, data, operatorData);\n }\n\n /**\n * @dev See {IERC20-allowance}.\n *\n * Note that operator and allowance concepts are orthogonal: operators may\n * not have allowance, and accounts with allowance may not be operators\n * themselves.\n */\n function allowance(address holder, address spender)\n public view override(IERC20) returns (uint256) {\n return _allowances[holder][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * Note that accounts cannot have allowance issued by their operators.\n */\n function approve(address spender, uint256 value) external override(IERC20) returns (bool) {\n address holder = _msgSender();\n _approve(holder, spender, value);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Note that operator and allowance concepts are orthogonal: operators cannot\n * call `transferFrom` (unless they have allowance), and accounts with\n * allowance cannot call `operatorSend` (unless they are operators).\n *\n * Emits {Sent}, {Transfer} and {Approval} events.\n */\n function transferFrom(address holder, address recipient, uint256 amount)\n external override(IERC20) returns (bool) {\n require(recipient != address(0), \"ERC777: transfer to zero address\");\n require(holder != address(0), \"ERC777: transfer from zero address\");\n\n address spender = _msgSender();\n\n _callTokensToSend(spender, holder, recipient, amount, \"\", \"\");\n\n _move(spender, holder, recipient, amount, \"\", \"\");\n _approve(holder, spender, _allowances[holder][spender].sub(amount, \"ERC777: transfer amount exceeds allowance\"));\n\n _callTokensReceived(spender, holder, recipient, amount, \"\", \"\", false);\n\n return true;\n }\n\n /**\n * @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * If a send hook is registered for `account`, the corresponding function\n * will be called with `operator`, `data` and `operatorData`.\n *\n * See {IERC777Sender} and {IERC777Recipient}.\n *\n * Emits {Minted} and {Transfer} events.\n *\n * Requirements\n *\n * - `account` cannot be the zero address.\n * - if `account` is a contract, it must implement the {IERC777Recipient}\n * interface.\n */\n function _mint(\n address operator,\n address account,\n uint256 amount,\n bytes memory userData,\n bytes memory operatorData\n )\n internal\n {\n require(account != address(0), \"ERC777: mint to zero address\");\n\n // Update state variables\n _totalSupply = _totalSupply.add(amount);\n _balances[account] = _balances[account].add(amount);\n\n _callTokensReceived(operator, address(0), account, amount, userData, operatorData, true);\n\n emit Minted(operator, account, amount, userData, operatorData);\n emit Transfer(address(0), account, amount);\n }\n\n /**\n * @dev Send tokens\n * @param operator address operator requesting the transfer\n * @param from address token holder address\n * @param to address recipient address\n * @param amount uint256 amount of tokens to transfer\n * @param userData bytes extra information provided by the token holder (if any)\n * @param operatorData bytes extra information provided by the operator (if any)\n * @param requireReceptionAck if true, contract recipients are required to implement ERC777TokensRecipient\n */\n function _send(\n address operator,\n address from,\n address to,\n uint256 amount,\n bytes memory userData,\n bytes memory operatorData,\n bool requireReceptionAck\n )\n internal\n {\n require(from != address(0), \"ERC777: send from zero address\");\n require(to != address(0), \"ERC777: send to zero address\");\n\n _callTokensToSend(operator, from, to, amount, userData, operatorData);\n\n _move(operator, from, to, amount, userData, operatorData);\n\n _callTokensReceived(operator, from, to, amount, userData, operatorData, requireReceptionAck);\n }\n\n /**\n * @dev Burn tokens\n * @param operator address operator requesting the operation\n * @param from address token holder address\n * @param amount uint256 amount of tokens to burn\n * @param data bytes extra information provided by the token holder\n * @param operatorData bytes extra information provided by the operator (if any)\n */\n function _burn(\n address operator,\n address from,\n uint256 amount,\n bytes memory data,\n bytes memory operatorData\n )\n internal\n {\n require(from != address(0), \"ERC777: burn from zero address\");\n\n _callTokensToSend(operator, from, address(0), amount, data, operatorData);\n\n // Update state variables\n _balances[from] = _balances[from].sub(amount, \"ERC777: burn amount exceeds balance\");\n _totalSupply = _totalSupply.sub(amount);\n\n emit Burned(operator, from, amount, data, operatorData);\n emit Transfer(from, address(0), amount);\n }\n\n function _move(\n address operator,\n address from,\n address to,\n uint256 amount,\n bytes memory userData,\n bytes memory operatorData\n )\n internal\n {\n _balances[from] = _balances[from].sub(amount, \"ERC777: transfer amount exceeds balance\");\n _balances[to] = _balances[to].add(amount);\n\n emit Sent(operator, from, to, amount, userData, operatorData);\n emit Transfer(from, to, amount);\n }\n\n function _approve(address holder, address spender, uint256 value) internal {\n // TODO: restore this require statement if this function becomes internal, or is called at a new callsite. It is\n // currently unnecessary.\n //require(holder != address(0), \"ERC777: approve from the zero address\");\n require(spender != address(0), \"ERC777: approve to zero address\");\n\n _allowances[holder][spender] = value;\n emit Approval(holder, spender, value);\n }\n\n /**\n * @dev Call from.tokensToSend() if the interface is registered\n * @param operator address operator requesting the transfer\n * @param from address token holder address\n * @param to address recipient address\n * @param amount uint256 amount of tokens to transfer\n * @param userData bytes extra information provided by the token holder (if any)\n * @param operatorData bytes extra information provided by the operator (if any)\n */\n function _callTokensToSend(\n address operator,\n address from,\n address to,\n uint256 amount,\n bytes memory userData,\n bytes memory operatorData\n )\n internal\n {\n address implementer = _erc1820.getInterfaceImplementer(from, TOKENS_SENDER_INTERFACE_HASH);\n if (implementer != address(0)) {\n IERC777Sender(implementer).tokensToSend(operator, from, to, amount, userData, operatorData);\n }\n }\n\n /**\n * @dev Call to.tokensReceived() if the interface is registered. Reverts if the recipient is a contract but\n * tokensReceived() was not registered for the recipient\n * @param operator address operator requesting the transfer\n * @param from address token holder address\n * @param to address recipient address\n * @param amount uint256 amount of tokens to transfer\n * @param userData bytes extra information provided by the token holder (if any)\n * @param operatorData bytes extra information provided by the operator (if any)\n * @param requireReceptionAck if true, contract recipients are required to implement ERC777TokensRecipient\n */\n function _callTokensReceived(\n address operator,\n address from,\n address to,\n uint256 amount,\n bytes memory userData,\n bytes memory operatorData,\n bool requireReceptionAck\n )\n private\n {\n address implementer = _erc1820.getInterfaceImplementer(to, TOKENS_RECIPIENT_INTERFACE_HASH);\n if (implementer != address(0)) {\n IERC777Recipient(implementer).tokensReceived(operator, from, to, amount, userData, operatorData);\n } else if (requireReceptionAck) {\n require(!to.isContract(), \"ERC777: token recipient contract has no implementer for ERC777TokensRecipient\");\n }\n }\n}\n" + }, + "contracts/interface/IERC677Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\ninterface IERC677Receiver {\n function onTokenTransfer(address _sender, uint _value, bytes calldata _data) external;\n}" + }, + "contracts/zeppelin/token/ERC777/IERC777Sender.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @dev Interface of the ERC777TokensSender standard as defined in the EIP.\n *\n * `IERC777` Token holders can be notified of operations performed on their\n * tokens by having a contract implement this interface (contract holders can be\n * their own implementer) and registering it on the\n * [ERC1820 global registry](https://eips.ethereum.org/EIPS/eip-1820).\n *\n * See `IERC1820Registry` and `ERC1820Implementer`.\n */\ninterface IERC777Sender {\n /**\n * @dev Called by an `IERC777` token contract whenever a registered holder's\n * (`from`) tokens are about to be moved or destroyed. The type of operation\n * is conveyed by `to` being the zero address or not.\n *\n * This call occurs _before_ the token contract's state is updated, so\n * `IERC777.balanceOf`, etc., can be used to query the pre-operation state.\n *\n * This function may revert to prevent the operation from being executed.\n */\n function tokensToSend(\n address operator,\n address from,\n address to,\n uint amount,\n bytes calldata userData,\n bytes calldata operatorData\n ) external;\n}\n" + }, + "contracts/zeppelin/upgradable/proxy/ProxyAdmin.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../../ownership/Ownable.sol\";\nimport \"./TransparentUpgradeableProxy.sol\";\n\n/**\n * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an\n * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.\n */\ncontract ProxyAdmin is Ownable {\n\n /**\n * @dev Returns the current implementation of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"implementation()\")) == 0x5c60da1b\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"5c60da1b\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Returns the current admin of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"admin()\")) == 0xf851a440\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"f851a440\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Changes the admin of `proxy` to `newAdmin`.\n *\n * Requirements:\n *\n * - This contract must be the current admin of `proxy`.\n */\n function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {\n proxy.changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgrade(TransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {\n proxy.upgradeTo(implementation);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. See\n * {TransparentUpgradeableProxy-upgradeToAndCall}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgradeAndCall(TransparentUpgradeableProxy proxy, address implementation, bytes memory data) public payable virtual onlyOwner {\n proxy.upgradeToAndCall{value: msg.value}(implementation, data);\n }\n}\n" + }, + "contracts/zeppelin/ownership/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../GSN/Context.sol\";\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () {\n _owner = _msgSender();\n emit OwnershipTransferred(address(0), _owner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(isOwner(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Returns true if the caller is the current owner.\n */\n function isOwner() public view returns (bool) {\n return _msgSender() == _owner;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public onlyOwner {\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n */\n function _transferOwnership(address newOwner) internal {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "contracts/zeppelin/upgradable/proxy/TransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"./UpgradeableProxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is UpgradeableProxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {UpgradeableProxy-constructor}.\n */\n constructor(address _logic, address admin_, bytes memory _data) payable UpgradeableProxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _setAdmin(admin_);\n }\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _admin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _admin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n require(newAdmin != address(0), \"TransparentUpgradeableProxy: new admin is the zero address\");\n emit AdminChanged(_admin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external virtual ifAdmin {\n _upgradeTo(newImplementation);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable virtual ifAdmin {\n _upgradeTo(newImplementation);\n Address.functionDelegateCall(newImplementation, data);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address adm) {\n bytes32 slot = _ADMIN_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n adm := sload(slot)\n }\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n bytes32 slot = _ADMIN_SLOT;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, newAdmin)\n }\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _admin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n}\n" + }, + "contracts/zeppelin/upgradable/proxy/UpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"./Proxy.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n *\n * Upgradeability is only provided internally through {_upgradeTo}. For an externally upgradeable proxy see\n * {TransparentUpgradeableProxy}.\n */\ncontract UpgradeableProxy is Proxy {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n _setImplementation(_logic);\n if(_data.length > 0) {\n Address.functionDelegateCall(_logic, _data);\n }\n }\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 private constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n bytes32 slot = _IMPLEMENTATION_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n impl := sload(slot)\n }\n }\n\n /**\n * @dev Upgrades the proxy to a new implementation.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal virtual {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"UpgradeableProxy: new implementation is not a contract\");\n\n bytes32 slot = _IMPLEMENTATION_SLOT;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, newImplementation)\n }\n }\n}\n" + }, + "contracts/zeppelin/upgradable/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 { revert(0, returndatasize()) }\n default { return(0, returndatasize()) }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback () external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive () external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {\n }\n}\n" + }, + "contracts/Federation/Federation.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n// Upgradables\nimport \"../zeppelin/upgradable/Initializable.sol\";\nimport \"../zeppelin/upgradable/ownership/UpgradableOwnable.sol\";\n\nimport \"../interface/IBridge.sol\";\nimport \"../interface/IFederation.sol\";\ncontract Federation is Initializable, UpgradableOwnable, IFederation {\n\tuint constant public MAX_MEMBER_COUNT = 50;\n\taddress constant private NULL_ADDRESS = address(0);\n\n\tIBridge public bridge;\n\taddress[] public members;\n\n\t/**\n\t\t@notice The minimum amount of votes to approve a transaction\n\t\t@dev It should have at least the required amount of members\n\t\t*/\n\tuint public required;\n\n\t/**\n\t\t@notice All the addresses that are members of the federation\n\t\t@dev The address should be a member to vote in transactions\n\t\t*/\n\tmapping (address => bool) public isMember;\n\n\t/**\n\t\t(bytes32) transactionId = keccak256(\n\t\t\tabi.encodePacked(\n\t\t\t\toriginalTokenAddress,\n\t\t\t\tsender,\n\t\t\t\treceiver,\n\t\t\t\tamount,\n\t\t\t\tblockHash,\n\t\t\t\ttransactionHash,\n\t\t\t\tlogIndex\n\t\t\t)\n\t\t) => (\n\t\t\t(address) members => (bool) voted\n\t\t)\n\t\t@notice Votes by members by the transaction ID\n\t\t@dev the members should approve the transaction by 50% + 1\n\t\t*/\n\tmapping (bytes32 => mapping (address => bool)) public votes;\n\n\t/**\n\t\t(bytes32) transactionId => (bool) voted\n\t\t@notice Check if that transaction was already processed\n\t*/\n\tmapping(bytes32 => bool) public processed;\n\n\tmodifier onlyMember() {\n\t\trequire(isMember[_msgSender()], \"Federation: Not Federator\");\n\t\t_;\n\t}\n\n\tmodifier validRequirement(uint membersCount, uint _required) {\n\t\trequire(_required <= membersCount && _required != 0 && membersCount != 0, \"Federation: Invalid requirements\");\n\t\t_;\n\t}\n\n\tfunction initialize(\n\t\taddress[] calldata _members,\n\t\tuint _required,\n\t\taddress _bridge,\n\t\taddress owner\n\t) public validRequirement(_members.length, _required) initializer {\n\t\tUpgradableOwnable.initialize(owner);\n\t\trequire(_members.length <= MAX_MEMBER_COUNT, \"Federation: Too many members\");\n\t\tmembers = _members;\n\t\tfor (uint i = 0; i < _members.length; i++) {\n\t\t\trequire(!isMember[_members[i]] && _members[i] != NULL_ADDRESS, \"Federation: Invalid members\");\n\t\t\tisMember[_members[i]] = true;\n\t\t\temit MemberAddition(_members[i]);\n\t\t}\n\t\trequired = _required;\n\t\temit RequirementChange(required);\n\t\t_setBridge(_bridge);\n\t}\n\n\t/**\n\t\t@notice Current version of the contract\n\t\t@return version in v{Number}\n\t\t*/\n\tfunction version() external pure override returns (string memory) {\n\t\treturn \"v3\";\n\t}\n\n\t/**\n\t\t@notice Sets a new bridge contract\n\t\t@dev Emits BridgeChanged event\n\t\t@param _bridge the new bridge contract address that should implement the IBridge interface\n\t\t*/\n\tfunction setBridge(address _bridge) external onlyOwner override {\n\t\t_setBridge(_bridge);\n\t}\n\n\tfunction _setBridge(address _bridge) internal {\n\t\trequire(_bridge != NULL_ADDRESS, \"Federation: Empty bridge\");\n\t\tbridge = IBridge(_bridge);\n\t\temit BridgeChanged(_bridge);\n\t}\n\n\tfunction validateTransaction(bytes32 transactionId, bytes32 transactionIdMultichain) internal view returns(bool) {\n\t\tuint256 minimumVotes = getMinimalNumberOfVotes();\n\t\tuint256 amountVotes = 0;\n\n for (uint256 i = 0; i < members.length; i++) {\n if (votes[transactionIdMultichain][members[i]]) {\n amountVotes += 1;\n\t\t\t} else if (votes[transactionId][members[i]]) {\n amountVotes += 1;\n\t\t\t}\n\n\t\t\tif (amountVotes >= minimumVotes && amountVotes >= required) {\n\t\t\t\treturn true;\n\t\t\t}\n }\n\n\t\treturn false;\n\t}\n\n\tfunction getMinimalNumberOfVotes() internal view returns(uint256) {\n\t\treturn members.length / 2 + 1;\n\t}\n\n\tfunction isProcessed(bytes32 transactionId, bytes32 transactionIdMultichain) public view returns(bool) {\n\t\treturn processed[transactionIdMultichain] || processed[transactionId];\n\t}\n\n\tfunction isVoted(bytes32 transactionId, bytes32 transactionIdMultichain) public view returns(bool) {\n\t\treturn votes[transactionIdMultichain][_msgSender()] || votes[transactionId][_msgSender()];\n\t}\n\n\tfunction shouldBeCurrentChainId(uint256 chainId) internal view {\n\t\trequire(chainId == block.chainid, \"Federation: Not block.chainid\");\n\t}\n\n\t/**\n\t\t@notice Vote in a transaction, if it has enough votes it accepts the transfer\n\t\t@param originalTokenAddress The address of the token in the origin (main) chain\n\t\t@param sender The address who solicited the cross token\n\t\t@param receiver Who is going to receive the token in the opposite chain\n\t\t@param value Amount\n\t\t@param blockHash The block hash in which the transaction with the cross event occurred\n\t\t@param transactionHash The transaction in which the cross event occurred\n\t\t@param logIndex Index of the event in the logs\n\t\t@param originChainId Is chainId of the original chain\n\t\t@param destinationChainId Is chainId of the destination chain\n\t\t*/\n\tfunction voteTransaction(\n\t\taddress originalTokenAddress,\n\t\taddress payable sender,\n\t\taddress payable receiver,\n\t\tuint256 value,\n\t\tbytes32 blockHash,\n\t\tbytes32 transactionHash,\n\t\tuint32 logIndex,\n\t\tuint256 originChainId,\n\t\tuint256\tdestinationChainId\n\t) external onlyMember override {\n\t\tshouldBeCurrentChainId(destinationChainId);\n\t\tbytes32 transactionId = keccak256(\n\t\t\tabi.encodePacked(\n\t\t\t\toriginalTokenAddress,\n\t\t\t\tsender,\n\t\t\t\treceiver,\n\t\t\t\tvalue,\n\t\t\t\tblockHash,\n\t\t\t\ttransactionHash,\n\t\t\t\tlogIndex\n\t\t\t)\n\t\t);\n\n\t\tbytes32 transactionIdMultichain = getTransactionId(\n\t\t\toriginalTokenAddress,\n\t\t\tsender,\n\t\t\treceiver,\n\t\t\tvalue,\n\t\t\tblockHash,\n\t\t\ttransactionHash,\n\t\t\tlogIndex,\n\t\t\toriginChainId,\n\t\t\tdestinationChainId\n\t\t);\n\n\t\tif (isProcessed(transactionId, transactionIdMultichain))\n\t\t\treturn;\n\n\t\tif (isVoted(transactionId, transactionIdMultichain))\n\t\t\treturn;\n\n\t\tvotes[transactionIdMultichain][_msgSender()] = true;\n\t\temit Voted(\n\t\t\t_msgSender(),\n\t\t\ttransactionHash,\n\t\t\ttransactionIdMultichain,\n\t\t\toriginalTokenAddress,\n\t\t\tsender,\n\t\t\treceiver,\n\t\t\tvalue,\n\t\t\tblockHash,\n\t\t\tlogIndex,\n\t\t\toriginChainId,\n\t\t\tdestinationChainId\n\t\t);\n\n\t\tif (validateTransaction(transactionId, transactionIdMultichain)) {\n\t\t\tprocessed[transactionIdMultichain] = true;\n\n\t\t\tacceptTransfer(\n\t\t\t\toriginalTokenAddress,\n\t\t\t\tsender,\n\t\t\t\treceiver,\n\t\t\t\tvalue,\n\t\t\t\tblockHash,\n\t\t\t\ttransactionHash,\n\t\t\t\tlogIndex,\n\t\t\t\t\n\t\t\t\toriginChainId,\n\t\t\t\tdestinationChainId\n\t\t\t);\n\n\t\t\temit Executed(\n\t\t\t\t_msgSender(),\n\t\t\t\ttransactionHash,\n\t\t\t\ttransactionIdMultichain,\n\t\t\t\toriginalTokenAddress,\n\t\t\t\tsender,\n\t\t\t\treceiver,\n\t\t\t\tvalue,\n\t\t\t\tblockHash,\n\t\t\t\tlogIndex,\n\t\t\t\toriginChainId,\n\t\t\t\tdestinationChainId\n\t\t\t);\n\t\t}\n\t}\n\n function acceptTransfer(\n address originalTokenAddress,\n address payable sender,\n address payable receiver,\n uint256 value,\n bytes32 blockHash,\n bytes32 transactionHash,\n uint32 logIndex,\n\tuint256 originChainId,\n\tuint256\tdestinationChainId\n ) internal {\n\t bridge.acceptTransfer(\n\t\toriginalTokenAddress,\n\t\tsender,\n\t\treceiver,\n\t\tvalue,\n\t\tblockHash,\n\t\ttransactionHash,\n\t\tlogIndex,\n\t\toriginChainId,\n\t\tdestinationChainId\n\t );\n }\n\n /**\n @notice Get the amount of approved votes for that transactionId\n @param transactionId The transaction hashed from getTransactionId function\n */\n function getTransactionCount(bytes32 transactionId) public view returns(uint) {\n uint count = 0;\n for (uint i = 0; i < members.length; i++) {\n if (votes[transactionId][members[i]])\n count += 1;\n }\n return count;\n }\n\n\tfunction hasVoted(bytes32 transactionId) external view returns(bool) {\n\t\treturn votes[transactionId][_msgSender()];\n\t}\n\n\tfunction transactionWasProcessed(bytes32 transactionId) external view returns(bool) {\n\t\treturn processed[transactionId];\n\t}\n\n\t/**\n\t\t@notice Gets the hash of transaction from the following parameters encoded and keccaked\n\t\t@dev It encodes and applies keccak256 to the parameters received in the same order\n\t\t@param originalTokenAddress The address of the token in the origin (main) chain\n\t\t@param sender The address who solicited the cross token\n\t\t@param receiver Who is going to receive the token in the opposite chain\n\t\t@param amount Could be the amount or the tokenId\n\t\t@param blockHash The block hash in which the transaction with the cross event occurred\n\t\t@param transactionHash The transaction in which the cross event occurred\n\t\t@param logIndex Index of the event in the logs\n\t\t@param originChainId Is chainId of the original chain\n\t\t@param destinationChainId Is chainId of the destination chain\n\t\t@return The hash generated by the parameters.\n\t*/\n\tfunction getTransactionId(\n\t\taddress originalTokenAddress,\n\t\taddress sender,\n\t\taddress receiver,\n\t\tuint256 amount,\n\t\tbytes32 blockHash,\n\t\tbytes32 transactionHash,\n\t\tuint32 logIndex,\n\t\tuint256 originChainId,\n\t\tuint256\tdestinationChainId\n\t) public pure returns(bytes32) {\n\t\treturn keccak256(\n\t\t\tabi.encodePacked(\n\t\t\t\toriginalTokenAddress,\n\t\t\t\tsender,\n\t\t\t\treceiver,\n\t\t\t\tamount,\n\t\t\t\tblockHash,\n\t\t\t\ttransactionHash,\n\t\t\t\tlogIndex,\n\t\t\t\toriginChainId,\n\t\t\t\tdestinationChainId\n\t\t\t)\n\t\t);\n\t}\n\n\tfunction addMember(address _newMember) external onlyOwner override {\n\t\trequire(_newMember != NULL_ADDRESS, \"Federation: Empty member\");\n\t\trequire(!isMember[_newMember], \"Federation: Member already exists\");\n\t\trequire(members.length < MAX_MEMBER_COUNT, \"Federation: Max members reached\");\n\n\t\tisMember[_newMember] = true;\n\t\tmembers.push(_newMember);\n\t\temit MemberAddition(_newMember);\n\t}\n\n\tfunction removeMember(address _oldMember) external onlyOwner override {\n\t\trequire(_oldMember != NULL_ADDRESS, \"Federation: Empty member\");\n\t\trequire(isMember[_oldMember], \"Federation: Member doesn't exists\");\n\t\trequire(members.length > 1, \"Federation: Can't remove all the members\");\n\t\trequire(members.length - 1 >= required, \"Federation: Can't have less than required members\");\n\n\t\tisMember[_oldMember] = false;\n\t\tfor (uint i = 0; i < members.length - 1; i++) {\n\t\t\tif (members[i] == _oldMember) {\n\t\t\t\tmembers[i] = members[members.length - 1];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tmembers.pop(); // remove an element from the end of the array.\n\t\temit MemberRemoval(_oldMember);\n\t}\n\n\t/**\n\t\t@notice Return all the current members of the federation\n\t\t@return Current members\n\t\t*/\n\tfunction getMembers() external view override returns (address[] memory) {\n\t\treturn members;\n\t}\n\n\t/**\n\t\t@notice Changes the number of required members to vote and approve an transaction\n\t\t@dev Emits the RequirementChange event\n\t\t@param _required the number of minimum members to approve an transaction, it has to be bigger than 1\n\t\t*/\n\tfunction changeRequirement(uint _required) external onlyOwner validRequirement(members.length, _required) override {\n\t\trequire(_required >= 2, \"Federation: Requires at least 2\");\n\t\trequired = _required;\n\t\temit RequirementChange(_required);\n\t}\n\n\t/**\n\t\t@notice It emits an HeartBeat like an health check\n\t\t@dev Emits HeartBeat event\n\t\t*/\n\tfunction emitHeartbeat(\n\t\tstring calldata fedVersion,\n\t\tuint256[] calldata fedChainsIds,\n\t\tuint256[] calldata fedChainsBlocks,\n\t\tstring[] calldata fedChainsInfo\n\t) external onlyMember override {\n\t\trequire(fedChainsIds.length == fedChainsBlocks.length &&\n\t\t\tfedChainsIds.length == fedChainsInfo.length, \"Federation: Length missmatch\");\n\t\temit HeartBeat(\n\t\t\t_msgSender(),\n\t\t\tblock.chainid,\n\t\t\tblock.number,\n\t\t\tfedVersion,\n\t\t\tfedChainsIds,\n\t\t\tfedChainsBlocks,\n\t\t\tfedChainsInfo\n\t\t);\n\t}\n}\n" + }, + "contracts/interface/IFederation.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\npragma abicoder v2;\n\ninterface IFederation {\n\n /**\n @notice Current version of the contract\n @return version in v{Number}\n */\n function version() external pure returns (string memory);\n\n /**\n @notice Sets a new bridge contract\n @param _bridge the new bridge contract address that should implement the IBridge interface\n */\n function setBridge(address _bridge) external;\n\n /**\n @notice Vote in a transaction, if it has enough votes it accepts the transfer\n @param originalTokenAddress The address of the token in the origin (main) chain\n @param sender The address who solicited the cross token\n @param receiver Who is going to receive the token in the opposite chain\n @param value Amount\n @param blockHash The block hash in which the transaction with the cross event occurred\n @param transactionHash The transaction in which the cross event occurred\n @param logIndex Index of the event in the logs\n\t\t@param originChainId Is chainId of the original chain\n\t\t@param destinationChainId Is chainId of the destination chain\n */\n function voteTransaction(\n address originalTokenAddress,\n address payable sender,\n address payable receiver,\n uint256 value,\n bytes32 blockHash,\n bytes32 transactionHash,\n uint32 logIndex,\n\t uint256 originChainId,\n\t uint256\tdestinationChainId\n ) external;\n\n /**\n @notice Add a new member to the federation\n @param _newMember address of the new member\n */\n function addMember(address _newMember) external;\n\n /**\n @notice Remove a member of the federation\n @param _oldMember address of the member to be removed from federation\n */\n function removeMember(address _oldMember) external;\n\n /**\n @notice Return all the current members of the federation\n @return Current members\n */\n function getMembers() external view returns (address[] memory);\n\n /**\n @notice Changes the number of required members to vote and approve an transaction\n @param _required the number of minimum members to approve an transaction, it has to be bigger than 1\n */\n function changeRequirement(uint _required) external;\n\n /**\n @notice It emmits an HeartBeat like an healthy check\n */\n function emitHeartbeat(\n string calldata federatorVersion,\n\t\tuint256[] calldata fedChainsIds,\n\t\tuint256[] calldata fedChainsBlocks,\n\t\tstring[] calldata fedChainsInfo\n ) external;\n\n event Executed(\n address indexed federator,\n bytes32 indexed transactionHash,\n bytes32 indexed transactionId,\n address originalTokenAddress,\n address sender,\n address receiver,\n uint256 amount,\n bytes32 blockHash,\n uint32 logIndex,\n\t\tuint256 originChainId,\n\t\tuint256\tdestinationChainId\n );\n event MemberAddition(address indexed member);\n event MemberRemoval(address indexed member);\n event RequirementChange(uint required);\n event BridgeChanged(address bridge);\n event Voted(\n address indexed federator,\n bytes32 indexed transactionHash,\n bytes32 indexed transactionId,\n address originalTokenAddress,\n address sender,\n address receiver,\n uint256 amount,\n bytes32 blockHash,\n uint32 logIndex,\n uint256 originChainId,\n\t\tuint256\tdestinationChainId\n );\n event HeartBeat(\n address indexed sender,\n uint256 currentChainId,\n uint256 currentBlock,\n string fedVersion,\n uint256[] fedChainsIds,\n\t\tuint256[] fedChainsBlocks,\n\t\tstring[] fedChainsInfo\n );\n\n}\n" + }, + "contracts/Proxies.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"./zeppelin/upgradable/proxy/TransparentUpgradeableProxy.sol\";\n\ncontract BridgeProxy is TransparentUpgradeableProxy {\n // solhint-disable-next-line no-empty-blocks\n constructor(address _logic, address _admin, bytes memory _data) TransparentUpgradeableProxy(_logic,_admin, _data) payable {}\n}\n\ncontract AllowTokensProxy is TransparentUpgradeableProxy {\n // solhint-disable-next-line no-empty-blocks\n constructor(address _logic, address _admin, bytes memory _data) TransparentUpgradeableProxy(_logic,_admin, _data) payable {}\n}\n\ncontract FederationProxy is TransparentUpgradeableProxy {\n // solhint-disable-next-line no-empty-blocks\n constructor(address _logic, address _admin, bytes memory _data) TransparentUpgradeableProxy(_logic,_admin, _data) payable {}\n}" + }, + "contracts/MultiSigWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - \ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * views\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this), \"Only wallet allowed\");\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner], \"The owner already exists\");\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner], \"The owner does not exist\");\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != address(0), \"Transaction does not exist\");\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner], \"Transaction is not confirmed by owner\");\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner], \"Transaction is already confirmed by owner\");\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed, \"Transaction was already executed\");\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != address(0), \"Address cannot be empty\");\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n // solium-disable-next-line max-len\n require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0, \"Required value is invalid for the current owners count\");\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n receive ()\n external\n payable\n {\n if (msg.value > 0)\n emit Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n constructor(address[] memory _owners, uint _required)\n validRequirement(_owners.length, _required)\n {\n for (uint i = 0; i < _owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != address(0), \"Owners addresses are invalid\");\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n emit OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i = 0; i < owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.pop(); // remove an element from the end of the array.\n if (required > owners.length)\n changeRequirement(owners.length);\n emit OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i = 0; i < owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n emit OwnerRemoval(owner);\n emit OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n emit RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return transactionId Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes memory data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n emit Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n emit Execution(transactionId);\n else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes memory data) internal returns (bool) {\n bool result;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas(), 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n view\n returns (bool)\n {\n uint count = 0;\n for (uint i = 0; i < owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n return false;\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return transactionId Returns transaction ID.\n function addTransaction(address destination, uint value, bytes memory data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n emit Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return count Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n view\n returns (uint count)\n {\n for (uint i = 0; i < owners.length; i++) {\n if (confirmations[transactionId][owners[i]]) {\n count += 1;\n }\n }\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return count Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n view\n returns (uint count)\n {\n for (uint i = 0; i < transactionCount; i++) {\n if ( pending && !transactions[i].executed || executed && transactions[i].executed) {\n count += 1;\n }\n }\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n view\n returns (address[] memory)\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return _confirmations Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n view\n returns (address[] memory _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i = 0; i < owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i = 0; i < count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return _transactionIds Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n view\n returns (uint[] memory _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i = 0; i < transactionCount; i++)\n if ( pending && !transactions[i].executed || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i = from; i < to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}" + } + }, + "settings": { + "evmVersion": "istanbul", + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/bridge/deployments/goerli/solcInputs/caeb40de80c8668828546c6b3fb7fad2.json b/bridge/deployments/goerli/solcInputs/caeb40de80c8668828546c6b3fb7fad2.json new file mode 100644 index 000000000..d1f8d4259 --- /dev/null +++ b/bridge/deployments/goerli/solcInputs/caeb40de80c8668828546c6b3fb7fad2.json @@ -0,0 +1,285 @@ +{ + "language": "Solidity", + "sources": { + "contracts/AllowTokens/AllowTokens.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../zeppelin/math/SafeMath.sol\";\n// Upgradables\nimport \"../zeppelin/upgradable/Initializable.sol\";\nimport \"../zeppelin/upgradable/ownership/UpgradableOwnable.sol\";\nimport \"../zeppelin/upgradable/ownership/UpgradableSecondary.sol\";\n\nimport \"../interface/IAllowTokens.sol\";\n\ncontract AllowTokens is Initializable, UpgradableOwnable, UpgradableSecondary, IAllowTokens {\n\tusing SafeMath for uint256;\n\n\taddress constant private NULL_ADDRESS = address(0);\n\tuint256 constant public MAX_TYPES = 250;\n\tmapping (address => TokenInfo) public allowedTokens;\n\tmapping (uint256 => Limits) public typeLimits;\n\tuint256 public smallAmountConfirmations;\n\tuint256 public mediumAmountConfirmations;\n\tuint256 public largeAmountConfirmations;\n\tstring[] public typeDescriptions;\n\n\tevent SetToken(address indexed _tokenAddress, uint256 _typeId);\n\tevent AllowedTokenRemoved(address indexed _tokenAddress);\n\tevent TokenTypeAdded(uint256 indexed _typeId, string _typeDescription);\n\tevent TypeLimitsChanged(uint256 indexed _typeId, Limits limits);\n\tevent UpdateTokensTransfered(address indexed _tokenAddress, uint256 _lastDay, uint256 _spentToday);\n\tevent ConfirmationsChanged(uint256 _smallAmountConfirmations, uint256 _mediumAmountConfirmations, uint256 _largeAmountConfirmations);\n\n\tmodifier notNull(address _address) {\n\t\trequire(_address != NULL_ADDRESS, \"AllowTokens: Null Address\");\n\t\t_;\n\t}\n\n\tfunction initialize(\n\t\taddress _manager,\n\t\taddress _primary,\n\t\tuint256 _smallAmountConfirmations,\n\t\tuint256 _mediumAmountConfirmations,\n\t\tuint256 _largeAmountConfirmations,\n\t\tTypeInfo[] memory typesInfo) public initializer {\n\t\tUpgradableOwnable.initialize(_manager);\n\t\tUpgradableSecondary.__Secondary_init(_primary);\n\t\t_setConfirmations(_smallAmountConfirmations, _mediumAmountConfirmations, _largeAmountConfirmations);\n\t\tfor(uint i = 0; i < typesInfo.length; i = i + 1) {\n\t\t\t_addTokenType(typesInfo[i].description, typesInfo[i].limits);\n\t\t}\n\t}\n\n\tfunction version() override external pure returns (string memory) {\n\t\treturn \"v1\";\n\t}\n\n\tfunction tokenInfo(address tokenAddress) public view returns(TokenInfo memory) {\n\t\treturn allowedTokens[tokenAddress];\n\t}\n\n\tfunction setTokenInfoByTokenAddress(address tokenAddress, TokenInfo memory info) internal {\n\t\trequire(isOwner() || _msgSender() == primary(), \"AllowTokens: unauthorized sender\");\n\t\tallowedTokens[tokenAddress] = info;\n\t}\n\n\tfunction getInfoAndLimits(\n\t\taddress tokenAddress\n\t) public view override returns (\n\t\tTokenInfo memory info,\n\t\tLimits memory limit\n\t) {\n\t\tinfo = tokenInfo(tokenAddress);\n\t\tlimit = typeLimits[info.typeId];\n\t\treturn (info, limit);\n\t}\n\n\tfunction calcMaxWithdraw(address token) public view override returns (uint256 maxWithdraw) {\n\t\t(TokenInfo memory info, Limits memory limits) = getInfoAndLimits(token);\n\t\treturn _calcMaxWithdraw(info, limits);\n\t}\n\n\tfunction _calcMaxWithdraw(TokenInfo memory info, Limits memory limits) private view returns (uint256 maxWithdraw) {\n\t\t// solium-disable-next-line security/no-block-members\n\t\tif (block.timestamp > info.lastDay + 24 hours) { // solhint-disable-line not-rely-on-time\n\t\t\tinfo.spentToday = 0;\n\t\t}\n\t\tif (limits.daily <= info.spentToday) {\n\t\t\treturn 0;\n\t\t}\n\t\tmaxWithdraw = limits.daily - info.spentToday;\n\t\tif (maxWithdraw > limits.max) {\n\t\t\tmaxWithdraw = limits.max;\n\t\t}\n\t\treturn maxWithdraw;\n\t}\n\n\tfunction updateTokenTransfer(address token, uint256 amount) override external onlyPrimary {\n\t\t(TokenInfo memory info, Limits memory limit) = getInfoAndLimits(token);\n\t\trequire(isTokenAllowed(token), \"AllowTokens: Not whitelisted\");\n\t\trequire(amount >= limit.min, \"AllowTokens: Lower than limit\");\n\n\t\t// solium-disable-next-line security/no-block-members\n\t\tif (block.timestamp > info.lastDay + 24 hours) { // solhint-disable-line not-rely-on-time\n\t\t\t// solium-disable-next-line security/no-block-members\n\t\t\tinfo.lastDay = block.timestamp; // solhint-disable-line not-rely-on-time\n\t\t\tinfo.spentToday = 0;\n\t\t}\n\t\tuint maxWithdraw = _calcMaxWithdraw(info, limit);\n\t\trequire(amount <= maxWithdraw, \"AllowTokens: Exceeded limit\");\n\t\tinfo.spentToday = info.spentToday.add(amount);\n\t\tsetTokenInfoByTokenAddress(token, info);\n\n\t\temit UpdateTokensTransfered(token, info.lastDay, info.spentToday);\n\t}\n\n\tfunction _addTokenType(string memory description, Limits memory limits) private returns(uint256 len) {\n\t\trequire(bytes(description).length > 0, \"AllowTokens: Empty description\");\n\t\tlen = typeDescriptions.length;\n\t\trequire(len + 1 <= MAX_TYPES, \"AllowTokens: Reached MAX_TYPES\");\n\t\ttypeDescriptions.push(description);\n\t\t_setTypeLimits(len, limits);\n\t\temit TokenTypeAdded(len, description);\n\t\treturn len;\n\t}\n\n\tfunction addTokenType(string calldata description, Limits calldata limits) external onlyOwner returns(uint256 len) {\n\t\treturn _addTokenType(description, limits);\n\t}\n\n\tfunction _setTypeLimits(uint256 typeId, Limits memory limits) private {\n\t\trequire(typeId < typeDescriptions.length, \"AllowTokens: bigger than typeDescriptions\");\n\t\trequire(limits.max >= limits.min, \"AllowTokens: maxTokens smaller than minTokens\");\n\t\trequire(limits.daily >= limits.max, \"AllowTokens: dailyLimit smaller than maxTokens\");\n\t\trequire(limits.mediumAmount > limits.min, \"AllowTokens: limits.mediumAmount smaller than min\");\n\t\trequire(limits.largeAmount > limits.mediumAmount, \"AllowTokens: limits.largeAmount smaller than mediumAmount\");\n\t\ttypeLimits[typeId] = limits;\n\t\temit TypeLimitsChanged(typeId, limits);\n\t}\n\n\tfunction setTypeLimits(uint256 typeId, Limits memory limits) public onlyOwner {\n\t\t_setTypeLimits(typeId, limits);\n\t}\n\n\tfunction getTypesLimits() external view override returns(Limits[] memory limits) {\n\t\tlimits = new Limits[](typeDescriptions.length);\n\t\tfor (uint256 i = 0; i < typeDescriptions.length; i++) {\n\t\t\tlimits[i] = typeLimits[i];\n\t\t}\n\t\treturn limits;\n\t}\n\n\tfunction getTypeDescriptionsLength() external view override returns(uint256) {\n\t\treturn typeDescriptions.length;\n\t}\n\n\tfunction getTypeDescriptions() external view override returns(string[] memory descriptions) {\n\t\tdescriptions = new string[](typeDescriptions.length);\n\t\tfor (uint256 i = 0; i < typeDescriptions.length; i++) {\n\t\t\tdescriptions[i] = typeDescriptions[i];\n\t\t}\n\t\treturn descriptions;\n\t}\n\n\tfunction isTokenAllowed(address token) public view notNull(token) override returns (bool) {\n\t\treturn tokenInfo(token).allowed;\n\t}\n\n\tfunction setToken(address token, uint256 typeId) override public notNull(token) {\n\t\trequire(isOwner() || _msgSender() == primary(), \"AllowTokens: unauthorized sender\");\n\t\trequire(typeId < typeDescriptions.length, \"AllowTokens: typeId does not exist\");\n\t\tTokenInfo memory info = tokenInfo(token);\n\t\tinfo.allowed = true;\n\t\tinfo.typeId = typeId;\n\t\tsetTokenInfoByTokenAddress(token, info);\n\t\temit SetToken(token, typeId);\n\t}\n\n\tfunction setMultipleTokens(TokensAndType[] calldata tokensAndTypes) external onlyOwner {\n\t\trequire(tokensAndTypes.length > 0, \"AllowTokens: empty tokens\");\n\t\tfor(uint256 i = 0; i < tokensAndTypes.length; i = i + 1) {\n\t\t\tsetToken(tokensAndTypes[i].token, tokensAndTypes[i].typeId);\n\t\t}\n\t}\n\n\tfunction removeAllowedToken(address token) external notNull(token) onlyOwner {\n\t\tTokenInfo memory info = tokenInfo(token);\n\t\trequire(info.allowed, \"AllowTokens: Not Allowed\");\n\t\tinfo.allowed = false;\n\t\tsetTokenInfoByTokenAddress(token, info);\n\t\temit AllowedTokenRemoved(token);\n\t}\n\n\tfunction setConfirmations(\n\t\tuint256 _smallAmountConfirmations,\n\t\tuint256 _mediumAmountConfirmations,\n\t\tuint256 _largeAmountConfirmations) external onlyOwner {\n\t\t_setConfirmations(_smallAmountConfirmations, _mediumAmountConfirmations, _largeAmountConfirmations);\n\t}\n\n\tfunction _setConfirmations(\n\t\tuint256 _smallAmountConfirmations,\n\t\tuint256 _mediumAmountConfirmations,\n\t\tuint256 _largeAmountConfirmations) private {\n\t\trequire(_smallAmountConfirmations <= _mediumAmountConfirmations, \"AllowTokens: small bigger than medium confirmations\");\n\t\trequire(_mediumAmountConfirmations <= _largeAmountConfirmations, \"AllowTokens: medium bigger than large confirmations\");\n\t\tsmallAmountConfirmations = _smallAmountConfirmations;\n\t\tmediumAmountConfirmations = _mediumAmountConfirmations;\n\t\tlargeAmountConfirmations = _largeAmountConfirmations;\n\t\temit ConfirmationsChanged(_smallAmountConfirmations, _mediumAmountConfirmations, _largeAmountConfirmations);\n\t}\n\n\tfunction getConfirmations() external view override\n\t\treturns (\n\t\tuint256 smallAmount,\n\t\tuint256 mediumAmount,\n\t\tuint256 largeAmount\n\t) {\n\t\treturn (smallAmountConfirmations, mediumAmountConfirmations, largeAmountConfirmations);\n\t}\n\n}\n" + }, + "contracts/zeppelin/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return sub(a, b, \"SafeMath: subtraction overflow\");\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n * - Subtraction cannot overflow.\n *\n * _Available since v2.4.0._\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers. Reverts on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n return div(a, b, \"SafeMath: division by zero\");\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers. Reverts with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n * - The divisor cannot be zero.\n *\n * _Available since v2.4.0._\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n // Solidity only automatically asserts when dividing by 0\n require(b > 0, errorMessage);\n uint256 c = a / b;\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\n\n return c;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * Reverts when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return mod(a, b, \"SafeMath: modulo by zero\");\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * Reverts with custom message when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n * - The divisor cannot be zero.\n *\n * _Available since v2.4.0._\n */\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b != 0, errorMessage);\n return a % b;\n }\n}\n" + }, + "contracts/zeppelin/upgradable/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @title Initializable\n *\n * @dev Helper contract to support initializer functions. To use it, replace\n * the constructor with a function that has the `initializer` modifier.\n * WARNING: Unlike constructors, initializer functions must be manually\n * invoked. This applies both to deploying an Initializable contract, as well\n * as extending an Initializable contract via inheritance.\n * WARNING: When used with inheritance, manual care must be taken to not invoke\n * a parent initializer twice, or ensure that all initializers are idempotent,\n * because this is not dealt with automatically as with constructors.\n */\ncontract Initializable {\n\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private initializing;\n\n /**\n * @dev Modifier to use in the initializer function of a contract.\n */\n modifier initializer() {\n require(initializing || !initialized, \"Contract instance is already initialized\");\n\n bool isTopLevelCall = !initializing;\n if (isTopLevelCall) {\n initializing = true;\n initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n initializing = false;\n }\n }\n\n // Reserved storage space to allow for layout changes in the future.\n uint256[50] private ______gap;\n}" + }, + "contracts/zeppelin/upgradable/ownership/UpgradableOwnable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../Initializable.sol\";\n\nimport \"../../GSN/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be aplied to your functions to restrict their use to\n * the owner.\n */\ncontract UpgradableOwnable is Initializable, Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function initialize(address sender) public initializer {\n _owner = sender;\n emit OwnershipTransferred(address(0), _owner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(isOwner(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Returns true if the caller is the current owner.\n */\n function isOwner() public view returns (bool) {\n return _msgSender() == _owner;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * > Note: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public onlyOwner {\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n */\n function _transferOwnership(address newOwner) internal {\n require(newOwner != address(0), \"Ownable: new owner is zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n\n}\n" + }, + "contracts/zeppelin/upgradable/ownership/UpgradableSecondary.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../Initializable.sol\";\n\nimport \"../../GSN/Context.sol\";\n\n/**\n * @dev A Secondary contract can only be used by its primary account (the one that created it).\n */\ncontract UpgradableSecondary is Initializable, Context {\n address private _primary;\n\n /**\n * @dev Emitted when the primary contract changes.\n */\n event PrimaryTransferred(\n address recipient\n );\n\n /**\n * @dev Sets the primary account to the one that is creating the Secondary contract.\n */\n function __Secondary_init(address sender) public initializer {\n _primary = sender;\n emit PrimaryTransferred(_primary);\n }\n\n /**\n * @dev Reverts if called from any account other than the primary.\n */\n modifier onlyPrimary() {\n require(_msgSender() == _primary, \"Secondary: caller is not the primary account\");\n _;\n }\n\n /**\n * @return the address of the primary.\n */\n function primary() public view returns (address) {\n return _primary;\n }\n\n /**\n * @dev Transfers contract to a new primary.\n * @param recipient The address of new primary.\n */\n function transferPrimary(address recipient) public onlyPrimary {\n require(recipient != address(0), \"Secondary: new primary is the zero address\");\n _primary = recipient;\n emit PrimaryTransferred(recipient);\n }\n\n}" + }, + "contracts/interface/IAllowTokens.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\ninterface IAllowTokens {\n\n\tstruct Limits {\n\t\tuint256 min;\n\t\tuint256 max;\n\t\tuint256 daily;\n\t\tuint256 mediumAmount;\n\t\tuint256 largeAmount;\n\t}\n\n\tstruct TokenInfo {\n\t\tbool allowed;\n\t\tuint256 typeId;\n\t\tuint256 spentToday;\n\t\tuint256 lastDay;\n\t}\n\n\tstruct TypeInfo {\n\t\tstring description;\n\t\tLimits limits;\n\t}\n\n\tstruct TokensAndType {\n\t\taddress token;\n\t\tuint256 typeId;\n\t}\n\n\tfunction version() external pure returns (string memory);\n\n\tfunction getInfoAndLimits(address token) external view returns (TokenInfo memory info, Limits memory limit);\n\n\tfunction calcMaxWithdraw(address token) external view returns (uint256 maxWithdraw);\n\n\tfunction getTypesLimits() external view returns(Limits[] memory limits);\n\n\tfunction getTypeDescriptionsLength() external view returns(uint256);\n\n\tfunction getTypeDescriptions() external view returns(string[] memory descriptions);\n\n\tfunction setToken(address token, uint256 typeId) external;\n\n\tfunction getConfirmations() external view returns (uint256 smallAmount, uint256 mediumAmount, uint256 largeAmount);\n\n\tfunction isTokenAllowed(address token) external view returns (bool);\n\n\tfunction updateTokenTransfer(address token, uint256 amount) external;\n}" + }, + "contracts/zeppelin/GSN/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n\n function _msgSender() internal view returns (address payable) {\n return payable(msg.sender);\n }\n\n function _msgData() internal view returns (bytes memory) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n" + }, + "contracts/Bridge/BridgeV3.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n// import \"hardhat/console.sol\";\n// Import base Initializable contract\nimport \"../zeppelin/upgradable/Initializable.sol\";\n// Import interface and library from OpenZeppelin contracts\nimport \"../zeppelin/upgradable/utils/ReentrancyGuard.sol\";\nimport \"../zeppelin/upgradable/lifecycle/UpgradablePausable.sol\";\nimport \"../zeppelin/upgradable/ownership/UpgradableOwnable.sol\";\n\nimport \"../zeppelin/introspection/IERC1820Registry.sol\";\nimport \"../zeppelin/token/ERC777/IERC777Recipient.sol\";\nimport \"../zeppelin/token/ERC20/IERC20.sol\";\nimport \"../zeppelin/token/ERC20/SafeERC20.sol\";\nimport \"../zeppelin/utils/Address.sol\";\nimport \"../zeppelin/math/SafeMath.sol\";\nimport \"../zeppelin/token/ERC777/IERC777.sol\";\n\nimport \"../lib/LibEIP712.sol\";\nimport \"../lib/LibUtils.sol\";\n\nimport \"./IBridgeV3.sol\";\nimport \"../interface/ISideToken.sol\";\nimport \"../interface/ISideTokenFactory.sol\";\nimport \"../interface/IAllowTokens.sol\";\nimport \"../interface/IWrapped.sol\";\n\n\ncontract BridgeV3 is Initializable, IBridgeV3, IERC777Recipient, UpgradablePausable, UpgradableOwnable, ReentrancyGuard {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n using Address for address;\n\n address constant internal NULL_ADDRESS = address(0);\n bytes32 constant internal NULL_HASH = bytes32(0);\n IERC1820Registry constant internal erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);\n\n address internal federation;\n uint256 internal feePercentage;\n string public symbolPrefix;\n bytes32 public DOMAIN_SEPARATOR; // replaces uint256 internal _depprecatedLastDay;\n uint256 internal _deprecatedSpentToday;\n\n mapping (address => address) public mappedTokens; // OirignalToken => SideToken\n mapping (address => address) public originalTokens; // SideToken => OriginalToken\n mapping (address => bool) public knownTokens; // OriginalToken => true\n mapping (bytes32 => bool) public claimed; // transactionDataHash => true // previously named processed\n IAllowTokens public allowTokens;\n ISideTokenFactory public sideTokenFactory;\n //Bridge_v1 variables\n bool public isUpgrading;\n uint256 constant public feePercentageDivider = 10000; // Porcentage with up to 2 decimals\n //Bridge_v3 variables\n bytes32 constant internal _erc777Interface = keccak256(\"ERC777Token\");\n IWrapped public wrappedCurrency;\n mapping (bytes32 => bytes32) public transactionsDataHashes; // transactionHash => transactionDataHash\n mapping (bytes32 => address) public originalTokenAddresses; // transactionHash => originalTokenAddress\n mapping (bytes32 => address) public senderAddresses; // transactionHash => senderAddress\n\n // keccak256(\"Claim(address to,uint256 amount,bytes32 transactionHash,address relayer,uint256 fee,uint256 nonce,uint256 deadline)\");\n bytes32 public constant CLAIM_TYPEHASH = 0xf18ceda3f6355f78c234feba066041a50f6557bfb600201e2a71a89e2dd80433;\n mapping(address => uint) public nonces;\n\n event AllowTokensChanged(address _newAllowTokens);\n event FederationChanged(address _newFederation);\n event SideTokenFactoryChanged(address _newSideTokenFactory);\n event Upgrading(bool _isUpgrading);\n event WrappedCurrencyChanged(address _wrappedCurrency);\n\n function initialize(\n address _manager,\n address _federation,\n address _allowTokens,\n address _sideTokenFactory,\n string memory _symbolPrefix\n ) public initializer {\n UpgradableOwnable.initialize(_manager);\n UpgradablePausable.__Pausable_init(_manager);\n symbolPrefix = _symbolPrefix;\n allowTokens = IAllowTokens(_allowTokens);\n sideTokenFactory = ISideTokenFactory(_sideTokenFactory);\n federation = _federation;\n //keccak256(\"ERC777TokensRecipient\")\n erc1820.setInterfaceImplementer(address(this), 0xb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b, address(this));\n initDomainSeparator();\n }\n\n receive () external payable {\n // The fallback function is needed to use WRBTC\n require(_msgSender() == address(wrappedCurrency), \"Bridge: not wrappedCurrency\");\n }\n\n function version() override external pure returns (string memory) {\n return \"v3\";\n }\n\n function initDomainSeparator() public {\n uint chainId;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n chainId := chainid()\n }\n DOMAIN_SEPARATOR = LibEIP712.hashEIP712Domain(\n \"RSK Token Bridge\",\n \"1\",\n chainId,\n address(this)\n );\n }\n\n modifier whenNotUpgrading() {\n require(!isUpgrading, \"Bridge: Upgrading\");\n _;\n }\n\n function acceptTransfer(\n address _originalTokenAddress,\n address payable _from,\n address payable _to,\n uint256 _amount,\n bytes32 _blockHash,\n bytes32 _transactionHash,\n uint32 _logIndex\n ) external whenNotPaused nonReentrant override {\n require(_msgSender() == federation, \"Bridge: Not Federation\");\n require(knownTokens[_originalTokenAddress] ||\n mappedTokens[_originalTokenAddress] != NULL_ADDRESS,\n \"Bridge: Unknown token\"\n );\n require(_to != NULL_ADDRESS, \"Bridge: Null To\");\n require(_amount > 0, \"Bridge: Amount 0\");\n require(_blockHash != NULL_HASH, \"Bridge: Null BlockHash\");\n require(_transactionHash != NULL_HASH, \"Bridge: Null TxHash\");\n require(transactionsDataHashes[_transactionHash] == bytes32(0), \"Bridge: Already accepted\");\n\n bytes32 _transactionDataHash = getTransactionDataHash(\n _to,\n _amount,\n _blockHash,\n _transactionHash,\n _logIndex\n );\n // Do not remove, claimed also has the previously processed using the older bridge version\n // https://github.com/rsksmart/tokenbridge/blob/TOKENBRIDGE-1.2.0/bridge/contracts/Bridge.sol#L41\n require(!claimed[_transactionDataHash], \"Bridge: Already claimed\");\n\n transactionsDataHashes[_transactionHash] = _transactionDataHash;\n originalTokenAddresses[_transactionHash] = _originalTokenAddress;\n senderAddresses[_transactionHash] = _from;\n\n emit AcceptedCrossTransfer(\n _transactionHash,\n _originalTokenAddress,\n _to,\n _from,\n _amount,\n _blockHash,\n _logIndex\n );\n }\n\n\n function createSideToken(\n uint256 _typeId,\n address _originalTokenAddress,\n uint8 _originalTokenDecimals,\n string calldata _originalTokenSymbol,\n string calldata _originalTokenName\n ) external onlyOwner {\n require(_originalTokenAddress != NULL_ADDRESS, \"Bridge: Null token\");\n address sideToken = mappedTokens[_originalTokenAddress];\n require(sideToken == NULL_ADDRESS, \"Bridge: Already exists\");\n uint256 granularity = LibUtils.decimalsToGranularity(_originalTokenDecimals);\n string memory newSymbol = string(abi.encodePacked(symbolPrefix, _originalTokenSymbol));\n\n // Create side token\n sideToken = sideTokenFactory.createSideToken(_originalTokenName, newSymbol, granularity);\n\n mappedTokens[_originalTokenAddress] = sideToken;\n originalTokens[sideToken] = _originalTokenAddress;\n allowTokens.setToken(sideToken, _typeId);\n\n emit NewSideToken(sideToken, _originalTokenAddress, newSymbol, granularity);\n }\n\n function claim(ClaimData calldata _claimData)\n external override returns (uint256 receivedAmount) {\n\n receivedAmount = _claim(\n _claimData,\n _claimData.to,\n payable(address(0)),\n 0\n );\n return receivedAmount;\n }\n\n function claimFallback(ClaimData calldata _claimData)\n external override returns (uint256 receivedAmount) {\n require(_msgSender() == senderAddresses[_claimData.transactionHash],\"Bridge: invalid sender\");\n receivedAmount = _claim(\n _claimData,\n _msgSender(),\n payable(address(0)),\n 0\n );\n return receivedAmount;\n }\n\n function getDigest(\n ClaimData memory _claimData,\n address payable _relayer,\n uint256 _fee,\n uint256 _deadline\n ) internal returns (bytes32) {\n return LibEIP712.hashEIP712Message(\n DOMAIN_SEPARATOR,\n keccak256(\n abi.encode(\n CLAIM_TYPEHASH,\n _claimData.to,\n _claimData.amount,\n _claimData.transactionHash,\n _relayer,\n _fee,\n nonces[_claimData.to]++,\n _deadline\n )\n )\n );\n }\n\n // Inspired by https://github.com/dapphub/ds-dach/blob/master/src/dach.sol\n function claimGasless(\n ClaimData calldata _claimData,\n address payable _relayer,\n uint256 _fee,\n uint256 _deadline,\n uint8 _v,\n bytes32 _r,\n bytes32 _s\n ) external override returns (uint256 receivedAmount) {\n require(_deadline >= block.timestamp, \"Bridge: EXPIRED\");\n\n bytes32 digest = getDigest(_claimData, _relayer, _fee, _deadline);\n address recoveredAddress = ecrecover(digest, _v, _r, _s);\n require(_claimData.to != address(0) && recoveredAddress == _claimData.to, \"Bridge: INVALID_SIGNATURE\");\n\n receivedAmount = _claim(\n _claimData,\n _claimData.to,\n _relayer,\n _fee\n );\n return receivedAmount;\n }\n\n function _claim(\n ClaimData calldata _claimData,\n address payable _reciever,\n address payable _relayer,\n uint256 _fee\n ) internal nonReentrant returns (uint256 receivedAmount) {\n address originalTokenAddress = originalTokenAddresses[_claimData.transactionHash];\n require(originalTokenAddress != NULL_ADDRESS, \"Bridge: Tx not crossed\");\n\n bytes32 transactionDataHash = getTransactionDataHash(\n _claimData.to,\n _claimData.amount,\n _claimData.blockHash,\n _claimData.transactionHash,\n _claimData.logIndex\n );\n require(transactionsDataHashes[_claimData.transactionHash] == transactionDataHash, \"Bridge: Wrong transactionDataHash\");\n require(!claimed[transactionDataHash], \"Bridge: Already claimed\");\n\n claimed[transactionDataHash] = true;\n if (knownTokens[originalTokenAddress]) {\n receivedAmount =_claimCrossBackToToken(\n originalTokenAddress,\n _reciever,\n _claimData.amount,\n _relayer,\n _fee\n );\n } else {\n receivedAmount =_claimCrossToSideToken(\n originalTokenAddress,\n _reciever,\n _claimData.amount,\n _relayer,\n _fee\n );\n }\n emit Claimed(\n _claimData.transactionHash,\n originalTokenAddress,\n _claimData.to,\n senderAddresses[_claimData.transactionHash],\n _claimData.amount,\n _claimData.blockHash,\n _claimData.logIndex,\n _reciever,\n _relayer,\n _fee\n );\n return receivedAmount;\n }\n\n function _claimCrossToSideToken(\n address _originalTokenAddress,\n address payable _receiver,\n uint256 _amount,\n address payable _relayer,\n uint256 _fee\n ) internal returns (uint256 receivedAmount) {\n address sideToken = mappedTokens[_originalTokenAddress];\n uint256 granularity = IERC777(sideToken).granularity();\n uint256 formattedAmount = _amount.mul(granularity);\n require(_fee <= formattedAmount, \"Bridge: fee too high\");\n receivedAmount = formattedAmount - _fee;\n ISideToken(sideToken).mint(_receiver, receivedAmount, \"\", \"\");\n if(_fee > 0) {\n ISideToken(sideToken).mint(_relayer, _fee, \"\", \"relayer fee\");\n }\n return receivedAmount;\n }\n\n function _claimCrossBackToToken(\n address _originalTokenAddress,\n address payable _receiver,\n uint256 _amount,\n address payable _relayer,\n uint256 _fee\n ) internal returns (uint256 receivedAmount) {\n uint256 decimals = LibUtils.getDecimals(_originalTokenAddress);\n //As side tokens are ERC777 they will always have 18 decimals\n uint256 formattedAmount = _amount.div(uint256(10) ** (18 - decimals));\n require(_fee <= formattedAmount, \"Bridge: fee too high\");\n receivedAmount = formattedAmount - _fee;\n if(address(wrappedCurrency) == _originalTokenAddress) {\n wrappedCurrency.withdraw(formattedAmount);\n _receiver.transfer(receivedAmount);\n if(_fee > 0) {\n _relayer.transfer(_fee);\n }\n } else {\n IERC20(_originalTokenAddress).safeTransfer(_receiver, receivedAmount);\n if(_fee > 0) {\n IERC20(_originalTokenAddress).safeTransfer(_relayer, _fee);\n }\n }\n return receivedAmount;\n }\n\n /**\n * ERC-20 tokens approve and transferFrom pattern\n * See https://eips.ethereum.org/EIPS/eip-20#transferfrom\n */\n function receiveTokensTo(address tokenToUse, address to, uint256 amount) override public {\n address sender = _msgSender();\n //Transfer the tokens on IERC20, they should be already Approved for the bridge Address to use them\n IERC20(tokenToUse).safeTransferFrom(sender, address(this), amount);\n crossTokens(tokenToUse, sender, to, amount, \"\");\n }\n\n /**\n * Use network currency and cross it.\n */\n function depositTo(address to) override external payable {\n address sender = _msgSender();\n require(address(wrappedCurrency) != NULL_ADDRESS, \"Bridge: wrappedCurrency empty\");\n wrappedCurrency.deposit{ value: msg.value }();\n crossTokens(address(wrappedCurrency), sender, to, msg.value, \"\");\n }\n\n /**\n * ERC-777 tokensReceived hook allows to send tokens to a contract and notify it in a single transaction\n * See https://eips.ethereum.org/EIPS/eip-777#motivation for details\n */\n function tokensReceived (\n address operator,\n address from,\n address to,\n uint amount,\n bytes calldata userData,\n bytes calldata\n ) external override(IBridgeV3, IERC777Recipient){\n //Hook from ERC777address\n if(operator == address(this)) return; // Avoid loop from bridge calling to ERC77transferFrom\n require(to == address(this), \"Bridge: Not to this address\");\n address tokenToUse = _msgSender();\n require(erc1820.getInterfaceImplementer(tokenToUse, _erc777Interface) != NULL_ADDRESS, \"Bridge: Not ERC777 token\");\n require(userData.length != 0 || !from.isContract(), \"Bridge: Specify receiver address in data\");\n address receiver = userData.length == 0 ? from : LibUtils.bytesToAddress(userData);\n crossTokens(tokenToUse, from, receiver, amount, userData);\n }\n\n function crossTokens(address tokenToUse, address from, address to, uint256 amount, bytes memory userData)\n internal whenNotUpgrading whenNotPaused nonReentrant {\n knownTokens[tokenToUse] = true;\n uint256 fee = amount.mul(feePercentage).div(feePercentageDivider);\n uint256 amountMinusFees = amount.sub(fee);\n uint8 decimals = LibUtils.getDecimals(tokenToUse);\n uint formattedAmount = amount;\n if(decimals != 18) {\n formattedAmount = amount.mul(uint256(10)**(18-decimals));\n }\n // We consider the amount before fees converted to 18 decimals to check the limits\n // updateTokenTransfer revert if token not allowed\n allowTokens.updateTokenTransfer(tokenToUse, formattedAmount);\n address originalTokenAddress = tokenToUse;\n if (originalTokens[tokenToUse] != NULL_ADDRESS) {\n //Side Token Crossing\n originalTokenAddress = originalTokens[tokenToUse];\n uint256 granularity = LibUtils.getGranularity(tokenToUse);\n uint256 modulo = amountMinusFees.mod(granularity);\n fee = fee.add(modulo);\n amountMinusFees = amountMinusFees.sub(modulo);\n IERC777(tokenToUse).burn(amountMinusFees, userData);\n }\n\n emit Cross(\n originalTokenAddress,\n from,\n to,\n amountMinusFees,\n userData\n );\n\n if (fee > 0) {\n //Send the payment to the MultiSig of the Federation\n IERC20(tokenToUse).safeTransfer(owner(), fee);\n }\n }\n\n function getTransactionDataHash(\n address _to,\n uint256 _amount,\n bytes32 _blockHash,\n bytes32 _transactionHash,\n uint32 _logIndex\n )\n public pure override returns(bytes32)\n {\n return keccak256(abi.encodePacked(_blockHash, _transactionHash, _to, _amount, _logIndex));\n }\n\n function setFeePercentage(uint amount) external onlyOwner {\n require(amount < (feePercentageDivider/10), \"Bridge: bigger than 10%\");\n feePercentage = amount;\n emit FeePercentageChanged(feePercentage);\n }\n\n function getFeePercentage() external view override returns(uint) {\n return feePercentage;\n }\n\n function changeFederation(address newFederation) external onlyOwner {\n require(newFederation != NULL_ADDRESS, \"Bridge: Federation is empty\");\n federation = newFederation;\n emit FederationChanged(federation);\n }\n\n\n function changeAllowTokens(address newAllowTokens) external onlyOwner {\n require(newAllowTokens != NULL_ADDRESS, \"Bridge: AllowTokens is empty\");\n allowTokens = IAllowTokens(newAllowTokens);\n emit AllowTokensChanged(newAllowTokens);\n }\n\n function getFederation() external view returns(address) {\n return federation;\n }\n\n function changeSideTokenFactory(address newSideTokenFactory) external onlyOwner {\n require(newSideTokenFactory != NULL_ADDRESS, \"Bridge: SideTokenFactory is empty\");\n sideTokenFactory = ISideTokenFactory(newSideTokenFactory);\n emit SideTokenFactoryChanged(newSideTokenFactory);\n }\n\n function setUpgrading(bool _isUpgrading) external onlyOwner {\n isUpgrading = _isUpgrading;\n emit Upgrading(isUpgrading);\n }\n\n function setWrappedCurrency(address _wrappedCurrency) external onlyOwner {\n require(_wrappedCurrency != NULL_ADDRESS, \"Bridge: wrapp is empty\");\n wrappedCurrency = IWrapped(_wrappedCurrency);\n emit WrappedCurrencyChanged(_wrappedCurrency);\n }\n\n function hasCrossed(bytes32 transactionHash) public view returns (bool) {\n return transactionsDataHashes[transactionHash] != bytes32(0);\n }\n\n function hasBeenClaimed(bytes32 transactionHash) public view returns (bool) {\n return claimed[transactionsDataHashes[transactionHash]];\n }\n\n}" + }, + "contracts/zeppelin/upgradable/utils/ReentrancyGuard.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../Initializable.sol\";\n\n/**\n * @title Helps contracts guard against reentrancy attacks.\n * @author Remco Bloemen , Eenae \n * @dev If you mark a function `nonReentrant`, you should also\n * mark it `external`.\n */\ncontract ReentrancyGuard is Initializable {\n /// @dev counter to allow mutex lock with only one SSTORE operation\n uint256 private _guardCounter;\n\n function initialize() public initializer {\n // The counter starts at one to prevent changing it from zero to a non-zero\n // value, which is a more expensive operation.\n _guardCounter = 1;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _guardCounter += 1;\n uint256 localCounter = _guardCounter;\n _;\n require(localCounter == _guardCounter, \"ReentrancyGuard: no reentrant allowed\");\n }\n}" + }, + "contracts/zeppelin/upgradable/lifecycle/UpgradablePausable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../Initializable.sol\";\n\nimport \"../../GSN/Context.sol\";\nimport \"../access/roles/UpgradablePauserRole.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\ncontract UpgradablePausable is Initializable, Context, UpgradablePauserRole {\n /**\n * @dev Emitted when the pause is triggered by a pauser (`account`).\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by a pauser (`account`).\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state. Assigns the Pauser role\n * to the deployer.\n */\n function __Pausable_init(address sender) public initializer {\n UpgradablePauserRole.__PauserRol_init(sender);\n\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n */\n modifier whenNotPaused() {\n require(!_paused, \"Pausable: paused\");\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n */\n modifier whenPaused() {\n require(_paused, \"Pausable: not paused\");\n _;\n }\n\n /**\n * @dev Called by a pauser to pause, triggers stopped state.\n */\n function pause() public onlyPauser whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Called by a pauser to unpause, returns to normal state.\n */\n function unpause() public onlyPauser whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" + }, + "contracts/zeppelin/introspection/IERC1820Registry.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @dev Interface of the global ERC1820 Registry, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1820[EIP]. Accounts may register\n * implementers for interfaces in this registry, as well as query support.\n *\n * Implementers may be shared by multiple accounts, and can also implement more\n * than a single interface for each account. Contracts can implement interfaces\n * for themselves, but externally-owned accounts (EOA) must delegate this to a\n * contract.\n *\n * {IERC165} interfaces can also be queried via the registry.\n *\n * For an in-depth explanation and source code analysis, see the EIP text.\n */\ninterface IERC1820Registry {\n /**\n * @dev Sets `newManager` as the manager for `account`. A manager of an\n * account is able to set interface implementers for it.\n *\n * By default, each account is its own manager. Passing a value of `0x0` in\n * `newManager` will reset the manager to this initial state.\n *\n * Emits a {ManagerChanged} event.\n *\n * Requirements:\n *\n * - the caller must be the current manager for `account`.\n */\n function setManager(address account, address newManager) external;\n\n /**\n * @dev Returns the manager for `account`.\n *\n * See {setManager}.\n */\n function getManager(address account) external view returns (address);\n\n /**\n * @dev Sets the `implementer` contract as `account`'s implementer for\n * `interfaceHash`.\n *\n * `account` being the zero address is an alias for the caller's address.\n * The zero address can also be used in `implementer` to remove an old one.\n *\n * See {interfaceHash} to learn how these are created.\n *\n * Emits an {InterfaceImplementerSet} event.\n *\n * Requirements:\n *\n * - the caller must be the current manager for `_account`.\n * - `_interfaceHash` must not be an {IERC165} interface id (i.e. it must not\n * end in 28 zeroes).\n * - `_implementer` must implement {IERC1820Implementer} and return true when\n * queried for support, unless `implementer` is the caller. See\n * {IERC1820Implementer-canImplementInterfaceForAddress}.\n */\n function setInterfaceImplementer(address _account, bytes32 _interfaceHash, address _implementer) external;\n\n /**\n * @dev Returns the implementer of `_interfaceHash` for `_account`. If no such\n * implementer is registered, returns the zero address.\n *\n * If `_interfaceHash` is an {IERC165} interface id (i.e. it ends with 28\n * zeroes), `_account` will be queried for support of it.\n *\n * `account` being the zero address is an alias for the caller's address.\n */\n function getInterfaceImplementer(address _account, bytes32 _interfaceHash) external view returns (address);\n\n /**\n * @dev Returns the interface hash for an `interfaceName`, as defined in the\n * corresponding\n * https://eips.ethereum.org/EIPS/eip-1820#interface-name[section of the EIP].\n */\n function interfaceHash(string calldata interfaceName) external pure returns (bytes32);\n\n /**\n * @notice Updates the cache with whether the contract implements an ERC165 interface or not.\n * @param account Address of the contract for which to update the cache.\n * @param interfaceId ERC165 interface for which to update the cache.\n */\n function updateERC165Cache(address account, bytes4 interfaceId) external;\n\n /**\n * @notice Checks whether a contract implements an ERC165 interface or not.\n * If the result is not cached a direct lookup on the contract address is performed.\n * If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling\n * {updateERC165Cache} with the contract address.\n * @param account Address of the contract to check.\n * @param interfaceId ERC165 interface to check.\n * @return True if `account` implements `interfaceId`, false otherwise.\n */\n function implementsERC165Interface(address account, bytes4 interfaceId) external view returns (bool);\n\n /**\n * @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache.\n * @param account Address of the contract to check.\n * @param interfaceId ERC165 interface to check.\n * @return True if `account` implements `interfaceId`, false otherwise.\n */\n function implementsERC165InterfaceNoCache(address account, bytes4 interfaceId) external view returns (bool);\n\n event InterfaceImplementerSet(address indexed account, bytes32 indexed interfaceHash, address indexed implementer);\n\n event ManagerChanged(address indexed account, address indexed newManager);\n}\n" + }, + "contracts/zeppelin/token/ERC777/IERC777Recipient.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @dev Interface of the ERC777TokensRecipient standard as defined in the EIP.\n *\n * Accounts can be notified of `IERC777` tokens being sent to them by having a\n * contract implement this interface (contract holders can be their own\n * implementer) and registering it on the\n * [ERC1820 global registry](https://eips.ethereum.org/EIPS/eip-1820).\n *\n * See `IERC1820Registry` and `ERC1820Implementer`.\n */\ninterface IERC777Recipient {\n /**\n * @dev Called by an `IERC777` token contract whenever tokens are being\n * moved or created into a registered account (`to`). The type of operation\n * is conveyed by `from` being the zero address or not.\n *\n * This call occurs _after_ the token contract's state is updated, so\n * `IERC777.balanceOf`, etc., can be used to query the post-operation state.\n *\n * This function may revert to prevent the operation from being executed.\n */\n function tokensReceived(\n address operator,\n address from,\n address to,\n uint amount,\n bytes calldata userData,\n bytes calldata operatorData\n ) external;\n}\n" + }, + "contracts/zeppelin/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP. Does not include\n * the optional functions; to access them see {ERC20Detailed}.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n" + }, + "contracts/zeppelin/token/ERC20/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using SafeMath for uint256;\n using Address for address;\n\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n // solhint-disable-next-line max-line-length\n require((value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve non-zero to non-zero allowance\"\n );\n callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).add(value);\n callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves.\n\n // A Solidity high level call has three parts:\n // 1. The target address is checked to verify it contains contract code\n // 2. The call itself is made, and success asserted\n // 3. The return value is decoded, which in turn checks the size of the returned data.\n // solhint-disable-next-line max-line-length\n require(address(token).isContract(), \"SafeERC20: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = address(token).call(data);\n require(success, \"SafeERC20: low-level call failed\");\n\n if (returndata.length > 0) { // Return data is optional\n // solhint-disable-next-line max-line-length\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" + }, + "contracts/zeppelin/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "contracts/zeppelin/token/ERC777/IERC777.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @dev Interface of the ERC777Token standard as defined in the EIP.\n *\n * This contract uses the\n * [ERC1820 registry standard](https://eips.ethereum.org/EIPS/eip-1820) to let\n * token holders and recipients react to token movements by using setting implementers\n * for the associated interfaces in said registry. See `IERC1820Registry` and\n * `ERC1820Implementer`.\n */\ninterface IERC777 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the smallest part of the token that is not divisible. This\n * means all token operations (creation, movement and destruction) must have\n * amounts that are a multiple of this number.\n *\n * For most token contracts, this value will equal 1.\n */\n function granularity() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by an account (`owner`).\n */\n function balanceOf(address owner) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * If send or receive hooks are registered for the caller and `recipient`,\n * the corresponding functions will be called with `data` and empty\n * `operatorData`. See `IERC777Sender` and `IERC777Recipient`.\n *\n * Emits a `Sent` event.\n *\n * Requirements\n *\n * - the caller must have at least `amount` tokens.\n * - `recipient` cannot be the zero address.\n * - if `recipient` is a contract, it must implement the `tokensReceived`\n * interface.\n */\n function send(address recipient, uint256 amount, bytes calldata data) external;\n\n /**\n * @dev Destroys `amount` tokens from the caller's account, reducing the\n * total supply.\n *\n * If a send hook is registered for the caller, the corresponding function\n * will be called with `data` and empty `operatorData`. See `IERC777Sender`.\n *\n * Emits a `Burned` event.\n *\n * Requirements\n *\n * - the caller must have at least `amount` tokens.\n */\n function burn(uint256 amount, bytes calldata data) external;\n\n /**\n * @dev Returns true if an account is an operator of `tokenHolder`.\n * Operators can send and burn tokens on behalf of their owners. All\n * accounts are their own operator.\n *\n * See `operatorSend` and `operatorBurn`.\n */\n function isOperatorFor(address operator, address tokenHolder) external view returns (bool);\n\n /**\n * @dev Make an account an operator of the caller.\n *\n * See `isOperatorFor`.\n *\n * Emits an `AuthorizedOperator` event.\n *\n * Requirements\n *\n * - `operator` cannot be calling address.\n */\n function authorizeOperator(address operator) external;\n\n /**\n * @dev Make an account an operator of the caller.\n *\n * See `isOperatorFor` and `defaultOperators`.\n *\n * Emits a `RevokedOperator` event.\n *\n * Requirements\n *\n * - `operator` cannot be calling address.\n */\n function revokeOperator(address operator) external;\n\n /**\n * @dev Returns the list of default operators. These accounts are operators\n * for all token holders, even if `authorizeOperator` was never called on\n * them.\n *\n * This list is immutable, but individual holders may revoke these via\n * `revokeOperator`, in which case `isOperatorFor` will return false.\n */\n function defaultOperators() external view returns (address[] memory);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient`. The caller must\n * be an operator of `sender`.\n *\n * If send or receive hooks are registered for `sender` and `recipient`,\n * the corresponding functions will be called with `data` and\n * `operatorData`. See `IERC777Sender` and `IERC777Recipient`.\n *\n * Emits a `Sent` event.\n *\n * Requirements\n *\n * - `sender` cannot be the zero address.\n * - `sender` must have at least `amount` tokens.\n * - the caller must be an operator for `sender`.\n * - `recipient` cannot be the zero address.\n * - if `recipient` is a contract, it must implement the `tokensReceived`\n * interface.\n */\n function operatorSend(\n address sender,\n address recipient,\n uint256 amount,\n bytes calldata data,\n bytes calldata operatorData\n ) external;\n\n /**\n * @dev Destoys `amount` tokens from `account`, reducing the total supply.\n * The caller must be an operator of `account`.\n *\n * If a send hook is registered for `account`, the corresponding function\n * will be called with `data` and `operatorData`. See `IERC777Sender`.\n *\n * Emits a `Burned` event.\n *\n * Requirements\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n * - the caller must be an operator for `account`.\n */\n function operatorBurn(\n address account,\n uint256 amount,\n bytes calldata data,\n bytes calldata operatorData\n ) external;\n\n event Sent(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256 amount,\n bytes data,\n bytes operatorData\n );\n\n function decimals() external returns (uint8);\n\n event Minted(address indexed operator, address indexed to, uint256 amount, bytes data, bytes operatorData);\n\n event Burned(address indexed operator, address indexed from, uint256 amount, bytes data, bytes operatorData);\n\n event AuthorizedOperator(address indexed operator, address indexed tokenHolder);\n\n event RevokedOperator(address indexed operator, address indexed tokenHolder);\n}\n" + }, + "contracts/lib/LibEIP712.sol": { + "content": "//SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n// https://github.com/0xProject/0x-monorepo/blob/development/contracts/utils/contracts/src/LibEIP712.sol\nlibrary LibEIP712 {\n\n // Hash of the EIP712 Domain Separator Schema\n // keccak256(abi.encodePacked(\n // \"EIP712Domain(\",\n // \"string name,\",\n // \"string version,\",\n // \"uint256 chainId,\",\n // \"address verifyingContract\",\n // \")\"\n // ))\n bytes32 constant internal _EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f;\n\n /// @dev Calculates a EIP712 domain separator.\n /// @param name The EIP712 domain name.\n /// @param version The EIP712 domain version.\n /// @param verifyingContract The EIP712 verifying contract.\n /// @return result EIP712 domain separator.\n function hashEIP712Domain(\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract\n )\n internal\n pure\n returns (bytes32 result)\n {\n bytes32 schemaHash = _EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH;\n\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // _EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,\n // keccak256(bytes(name)),\n // keccak256(bytes(version)),\n // chainId,\n // uint256(verifyingContract)\n // ))\n\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n // Calculate hashes of dynamic data\n let nameHash := keccak256(add(name, 32), mload(name))\n let versionHash := keccak256(add(version, 32), mload(version))\n\n // Load free memory pointer\n let memPtr := mload(64)\n\n // Store params in memory\n mstore(memPtr, schemaHash)\n mstore(add(memPtr, 32), nameHash)\n mstore(add(memPtr, 64), versionHash)\n mstore(add(memPtr, 96), chainId)\n mstore(add(memPtr, 128), verifyingContract)\n\n // Compute hash\n result := keccak256(memPtr, 160)\n }\n return result;\n }\n\n /// @dev Calculates EIP712 encoding for a hash struct with a given domain hash.\n /// @param eip712DomainHash Hash of the domain domain separator data, computed\n /// with getDomainHash().\n /// @param hashStruct The EIP712 hash struct.\n /// @return result EIP712 hash applied to the given EIP712 Domain.\n function hashEIP712Message(bytes32 eip712DomainHash, bytes32 hashStruct)\n internal\n pure\n returns (bytes32 result)\n {\n // Assembly for more efficient computing:\n // keccak256(abi.encodePacked(\n // EIP191_HEADER,\n // EIP712_DOMAIN_HASH,\n // hashStruct\n // ));\n\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n // Load free memory pointer\n let memPtr := mload(64)\n\n mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header\n mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash\n mstore(add(memPtr, 34), hashStruct) // Hash of struct\n\n // Compute hash\n result := keccak256(memPtr, 66)\n }\n return result;\n }\n}" + }, + "contracts/lib/LibUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nlibrary LibUtils {\n\n function decimalsToGranularity(uint8 decimals) internal pure returns (uint256) {\n require(decimals <= 18, \"LibUtils: Decimals not <= 18\");\n return uint256(10)**(18-decimals);\n }\n\n function getDecimals(address tokenToUse) internal view returns (uint8) {\n //support decimals as uint256 or uint8\n (bool success, bytes memory data) = tokenToUse.staticcall(abi.encodeWithSignature(\"decimals()\"));\n require(success, \"LibUtils: No decimals\");\n // uint: enc(X) is the big-endian encoding of X,\n //padded on the higher-order (left) side with zero-bytes such that the length is 32 bytes.\n return uint8(abi.decode(data, (uint256)));\n }\n\n function getGranularity(address tokenToUse) internal view returns (uint256) {\n //support granularity if ERC777\n (bool success, bytes memory data) = tokenToUse.staticcall(abi.encodeWithSignature(\"granularity()\"));\n require(success, \"LibUtils: No granularity\");\n\n return abi.decode(data, (uint256));\n }\n\n function bytesToAddress(bytes memory bys) internal pure returns (address addr) {\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n addr := mload(add(bys,20))\n }\n }\n\n function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {\n require(_bytes.length >= _start + 20, \"LibUtils: toAddress_outOfBounds\");\n address tempAddress;\n\n assembly {\n tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\n }\n\n return tempAddress;\n }\n\n function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {\n require(_bytes.length >= _start + 16, \"LibUtils: toUint128_outOfBounds\");\n uint128 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x10), _start))\n }\n\n return tempUint;\n }\n\n function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {\n\t\trequire(_bytes.length >= _start + 32, \"LibUtils: toUint256_outOfBounds\");\n\t\tuint256 tempUint;\n\n // solium-disable-next-line security/no-inline-assembly\n\t\tassembly {\n\t\t\ttempUint := mload(add(add(_bytes, 0x20), _start))\n\t\t}\n\n\t\treturn tempUint;\n\t}\n}\n" + }, + "contracts/Bridge/IBridgeV3.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IBridgeV3 {\n\n struct ClaimData {\n address payable to;\n uint256 amount;\n bytes32 blockHash;\n bytes32 transactionHash;\n uint32 logIndex;\n }\n\n function version() external pure returns (string memory);\n\n function getFeePercentage() external view returns(uint);\n\n /**\n * ERC-20 tokens approve and transferFrom pattern\n * See https://eips.ethereum.org/EIPS/eip-20#transferfrom\n */\n function receiveTokensTo(address tokenToUse, address to, uint256 amount) external;\n\n /**\n * Use network currency and cross it.\n */\n function depositTo(address to) external payable;\n\n /**\n * ERC-777 tokensReceived hook allows to send tokens to a contract and notify it in a single transaction\n * See https://eips.ethereum.org/EIPS/eip-777#motivation for details\n */\n function tokensReceived (\n address operator,\n address from,\n address to,\n uint amount,\n bytes calldata userData,\n bytes calldata operatorData\n ) external;\n\n /**\n * Accepts the transaction from the other chain that was voted and sent by the Federation contract\n */\n function acceptTransfer(\n address _originalTokenAddress,\n address payable _from,\n address payable _to,\n uint256 _amount,\n bytes32 _blockHash,\n bytes32 _transactionHash,\n uint32 _logIndex\n ) external;\n\n /**\n * Claims the crossed transaction using the hash, this sends the funds to the address indicated in\n */\n function claim(ClaimData calldata _claimData) external returns (uint256 receivedAmount);\n\n function claimFallback(ClaimData calldata _claimData) external returns (uint256 receivedAmount);\n\n function claimGasless(\n ClaimData calldata _claimData,\n address payable _relayer,\n uint256 _fee,\n uint256 _deadline,\n uint8 _v,\n bytes32 _r,\n bytes32 _s\n ) external returns (uint256 receivedAmount);\n\n function getTransactionDataHash(\n address _to,\n uint256 _amount,\n bytes32 _blockHash,\n bytes32 _transactionHash,\n uint32 _logIndex\n ) external returns(bytes32);\n\n event Cross(\n address indexed _tokenAddress,\n address indexed _from,\n address indexed _to,\n uint256 _amount,\n bytes _userData\n );\n event NewSideToken(\n address indexed _newSideTokenAddress,\n address indexed _originalTokenAddress,\n string _newSymbol,\n uint256 _granularity\n );\n event AcceptedCrossTransfer(\n bytes32 indexed _transactionHash,\n address indexed _originalTokenAddress,\n address indexed _to,\n address _from,\n uint256 _amount,\n bytes32 _blockHash,\n uint256 _logIndex\n );\n event FeePercentageChanged(uint256 _amount);\n event Claimed(\n bytes32 indexed _transactionHash,\n address indexed _originalTokenAddress,\n address indexed _to,\n address _sender,\n uint256 _amount,\n bytes32 _blockHash,\n uint256 _logIndex,\n address _reciever,\n address _relayer,\n uint256 _fee\n );\n}" + }, + "contracts/interface/ISideToken.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\ninterface ISideToken {\n function mint(address account, uint256 amount, bytes calldata userData, bytes calldata operatorData) external;\n}" + }, + "contracts/interface/ISideTokenFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\ninterface ISideTokenFactory {\n\n function createSideToken(string calldata name, string calldata symbol, uint256 granularity) external returns(address);\n\n event SideTokenCreated(address indexed sideToken, string symbol, uint256 granularity);\n}" + }, + "contracts/interface/IWrapped.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\ninterface IWrapped {\n function balanceOf(address) external returns(uint);\n\n function deposit() external payable;\n\n function withdraw(uint wad) external;\n\n function totalSupply() external view returns (uint);\n\n function approve(address guy, uint wad) external returns (bool);\n\n function transfer(address dst, uint wad) external returns (bool);\n\n function transferFrom(address src, address dst, uint wad)\n external\n returns (bool);\n}" + }, + "contracts/zeppelin/upgradable/access/roles/UpgradablePauserRole.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../../Initializable.sol\";\n\nimport \"../../../GSN/Context.sol\";\nimport \"../../../access/Roles.sol\";\n\ncontract UpgradablePauserRole is Initializable, Context {\n using Roles for Roles.Role;\n\n event PauserAdded(address indexed account);\n event PauserRemoved(address indexed account);\n\n Roles.Role private _pausers;\n\n function __PauserRol_init(address sender) public initializer {\n if (!isPauser(sender)) {\n _addPauser(sender);\n }\n }\n\n modifier onlyPauser() {\n require(isPauser(_msgSender()), \"PauserRole: caller doesn't have the role\");\n _;\n }\n\n function isPauser(address account) public view returns (bool) {\n return _pausers.has(account);\n }\n\n function addPauser(address account) public onlyPauser {\n _addPauser(account);\n }\n\n function renouncePauser() public {\n _removePauser(_msgSender());\n }\n\n function _addPauser(address account) internal {\n _pausers.add(account);\n emit PauserAdded(account);\n }\n\n function _removePauser(address account) internal {\n _pausers.remove(account);\n emit PauserRemoved(account);\n }\n}\n" + }, + "contracts/zeppelin/access/Roles.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @title Roles\n * @dev Library for managing addresses assigned to a Role.\n */\nlibrary Roles {\n struct Role {\n mapping (address => bool) bearer;\n }\n\n /**\n * @dev Give an account access to this role.\n */\n function add(Role storage role, address account) internal {\n require(!has(role, account), \"Roles: account already has role\");\n role.bearer[account] = true;\n }\n\n /**\n * @dev Remove an account's access to this role.\n */\n function remove(Role storage role, address account) internal {\n require(has(role, account), \"Roles: account doesn't have role\");\n role.bearer[account] = false;\n }\n\n /**\n * @dev Check if an account has this role.\n * @return bool\n */\n function has(Role storage role, address account) internal view returns (bool) {\n require(account != address(0), \"Roles: account is the zero address\");\n return role.bearer[account];\n }\n}\n" + }, + "contracts/test/WRBTC.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../interface/IWrapped.sol\";\n\ncontract WRBTC is IWrapped {\n string public name = \"Wrapped RBTC\";\n string public symbol = \"WRBTC\";\n uint8 public decimals = 18;\n\n event Approval(address indexed src, address indexed guy, uint wad);\n event Transfer(address indexed src, address indexed dst, uint wad);\n event Deposit(address indexed dst, uint wad);\n event Withdrawal(address indexed src, uint wad);\n\n mapping (address => uint) override public balanceOf;\n mapping (address => mapping (address => uint)) public allowance;\n\n receive () external payable {\n deposit();\n }\n function deposit() override public payable {\n balanceOf[msg.sender] += msg.value;\n emit Deposit(msg.sender, msg.value);\n }\n function withdraw(uint wad) override public {\n require(balanceOf[msg.sender] >= wad, \"WRBTC: Balance less than wad\");\n balanceOf[msg.sender] -= wad;\n (bool success, ) = msg.sender.call{value:wad, gas:23000}(\"\");\n require(success, \"WRBTC: transfer fail\");\n emit Withdrawal(msg.sender, wad);\n }\n\n function totalSupply() override public view returns (uint) {\n return address(this).balance;\n }\n\n function approve(address guy, uint wad) override public returns (bool) {\n allowance[msg.sender][guy] = wad;\n emit Approval(msg.sender, guy, wad);\n return true;\n }\n\n function transfer(address dst, uint wad) override public returns (bool) {\n return transferFrom(msg.sender, dst, wad);\n }\n\n function transferFrom(address src, address dst, uint wad)\n override public\n returns (bool)\n {\n require(balanceOf[src] >= wad, \"WRBTC: Balance less than wad\");\n\n if (src != msg.sender && allowance[src][msg.sender] != type(uint).max) {\n require(allowance[src][msg.sender] >= wad, \"WRBTC: Allowance less than wad\");\n allowance[src][msg.sender] -= wad;\n }\n\n balanceOf[src] -= wad;\n balanceOf[dst] += wad;\n\n emit Transfer(src, dst, wad);\n\n return true;\n }\n}" + }, + "contracts/Bridge/Bridge.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n// import \"hardhat/console.sol\";\n// Import base Initializable contract\nimport \"../zeppelin/upgradable/Initializable.sol\";\n// Import interface and library from OpenZeppelin contracts\nimport \"../zeppelin/upgradable/utils/ReentrancyGuard.sol\";\nimport \"../zeppelin/upgradable/lifecycle/UpgradablePausable.sol\";\nimport \"../zeppelin/upgradable/ownership/UpgradableOwnable.sol\";\n\nimport \"../zeppelin/introspection/IERC1820Registry.sol\";\nimport \"../zeppelin/token/ERC777/IERC777Recipient.sol\";\nimport \"../zeppelin/token/ERC20/IERC20.sol\";\nimport \"../zeppelin/token/ERC20/SafeERC20.sol\";\nimport \"../zeppelin/utils/Address.sol\";\nimport \"../zeppelin/math/SafeMath.sol\";\nimport \"../zeppelin/token/ERC777/IERC777.sol\";\n\nimport \"../lib/LibEIP712.sol\";\nimport \"../lib/LibUtils.sol\";\n\nimport \"../interface/IBridge.sol\";\nimport \"../interface/ISideToken.sol\";\nimport \"../interface/ISideTokenFactory.sol\";\nimport \"../interface/IAllowTokens.sol\";\nimport \"../interface/IWrapped.sol\";\n\n// Author: @rootstock\n// solhint-disable-next-line max-states-count\ncontract Bridge is Initializable, IBridge, IERC777Recipient, UpgradablePausable, UpgradableOwnable, ReentrancyGuard {\n\tusing SafeMath for uint256;\n\tusing SafeERC20 for IERC20;\n\tusing Address for address;\n\n\taddress constant internal NULL_ADDRESS = address(0);\n\tbytes32 constant internal NULL_HASH = bytes32(0);\n\tIERC1820Registry constant internal ERC1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);\n\n\taddress internal federation;\n\tuint256 internal feePercentage;\n\tstring public deprecatedSymbolPrefix;\n\t// domainSeparator replaces uint256 internal _depprecatedLastDay;\n\tbytes32 public domainSeparator;\n\tuint256 internal _deprecatedSpentToday;\n\n\tmapping (address => address) public deprecatedMappedTokens; // OriginalToken => SideToken\n\tmapping (address => address) public deprecatedOriginalTokens; // SideToken => OriginalToken\n\tmapping (address => bool) public deprecatedKnownTokens; // OriginalToken => true\n\n\t// claimed can use the same of bytes32\n\tmapping (bytes32 => bool) public claimed; // transactionDataHash => true // previously named processed\n\n\tIAllowTokens public allowTokens;\n\tISideTokenFactory public sideTokenFactory;\n\t//Bridge_v1 variables\n\tbool public isUpgrading;\n\t// Percentage with up to 2 decimals\n\tuint256 constant public feePercentageDivider = 10000; // solhint-disable-line const-name-snakecase\n\t//Bridge_v2 variables\n\tbytes32 constant internal _erc777Interface = keccak256(\"ERC777Token\"); // solhint-disable-line const-name-snakecase\n\tIWrapped public wrappedCurrency;\n\tmapping (bytes32 => bytes32) public transactionsDataHashes; // transactionHash => transactionDataHash\n\tmapping (bytes32 => address) public originalTokenAddresses; // transactionHash => originalTokenAddress\n\tmapping (bytes32 => address) public senderAddresses; // transactionHash => senderAddress\n\n\t// keccak256(\"Claim(address to,uint256 amount,bytes32 transactionHash,uint256 originChainId,address relayer,uint256 fee,uint256 nonce,uint256 deadline)\");\n\tbytes32 public constant CLAIM_TYPEHASH = 0xaf3ac34fea9cc1b1def33a9bdc482d988feb61b5015ae4a55e2a62bb3600d54c;\n\tmapping(address => uint) public nonces;\n\n\t//Bridge_v3 variables multichain\n\tmapping (uint256 => mapping(address => address)) public sideTokenByOriginalTokenByChain; // chainId => OriginalToken Address => SideToken Address\n\tmapping (address => OriginalToken) public originalTokenBySideToken; // SideTokenAddress => struct {}\n\tmapping (uint256 => mapping(address => bool)) public knownTokenByChain; // chainId => OriginalToken Address => Know\n\n\tevent AllowTokensChanged(address _newAllowTokens);\n\tevent FederationChanged(address _newFederation);\n\tevent SideTokenFactoryChanged(address _newSideTokenFactory);\n\tevent Upgrading(bool _isUpgrading);\n\tevent WrappedCurrencyChanged(address _wrappedCurrency);\n\n\tfunction initialize(\n\t\taddress _manager,\n\t\taddress _federation,\n\t\taddress _allowTokens,\n\t\taddress _sideTokenFactory\n\t) public initializer {\n\t\tUpgradableOwnable.initialize(_manager);\n\t\tUpgradablePausable.__Pausable_init(_manager);\n\t\tallowTokens = IAllowTokens(_allowTokens);\n\t\tsideTokenFactory = ISideTokenFactory(_sideTokenFactory);\n\t\tfederation = _federation;\n\t\t//keccak256(\"ERC777TokensRecipient\")\n\t\tERC1820.setInterfaceImplementer(address(this), 0xb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b, address(this));\n\t\tinitDomainSeparator();\n\t}\n\n\treceive () external payable {\n\t\t// The fallback function is needed to use WRBTC\n\t\trequire(_msgSender() == address(wrappedCurrency), \"Bridge: not wrappedCurrency\");\n\t}\n\n\tfunction version() override external pure returns (string memory) {\n\t\treturn \"v4\";\n\t}\n\n\tfunction initDomainSeparator() public {\n\t\tdomainSeparator = LibEIP712.hashEIP712Domain(\n\t\t\t\"RSK Token Bridge\",\n\t\t\t\"1\",\n\t\t\tblock.chainid,\n\t\t\taddress(this)\n\t\t);\n\t}\n\n\tmodifier whenNotUpgrading() {\n\t\trequire(!isUpgrading, \"Bridge: Upgrading\");\n\t\t_;\n\t}\n\n\tfunction shouldBeCurrentChainId(uint256 chainId) internal view {\n\t\trequire(chainId == block.chainid, \"Bridge: Not block.chainid\");\n\t}\n\n\tfunction sideTokenByOriginalToken(uint256 chainId, address originalToken) public view returns(address) {\n\t\taddress sideTokenAddr = sideTokenByOriginalTokenByChain[chainId][originalToken];\n\n\t\tif (sideTokenAddr != NULL_ADDRESS) {\n\t\t\treturn sideTokenAddr;\n\t\t}\n\n\t\t// specification for retrocompatibility\n\t\treturn deprecatedMappedTokens[originalToken];\n\t}\n\n\tfunction setSideTokenByOriginalAddressByChain(uint256 chainId, address originalToken, address sideToken) public onlyOwner {\n\t\tsideTokenByOriginalTokenByChain[chainId][originalToken] = sideToken;\n\t}\n\n\tfunction getOriginalTokenBySideToken(address sideToken) public view returns(OriginalToken memory originalToken) {\n\t\toriginalToken = originalTokenBySideToken[sideToken];\n\t\tif (originalToken.tokenAddress != NULL_ADDRESS) {\n\t\t\treturn originalToken;\n\t\t}\n\n\t\t// specification for retrocompatibility\n\t\toriginalToken.originChainId = 1; // ethereum main chain id\n\t\toriginalToken.tokenAddress = deprecatedOriginalTokens[sideToken];\n\t\treturn originalToken;\n\t}\n\n\tfunction setOriginalTokenBySideTokenByChain(address sideToken, OriginalToken memory originalToken) public onlyOwner {\n\t\toriginalTokenBySideToken[sideToken] = originalToken;\n\t}\n\n\tfunction knownToken(uint256 chainId, address originalToken) public view returns(bool) {\n\t\tbool knowToken = knownTokenByChain[chainId][originalToken];\n\t\tif (knowToken) {\n\t\t\treturn knowToken;\n\t\t}\n\n\t\t// specification for retrocompatibility\n\t\treturn deprecatedKnownTokens[originalToken];\n\t}\n\n\tfunction _setKnownTokenByChain(uint256 chainId, address originalToken, bool knownTokenValue) internal {\n\t\tknownTokenByChain[chainId][originalToken] = knownTokenValue;\n\t}\n\n\tfunction acceptTransfer(\n\t\taddress _originalTokenAddress,\n\t\taddress payable _from,\n\t\taddress payable _to,\n\t\tuint256 _amount,\n\t\tbytes32 _blockHash,\n\t\tbytes32 _transactionHash,\n\t\tuint32 _logIndex,\n\t\tuint256 _originChainId,\n\t\tuint256\t_destinationChainId\n\t) external whenNotPaused nonReentrant override {\n\t\trequire(_msgSender() == federation, \"Bridge: Not Federation\");\n\t\tcheckChainId(_originChainId);\n\t\tshouldBeCurrentChainId(_destinationChainId);\n\t\trequire(knownToken(_originChainId, _originalTokenAddress) ||\n\t\t\tsideTokenByOriginalToken(_originChainId, _originalTokenAddress) != NULL_ADDRESS,\n\t\t\t\"Bridge: Unknown token\"\n\t\t);\n\t\trequire(_to != NULL_ADDRESS, \"Bridge: Null To\");\n\t\trequire(_amount > 0, \"Bridge: Amount 0\");\n\t\trequire(_blockHash != NULL_HASH, \"Bridge: Null BlockHash\");\n\t\trequire(_transactionHash != NULL_HASH, \"Bridge: Null TxHash\");\n\t\trequire(transactionsDataHashes[_transactionHash] == bytes32(0), \"Bridge: Already accepted\");\n\n\t\tbytes32 _transactionDataHash = getTransactionDataHash(\n\t\t\t_to,\n\t\t\t_amount,\n\t\t\t_blockHash,\n\t\t\t_transactionHash,\n\t\t\t_logIndex\n\t\t);\n\n\t\tbytes32 _transactionDataHashMultichain = getTransactionDataHash(\n\t\t\t_to,\n\t\t\t_amount,\n\t\t\t_blockHash,\n\t\t\t_transactionHash,\n\t\t\t_logIndex,\n\t\t\t_originChainId,\n\t\t\t_destinationChainId\n\t\t);\n\t\t// Do not remove, claimed also has the previously processed using the older bridge version\n\t\t// https://github.com/rsksmart/tokenbridge/blob/TOKENBRIDGE-1.2.0/bridge/contracts/Bridge.sol#L41\n\t\trequire(!isClaimed(_transactionDataHash, _transactionDataHashMultichain), \"Bridge: Already claimed\");\n\n\t\ttransactionsDataHashes[_transactionHash] = _transactionDataHashMultichain;\n\t\toriginalTokenAddresses[_transactionHash] = _originalTokenAddress;\n\t\tsenderAddresses[_transactionHash] = _from;\n\n\t\temit AcceptedCrossTransfer(\n\t\t\t_transactionHash,\n\t\t\t_originalTokenAddress,\n\t\t\t_to,\n\t\t\t_from,\n\t\t\t_amount,\n\t\t\t_blockHash,\n\t\t\t_logIndex,\n\t\t\t_originChainId,\n\t\t\t_destinationChainId\n\t\t);\n\t}\n\n\tfunction checkChainId(uint256 chainId) internal pure {\n\t\trequire(chainId > 0, \"Bridge: ChainId is 0\");\n\t}\n\n\tfunction _createSideToken(\n\t\tuint256 _typeId,\n\t\taddress _originalTokenAddress,\n\t\tuint8 _originalTokenDecimals,\n\t\tstring calldata _tokenSymbol,\n\t\tstring calldata _tokenName,\n\t\tuint256 _originChainId\n\t) internal {\n\t\trequire(_originalTokenAddress != NULL_ADDRESS, \"Bridge: Null token\");\n\t\tcheckChainId(_originChainId);\n\t\taddress sideToken = sideTokenByOriginalToken(_originChainId, _originalTokenAddress);\n\t\trequire(sideToken == NULL_ADDRESS, \"Bridge: Already exists\");\n\n\t\tuint256 granularity = LibUtils.decimalsToGranularity(_originalTokenDecimals);\n\n\t\t// Create side token\n\t\tsideToken = sideTokenFactory.createSideToken(_tokenName, _tokenSymbol, granularity);\n\n\t\tsetSideTokenByOriginalAddressByChain(_originChainId, _originalTokenAddress, sideToken);\n\n\t\tOriginalToken memory originalToken;\n\t\toriginalToken.originChainId = _originChainId;\n\t\toriginalToken.tokenAddress = _originalTokenAddress;\n\t\tsetOriginalTokenBySideTokenByChain(sideToken, originalToken);\n\t\tallowTokens.setToken(sideToken, _typeId);\n\n\t\temit NewSideToken(sideToken, _originalTokenAddress, _tokenSymbol, granularity, _originChainId);\n\t}\n\n\tfunction createSideToken(\n\t\tuint256 _typeId,\n\t\taddress _originalTokenAddress,\n\t\tuint8 _originalTokenDecimals,\n\t\tstring calldata _tokenSymbol,\n\t\tstring calldata _tokenName,\n\t\tuint256 _originChainId\n\t) external onlyOwner override {\n\t\t_createSideToken(\n\t\t\t_typeId,\n\t\t\t_originalTokenAddress,\n\t\t\t_originalTokenDecimals,\n\t\t\t_tokenSymbol,\n\t\t\t_tokenName,\n\t\t\t_originChainId\n\t\t);\n\t}\n\n\tfunction createMultipleSideTokens(\n\t\tCreateSideTokenStruct[] calldata createSideTokenStruct\n\t) external onlyOwner {\n\t\tfor(uint256 i = 0; i < createSideTokenStruct.length; i++) {\n\t\t\t_createSideToken(\n\t\t\t\tcreateSideTokenStruct[i]._typeId,\n\t\t\t\tcreateSideTokenStruct[i]._originalTokenAddress,\n\t\t\t\tcreateSideTokenStruct[i]._originalTokenDecimals,\n\t\t\t\tcreateSideTokenStruct[i]._originalTokenSymbol,\n\t\t\t\tcreateSideTokenStruct[i]._originalTokenName,\n\t\t\t\tcreateSideTokenStruct[i]._originChainId\n\t\t\t);\n\t\t}\n\t}\n\n\tfunction claim(ClaimData calldata _claimData) external override returns (uint256 receivedAmount) {\n\t\treceivedAmount = _claim(\n\t\t\t_claimData,\n\t\t\t_claimData.to,\n\t\t\tpayable(address(0)),\n\t\t\t0\n\t\t);\n\t\treturn receivedAmount;\n\t}\n\n\tfunction claimFallback(ClaimData calldata _claimData) external override returns (uint256 receivedAmount) {\n\t\trequire(_msgSender() == senderAddresses[_claimData.transactionHash],\"Bridge: invalid sender\");\n\t\treceivedAmount = _claim(\n\t\t\t_claimData,\n\t\t\t_msgSender(),\n\t\t\tpayable(address(0)),\n\t\t\t0\n\t\t);\n\t\treturn receivedAmount;\n\t}\n\n\tfunction getDigest(\n\t\tClaimData memory _claimData,\n\t\taddress payable _relayer,\n\t\tuint256 _fee,\n\t\tuint256 _deadline\n\t) internal returns (bytes32) {\n\t\treturn LibEIP712.hashEIP712Message(\n\t\t\tdomainSeparator,\n\t\t\tkeccak256(\n\t\t\t\tabi.encode(\n\t\t\t\t\tCLAIM_TYPEHASH,\n\t\t\t\t\t_claimData.to,\n\t\t\t\t\t_claimData.amount,\n\t\t\t\t\t_claimData.transactionHash,\n\t\t\t\t\t_claimData.originChainId,\n\t\t\t\t\t_relayer,\n\t\t\t\t\t_fee,\n\t\t\t\t\tnonces[_claimData.to]++,\n\t\t\t\t\t_deadline\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}\n\n\t// Inspired by https://github.com/dapphub/ds-dach/blob/master/src/dach.sol\n\tfunction claimGasless(\n\t\tClaimData calldata _claimData,\n\t\taddress payable _relayer,\n\t\tuint256 _fee,\n\t\tuint256 _deadline,\n\t\tuint8 _v,\n\t\tbytes32 _r,\n\t\tbytes32 _s\n\t) external override returns (uint256 receivedAmount) {\n\t\trequire(_deadline >= block.timestamp, \"Bridge: EXPIRED\"); // solhint-disable-line not-rely-on-time\n\n\t\tbytes32 digest = getDigest(_claimData, _relayer, _fee, _deadline);\n\t\taddress recoveredAddress = ecrecover(digest, _v, _r, _s);\n\t\trequire(_claimData.to != address(0) && recoveredAddress == _claimData.to, \"Bridge: INVALID_SIGNATURE\");\n\n\t\treturn _claim(\n\t\t\t_claimData,\n\t\t\t_claimData.to,\n\t\t\t_relayer,\n\t\t\t_fee\n\t\t);\n\t}\n\n\tfunction isClaimed(bytes32 transactionDataHash, bytes32 transactionDataHashMultichain) public view returns(bool) {\n\t\treturn claimed[transactionDataHash] || claimed[transactionDataHashMultichain];\n\t}\n\n\tfunction isClaimed(ClaimData calldata _claimData, bytes32 transactionDataHashMultichain) public view returns(bool) {\n\t\tbytes32 transactionDataHash = getTransactionDataHash(\n\t\t\t_claimData.to,\n\t\t\t_claimData.amount,\n\t\t\t_claimData.blockHash,\n\t\t\t_claimData.transactionHash,\n\t\t\t_claimData.logIndex\n\t\t);\n\n\t\treturn claimed[transactionDataHash] || claimed[transactionDataHashMultichain];\n\t}\n\n\tfunction _claim(\n\t\tClaimData calldata _claimData,\n\t\taddress payable _reciever,\n\t\taddress payable _relayer,\n\t\tuint256 _fee\n\t) internal nonReentrant returns (uint256 receivedAmount) {\n\t\taddress originalTokenAddress = originalTokenAddresses[_claimData.transactionHash];\n\t\trequire(originalTokenAddress != NULL_ADDRESS, \"Bridge: Tx not crossed\");\n\n\t\tbytes32 transactionDataHash = getTransactionDataHash(\n\t\t\t_claimData.to,\n\t\t\t_claimData.amount,\n\t\t\t_claimData.blockHash,\n\t\t\t_claimData.transactionHash,\n\t\t\t_claimData.logIndex,\n\t\t\t_claimData.originChainId,\n\t\t\tblock.chainid\n\t\t);\n\n\t\trequire(transactionsDataHashes[_claimData.transactionHash] == transactionDataHash, \"Bridge: Wrong transactionDataHash\");\n\t\trequire(!isClaimed(_claimData, transactionDataHash), \"Bridge: Already claimed\");\n\t\tclaimed[transactionDataHash] = true;\n\n\t\treceivedAmount = _claimCross(\n\t\t\t_claimData.originChainId,\n\t\t\toriginalTokenAddress,\n\t\t\t_reciever,\n\t\t\t_claimData.amount,\n\t\t\t_relayer,\n\t\t\t_fee\n\t\t);\n\n\t\temitClaimed(_claimData, originalTokenAddress, _reciever, _relayer, _fee);\n\t\treturn receivedAmount;\n\t}\n\n\tfunction emitClaimed(\n\t\tClaimData calldata _claimData,\n\t\taddress _originalTokenAddress,\n\t\taddress payable _reciever,\n\t\taddress payable _relayer,\n\t\tuint256 _fee\n\t) internal {\n\t\temit Claimed(\n\t\t\t_claimData.transactionHash,\n\t\t\t_originalTokenAddress,\n\t\t\t_claimData.to,\n\t\t\tsenderAddresses[_claimData.transactionHash],\n\t\t\t_claimData.amount,\n\t\t\t_claimData.blockHash,\n\t\t\t_claimData.logIndex,\n\t\t\t_reciever,\n\t\t\t_relayer,\n\t\t\t_fee,\n\t\t\t_claimData.originChainId,\n\t\t\tblock.chainid\n\t\t);\n\t}\n\n\tfunction _claimCross(\n\t\tuint256 _originalChainId,\n\t\taddress _originalTokenAddress,\n\t\taddress payable _reciever,\n\t\tuint256 _amount,\n\t\taddress payable _relayer,\n\t\tuint256 _fee\n\t) internal returns (uint256) {\n\t\tcheckChainId(_originalChainId);\n\t\tif (knownToken(_originalChainId, _originalTokenAddress)) {\n\t\t\treturn _claimCrossBackToToken(\n\t\t\t\t_originalTokenAddress,\n\t\t\t\t_reciever,\n\t\t\t\t_amount,\n\t\t\t\t_relayer,\n\t\t\t\t_fee\n\t\t\t);\n\t\t}\n\n\t\treturn _claimCrossToSideToken(\n\t\t\tsideTokenByOriginalToken(_originalChainId, _originalTokenAddress),\n\t\t\t_reciever,\n\t\t\t_amount,\n\t\t\t_relayer,\n\t\t\t_fee\n\t\t);\n\t}\n\n\tfunction _claimCrossToSideToken(\n\t\taddress _sideToken,\n\t\taddress payable _receiver,\n\t\tuint256 _amount,\n\t\taddress payable _relayer,\n\t\tuint256 _fee\n\t) internal returns (uint256 receivedAmount) {\n\t\trequire(_sideToken != NULL_ADDRESS, \"Bridge: side token is null\");\n\t\tuint256 granularity = IERC777(_sideToken).granularity();\n\t\tuint256 formattedAmount = _amount.mul(granularity);\n\t\trequire(_fee <= formattedAmount, \"Bridge: fee too high\");\n\t\treceivedAmount = formattedAmount.sub(_fee);\n\t\tISideToken(_sideToken).mint(_receiver, receivedAmount, \"\", \"\");\n\t\tif (_fee > 0) {\n\t\t\tISideToken(_sideToken).mint(_relayer, _fee, \"\", \"relayer fee\");\n\t\t}\n\t\treturn receivedAmount;\n\t}\n\n\tfunction _claimCrossBackToToken(\n\t\taddress _originalTokenAddress,\n\t\taddress payable _receiver,\n\t\tuint256 _amount,\n\t\taddress payable _relayer,\n\t\tuint256 _fee\n\t) internal returns (uint256 receivedAmount) {\n\t\tuint256 decimals = LibUtils.getDecimals(_originalTokenAddress);\n\t\t//As side tokens are ERC777 they will always have 18 decimals\n\t\tuint256 formattedAmount = _amount.div(uint256(10) ** (18 - decimals));\n\t\trequire(_fee <= formattedAmount, \"Bridge: fee too high\");\n\t\treceivedAmount = formattedAmount.sub(_fee);\n\t\tif (address(wrappedCurrency) == _originalTokenAddress) {\n\t\t\twrappedCurrency.withdraw(formattedAmount);\n\t\t\t_receiver.transfer(receivedAmount);\n\t\t\tif(_fee > 0) {\n\t\t\t\t_relayer.transfer(_fee);\n\t\t\t}\n\t\t} else {\n\t\t\tIERC20(_originalTokenAddress).safeTransfer(_receiver, receivedAmount);\n\t\t\tif(_fee > 0) {\n\t\t\t\tIERC20(_originalTokenAddress).safeTransfer(_relayer, _fee);\n\t\t\t}\n\t\t}\n\t\treturn receivedAmount;\n\t}\n\n\t/**\n\t\t* ERC-20 tokens approve and transferFrom pattern\n\t\t* See https://eips.ethereum.org/EIPS/eip-20#transferfrom\n\t\t*/\n\tfunction receiveTokensTo(uint256 destinationChainId, address tokenToUse, address to, uint256 amount) external override {\n\t\taddress sender = _msgSender();\n\t\t//Transfer the tokens on IERC20, they should be already Approved for the bridge Address to use them\n\t\tIERC20(tokenToUse).safeTransferFrom(sender, address(this), amount);\n\t\tcrossTokens(tokenToUse, sender, to, amount, \"\", destinationChainId);\n\t}\n\n\t/**\n\t\t* Use network currency and cross it.\n\t\t*/\n\tfunction depositTo(uint256 chainId, address to) external payable override {\n\t\taddress sender = _msgSender();\n\t\trequire(address(wrappedCurrency) != NULL_ADDRESS, \"Bridge: wrappedCurrency empty\");\n\t\twrappedCurrency.deposit{ value: msg.value }();\n\t\tcrossTokens(address(wrappedCurrency), sender, to, msg.value, \"\", chainId);\n\t}\n\n\t/**\n\t\t* ERC-777 tokensReceived hook allows to send tokens to a contract and notify it in a single transaction\n\t\t* See https://eips.ethereum.org/EIPS/eip-777#motivation for details\n\t\t* @param userData it can be 2 options in the first one you can send the receiver and the chain id of the destination\n\t\t* const userData = web3.eth.abi.encodeParameters(\n * [\"address\", \"uint256\"],\n * [anAccount.toLowerCase(), chains.ETHEREUM_MAIN_NET_CHAIN_ID]\n * );\n\t\t* or you also can send only the destination chain id, and the receiver would be the same as the from parameter\n\t\t* const userData = web3.eth.abi.encodeParameters([\"uint256\"], [chains.ETHEREUM_MAIN_NET_CHAIN_ID]);\n\t\t*/\n\tfunction tokensReceived(\n\t\taddress operator,\n\t\taddress from,\n\t\taddress to,\n\t\tuint amount,\n\t\tbytes calldata userData, // [address,uint256] user addrest receiver, destinationChainId || [uint256] same as from, destinationChainId\n\t\tbytes calldata\n\t) external override(IBridge, IERC777Recipient) {\n\t\t//Hook from ERC777address\n\t\tif(operator == address(this)) return; // Avoid loop from bridge calling to ERC77transferFrom\n\t\trequire(to == address(this), \"Bridge: Not to this address\");\n\t\taddress tokenToUse = _msgSender();\n\t\trequire(ERC1820.getInterfaceImplementer(tokenToUse, _erc777Interface) != NULL_ADDRESS, \"Bridge: Not ERC777 token\");\n\t\trequire(userData.length >= 32, \"Bridge: user data with at least the destinationChainId\");\n\t\trequire(userData.length == 64 || !from.isContract(), \"Bridge: Specify receiver address in data\");\n\t\taddress receiver = userData.length == 32 ? from : LibUtils.toAddress(userData, 12);\n\t\tuint256 destinationChainId = LibUtils.toUint256(userData, userData.length - 32);\n\t\tcrossTokens(tokenToUse, from, receiver, amount, userData, destinationChainId);\n\t}\n\n\tfunction crossTokens(\n\t\taddress tokenToUse,\n\t\taddress from,\n\t\taddress to,\n\t\tuint256 amount,\n\t\tbytes memory userData,\n\t\tuint256 destinationChainId\n\t) internal whenNotUpgrading whenNotPaused nonReentrant {\n\t\trequire(block.chainid != destinationChainId, \"Bridge: destination chain id equal current chain id\");\n\t\tcheckChainId(destinationChainId);\n\t\t_setKnownTokenByChain(destinationChainId, tokenToUse, true);\n\t\tuint256 fee = amount.mul(feePercentage).div(feePercentageDivider);\n\t\tuint256 amountMinusFees = amount.sub(fee);\n\t\tuint8 decimals = LibUtils.getDecimals(tokenToUse);\n\t\tuint formattedAmount = amount;\n\t\tif (decimals != 18) {\n\t\t\tformattedAmount = amount.mul(uint256(10)**(18-decimals));\n\t\t}\n\t\t// We consider the amount before fees converted to 18 decimals to check the limits\n\t\t// updateTokenTransfer revert if token not allowed\n\t\tallowTokens.updateTokenTransfer(tokenToUse, formattedAmount);\n\n\t\tOriginalToken memory sideToken = getOriginalTokenBySideToken(tokenToUse);\n\t\tif (sideToken.tokenAddress != NULL_ADDRESS) {\n\t\t\t// Side Token Crossing back\n\t\t\t{ // Created scope to avoid stack too deep\n\t\t\t\tuint256 granularity = LibUtils.getGranularity(tokenToUse);\n\t\t\t\tuint256 modulo = amountMinusFees.mod(granularity);\n\t\t\t\tfee = fee.add(modulo);\n\t\t\t\tamountMinusFees = amountMinusFees.sub(modulo);\n\t\t\t\tIERC777(tokenToUse).burn(amountMinusFees, userData);\n\t\t\t}\n\t\t\temit Cross(\n\t\t\t\tsideToken.tokenAddress,\n\t\t\t\tto,\n\t\t\t\tdestinationChainId,\n\t\t\t\tfrom,\n\t\t\t\tblock.chainid,\n\t\t\t\tamountMinusFees,\n\t\t\t\tuserData\n\t\t\t);\n\t\t} else {\n\t\t\temit Cross(\n\t\t\t\ttokenToUse,\n\t\t\t\tto,\n\t\t\t\tdestinationChainId,\n\t\t\t\tfrom,\n\t\t\t\tblock.chainid,\n\t\t\t\tamountMinusFees,\n\t\t\t\tuserData\n\t\t\t);\n\t\t}\n\n\t\tif (fee > 0) {\n\t\t\t//Send the payment to the MultiSig of the Federation\n\t\t\tIERC20(tokenToUse).safeTransfer(owner(), fee);\n\t\t}\n\t}\n\n\t// function for retrocompatibility\n\tfunction getTransactionDataHash(\n\t\taddress _to,\n\t\tuint256 _amount,\n\t\tbytes32 _blockHash,\n\t\tbytes32 _transactionHash,\n\t\tuint32 _logIndex\n\t) internal pure returns(bytes32) {\n\t\treturn keccak256(abi.encodePacked(_blockHash, _transactionHash, _to, _amount, _logIndex));\n\t}\n\n\tfunction getTransactionDataHash(\n\t\taddress _to,\n\t\tuint256 _amount,\n\t\tbytes32 _blockHash,\n\t\tbytes32 _transactionHash,\n\t\tuint32 _logIndex,\n\t\tuint256 _originChainId,\n\t\tuint256\t_destinationChainId\n\t) public pure override returns(bytes32) {\n\t\treturn keccak256(abi.encodePacked(_blockHash, _transactionHash, _to, _amount, _logIndex, _originChainId, _destinationChainId));\n\t}\n\n\tfunction setFeePercentage(uint amount) external onlyOwner {\n\t\trequire(amount < (feePercentageDivider/10), \"Bridge: bigger than 10%\");\n\t\tfeePercentage = amount;\n\t\temit FeePercentageChanged(feePercentage);\n\t}\n\n\tfunction getFeePercentage() external view override returns(uint) {\n\t\treturn feePercentage;\n\t}\n\n\tfunction changeFederation(address newFederation) external onlyOwner {\n\t\trequire(newFederation != NULL_ADDRESS, \"Bridge: Federation is empty\");\n\t\tfederation = newFederation;\n\t\temit FederationChanged(federation);\n\t}\n\n\tfunction changeAllowTokens(address newAllowTokens) external onlyOwner {\n\t\trequire(newAllowTokens != NULL_ADDRESS, \"Bridge: AllowTokens is empty\");\n\t\tallowTokens = IAllowTokens(newAllowTokens);\n\t\temit AllowTokensChanged(newAllowTokens);\n\t}\n\n\tfunction getFederation() external view returns(address) {\n\t\treturn federation;\n\t}\n\n\tfunction changeSideTokenFactory(address newSideTokenFactory) external onlyOwner {\n\t\trequire(newSideTokenFactory != NULL_ADDRESS, \"Bridge: SideTokenFactory is empty\");\n\t\tsideTokenFactory = ISideTokenFactory(newSideTokenFactory);\n\t\temit SideTokenFactoryChanged(newSideTokenFactory);\n\t}\n\n\tfunction setUpgrading(bool _isUpgrading) external onlyOwner {\n\t\tisUpgrading = _isUpgrading;\n\t\temit Upgrading(isUpgrading);\n\t}\n\n\tfunction setWrappedCurrency(address _wrappedCurrency) external onlyOwner {\n\t\trequire(_wrappedCurrency != NULL_ADDRESS, \"Bridge: wrapp is empty\");\n\t\twrappedCurrency = IWrapped(_wrappedCurrency);\n\t\temit WrappedCurrencyChanged(_wrappedCurrency);\n\t}\n\n\tfunction hasCrossed(bytes32 transactionHash) public view returns (bool) {\n\t\treturn transactionsDataHashes[transactionHash] != bytes32(0);\n\t}\n\n\tfunction hasBeenClaimed(bytes32 transactionHash) public view returns (bool) {\n\t\treturn claimed[transactionsDataHashes[transactionHash]];\n\t}\n\n}\n" + }, + "contracts/interface/IBridge.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\ninterface IBridge {\n\n\tstruct ClaimData {\n\t\taddress payable to;\n\t\tuint256 amount;\n\t\tbytes32 blockHash;\n\t\tbytes32 transactionHash;\n\t\tuint32 logIndex;\n\t\tuint256 originChainId;\n\t}\n\n\tstruct OriginalToken {\n\t\taddress tokenAddress;\n\t\tuint256 originChainId;\n\t}\n\t\n\tstruct CreateSideTokenStruct {\n\t\tuint256 _typeId;\n\t\taddress _originalTokenAddress;\n\t\tuint8 _originalTokenDecimals;\n\t\tstring _originalTokenSymbol;\n\t\tstring _originalTokenName;\n\t\tuint256 _originChainId;\n\t}\n\n\tfunction version() external pure returns (string memory);\n\n\tfunction getFeePercentage() external view returns(uint);\n\n\t/**\n\t\t* ERC-20 tokens approve and transferFrom pattern\n\t\t* See https://eips.ethereum.org/EIPS/eip-20#transferfrom\n\t\t*/\n\tfunction receiveTokensTo(uint256 chainId, address tokenToUse, address to, uint256 amount) external;\n\n\t/**\n\t\t* Use network currency and cross it.\n\t\t*/\n\tfunction depositTo(uint256 chainId, address to) external payable;\n\n\t/**\n\t\t* ERC-777 tokensReceived hook allows to send tokens to a contract and notify it in a single transaction\n\t\t* See https://eips.ethereum.org/EIPS/eip-777#motivation for details\n\t\t* @param userData it can be 2 options in the first one you can send the receiver and the chain id of the destination\n\t\t* const userData = web3.eth.abi.encodeParameters(\n * [\"address\", \"uint256\"],\n * [anAccount.toLowerCase(), chains.ETHEREUM_MAIN_NET_CHAIN_ID]\n * );\n\t\t* or you also can send only the destination chain id, and the receiver would be the same as the from parameter\n\t\t* const userData = web3.eth.abi.encodeParameters([\"uint256\"], [chains.ETHEREUM_MAIN_NET_CHAIN_ID]);\n\t\t*/\n\tfunction tokensReceived (\n\t\taddress operator,\n\t\taddress from,\n\t\taddress to,\n\t\tuint amount,\n\t\tbytes calldata userData,\n\t\tbytes calldata operatorData\n\t) external;\n\n\t/**\n\t\t* Accepts the transaction from the other chain that was voted and sent by the Federation contract\n\t\t*/\n\tfunction acceptTransfer(\n\t\taddress _originalTokenAddress,\n\t\taddress payable _from,\n\t\taddress payable _to,\n\t\tuint256 _amount,\n\t\tbytes32 _blockHash,\n\t\tbytes32 _transactionHash,\n\t\tuint32 _logIndex,\n\t\tuint256 _originChainId,\n\t\tuint256\t_destinationChainId\n\t) external;\n\n\t/**\n\t\t* Claims the crossed transaction using the hash, this sends the funds to the address indicated in\n\t\t*/\n\tfunction claim(ClaimData calldata _claimData) external returns (uint256 receivedAmount);\n\n\tfunction claimFallback(ClaimData calldata _claimData) external returns (uint256 receivedAmount);\n\n\tfunction claimGasless(\n\t\tClaimData calldata _claimData,\n\t\taddress payable _relayer,\n\t\tuint256 _fee,\n\t\tuint256 _deadline,\n\t\tuint8 _v,\n\t\tbytes32 _r,\n\t\tbytes32 _s\n\t) external returns (uint256 receivedAmount);\n\n\tfunction createSideToken(\n\t\tuint256 _typeId,\n\t\taddress _originalTokenAddress,\n\t\tuint8 _originalTokenDecimals,\n\t\tstring calldata _originalTokenSymbol,\n\t\tstring calldata _originalTokenName,\n\t\tuint256 _chainId\n\t) external;\n\n\tfunction createMultipleSideTokens(\n\t\tCreateSideTokenStruct[] calldata createSideTokenStruct\n\t) external;\n\n\tfunction getTransactionDataHash(\n\t\taddress _to,\n\t\tuint256 _amount,\n\t\tbytes32 _blockHash,\n\t\tbytes32 _transactionHash,\n\t\tuint32 _logIndex,\n\t\tuint256 _originChainId,\n\t\tuint256 _destinationChainId\n\t) external returns(bytes32);\n\n\tevent Cross(\n\t\taddress indexed _tokenAddress,\n\t\taddress indexed _to,\n\t\tuint256 indexed _destinationChainId,\n\t\taddress _from,\n\t\tuint256 _originChainId,\n\t\tuint256 _amount,\n\t\tbytes _userData\n\t);\n\n\tevent NewSideToken(\n\t\taddress indexed _newSideTokenAddress,\n\t\taddress indexed _originalTokenAddress,\n\t\tstring _newSymbol,\n\t\tuint256 _granularity,\n\t\tuint256 _chainId\n\t);\n\tevent AcceptedCrossTransfer(\n\t\tbytes32 indexed _transactionHash,\n\t\taddress indexed _originalTokenAddress,\n\t\taddress indexed _to,\n\t\taddress _from,\n\t\tuint256 _amount,\n\t\tbytes32 _blockHash,\n\t\tuint256 _logIndex,\n\t\tuint256 _originChainId,\n\t\tuint256\t_destinationChainId\n\t);\n\tevent FeePercentageChanged(uint256 _amount);\n\tevent Claimed(\n\t\tbytes32 indexed _transactionHash,\n\t\taddress indexed _originalTokenAddress,\n\t\taddress indexed _to,\n\t\taddress _sender,\n\t\tuint256 _amount,\n\t\tbytes32 _blockHash,\n\t\tuint256 _logIndex,\n\t\taddress _reciever,\n\t\taddress _relayer,\n\t\tuint256 _fee,\n\t\tuint256 _destinationChainId,\n\t\tuint256 _originChainId\n\t);\n}" + }, + "contracts/SideTokenFactory/SideTokenFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../zeppelin/ownership/Secondary.sol\";\nimport \"../interface/ISideTokenFactory.sol\";\nimport \"../SideToken/SideToken.sol\";\n\n\n// Author: @rootstock\ncontract SideTokenFactory is ISideTokenFactory, Secondary {\n\n function createSideToken(string calldata name, string calldata symbol, uint256 granularity)\n external onlyPrimary override returns(address) {\n address sideToken = address(new SideToken(name, symbol, primary(), granularity));\n emit SideTokenCreated(sideToken, symbol, granularity);\n return sideToken;\n }\n}" + }, + "contracts/zeppelin/ownership/Secondary.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../GSN/Context.sol\";\n/**\n * @dev A Secondary contract can only be used by its primary account (the one that created it).\n */\nabstract contract Secondary is Context {\n address private _primary;\n\n /**\n * @dev Emitted when the primary contract changes.\n */\n event PrimaryTransferred(\n address recipient\n );\n\n /**\n * @dev Sets the primary account to the one that is creating the Secondary contract.\n */\n constructor () {\n _primary = _msgSender();\n emit PrimaryTransferred(_primary);\n }\n\n /**\n * @dev Reverts if called from any account other than the primary.\n */\n modifier onlyPrimary() {\n require(_msgSender() == _primary, \"Secondary: caller is not the primary account\");\n _;\n }\n\n /**\n * @return the address of the primary.\n */\n function primary() public view returns (address) {\n return _primary;\n }\n\n /**\n * @dev Transfers contract to a new primary.\n * @param recipient The address of new primary.\n */\n function transferPrimary(address recipient) public onlyPrimary {\n require(recipient != address(0), \"Secondary: new primary is the zero address\");\n _primary = recipient;\n emit PrimaryTransferred(_primary);\n }\n}\n" + }, + "contracts/SideToken/SideToken.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../zeppelin/token/ERC777/ERC777.sol\";\nimport \"../interface/IERC677Receiver.sol\";\nimport \"../interface/ISideToken.sol\";\nimport \"../lib/LibEIP712.sol\";\n\n\n// Author: @rootstock\ncontract SideToken is ISideToken, ERC777 {\n using SafeMath for uint256;\n\n address public minter;\n uint256 private _granularity;\n\n // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2612.md\n bytes32 public domainSeparator;\n // keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");\n bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;\n mapping(address => uint) public nonces;\n\n // ERC677 Transfer Event\n event Transfer(address,address,uint256,bytes);\n\n constructor(string memory _tokenName, string memory _tokenSymbol, address _minterAddr, uint256 _newGranularity)\n ERC777(_tokenName, _tokenSymbol, new address[](0)) {\n require(_minterAddr != address(0), \"SideToken: Empty Minter\");\n require(_newGranularity >= 1, \"SideToken: Granularity < 1\");\n minter = _minterAddr;\n _granularity = _newGranularity;\n\n domainSeparator = LibEIP712.hashEIP712Domain(\n name(),\n \"1\",\n block.chainid,\n address(this)\n );\n }\n\n modifier onlyMinter() {\n require(_msgSender() == minter, \"SideToken: Caller is not the minter\");\n _;\n }\n\n function mint(\n address account,\n uint256 amount,\n bytes calldata userData,\n bytes calldata operatorData\n )\n external onlyMinter override\n {\n _mint(_msgSender(), account, amount, userData, operatorData);\n }\n\n /**\n * @dev ERC677 transfer token with additional data if the recipient is a contact.\n * @param recipient The address to transfer to.\n * @param amount The amount to be transferred.\n * @param data The extra data to be passed to the receiving contract.\n */\n function transferAndCall(address recipient, uint amount, bytes calldata data)\n external returns (bool success)\n {\n address from = _msgSender();\n\n _send(from, from, recipient, amount, data, \"\", false);\n emit Transfer(from, recipient, amount, data);\n IERC677Receiver(recipient).onTokenTransfer(from, amount, data);\n return true;\n }\n\n function granularity() public view override returns (uint256) {\n return _granularity;\n }\n\n // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2612.md\n function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {\n require(deadline >= block.timestamp, \"SideToken: EXPIRED\"); // solhint-disable-line not-rely-on-time\n bytes32 digest = LibEIP712.hashEIP712Message(\n domainSeparator,\n keccak256(\n abi.encode(\n PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n nonces[owner]++,\n deadline\n )\n )\n );\n address recoveredAddress = ecrecover(digest, v, r, s);\n require(recoveredAddress != address(0) && recoveredAddress == owner, \"SideToken: INVALID_SIGNATURE\");\n _approve(owner, spender, value);\n }\n\n}" + }, + "contracts/zeppelin/token/ERC777/ERC777.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../../GSN/Context.sol\";\nimport \"./IERC777.sol\";\nimport \"./IERC777Recipient.sol\";\nimport \"./IERC777Sender.sol\";\nimport \"../../token/ERC20/IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../introspection/IERC1820Registry.sol\";\n\n/**\n * @dev Implementation of the {IERC777} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n *\n * Support for ERC20 is included in this contract, as specified by the EIP: both\n * the ERC777 and ERC20 interfaces can be safely used when interacting with it.\n * Both {IERC777-Sent} and {IERC20-Transfer} events are emitted on token\n * movements.\n *\n * Additionally, the {IERC777-granularity} value is hard-coded to `1`, meaning that there\n * are no special restrictions in the amount of tokens that created, moved, or\n * destroyed. This makes integration with ERC20 applications seamless.\n */\ncontract ERC777 is Context, IERC777, IERC20 {\n using SafeMath for uint256;\n using Address for address;\n\n IERC1820Registry constant private _erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);\n\n mapping(address => uint256) private _balances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n // We inline the result of the following hashes because Solidity doesn't resolve them at compile time.\n // See https://github.com/ethereum/solidity/issues/4024.\n\n // keccak256(\"ERC777TokensSender\")\n bytes32 constant private TOKENS_SENDER_INTERFACE_HASH =\n 0x29ddb589b1fb5fc7cf394961c1adf5f8c6454761adf795e67fe149f658abe895;\n\n // keccak256(\"ERC777TokensRecipient\")\n bytes32 constant private TOKENS_RECIPIENT_INTERFACE_HASH =\n 0xb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b;\n\n // This isn't ever read from - it's only used to respond to the defaultOperators query.\n address[] private _defaultOperatorsArray;\n\n // Immutable, but accounts may revoke them (tracked in __revokedDefaultOperators).\n mapping(address => bool) private _defaultOperators;\n\n // For each account, a mapping of its operators and revoked default operators.\n mapping(address => mapping(address => bool)) private _operators;\n mapping(address => mapping(address => bool)) private _revokedDefaultOperators;\n\n // ERC20-allowances\n mapping (address => mapping (address => uint256)) private _allowances;\n\n /**\n * @dev `defaultOperators` may be an empty array.\n */\n constructor(\n string memory aName,\n string memory aSymbol,\n address[] memory theDefaultOperators\n ) {\n _name = aName;\n _symbol = aSymbol;\n\n _defaultOperatorsArray = theDefaultOperators;\n for (uint256 i = 0; i < _defaultOperatorsArray.length; i++) {\n _defaultOperators[_defaultOperatorsArray[i]] = true;\n }\n\n // register interfaces\n _erc1820.setInterfaceImplementer(address(this), keccak256(\"ERC777Token\"), address(this));\n _erc1820.setInterfaceImplementer(address(this), keccak256(\"ERC20Token\"), address(this));\n }\n\n /**\n * @dev See {IERC777-name}.\n */\n function name() public view override(IERC777) returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC777-symbol}.\n */\n function symbol() public view override(IERC777) returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {ERC20Detailed-decimals}.\n *\n * Always returns 18, as per the\n * [ERC777 EIP](https://eips.ethereum.org/EIPS/eip-777#backward-compatibility).\n */\n function decimals() public pure override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC777-granularity}.\n *\n * This implementation always returns `1`.\n */\n function granularity() public view virtual override(IERC777) returns (uint256) {\n return 1;\n }\n\n /**\n * @dev See {IERC777-totalSupply}.\n */\n function totalSupply() public view override(IERC20, IERC777) returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev Returns the amount of tokens owned by an account (`tokenHolder`).\n */\n function balanceOf(address tokenHolder) public view override(IERC20, IERC777) returns (uint256) {\n return _balances[tokenHolder];\n }\n\n /**\n * @dev See {IERC777-send}.\n *\n * Also emits a {Transfer} event for ERC20 compatibility.\n */\n function send(address recipient, uint256 amount, bytes calldata data) external override(IERC777) {\n _send(_msgSender(), _msgSender(), recipient, amount, data, \"\", true);\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Unlike `send`, `recipient` is _not_ required to implement the {IERC777Recipient}\n * interface if it is a contract.\n *\n * Also emits a {Sent} event.\n */\n function transfer(address recipient, uint256 amount) external override(IERC20) returns (bool) {\n require(recipient != address(0), \"ERC777: transfer to zero address\");\n\n address from = _msgSender();\n\n _callTokensToSend(from, from, recipient, amount, \"\", \"\");\n\n _move(from, from, recipient, amount, \"\", \"\");\n\n _callTokensReceived(from, from, recipient, amount, \"\", \"\", false);\n\n return true;\n }\n\n /**\n * @dev See {IERC777-burn}.\n *\n * Also emits a {Transfer} event for ERC20 compatibility.\n */\n function burn(uint256 amount, bytes calldata data) external override(IERC777) {\n _burn(_msgSender(), _msgSender(), amount, data, \"\");\n }\n\n /**\n * @dev See {IERC777-isOperatorFor}.\n */\n function isOperatorFor(\n address operator,\n address tokenHolder\n ) public view override(IERC777) returns (bool) {\n return operator == tokenHolder ||\n (_defaultOperators[operator] && !_revokedDefaultOperators[tokenHolder][operator]) ||\n _operators[tokenHolder][operator];\n }\n\n /**\n * @dev See {IERC777-authorizeOperator}.\n */\n function authorizeOperator(address operator) external override(IERC777) {\n require(_msgSender() != operator, \"ERC777: authorizing self as operator\");\n\n if (_defaultOperators[operator]) {\n delete _revokedDefaultOperators[_msgSender()][operator];\n } else {\n _operators[_msgSender()][operator] = true;\n }\n\n emit AuthorizedOperator(operator, _msgSender());\n }\n\n /**\n * @dev See {IERC777-revokeOperator}.\n */\n function revokeOperator(address operator) external override(IERC777) {\n require(operator != _msgSender(), \"ERC777: revoking self as operator\");\n\n if (_defaultOperators[operator]) {\n _revokedDefaultOperators[_msgSender()][operator] = true;\n } else {\n delete _operators[_msgSender()][operator];\n }\n\n emit RevokedOperator(operator, _msgSender());\n }\n\n /**\n * @dev See {IERC777-defaultOperators}.\n */\n function defaultOperators() public view override(IERC777) returns (address[] memory) {\n return _defaultOperatorsArray;\n }\n\n /**\n * @dev See {IERC777-operatorSend}.\n *\n * Emits {Sent} and {Transfer} events.\n */\n function operatorSend(\n address sender,\n address recipient,\n uint256 amount,\n bytes calldata data,\n bytes calldata operatorData\n )\n external override(IERC777)\n {\n require(isOperatorFor(_msgSender(), sender), \"ERC777: caller is not an operator\");\n _send(_msgSender(), sender, recipient, amount, data, operatorData, true);\n }\n\n /**\n * @dev See {IERC777-operatorBurn}.\n *\n * Emits {Burned} and {Transfer} events.\n */\n function operatorBurn(address account, uint256 amount, bytes calldata data, bytes calldata operatorData)\n external override(IERC777) {\n require(isOperatorFor(_msgSender(), account), \"ERC777: caller is not an operator\");\n _burn(_msgSender(), account, amount, data, operatorData);\n }\n\n /**\n * @dev See {IERC20-allowance}.\n *\n * Note that operator and allowance concepts are orthogonal: operators may\n * not have allowance, and accounts with allowance may not be operators\n * themselves.\n */\n function allowance(address holder, address spender)\n public view override(IERC20) returns (uint256) {\n return _allowances[holder][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * Note that accounts cannot have allowance issued by their operators.\n */\n function approve(address spender, uint256 value) external override(IERC20) returns (bool) {\n address holder = _msgSender();\n _approve(holder, spender, value);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Note that operator and allowance concepts are orthogonal: operators cannot\n * call `transferFrom` (unless they have allowance), and accounts with\n * allowance cannot call `operatorSend` (unless they are operators).\n *\n * Emits {Sent}, {Transfer} and {Approval} events.\n */\n function transferFrom(address holder, address recipient, uint256 amount)\n external override(IERC20) returns (bool) {\n require(recipient != address(0), \"ERC777: transfer to zero address\");\n require(holder != address(0), \"ERC777: transfer from zero address\");\n\n address spender = _msgSender();\n\n _callTokensToSend(spender, holder, recipient, amount, \"\", \"\");\n\n _move(spender, holder, recipient, amount, \"\", \"\");\n _approve(holder, spender, _allowances[holder][spender].sub(amount, \"ERC777: transfer amount exceeds allowance\"));\n\n _callTokensReceived(spender, holder, recipient, amount, \"\", \"\", false);\n\n return true;\n }\n\n /**\n * @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * If a send hook is registered for `account`, the corresponding function\n * will be called with `operator`, `data` and `operatorData`.\n *\n * See {IERC777Sender} and {IERC777Recipient}.\n *\n * Emits {Minted} and {Transfer} events.\n *\n * Requirements\n *\n * - `account` cannot be the zero address.\n * - if `account` is a contract, it must implement the {IERC777Recipient}\n * interface.\n */\n function _mint(\n address operator,\n address account,\n uint256 amount,\n bytes memory userData,\n bytes memory operatorData\n )\n internal\n {\n require(account != address(0), \"ERC777: mint to zero address\");\n\n // Update state variables\n _totalSupply = _totalSupply.add(amount);\n _balances[account] = _balances[account].add(amount);\n\n _callTokensReceived(operator, address(0), account, amount, userData, operatorData, true);\n\n emit Minted(operator, account, amount, userData, operatorData);\n emit Transfer(address(0), account, amount);\n }\n\n /**\n * @dev Send tokens\n * @param operator address operator requesting the transfer\n * @param from address token holder address\n * @param to address recipient address\n * @param amount uint256 amount of tokens to transfer\n * @param userData bytes extra information provided by the token holder (if any)\n * @param operatorData bytes extra information provided by the operator (if any)\n * @param requireReceptionAck if true, contract recipients are required to implement ERC777TokensRecipient\n */\n function _send(\n address operator,\n address from,\n address to,\n uint256 amount,\n bytes memory userData,\n bytes memory operatorData,\n bool requireReceptionAck\n )\n internal\n {\n require(from != address(0), \"ERC777: send from zero address\");\n require(to != address(0), \"ERC777: send to zero address\");\n\n _callTokensToSend(operator, from, to, amount, userData, operatorData);\n\n _move(operator, from, to, amount, userData, operatorData);\n\n _callTokensReceived(operator, from, to, amount, userData, operatorData, requireReceptionAck);\n }\n\n /**\n * @dev Burn tokens\n * @param operator address operator requesting the operation\n * @param from address token holder address\n * @param amount uint256 amount of tokens to burn\n * @param data bytes extra information provided by the token holder\n * @param operatorData bytes extra information provided by the operator (if any)\n */\n function _burn(\n address operator,\n address from,\n uint256 amount,\n bytes memory data,\n bytes memory operatorData\n )\n internal\n {\n require(from != address(0), \"ERC777: burn from zero address\");\n\n _callTokensToSend(operator, from, address(0), amount, data, operatorData);\n\n // Update state variables\n _balances[from] = _balances[from].sub(amount, \"ERC777: burn amount exceeds balance\");\n _totalSupply = _totalSupply.sub(amount);\n\n emit Burned(operator, from, amount, data, operatorData);\n emit Transfer(from, address(0), amount);\n }\n\n function _move(\n address operator,\n address from,\n address to,\n uint256 amount,\n bytes memory userData,\n bytes memory operatorData\n )\n internal\n {\n _balances[from] = _balances[from].sub(amount, \"ERC777: transfer amount exceeds balance\");\n _balances[to] = _balances[to].add(amount);\n\n emit Sent(operator, from, to, amount, userData, operatorData);\n emit Transfer(from, to, amount);\n }\n\n function _approve(address holder, address spender, uint256 value) internal {\n // TODO: restore this require statement if this function becomes internal, or is called at a new callsite. It is\n // currently unnecessary.\n //require(holder != address(0), \"ERC777: approve from the zero address\");\n require(spender != address(0), \"ERC777: approve to zero address\");\n\n _allowances[holder][spender] = value;\n emit Approval(holder, spender, value);\n }\n\n /**\n * @dev Call from.tokensToSend() if the interface is registered\n * @param operator address operator requesting the transfer\n * @param from address token holder address\n * @param to address recipient address\n * @param amount uint256 amount of tokens to transfer\n * @param userData bytes extra information provided by the token holder (if any)\n * @param operatorData bytes extra information provided by the operator (if any)\n */\n function _callTokensToSend(\n address operator,\n address from,\n address to,\n uint256 amount,\n bytes memory userData,\n bytes memory operatorData\n )\n internal\n {\n address implementer = _erc1820.getInterfaceImplementer(from, TOKENS_SENDER_INTERFACE_HASH);\n if (implementer != address(0)) {\n IERC777Sender(implementer).tokensToSend(operator, from, to, amount, userData, operatorData);\n }\n }\n\n /**\n * @dev Call to.tokensReceived() if the interface is registered. Reverts if the recipient is a contract but\n * tokensReceived() was not registered for the recipient\n * @param operator address operator requesting the transfer\n * @param from address token holder address\n * @param to address recipient address\n * @param amount uint256 amount of tokens to transfer\n * @param userData bytes extra information provided by the token holder (if any)\n * @param operatorData bytes extra information provided by the operator (if any)\n * @param requireReceptionAck if true, contract recipients are required to implement ERC777TokensRecipient\n */\n function _callTokensReceived(\n address operator,\n address from,\n address to,\n uint256 amount,\n bytes memory userData,\n bytes memory operatorData,\n bool requireReceptionAck\n )\n private\n {\n address implementer = _erc1820.getInterfaceImplementer(to, TOKENS_RECIPIENT_INTERFACE_HASH);\n if (implementer != address(0)) {\n IERC777Recipient(implementer).tokensReceived(operator, from, to, amount, userData, operatorData);\n } else if (requireReceptionAck) {\n require(!to.isContract(), \"ERC777: token recipient contract has no implementer for ERC777TokensRecipient\");\n }\n }\n}\n" + }, + "contracts/interface/IERC677Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\ninterface IERC677Receiver {\n function onTokenTransfer(address _sender, uint _value, bytes calldata _data) external;\n}" + }, + "contracts/zeppelin/token/ERC777/IERC777Sender.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @dev Interface of the ERC777TokensSender standard as defined in the EIP.\n *\n * `IERC777` Token holders can be notified of operations performed on their\n * tokens by having a contract implement this interface (contract holders can be\n * their own implementer) and registering it on the\n * [ERC1820 global registry](https://eips.ethereum.org/EIPS/eip-1820).\n *\n * See `IERC1820Registry` and `ERC1820Implementer`.\n */\ninterface IERC777Sender {\n /**\n * @dev Called by an `IERC777` token contract whenever a registered holder's\n * (`from`) tokens are about to be moved or destroyed. The type of operation\n * is conveyed by `to` being the zero address or not.\n *\n * This call occurs _before_ the token contract's state is updated, so\n * `IERC777.balanceOf`, etc., can be used to query the pre-operation state.\n *\n * This function may revert to prevent the operation from being executed.\n */\n function tokensToSend(\n address operator,\n address from,\n address to,\n uint amount,\n bytes calldata userData,\n bytes calldata operatorData\n ) external;\n}\n" + }, + "contracts/test/mockERC677Reciever.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../zeppelin/token/ERC20/ERC20Detailed.sol\";\nimport \"../zeppelin/token/ERC20/ERC20.sol\";\nimport \"../interface/IERC677Receiver.sol\";\n\ncontract mockERC677Receiver is IERC677Receiver {\n event Success(address _sender, uint _value, bytes _data);\n /**\n * ERC-677's only method implementation\n * See https://github.com/ethereum/EIPs/issues/677 for details\n */\n function onTokenTransfer(address _sender, uint _value, bytes memory _data) override public {\n emit Success(_sender, _value, _data);\n }\n}" + }, + "contracts/zeppelin/token/ERC20/ERC20Detailed.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"./IERC20.sol\";\n\n/**\n * @dev Optional functions from the ERC20 standard.\n */\nabstract contract ERC20Detailed is IERC20 {\n string private _name;\n string private _symbol;\n uint8 private _decimals;\n\n /**\n * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of\n * these values are immutable: they can only be set once during\n * construction.\n */\n constructor (string memory aName, string memory aSymbol, uint8 theDecimals) {\n _name = aName;\n _symbol = aSymbol;\n _decimals = theDecimals;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5,05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n}\n" + }, + "contracts/zeppelin/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../../GSN/Context.sol\";\nimport \"./IERC20.sol\";\nimport \"../../math/SafeMath.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20Mintable}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin guidelines: functions revert instead\n * of returning `false` on failure. This behavior is nonetheless conventional\n * and does not conflict with the expectations of ERC20 applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20 {\n using SafeMath for uint256;\n\n mapping (address => uint256) private _balances;\n\n mapping (address => mapping (address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() override public view returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) override public view returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `recipient` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address recipient, uint256 amount) override public returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) override public view returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) override public returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20};\n *\n * Requirements:\n * - `sender` and `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n * - the caller must have allowance for `sender`'s tokens of at least\n * `amount`.\n */\n function transferFrom(address sender, address recipient, uint256 amount) override public returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, \"ERC20: transfer amount exceeds allowance\"));\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, \"ERC20: decreased allowance below zero\"));\n return true;\n }\n\n /**\n * @dev Moves tokens `amount` from `sender` to `recipient`.\n *\n * This is internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `sender` cannot be the zero address.\n * - `recipient` cannot be the zero address.\n * - `sender` must have a balance of at least `amount`.\n */\n function _transfer(address sender, address recipient, uint256 amount) internal {\n require(sender != address(0), \"ERC20: transfer from zero address\");\n require(recipient != address(0), \"ERC20: transfer to zero address\");\n\n _balances[sender] = _balances[sender].sub(amount, \"ERC20: transfer amount exceeds balance\");\n _balances[recipient] = _balances[recipient].add(amount);\n emit Transfer(sender, recipient, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements\n *\n * - `to` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal {\n require(account != address(0), \"ERC20: mint to zero address\");\n\n _totalSupply = _totalSupply.add(amount);\n _balances[account] = _balances[account].add(amount);\n emit Transfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal {\n require(account != address(0), \"ERC20: burn from zero address\");\n\n _balances[account] = _balances[account].sub(amount, \"ERC20: burn amount exceeds balance\");\n _totalSupply = _totalSupply.sub(amount);\n emit Transfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.\n *\n * This is internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal {\n require(owner != address(0), \"ERC20: approve from zero address\");\n require(spender != address(0), \"ERC20: approve to zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`.`amount` is then deducted\n * from the caller's allowance.\n *\n * See {_burn} and {_approve}.\n */\n function _burnFrom(address account, uint256 amount) internal {\n _burn(account, amount);\n _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, \"ERC20: burn amount exceeds allowance\"));\n }\n}\n" + }, + "contracts/test/mockReceiveTokensCall.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../interface/IBridge.sol\";\nimport \"../zeppelin/token/ERC20/IERC20.sol\";\nimport \"../zeppelin/token/ERC777/IERC777.sol\";\nimport \"../zeppelin/token/ERC777/IERC777Recipient.sol\";\nimport \"../zeppelin/introspection/IERC1820Registry.sol\";\n\ncontract mockReceiveTokensCall is IERC777Recipient {\n address public bridge;\n IERC1820Registry constant public erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);\n\n constructor(address _bridge) {\n bridge = _bridge;\n //keccak256(\"ERC777TokensRecipient\")\n erc1820.setInterfaceImplementer(address(this), 0xb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b, address(this));\n }\n\n function callReceiveTokens(address tokenToUse, address receiver, uint256 amount, uint256 destinationChainId) external {\n IERC20(tokenToUse).approve(bridge, amount);\n IBridge(bridge).receiveTokensTo(destinationChainId, tokenToUse, receiver, amount);\n }\n\n function callDepositTo(address receiver, uint256 destinationChainId) external payable {\n IBridge(bridge).depositTo{ value: msg.value }(destinationChainId, receiver);\n }\n\n function callTokensReceived(address tokenToUse, uint256 amount, bytes calldata data) external {\n IERC777(tokenToUse).send(bridge, amount, data);\n }\n\n // Mandatory for IERC777Recipient\n function tokensReceived(\n address,\n address,\n address,\n uint,\n bytes calldata,\n bytes calldata\n ) override external view {\n this;\n }\n}" + }, + "contracts/test/mockERC777Recipient.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../zeppelin/token/ERC777/IERC777Recipient.sol\";\nimport \"../zeppelin/introspection/IERC1820Registry.sol\";\n\ncontract mockERC777Recipient is IERC777Recipient {\n IERC1820Registry constant private _erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);\n\n constructor() {\n _erc1820.setInterfaceImplementer(address(this), keccak256(\"ERC777TokensRecipient\"), address(this));\n }\n\n event Success(\n address operator,\n address from,\n address to,\n uint amount,\n bytes userData,\n bytes operatorData);\n\n /**\n * ERC-677's only method implementation\n * See https://github.com/ethereum/EIPs/issues/677 for details\n */\n function tokensReceived(\n address operator,\n address from,\n address to,\n uint amount,\n bytes calldata userData,\n bytes calldata operatorData\n ) override external {\n emit Success(operator, from, to, amount, userData, operatorData);\n }\n}" + }, + "contracts/zeppelin/upgradable/proxy/UpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"./Proxy.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n *\n * Upgradeability is only provided internally through {_upgradeTo}. For an externally upgradeable proxy see\n * {TransparentUpgradeableProxy}.\n */\ncontract UpgradeableProxy is Proxy {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n _setImplementation(_logic);\n if(_data.length > 0) {\n Address.functionDelegateCall(_logic, _data);\n }\n }\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 private constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n bytes32 slot = _IMPLEMENTATION_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n impl := sload(slot)\n }\n }\n\n /**\n * @dev Upgrades the proxy to a new implementation.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal virtual {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"UpgradeableProxy: new implementation is not a contract\");\n\n bytes32 slot = _IMPLEMENTATION_SLOT;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, newImplementation)\n }\n }\n}\n" + }, + "contracts/zeppelin/upgradable/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 { revert(0, returndatasize()) }\n default { return(0, returndatasize()) }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback () external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive () external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {\n }\n}\n" + }, + "contracts/zeppelin/upgradable/proxy/TransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"./UpgradeableProxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is UpgradeableProxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {UpgradeableProxy-constructor}.\n */\n constructor(address _logic, address admin_, bytes memory _data) payable UpgradeableProxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _setAdmin(admin_);\n }\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _admin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _admin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n require(newAdmin != address(0), \"TransparentUpgradeableProxy: new admin is the zero address\");\n emit AdminChanged(_admin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external virtual ifAdmin {\n _upgradeTo(newImplementation);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable virtual ifAdmin {\n _upgradeTo(newImplementation);\n Address.functionDelegateCall(newImplementation, data);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address adm) {\n bytes32 slot = _ADMIN_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n adm := sload(slot)\n }\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n bytes32 slot = _ADMIN_SLOT;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, newAdmin)\n }\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _admin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n}\n" + }, + "contracts/zeppelin/upgradable/proxy/ProxyAdmin.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../../ownership/Ownable.sol\";\nimport \"./TransparentUpgradeableProxy.sol\";\n\n/**\n * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an\n * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.\n */\n // Author: @rootstock123\ncontract ProxyAdmin is Ownable {\n\n /**\n * @dev Returns the current implementation of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"implementation()\")) == 0x5c60da1b\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"5c60da1b\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Returns the current admin of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"admin()\")) == 0xf851a440\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"f851a440\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Changes the admin of `proxy` to `newAdmin`.\n *\n * Requirements:\n *\n * - This contract must be the current admin of `proxy`.\n */\n function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {\n proxy.changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgrade(TransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {\n proxy.upgradeTo(implementation);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. See\n * {TransparentUpgradeableProxy-upgradeToAndCall}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgradeAndCall(TransparentUpgradeableProxy proxy, address implementation, bytes memory data) public payable virtual onlyOwner {\n proxy.upgradeToAndCall{value: msg.value}(implementation, data);\n }\n}\n" + }, + "contracts/zeppelin/ownership/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../GSN/Context.sol\";\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () {\n _owner = _msgSender();\n emit OwnershipTransferred(address(0), _owner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(isOwner(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Returns true if the caller is the current owner.\n */\n function isOwner() public view returns (bool) {\n return _msgSender() == _owner;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public onlyOwner {\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n */\n function _transferOwnership(address newOwner) internal {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "contracts/Federation/FederationV2.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n// Upgradables\nimport \"../zeppelin/upgradable/Initializable.sol\";\nimport \"../zeppelin/upgradable/ownership/UpgradableOwnable.sol\";\n\nimport \"../Bridge/IBridgeV3.sol\";\n\ncontract FederationV2 is Initializable, UpgradableOwnable {\n uint constant public MAX_MEMBER_COUNT = 50;\n address constant private NULL_ADDRESS = address(0);\n\n IBridgeV3 public bridge;\n address[] public members;\n uint public required;\n\n mapping (address => bool) public isMember;\n mapping (bytes32 => mapping (address => bool)) public votes;\n mapping(bytes32 => bool) public processed;\n\n event Executed(\n address indexed federator,\n bytes32 indexed transactionHash,\n bytes32 indexed transactionId,\n address originalTokenAddress,\n address sender,\n address receiver,\n uint256 amount,\n bytes32 blockHash,\n uint32 logIndex\n );\n event MemberAddition(address indexed member);\n event MemberRemoval(address indexed member);\n event RequirementChange(uint required);\n event BridgeChanged(address bridge);\n event Voted(\n address indexed federator,\n bytes32 indexed transactionHash,\n bytes32 indexed transactionId,\n address originalTokenAddress,\n address sender,\n address receiver,\n uint256 amount,\n bytes32 blockHash,\n uint32 logIndex\n );\n event HeartBeat(\n address indexed sender,\n uint256 fedRskBlock,\n uint256 fedEthBlock,\n string federatorVersion,\n string nodeRskInfo,\n string nodeEthInfo\n );\n\n modifier onlyMember() {\n require(isMember[_msgSender()], \"Federation: Not Federator\");\n _;\n }\n\n modifier validRequirement(uint membersCount, uint _required) {\n // solium-disable-next-line max-len\n require(_required <= membersCount && _required != 0 && membersCount != 0, \"Federation: Invalid requirements\");\n _;\n }\n\n function initialize(address[] memory _members, uint _required, address _bridge, address owner)\n validRequirement(_members.length, _required) public initializer {\n UpgradableOwnable.initialize(owner);\n require(_members.length <= MAX_MEMBER_COUNT, \"Federation: Too many members\");\n members = _members;\n for (uint i = 0; i < _members.length; i++) {\n require(!isMember[_members[i]] && _members[i] != NULL_ADDRESS, \"Federation: Invalid members\");\n isMember[_members[i]] = true;\n emit MemberAddition(_members[i]);\n }\n required = _required;\n emit RequirementChange(required);\n _setBridge(_bridge);\n }\n\n function version() external pure returns (string memory) {\n return \"v2\";\n }\n\n function setBridge(address _bridge) external onlyOwner {\n _setBridge(_bridge);\n }\n\n function _setBridge(address _bridge) internal {\n require(_bridge != NULL_ADDRESS, \"Federation: Empty bridge\");\n bridge = IBridgeV3(_bridge);\n emit BridgeChanged(_bridge);\n }\n\n function voteTransaction(\n address originalTokenAddress,\n address payable sender,\n address payable receiver,\n uint256 amount,\n bytes32 blockHash,\n bytes32 transactionHash,\n uint32 logIndex\n )\n public onlyMember returns(bool)\n {\n bytes32 transactionId = getTransactionId(\n originalTokenAddress,\n sender,\n receiver,\n amount,\n blockHash,\n transactionHash,\n logIndex\n );\n if (processed[transactionId])\n return true;\n\n if (votes[transactionId][_msgSender()])\n return true;\n\n votes[transactionId][_msgSender()] = true;\n emit Voted(\n _msgSender(),\n transactionHash,\n transactionId,\n originalTokenAddress,\n sender,\n receiver,\n amount,\n blockHash,\n logIndex\n );\n\n uint transactionCount = getTransactionCount(transactionId);\n if (transactionCount >= required && transactionCount >= members.length / 2 + 1) {\n processed[transactionId] = true;\n bridge.acceptTransfer(\n originalTokenAddress,\n sender,\n receiver,\n amount,\n blockHash,\n transactionHash,\n logIndex\n );\n emit Executed(\n _msgSender(),\n transactionHash,\n transactionId,\n originalTokenAddress,\n sender,\n receiver,\n amount,\n blockHash,\n logIndex\n );\n return true;\n }\n\n return true;\n }\n\n function getTransactionCount(bytes32 transactionId) public view returns(uint) {\n uint count = 0;\n for (uint i = 0; i < members.length; i++) {\n if (votes[transactionId][members[i]])\n count += 1;\n }\n return count;\n }\n\n function hasVoted(bytes32 transactionId) external view returns(bool)\n {\n return votes[transactionId][_msgSender()];\n }\n\n function transactionWasProcessed(bytes32 transactionId) external view returns(bool)\n {\n return processed[transactionId];\n }\n\n function getTransactionId(\n address originalTokenAddress,\n address sender,\n address receiver,\n uint256 amount,\n bytes32 blockHash,\n bytes32 transactionHash,\n uint32 logIndex\n ) public pure returns(bytes32)\n {\n return keccak256(\n abi.encodePacked(\n originalTokenAddress,\n sender,\n receiver,\n amount,\n blockHash,\n transactionHash,\n logIndex\n )\n );\n }\n\n function addMember(address _newMember) external onlyOwner\n {\n require(_newMember != NULL_ADDRESS, \"Federation: Empty member\");\n require(!isMember[_newMember], \"Federation: Member already exists\");\n require(members.length < MAX_MEMBER_COUNT, \"Federation: Max members reached\");\n\n isMember[_newMember] = true;\n members.push(_newMember);\n emit MemberAddition(_newMember);\n }\n\n function removeMember(address _oldMember) external onlyOwner\n {\n require(_oldMember != NULL_ADDRESS, \"Federation: Empty member\");\n require(isMember[_oldMember], \"Federation: Member doesn't exists\");\n require(members.length > 1, \"Federation: Can't remove all the members\");\n require(members.length - 1 >= required, \"Federation: Can't have less than required members\");\n\n isMember[_oldMember] = false;\n for (uint i = 0; i < members.length - 1; i++) {\n if (members[i] == _oldMember) {\n members[i] = members[members.length - 1];\n break;\n }\n }\n members.pop(); // remove an element from the end of the array.\n emit MemberRemoval(_oldMember);\n }\n\n function getMembers() external view returns (address[] memory)\n {\n return members;\n }\n\n function changeRequirement(uint _required) external onlyOwner validRequirement(members.length, _required)\n {\n require(_required >= 2, \"Federation: Requires at least 2\");\n required = _required;\n emit RequirementChange(_required);\n }\n\n function emitHeartbeat(\n uint256 fedRskBlock,\n uint256 fedEthBlock,\n string calldata federatorVersion,\n string calldata nodeRskInfo,\n string calldata nodeEthInfo\n ) external onlyMember {\n emit HeartBeat(\n _msgSender(),\n fedRskBlock,\n fedEthBlock,\n federatorVersion,\n nodeRskInfo,\n nodeEthInfo\n );\n }\n}" + }, + "contracts/Federation/Federation.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n// Upgradables\nimport \"../zeppelin/upgradable/Initializable.sol\";\nimport \"../zeppelin/upgradable/ownership/UpgradableOwnable.sol\";\n\nimport \"../interface/IBridge.sol\";\nimport \"../interface/IFederation.sol\";\n\n// Author: @rootstock\ncontract Federation is Initializable, UpgradableOwnable, IFederation {\n\tuint constant public MAX_MEMBER_COUNT = 50;\n\taddress constant private NULL_ADDRESS = address(0);\n\n\tIBridge public bridge;\n\taddress[] public members;\n\n\t/**\n\t\t@notice The minimum amount of votes to approve a transaction\n\t\t@dev It should have at least the required amount of members\n\t\t*/\n\tuint public required;\n\n\t/**\n\t\t@notice All the addresses that are members of the federation\n\t\t@dev The address should be a member to vote in transactions\n\t\t*/\n\tmapping (address => bool) public isMember;\n\n\t/**\n\t\t(bytes32) transactionId = keccak256(\n\t\t\tabi.encodePacked(\n\t\t\t\toriginalTokenAddress,\n\t\t\t\tsender,\n\t\t\t\treceiver,\n\t\t\t\tamount,\n\t\t\t\tblockHash,\n\t\t\t\ttransactionHash,\n\t\t\t\tlogIndex\n\t\t\t)\n\t\t) => (\n\t\t\t(address) members => (bool) voted\n\t\t)\n\t\t@notice Votes by members by the transaction ID\n\t\t@dev the members should approve the transaction by 50% + 1\n\t\t*/\n\tmapping (bytes32 => mapping (address => bool)) public votes;\n\n\t/**\n\t\t(bytes32) transactionId => (bool) voted\n\t\t@notice Check if that transaction was already processed\n\t*/\n\tmapping(bytes32 => bool) public processed;\n\n\tmodifier onlyMember() {\n\t\trequire(isMember[_msgSender()], \"Federation: Not Federator\");\n\t\t_;\n\t}\n\n\tmodifier validRequirement(uint membersCount, uint _required) {\n\t\trequire(_required <= membersCount && _required != 0 && membersCount != 0, \"Federation: Invalid requirements\");\n\t\t_;\n\t}\n\n\tfunction initialize(\n\t\taddress[] calldata _members,\n\t\tuint _required,\n\t\taddress _bridge,\n\t\taddress owner\n\t) public validRequirement(_members.length, _required) initializer {\n\t\tUpgradableOwnable.initialize(owner);\n\t\trequire(_members.length <= MAX_MEMBER_COUNT, \"Federation: Too many members\");\n\t\tmembers = _members;\n\t\tfor (uint i = 0; i < _members.length; i++) {\n\t\t\trequire(!isMember[_members[i]] && _members[i] != NULL_ADDRESS, \"Federation: Invalid members\");\n\t\t\tisMember[_members[i]] = true;\n\t\t\temit MemberAddition(_members[i]);\n\t\t}\n\t\trequired = _required;\n\t\temit RequirementChange(required);\n\t\t_setBridge(_bridge);\n\t}\n\n\t/**\n\t\t@notice Current version of the contract\n\t\t@return version in v{Number}\n\t\t*/\n\tfunction version() external pure override returns (string memory) {\n\t\treturn \"v3\";\n\t}\n\n\t/**\n\t\t@notice Sets a new bridge contract\n\t\t@dev Emits BridgeChanged event\n\t\t@param _bridge the new bridge contract address that should implement the IBridge interface\n\t\t*/\n\tfunction setBridge(address _bridge) external onlyOwner override {\n\t\t_setBridge(_bridge);\n\t}\n\n\tfunction _setBridge(address _bridge) internal {\n\t\trequire(_bridge != NULL_ADDRESS, \"Federation: Empty bridge\");\n\t\tbridge = IBridge(_bridge);\n\t\temit BridgeChanged(_bridge);\n\t}\n\n\tfunction validateTransaction(bytes32 transactionId, bytes32 transactionIdMultichain) internal view returns(bool) {\n\t\tuint256 minimumVotes = getMinimalNumberOfVotes();\n\t\tuint256 amountVotes = 0;\n\n for (uint256 i = 0; i < members.length; i++) {\n if (votes[transactionIdMultichain][members[i]]) {\n amountVotes += 1;\n\t\t\t} else if (votes[transactionId][members[i]]) {\n amountVotes += 1;\n\t\t\t}\n\n\t\t\tif (amountVotes >= minimumVotes && amountVotes >= required) {\n\t\t\t\treturn true;\n\t\t\t}\n }\n\n\t\treturn false;\n\t}\n\n\tfunction getMinimalNumberOfVotes() internal view returns(uint256) {\n\t\treturn members.length / 2 + 1;\n\t}\n\n\tfunction isProcessed(bytes32 transactionId, bytes32 transactionIdMultichain) public view returns(bool) {\n\t\treturn processed[transactionIdMultichain] || processed[transactionId];\n\t}\n\n\tfunction isVoted(bytes32 transactionId, bytes32 transactionIdMultichain) public view returns(bool) {\n\t\treturn votes[transactionIdMultichain][_msgSender()] || votes[transactionId][_msgSender()];\n\t}\n\n\tfunction shouldBeCurrentChainId(uint256 chainId) internal view {\n\t\trequire(chainId == block.chainid, \"Federation: Not block.chainid\");\n\t}\n\n\t/**\n\t\t@notice Vote in a transaction, if it has enough votes it accepts the transfer\n\t\t@param originalTokenAddress The address of the token in the origin (main) chain\n\t\t@param sender The address who solicited the cross token\n\t\t@param receiver Who is going to receive the token in the opposite chain\n\t\t@param value Amount\n\t\t@param blockHash The block hash in which the transaction with the cross event occurred\n\t\t@param transactionHash The transaction in which the cross event occurred\n\t\t@param logIndex Index of the event in the logs\n\t\t@param originChainId Is chainId of the original chain\n\t\t@param destinationChainId Is chainId of the destination chain\n\t\t*/\n\tfunction voteTransaction(\n\t\taddress originalTokenAddress,\n\t\taddress payable sender,\n\t\taddress payable receiver,\n\t\tuint256 value,\n\t\tbytes32 blockHash,\n\t\tbytes32 transactionHash,\n\t\tuint32 logIndex,\n\t\tuint256 originChainId,\n\t\tuint256\tdestinationChainId\n\t) external onlyMember override {\n\t\tshouldBeCurrentChainId(destinationChainId);\n\t\tbytes32 transactionId = keccak256(\n\t\t\tabi.encodePacked(\n\t\t\t\toriginalTokenAddress,\n\t\t\t\tsender,\n\t\t\t\treceiver,\n\t\t\t\tvalue,\n\t\t\t\tblockHash,\n\t\t\t\ttransactionHash,\n\t\t\t\tlogIndex\n\t\t\t)\n\t\t);\n\n\t\tbytes32 transactionIdMultichain = getTransactionId(\n\t\t\toriginalTokenAddress,\n\t\t\tsender,\n\t\t\treceiver,\n\t\t\tvalue,\n\t\t\tblockHash,\n\t\t\ttransactionHash,\n\t\t\tlogIndex,\n\t\t\toriginChainId,\n\t\t\tdestinationChainId\n\t\t);\n\n\t\tif (isProcessed(transactionId, transactionIdMultichain))\n\t\t\treturn;\n\n\t\tif (isVoted(transactionId, transactionIdMultichain))\n\t\t\treturn;\n\n\t\tvotes[transactionIdMultichain][_msgSender()] = true;\n\t\temit Voted(\n\t\t\t_msgSender(),\n\t\t\ttransactionHash,\n\t\t\ttransactionIdMultichain,\n\t\t\toriginalTokenAddress,\n\t\t\tsender,\n\t\t\treceiver,\n\t\t\tvalue,\n\t\t\tblockHash,\n\t\t\tlogIndex,\n\t\t\toriginChainId,\n\t\t\tdestinationChainId\n\t\t);\n\n\t\tif (validateTransaction(transactionId, transactionIdMultichain)) {\n\t\t\tprocessed[transactionIdMultichain] = true;\n\n\t\t\tacceptTransfer(\n\t\t\t\toriginalTokenAddress,\n\t\t\t\tsender,\n\t\t\t\treceiver,\n\t\t\t\tvalue,\n\t\t\t\tblockHash,\n\t\t\t\ttransactionHash,\n\t\t\t\tlogIndex,\n\t\t\t\t\n\t\t\t\toriginChainId,\n\t\t\t\tdestinationChainId\n\t\t\t);\n\n\t\t\temit Executed(\n\t\t\t\t_msgSender(),\n\t\t\t\ttransactionHash,\n\t\t\t\ttransactionIdMultichain,\n\t\t\t\toriginalTokenAddress,\n\t\t\t\tsender,\n\t\t\t\treceiver,\n\t\t\t\tvalue,\n\t\t\t\tblockHash,\n\t\t\t\tlogIndex,\n\t\t\t\toriginChainId,\n\t\t\t\tdestinationChainId\n\t\t\t);\n\t\t}\n\t}\n\n function acceptTransfer(\n address originalTokenAddress,\n address payable sender,\n address payable receiver,\n uint256 value,\n bytes32 blockHash,\n bytes32 transactionHash,\n uint32 logIndex,\n\tuint256 originChainId,\n\tuint256\tdestinationChainId\n ) internal {\n\t bridge.acceptTransfer(\n\t\toriginalTokenAddress,\n\t\tsender,\n\t\treceiver,\n\t\tvalue,\n\t\tblockHash,\n\t\ttransactionHash,\n\t\tlogIndex,\n\t\toriginChainId,\n\t\tdestinationChainId\n\t );\n }\n\n /**\n @notice Get the amount of approved votes for that transactionId\n @param transactionId The transaction hashed from getTransactionId function\n */\n function getTransactionCount(bytes32 transactionId) public view returns(uint) {\n uint count = 0;\n for (uint i = 0; i < members.length; i++) {\n if (votes[transactionId][members[i]])\n count += 1;\n }\n return count;\n }\n\n\tfunction hasVoted(bytes32 transactionId) external view returns(bool) {\n\t\treturn votes[transactionId][_msgSender()];\n\t}\n\n\tfunction transactionWasProcessed(bytes32 transactionId) external view returns(bool) {\n\t\treturn processed[transactionId];\n\t}\n\n\t/**\n\t\t@notice Gets the hash of transaction from the following parameters encoded and keccaked\n\t\t@dev It encodes and applies keccak256 to the parameters received in the same order\n\t\t@param originalTokenAddress The address of the token in the origin (main) chain\n\t\t@param sender The address who solicited the cross token\n\t\t@param receiver Who is going to receive the token in the opposite chain\n\t\t@param amount Could be the amount or the tokenId\n\t\t@param blockHash The block hash in which the transaction with the cross event occurred\n\t\t@param transactionHash The transaction in which the cross event occurred\n\t\t@param logIndex Index of the event in the logs\n\t\t@param originChainId Is chainId of the original chain\n\t\t@param destinationChainId Is chainId of the destination chain\n\t\t@return The hash generated by the parameters.\n\t*/\n\tfunction getTransactionId(\n\t\taddress originalTokenAddress,\n\t\taddress sender,\n\t\taddress receiver,\n\t\tuint256 amount,\n\t\tbytes32 blockHash,\n\t\tbytes32 transactionHash,\n\t\tuint32 logIndex,\n\t\tuint256 originChainId,\n\t\tuint256\tdestinationChainId\n\t) public pure returns(bytes32) {\n\t\treturn keccak256(\n\t\t\tabi.encodePacked(\n\t\t\t\toriginalTokenAddress,\n\t\t\t\tsender,\n\t\t\t\treceiver,\n\t\t\t\tamount,\n\t\t\t\tblockHash,\n\t\t\t\ttransactionHash,\n\t\t\t\tlogIndex,\n\t\t\t\toriginChainId,\n\t\t\t\tdestinationChainId\n\t\t\t)\n\t\t);\n\t}\n\n\tfunction addMember(address _newMember) external onlyOwner override {\n\t\trequire(_newMember != NULL_ADDRESS, \"Federation: Empty member\");\n\t\trequire(!isMember[_newMember], \"Federation: Member already exists\");\n\t\trequire(members.length < MAX_MEMBER_COUNT, \"Federation: Max members reached\");\n\n\t\tisMember[_newMember] = true;\n\t\tmembers.push(_newMember);\n\t\temit MemberAddition(_newMember);\n\t}\n\n\tfunction removeMember(address _oldMember) external onlyOwner override {\n\t\trequire(_oldMember != NULL_ADDRESS, \"Federation: Empty member\");\n\t\trequire(isMember[_oldMember], \"Federation: Member doesn't exists\");\n\t\trequire(members.length > 1, \"Federation: Can't remove all the members\");\n\t\trequire(members.length - 1 >= required, \"Federation: Can't have less than required members\");\n\n\t\tisMember[_oldMember] = false;\n\t\tfor (uint i = 0; i < members.length - 1; i++) {\n\t\t\tif (members[i] == _oldMember) {\n\t\t\t\tmembers[i] = members[members.length - 1];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tmembers.pop(); // remove an element from the end of the array.\n\t\temit MemberRemoval(_oldMember);\n\t}\n\n\t/**\n\t\t@notice Return all the current members of the federation\n\t\t@return Current members\n\t\t*/\n\tfunction getMembers() external view override returns (address[] memory) {\n\t\treturn members;\n\t}\n\n\t/**\n\t\t@notice Changes the number of required members to vote and approve an transaction\n\t\t@dev Emits the RequirementChange event\n\t\t@param _required the number of minimum members to approve an transaction, it has to be bigger than 1\n\t\t*/\n\tfunction changeRequirement(uint _required) external onlyOwner validRequirement(members.length, _required) override {\n\t\trequire(_required >= 2, \"Federation: Requires at least 2\");\n\t\trequired = _required;\n\t\temit RequirementChange(_required);\n\t}\n\n\t/**\n\t\t@notice It emits an HeartBeat like an health check\n\t\t@dev Emits HeartBeat event\n\t\t*/\n\tfunction emitHeartbeat(\n\t\tstring calldata fedVersion,\n\t\tuint256[] calldata fedChainsIds,\n\t\tuint256[] calldata fedChainsBlocks,\n\t\tstring[] calldata fedChainsInfo\n\t) external onlyMember override {\n\t\trequire(fedChainsIds.length == fedChainsBlocks.length &&\n\t\t\tfedChainsIds.length == fedChainsInfo.length, \"Federation: Length missmatch\");\n\t\temit HeartBeat(\n\t\t\t_msgSender(),\n\t\t\tblock.chainid,\n\t\t\tblock.number,\n\t\t\tfedVersion,\n\t\t\tfedChainsIds,\n\t\t\tfedChainsBlocks,\n\t\t\tfedChainsInfo\n\t\t);\n\t}\n}\n" + }, + "contracts/interface/IFederation.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\npragma abicoder v2;\n\ninterface IFederation {\n\n /**\n @notice Current version of the contract\n @return version in v{Number}\n */\n function version() external pure returns (string memory);\n\n /**\n @notice Sets a new bridge contract\n @param _bridge the new bridge contract address that should implement the IBridge interface\n */\n function setBridge(address _bridge) external;\n\n /**\n @notice Vote in a transaction, if it has enough votes it accepts the transfer\n @param originalTokenAddress The address of the token in the origin (main) chain\n @param sender The address who solicited the cross token\n @param receiver Who is going to receive the token in the opposite chain\n @param value Amount\n @param blockHash The block hash in which the transaction with the cross event occurred\n @param transactionHash The transaction in which the cross event occurred\n @param logIndex Index of the event in the logs\n\t\t@param originChainId Is chainId of the original chain\n\t\t@param destinationChainId Is chainId of the destination chain\n */\n function voteTransaction(\n address originalTokenAddress,\n address payable sender,\n address payable receiver,\n uint256 value,\n bytes32 blockHash,\n bytes32 transactionHash,\n uint32 logIndex,\n\t uint256 originChainId,\n\t uint256\tdestinationChainId\n ) external;\n\n /**\n @notice Add a new member to the federation\n @param _newMember address of the new member\n */\n function addMember(address _newMember) external;\n\n /**\n @notice Remove a member of the federation\n @param _oldMember address of the member to be removed from federation\n */\n function removeMember(address _oldMember) external;\n\n /**\n @notice Return all the current members of the federation\n @return Current members\n */\n function getMembers() external view returns (address[] memory);\n\n /**\n @notice Changes the number of required members to vote and approve an transaction\n @param _required the number of minimum members to approve an transaction, it has to be bigger than 1\n */\n function changeRequirement(uint _required) external;\n\n /**\n @notice It emmits an HeartBeat like an healthy check\n */\n function emitHeartbeat(\n string calldata federatorVersion,\n\t\tuint256[] calldata fedChainsIds,\n\t\tuint256[] calldata fedChainsBlocks,\n\t\tstring[] calldata fedChainsInfo\n ) external;\n\n event Executed(\n address indexed federator,\n bytes32 indexed transactionHash,\n bytes32 indexed transactionId,\n address originalTokenAddress,\n address sender,\n address receiver,\n uint256 amount,\n bytes32 blockHash,\n uint32 logIndex,\n\t\tuint256 originChainId,\n\t\tuint256\tdestinationChainId\n );\n event MemberAddition(address indexed member);\n event MemberRemoval(address indexed member);\n event RequirementChange(uint required);\n event BridgeChanged(address bridge);\n event Voted(\n address indexed federator,\n bytes32 indexed transactionHash,\n bytes32 indexed transactionId,\n address originalTokenAddress,\n address sender,\n address receiver,\n uint256 amount,\n bytes32 blockHash,\n uint32 logIndex,\n uint256 originChainId,\n\t\tuint256\tdestinationChainId\n );\n event HeartBeat(\n address indexed sender,\n uint256 currentChainId,\n uint256 currentBlock,\n string fedVersion,\n uint256[] fedChainsIds,\n\t\tuint256[] fedChainsBlocks,\n\t\tstring[] fedChainsInfo\n );\n\n}\n" + }, + "contracts/zeppelin/access/roles/PauserRole.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../../GSN/Context.sol\";\nimport \"../Roles.sol\";\n\nabstract contract PauserRole is Context {\n using Roles for Roles.Role;\n\n event PauserAdded(address indexed account);\n event PauserRemoved(address indexed account);\n\n Roles.Role private _pausers;\n\n constructor () {\n _addPauser(_msgSender());\n }\n\n modifier onlyPauser() {\n require(isPauser(_msgSender()), \"PauserRole: caller doesn't have the role\");\n _;\n }\n\n function isPauser(address account) public view returns (bool) {\n return _pausers.has(account);\n }\n\n function addPauser(address account) public onlyPauser {\n _addPauser(account);\n }\n\n function renouncePauser() public {\n _removePauser(_msgSender());\n }\n\n function _addPauser(address account) internal {\n _pausers.add(account);\n emit PauserAdded(account);\n }\n\n function _removePauser(address account) internal {\n _pausers.remove(account);\n emit PauserRemoved(account);\n }\n}\n" + }, + "contracts/zeppelin/lifecycle/Pausable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../GSN/Context.sol\";\nimport \"../access/roles/PauserRole.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context, PauserRole {\n /**\n * @dev Emitted when the pause is triggered by a pauser (`account`).\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by a pauser (`account`).\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state. Assigns the Pauser role\n * to the deployer.\n */\n constructor () {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n */\n modifier whenNotPaused() {\n require(!_paused, \"Pausable: paused\");\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n */\n modifier whenPaused() {\n require(_paused, \"Pausable: not paused\");\n _;\n }\n\n /**\n * @dev Called by a pauser to pause, triggers stopped state.\n */\n function pause() public onlyPauser whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Called by a pauser to unpause, returns to normal state.\n */\n function unpause() public onlyPauser whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" + }, + "contracts/zeppelin/token/ERC721/ERC721Pausable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721.sol\";\nimport \"../../lifecycle/Pausable.sol\";\n\n/**\n * @dev ERC721 token with pausable token transfers, minting and burning.\n *\n * Useful for scenarios such as preventing trades until the end of an evaluation\n * period, or having an emergency switch for freezing all token transfers in the\n * event of a large bug.\n */\nabstract contract ERC721Pausable is ERC721, Pausable {\n /**\n * @dev See {ERC721-_beforeTokenTransfer}.\n *\n * Requirements:\n *\n * - the contract must not be paused.\n */\n function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override {\n super._beforeTokenTransfer(from, to, tokenId);\n\n require(!paused(), \"ERC721Pausable: token transfer while paused\");\n }\n}\n" + }, + "contracts/zeppelin/token/ERC721/ERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../../GSN/Context.sol\";\nimport \"./IERC721.sol\";\nimport \"./IERC721Metadata.sol\";\nimport \"./IERC721Enumerable.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"../../introspection/ERC165.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/EnumerableSet.sol\";\nimport \"../../utils/EnumerableMap.sol\";\nimport \"../../utils/Strings.sol\";\n\n/**\n * @title ERC721 Non-Fungible Token Standard basic implementation\n * @dev see https://eips.ethereum.org/EIPS/eip-721\n */\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {\n using SafeMath for uint256;\n using Address for address;\n using EnumerableSet for EnumerableSet.UintSet;\n using EnumerableMap for EnumerableMap.UintToAddressMap;\n using Strings for uint256;\n\n // Equals to `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector`\n bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;\n\n // Mapping from holder address to their (enumerable) set of owned tokens\n mapping (address => EnumerableSet.UintSet) private _holderTokens;\n\n // Enumerable mapping from token ids to their owners\n EnumerableMap.UintToAddressMap private _tokenOwners;\n\n // Mapping from token ID to approved address\n mapping (uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping (address => mapping (address => bool)) private _operatorApprovals;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Optional mapping for token URIs\n mapping (uint256 => string) private _tokenURIs;\n\n // Base URI\n string private _baseURI;\n\n /*\n * bytes4(keccak256('balanceOf(address)')) == 0x70a08231\n * bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e\n * bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3\n * bytes4(keccak256('getApproved(uint256)')) == 0x081812fc\n * bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465\n * bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5\n * bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd\n * bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e\n * bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde\n *\n * => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^\n * 0xa22cb465 ^ 0xe985e9c5 ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd\n */\n bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;\n\n /*\n * bytes4(keccak256('name()')) == 0x06fdde03\n * bytes4(keccak256('symbol()')) == 0x95d89b41\n * bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd\n *\n * => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f\n */\n bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;\n\n /*\n * bytes4(keccak256('totalSupply()')) == 0x18160ddd\n * bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) == 0x2f745c59\n * bytes4(keccak256('tokenByIndex(uint256)')) == 0x4f6ccce7\n *\n * => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63\n */\n bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor (string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n\n // register the supported interfaces to conform to ERC721 via ERC165\n _registerInterface(_INTERFACE_ID_ERC721);\n _registerInterface(_INTERFACE_ID_ERC721_METADATA);\n _registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: balance query for the zero address\");\n return _holderTokens[owner].length();\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n return _tokenOwners.get(tokenId, \"ERC721: owner query for nonexistent token\");\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n require(_exists(tokenId), \"ERC721Metadata: URI query for nonexistent token\");\n\n string memory _tokenURI = _tokenURIs[tokenId];\n string memory base = baseURI();\n\n // If there is no base URI, return the token URI.\n if (bytes(base).length == 0) {\n return _tokenURI;\n }\n // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).\n if (bytes(_tokenURI).length > 0) {\n return string(abi.encodePacked(base, _tokenURI));\n }\n // If there is a baseURI but no tokenURI, concatenate the tokenID to the baseURI.\n return string(abi.encodePacked(base, tokenId.toString()));\n }\n\n /**\n * @dev Returns the base URI set via {_setBaseURI}. This will be\n * automatically added as a prefix in {tokenURI} to each token's URI, or\n * to the token ID if no specific URI is set for that token ID.\n */\n function baseURI() public view virtual returns (string memory) {\n return _baseURI;\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {\n return _holderTokens[owner].at(index);\n }\n\n /**\n * @dev See {IERC721Enumerable-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n // _tokenOwners are indexed by tokenIds, so .length() returns the number of tokenIds\n return _tokenOwners.length();\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenByIndex}.\n */\n function tokenByIndex(uint256 index) public view virtual override returns (uint256) {\n (uint256 tokenId, ) = _tokenOwners.at(index);\n return tokenId;\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(_msgSender() == owner || ERC721.isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not owner nor approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n require(_exists(tokenId), \"ERC721: approved query for nonexistent token\");\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n require(operator != _msgSender(), \"ERC721: approve to caller\");\n\n _operatorApprovals[_msgSender()][operator] = approved;\n emit ApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(address from, address to, uint256 tokenId) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: transfer caller is not owner nor approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: transfer caller is not owner nor approved\");\n _safeTransfer(from, to, tokenId, _data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `_data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, _data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _tokenOwners.contains(tokenId);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n require(_exists(tokenId), \"ERC721: operator query for nonexistent token\");\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner || getApproved(tokenId) == spender || ERC721.isApprovedForAll(owner, spender));\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n d*\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(address to, uint256 tokenId, bytes memory _data) internal virtual {\n _mint(to, tokenId);\n require(_checkOnERC721Received(address(0), to, tokenId, _data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId);\n\n _holderTokens[to].add(tokenId);\n\n _tokenOwners.set(tokenId, to);\n\n emit Transfer(address(0), to, tokenId);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721.ownerOf(tokenId); // internal owner\n\n _beforeTokenTransfer(owner, address(0), tokenId);\n\n // Clear approvals\n _approve(address(0), tokenId);\n\n // Clear metadata (if any)\n if (bytes(_tokenURIs[tokenId]).length != 0) {\n delete _tokenURIs[tokenId];\n }\n\n _holderTokens[owner].remove(tokenId);\n\n _tokenOwners.remove(tokenId);\n\n emit Transfer(owner, address(0), tokenId);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(address from, address to, uint256 tokenId) internal virtual {\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer of token that is not own\"); // internal owner\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId);\n\n // Clear approvals from the previous owner\n _approve(address(0), tokenId);\n\n _holderTokens[from].remove(tokenId);\n _holderTokens[to].add(tokenId);\n\n _tokenOwners.set(tokenId, to);\n\n emit Transfer(from, to, tokenId);\n }\n\n /**\n * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {\n require(_exists(tokenId), \"ERC721Metadata: URI set of nonexistent token\");\n _tokenURIs[tokenId] = _tokenURI;\n }\n\n /**\n * @dev Internal function to set the base URI for all token IDs. It is\n * automatically added as a prefix to the value returned in {tokenURI},\n * or to the token ID if {tokenURI} is empty.\n */\n function _setBaseURI(string memory baseURI_) internal virtual {\n _baseURI = baseURI_;\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param _data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)\n private returns (bool)\n {\n if (!to.isContract()) {\n return true;\n }\n bytes memory returndata = to.functionCall(abi.encodeWithSelector(\n IERC721Receiver(to).onERC721Received.selector,\n _msgSender(),\n from,\n tokenId,\n _data\n ), \"ERC721: transfer to non ERC721Receiver implementer\");\n bytes4 retval = abi.decode(returndata, (bytes4));\n return (retval == _ERC721_RECEIVED);\n }\n\n function _approve(address to, uint256 tokenId) private {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId); // internal owner\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, ``from``'s `tokenId` will be burned.\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual { }\n}\n" + }, + "contracts/zeppelin/token/ERC721/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../../introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\n}\n" + }, + "contracts/zeppelin/token/ERC721/IERC721Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" + }, + "contracts/zeppelin/token/ERC721/IERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Enumerable is IERC721 {\n\n /**\n * @dev Returns the total amount of tokens stored by the contract.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);\n\n /**\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\n * Use along with {totalSupply} to enumerate all tokens.\n */\n function tokenByIndex(uint256 index) external view returns (uint256);\n}\n" + }, + "contracts/zeppelin/token/ERC721/IERC721Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.\n */\n function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4);\n}\n" + }, + "contracts/zeppelin/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts may inherit from this and call {_registerInterface} to declare\n * their support of an interface.\n */\nabstract contract ERC165 is IERC165 {\n /*\n * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7\n */\n bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;\n\n /**\n * @dev Mapping of interface ids to whether or not it's supported.\n */\n mapping(bytes4 => bool) private _supportedInterfaces;\n\n constructor () {\n // Derived contracts need only register support for their own interfaces,\n // we register support for ERC165 itself here\n _registerInterface(_INTERFACE_ID_ERC165);\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n *\n * Time complexity O(1), guaranteed to always use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return _supportedInterfaces[interfaceId];\n }\n\n /**\n * @dev Registers the contract as an implementer of the interface defined by\n * `interfaceId`. Support of the actual ERC165 interface is automatic and\n * registering its interface id is not required.\n *\n * See {IERC165-supportsInterface}.\n *\n * Requirements:\n *\n * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).\n */\n function _registerInterface(bytes4 interfaceId) internal virtual {\n require(interfaceId != 0xffffffff, \"ERC165: invalid interface id\");\n _supportedInterfaces[interfaceId] = true;\n }\n}\n" + }, + "contracts/zeppelin/utils/EnumerableSet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping (bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) { // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\n\n bytes32 lastvalue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastvalue;\n // Update the index for the moved value\n set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n require(set._values.length > index, \"EnumerableSet: index out of bounds\");\n return set._values[index];\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n}\n" + }, + "contracts/zeppelin/utils/EnumerableMap.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing an enumerable variant of Solidity's\n * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]\n * type.\n *\n * Maps have the following properties:\n *\n * - Entries are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Entries are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableMap for EnumerableMap.UintToAddressMap;\n *\n * // Declare a set state variable\n * EnumerableMap.UintToAddressMap private myMap;\n * }\n * ```\n *\n * As of v3.0.0, only maps of type `uint256 -> address` (`UintToAddressMap`) are\n * supported.\n */\nlibrary EnumerableMap {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Map type with\n // bytes32 keys and values.\n // The Map implementation uses private functions, and user-facing\n // implementations (such as Uint256ToAddressMap) are just wrappers around\n // the underlying Map.\n // This means that we can only create new EnumerableMaps for types that fit\n // in bytes32.\n\n struct MapEntry {\n bytes32 _key;\n bytes32 _value;\n }\n\n struct Map {\n // Storage of map keys and values\n MapEntry[] _entries;\n\n // Position of the entry defined by a key in the `entries` array, plus 1\n // because index 0 means a key is not in the map.\n mapping (bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Adds a key-value pair to a map, or updates the value for an existing\n * key. O(1).\n *\n * Returns true if the key was added to the map, that is if it was not\n * already present.\n */\n function _set(Map storage map, bytes32 key, bytes32 value) private returns (bool) {\n // We read and store the key's index to prevent multiple reads from the same storage slot\n uint256 keyIndex = map._indexes[key];\n\n if (keyIndex == 0) { // Equivalent to !contains(map, key)\n map._entries.push(MapEntry({ _key: key, _value: value }));\n // The entry is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n map._indexes[key] = map._entries.length;\n return true;\n } else {\n map._entries[keyIndex - 1]._value = value;\n return false;\n }\n }\n\n /**\n * @dev Removes a key-value pair from a map. O(1).\n *\n * Returns true if the key was removed from the map, that is if it was present.\n */\n function _remove(Map storage map, bytes32 key) private returns (bool) {\n // We read and store the key's index to prevent multiple reads from the same storage slot\n uint256 keyIndex = map._indexes[key];\n\n if (keyIndex != 0) { // Equivalent to contains(map, key)\n // To delete a key-value pair from the _entries array in O(1), we swap the entry to delete with the last one\n // in the array, and then remove the last entry (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = keyIndex - 1;\n uint256 lastIndex = map._entries.length - 1;\n\n // When the entry to delete is the last one, the swap operation is unnecessary. However, since this occurs\n // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.\n\n MapEntry storage lastEntry = map._entries[lastIndex];\n\n // Move the last entry to the index where the entry to delete is\n map._entries[toDeleteIndex] = lastEntry;\n // Update the index for the moved entry\n map._indexes[lastEntry._key] = toDeleteIndex + 1; // All indexes are 1-based\n\n // Delete the slot where the moved entry was stored\n map._entries.pop();\n\n // Delete the index for the deleted slot\n delete map._indexes[key];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the key is in the map. O(1).\n */\n function _contains(Map storage map, bytes32 key) private view returns (bool) {\n return map._indexes[key] != 0;\n }\n\n /**\n * @dev Returns the number of key-value pairs in the map. O(1).\n */\n function _length(Map storage map) private view returns (uint256) {\n return map._entries.length;\n }\n\n /**\n * @dev Returns the key-value pair stored at position `index` in the map. O(1).\n *\n * Note that there are no guarantees on the ordering of entries inside the\n * array, and it may change when more entries are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Map storage map, uint256 index) private view returns (bytes32, bytes32) {\n require(map._entries.length > index, \"EnumerableMap: index out of bounds\");\n\n MapEntry storage entry = map._entries[index];\n return (entry._key, entry._value);\n }\n\n /**\n * @dev Tries to returns the value associated with `key`. O(1).\n * Does not revert if `key` is not in the map.\n */\n function _tryGet(Map storage map, bytes32 key) private view returns (bool, bytes32) {\n uint256 keyIndex = map._indexes[key];\n if (keyIndex == 0) return (false, 0); // Equivalent to contains(map, key)\n return (true, map._entries[keyIndex - 1]._value); // All indexes are 1-based\n }\n\n /**\n * @dev Returns the value associated with `key`. O(1).\n *\n * Requirements:\n *\n * - `key` must be in the map.\n */\n function _get(Map storage map, bytes32 key) private view returns (bytes32) {\n uint256 keyIndex = map._indexes[key];\n require(keyIndex != 0, \"EnumerableMap: nonexistent key\"); // Equivalent to contains(map, key)\n return map._entries[keyIndex - 1]._value; // All indexes are 1-based\n }\n\n /**\n * @dev Same as {_get}, with a custom error message when `key` is not in the map.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {_tryGet}.\n */\n function _get(Map storage map, bytes32 key, string memory errorMessage) private view returns (bytes32) {\n uint256 keyIndex = map._indexes[key];\n require(keyIndex != 0, errorMessage); // Equivalent to contains(map, key)\n return map._entries[keyIndex - 1]._value; // All indexes are 1-based\n }\n\n // UintToAddressMap\n\n struct UintToAddressMap {\n Map _inner;\n }\n\n /**\n * @dev Adds a key-value pair to a map, or updates the value for an existing\n * key. O(1).\n *\n * Returns true if the key was added to the map, that is if it was not\n * already present.\n */\n function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) {\n return _set(map._inner, bytes32(key), bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the key was removed from the map, that is if it was present.\n */\n function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) {\n return _remove(map._inner, bytes32(key));\n }\n\n /**\n * @dev Returns true if the key is in the map. O(1).\n */\n function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) {\n return _contains(map._inner, bytes32(key));\n }\n\n /**\n * @dev Returns the number of elements in the map. O(1).\n */\n function length(UintToAddressMap storage map) internal view returns (uint256) {\n return _length(map._inner);\n }\n\n /**\n * @dev Returns the element stored at position `index` in the set. O(1).\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {\n (bytes32 key, bytes32 value) = _at(map._inner, index);\n return (uint256(key), address(uint160(uint256(value))));\n }\n\n /**\n * @dev Tries to returns the value associated with `key`. O(1).\n * Does not revert if `key` is not in the map.\n *\n * _Available since v3.4._\n */\n function tryGet(UintToAddressMap storage map, uint256 key) internal view returns (bool, address) {\n (bool success, bytes32 value) = _tryGet(map._inner, bytes32(key));\n return (success, address(uint160(uint256(value))));\n }\n\n /**\n * @dev Returns the value associated with `key`. O(1).\n *\n * Requirements:\n *\n * - `key` must be in the map.\n */\n function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {\n return address(uint160(uint256(_get(map._inner, bytes32(key)))));\n }\n\n /**\n * @dev Same as {get}, with a custom error message when `key` is not in the map.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryGet}.\n */\n function get(UintToAddressMap storage map, uint256 key, string memory errorMessage) internal view returns (address) {\n return address(uint160(uint256(_get(map._inner, bytes32(key), errorMessage))));\n }\n}\n" + }, + "contracts/zeppelin/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n // Inspired by OraclizeAPI's implementation - MIT licence\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n}\n" + }, + "contracts/zeppelin/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "contracts/zeppelin/token/ERC721/ERC721Burnable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../../GSN/Context.sol\";\nimport \"./ERC721.sol\";\n\n/**\n * @title ERC721 Burnable Token\n * @dev ERC721 Token that can be irreversibly burned (destroyed).\n */\nabstract contract ERC721Burnable is Context, ERC721 {\n /**\n * @dev Burns `tokenId`. See {ERC721-_burn}.\n *\n * Requirements:\n *\n * - The caller must own `tokenId` or be an approved operator.\n */\n function burn(uint256 tokenId) public virtual {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721Burnable: caller is not owner nor approved\");\n _burn(tokenId);\n }\n}\n" + }, + "contracts/test/nftbridge/OpenSea721.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n// created using https://github.com/ProjectOpenSea/opensea-creatures/blob/master/contracts/ERC721Tradable.sol\n// and https://github.com/ProjectOpenSea/opensea-creatures/blob/master/contracts/Creature.sol\nimport \"../../zeppelin/token/ERC721/ERC721.sol\";\nimport \"../../zeppelin/ownership/Ownable.sol\";\nimport \"../../zeppelin/math/SafeMath.sol\";\nimport \"../../zeppelin/utils/Strings.sol\";\nimport \"./OpenSeaEIP712Base.sol\";\n\n\n/**\n * @title OpenSea721\n * OpenSea721 - ERC721 contract that whitelists a trading address, and has minting functionality.\n */\ncontract OpenSea721 is ERC721, OpenSeaEIP712Base, Ownable {\n using SafeMath for uint256;\n\n uint256 private _currentTokenId = 0;\n\n constructor(\n string memory _name,\n string memory _symbol\n ) ERC721(_name, _symbol) {\n _initializeEIP712(_name);\n }\n\n function baseTokenURI() public pure returns (string memory) {\n return \"https://creatures-api.opensea.io/api/creature/\";\n }\n\n function contractURI() public pure returns (string memory) {\n return \"https://creatures-api.opensea.io/contract/opensea-creatures\";\n }\n\n /**\n * @dev Mints a token to an address with a tokenURI.\n * @param _to address of the future owner of the token\n */\n function mintTo(address _to) public onlyOwner {\n uint256 newTokenId = _getNextTokenId();\n _mint(_to, newTokenId);\n _incrementTokenId();\n }\n\n /**\n * @dev calculates the next token ID based on value of _currentTokenId\n * @return uint256 for the next token ID\n */\n function _getNextTokenId() private view returns (uint256) {\n return _currentTokenId.add(1);\n }\n\n /**\n * @dev increments the value of _currentTokenId\n */\n function _incrementTokenId() private {\n _currentTokenId++;\n }\n\n function tokenURI(uint256 _tokenId) override public pure returns (string memory) {\n return string(abi.encodePacked(baseTokenURI(), Strings.toString(_tokenId)));\n }\n\n}" + }, + "contracts/test/nftbridge/OpenSeaEIP712Base.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../../zeppelin/upgradable/Initializable.sol\";\n\ncontract OpenSeaEIP712Base is Initializable {\n struct EIP712Domain {\n string name;\n string version;\n address verifyingContract;\n bytes32 salt;\n }\n\n string constant public ERC712_VERSION = \"1\";\n\n bytes32 internal constant EIP712_DOMAIN_TYPEHASH = keccak256(\n bytes(\n \"EIP712Domain(string name,string version,address verifyingContract,bytes32 salt)\"\n )\n );\n bytes32 internal domainSeperator;\n\n // supposed to be called once while initializing.\n // one of the contracts that inherits this contract follows proxy pattern\n // so it is not possible to do this in a constructor\n function _initializeEIP712(\n string memory name\n )\n internal\n initializer\n {\n _setDomainSeperator(name);\n }\n\n function _setDomainSeperator(string memory name) internal {\n domainSeperator = keccak256(\n abi.encode(\n EIP712_DOMAIN_TYPEHASH,\n keccak256(bytes(name)),\n keccak256(bytes(ERC712_VERSION)),\n address(this),\n bytes32(block.chainid)\n )\n );\n }\n\n function getDomainSeperator() public view returns (bytes32) {\n return domainSeperator;\n }\n\n /**\n * Accept message hash and returns hash message in EIP712 compatible form\n * So that it can be used to recover signer from signature signed using EIP712 formatted data\n * https://eips.ethereum.org/EIPS/eip-712\n * \"\\\\x19\" makes the encoding deterministic\n * \"\\\\x01\" is the version byte to make it compatible to EIP-191\n */\n function toTypedMessageHash(bytes32 messageHash)\n internal\n view\n returns (bytes32)\n {\n return\n keccak256(\n abi.encodePacked(\"\\x19\\x01\", getDomainSeperator(), messageHash)\n );\n }\n}\n" + }, + "contracts/zeppelin/token/ERC1155/ERC1155Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC1155Receiver.sol\";\nimport \"../../introspection/ERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\nabstract contract ERC1155Receiver is ERC165, IERC1155Receiver {\n constructor() {\n _registerInterface(\n ERC1155Receiver(address(0)).onERC1155Received.selector ^\n ERC1155Receiver(address(0)).onERC1155BatchReceived.selector\n );\n }\n}\n" + }, + "contracts/zeppelin/token/ERC1155/IERC1155Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../../introspection/IERC165.sol\";\n\n/**\n * _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n\n /**\n @dev Handles the receipt of a single ERC1155 token type. This function is\n called at the end of a `safeTransferFrom` after the balance has been updated.\n To accept the transfer, this must return\n `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n (i.e. 0xf23a6e61, or its own function selector).\n @param operator The address which initiated the transfer (i.e. msg.sender)\n @param from The address which previously owned the token\n @param id The ID of the token being transferred\n @param value The amount of tokens being transferred\n @param data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n )\n external\n returns(bytes4);\n\n /**\n @dev Handles the receipt of a multiple ERC1155 token types. This function\n is called at the end of a `safeBatchTransferFrom` after the balances have\n been updated. To accept the transfer(s), this must return\n `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n (i.e. 0xbc197c81, or its own function selector).\n @param operator The address which initiated the batch transfer (i.e. msg.sender)\n @param from The address which previously owned the token\n @param ids An array containing ids of each token being transferred (order and length must match values array)\n @param values An array containing amounts of each token being transferred (order and length must match ids array)\n @param data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n )\n external\n returns(bytes4);\n}\n" + }, + "contracts/zeppelin/token/ERC1155/IERC1155.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../../introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values);\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data) external;\n}\n" + }, + "contracts/zeppelin/token/ERC1155/IERC1155MetadataURI.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC1155.sol\";\n\n/**\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155MetadataURI is IERC1155 {\n /**\n * @dev Returns the URI for token type `id`.\n *\n * If the `\\{id\\}` substring is present in the URI, it must be replaced by\n * clients with the actual token type ID.\n */\n function uri(uint256 id) external view returns (string memory);\n}\n" + }, + "contracts/zeppelin/token/ERC1155/ERC1155.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC1155.sol\";\nimport \"./IERC1155MetadataURI.sol\";\nimport \"./IERC1155Receiver.sol\";\nimport \"../../GSN/Context.sol\";\nimport \"../../introspection/ERC165.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n *\n * @dev Implementation of the basic standard multi-token.\n * See https://eips.ethereum.org/EIPS/eip-1155\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\n *\n * _Available since v3.1._\n */\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\n using SafeMath for uint256;\n using Address for address;\n\n // Mapping from token ID to account balances\n mapping (uint256 => mapping(address => uint256)) private _balances;\n\n // Mapping from account to operator approvals\n mapping (address => mapping(address => bool)) private _operatorApprovals;\n\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\n string private _uri;\n\n /*\n * bytes4(keccak256('balanceOf(address,uint256)')) == 0x00fdd58e\n * bytes4(keccak256('balanceOfBatch(address[],uint256[])')) == 0x4e1273f4\n * bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465\n * bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5\n * bytes4(keccak256('safeTransferFrom(address,address,uint256,uint256,bytes)')) == 0xf242432a\n * bytes4(keccak256('safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)')) == 0x2eb2c2d6\n *\n * => 0x00fdd58e ^ 0x4e1273f4 ^ 0xa22cb465 ^\n * 0xe985e9c5 ^ 0xf242432a ^ 0x2eb2c2d6 == 0xd9b67a26\n */\n bytes4 private constant _INTERFACE_ID_ERC1155 = 0xd9b67a26;\n\n /*\n * bytes4(keccak256('uri(uint256)')) == 0x0e89341c\n */\n bytes4 private constant _INTERFACE_ID_ERC1155_METADATA_URI = 0x0e89341c;\n\n /**\n * @dev See {_setURI}.\n */\n constructor (string memory uri_) {\n _setURI(uri_);\n\n // register the supported interfaces to conform to ERC1155 via ERC165\n _registerInterface(_INTERFACE_ID_ERC1155);\n\n // register the supported interfaces to conform to ERC1155MetadataURI via ERC165\n _registerInterface(_INTERFACE_ID_ERC1155_METADATA_URI);\n }\n\n /**\n * @dev See {IERC1155MetadataURI-uri}.\n *\n * This implementation returns the same URI for *all* token types. It relies\n * on the token type ID substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * Clients calling this function must replace the `\\{id\\}` substring with the\n * actual token type ID.\n */\n function uri(uint256) external view virtual override returns (string memory) {\n return _uri;\n }\n\n /**\n * @dev See {IERC1155-balanceOf}.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\n require(account != address(0), \"ERC1155: balance query for the zero address\");\n return _balances[id][account];\n }\n\n /**\n * @dev See {IERC1155-balanceOfBatch}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(\n address[] memory accounts,\n uint256[] memory ids\n )\n public\n view\n virtual\n override\n returns (uint256[] memory)\n {\n require(accounts.length == ids.length, \"ERC1155: accounts and ids length mismatch\");\n\n uint256[] memory batchBalances = new uint256[](accounts.length);\n\n for (uint256 i = 0; i < accounts.length; ++i) {\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\n }\n\n return batchBalances;\n }\n\n /**\n * @dev See {IERC1155-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n require(_msgSender() != operator, \"ERC1155: setting approval status for self\");\n\n _operatorApprovals[_msgSender()][operator] = approved;\n emit ApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC1155-isApprovedForAll}.\n */\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev See {IERC1155-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n )\n public\n virtual\n override\n {\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not owner nor approved\"\n );\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);\n\n _balances[id][from] = _balances[id][from].sub(amount, \"ERC1155: insufficient balance for transfer\");\n _balances[id][to] = _balances[id][to].add(amount);\n\n emit TransferSingle(operator, from, to, id, amount);\n\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\n }\n\n /**\n * @dev See {IERC1155-safeBatchTransferFrom}.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n )\n public\n virtual\n override\n {\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: transfer caller is not owner nor approved\"\n );\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; ++i) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n _balances[id][from] = _balances[id][from].sub(\n amount,\n \"ERC1155: insufficient balance for transfer\"\n );\n _balances[id][to] = _balances[id][to].add(amount);\n }\n\n emit TransferBatch(operator, from, to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\n }\n\n /**\n * @dev Sets a new URI for all token types, by relying on the token type ID\n * substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * By this mechanism, any occurrence of the `\\{id\\}` substring in either the\n * URI or any of the amounts in the JSON file at said URI will be replaced by\n * clients with the token type ID.\n *\n * For example, the `https://token-cdn-domain/\\{id\\}.json` URI would be\n * interpreted by clients as\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\n * for token type ID 0x4cce0.\n *\n * See {uri}.\n *\n * Because these URIs cannot be meaningfully represented by the {URI} event,\n * this function emits no events.\n */\n function _setURI(string memory newuri) internal virtual {\n _uri = newuri;\n }\n\n /**\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `account`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - If `account` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _mint(address account, uint256 id, uint256 amount, bytes memory data) internal virtual {\n require(account != address(0), \"ERC1155: mint to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), account, _asSingletonArray(id), _asSingletonArray(amount), data);\n\n _balances[id][account] = _balances[id][account].add(amount);\n emit TransferSingle(operator, address(0), account, id, amount);\n\n _doSafeTransferAcceptanceCheck(operator, address(0), account, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n for (uint i = 0; i < ids.length; i++) {\n _balances[ids[i]][to] = amounts[i].add(_balances[ids[i]][to]);\n }\n\n emit TransferBatch(operator, address(0), to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\n }\n\n /**\n * @dev Destroys `amount` tokens of token type `id` from `account`\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens of token type `id`.\n */\n function _burn(address account, uint256 id, uint256 amount) internal virtual {\n require(account != address(0), \"ERC1155: burn from the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, account, address(0), _asSingletonArray(id), _asSingletonArray(amount), \"\");\n\n _balances[id][account] = _balances[id][account].sub(\n amount,\n \"ERC1155: burn amount exceeds balance\"\n );\n\n emit TransferSingle(operator, account, address(0), id, amount);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n */\n function _burnBatch(address account, uint256[] memory ids, uint256[] memory amounts) internal virtual {\n require(account != address(0), \"ERC1155: burn from the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, account, address(0), ids, amounts, \"\");\n\n for (uint i = 0; i < ids.length; i++) {\n _balances[ids[i]][account] = _balances[ids[i]][account].sub(\n amounts[i],\n \"ERC1155: burn amount exceeds balance\"\n );\n }\n\n emit TransferBatch(operator, account, address(0), ids, amounts);\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `id` and `amount` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n )\n internal\n virtual\n { }\n\n function _doSafeTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n )\n private\n {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\n if (response != IERC1155Receiver(to).onERC1155Received.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _doSafeBatchTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n )\n private\n {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (bytes4 response) {\n if (response != IERC1155Receiver(to).onERC1155BatchReceived.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\n uint256[] memory array = new uint256[](1);\n array[0] = element;\n\n return array;\n }\n}\n" + }, + "contracts/zeppelin/token/ERC1155/ERC1155Pausable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC1155.sol\";\nimport \"../../lifecycle/Pausable.sol\";\n\n/**\n * @dev ERC1155 token with pausable token transfers, minting and burning.\n *\n * Useful for scenarios such as preventing trades until the end of an evaluation\n * period, or having an emergency switch for freezing all token transfers in the\n * event of a large bug.\n *\n * _Available since v3.1._\n */\nabstract contract ERC1155Pausable is ERC1155, Pausable {\n /**\n * @dev See {ERC1155-_beforeTokenTransfer}.\n *\n * Requirements:\n *\n * - the contract must not be paused.\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n )\n internal\n virtual\n override\n {\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n require(!paused(), \"ERC1155Pausable: token transfer while paused\");\n }\n}\n" + }, + "contracts/zeppelin/token/ERC1155/ERC1155Burnable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC1155.sol\";\n\n/**\n * @dev Extension of {ERC1155} that allows token holders to destroy both their\n * own tokens and those that they have been approved to use.\n *\n * _Available since v3.1._\n */\nabstract contract ERC1155Burnable is ERC1155 {\n function burn(address account, uint256 id, uint256 value) public virtual {\n require(\n account == _msgSender() || isApprovedForAll(account, _msgSender()),\n \"ERC1155: caller is not owner nor approved\"\n );\n\n _burn(account, id, value);\n }\n\n function burnBatch(address account, uint256[] memory ids, uint256[] memory values) public virtual {\n require(\n account == _msgSender() || isApprovedForAll(account, _msgSender()),\n \"ERC1155: caller is not owner nor approved\"\n );\n\n _burnBatch(account, ids, values);\n }\n}\n" + }, + "contracts/zeppelin/token/ERC1155/ERC1155Holder.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC1155Receiver.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ncontract ERC1155Holder is ERC1155Receiver {\n function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual override returns (bytes4) {\n return this.onERC1155Received.selector;\n }\n\n function onERC1155BatchReceived(address, address, uint256[] memory, uint256[] memory, bytes memory) public virtual override returns (bytes4) {\n return this.onERC1155BatchReceived.selector;\n }\n}\n" + }, + "contracts/zeppelin/token/ERC721/ERC721Holder.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721Receiver.sol\";\n\n /**\n * @dev Implementation of the {IERC721Receiver} interface.\n *\n * Accepts all token transfers. \n * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.\n */\ncontract ERC721Holder is IERC721Receiver {\n\n /**\n * @dev See {IERC721Receiver-onERC721Received}.\n *\n * Always returns `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) {\n return this.onERC721Received.selector;\n }\n}\n" + }, + "contracts/zeppelin/access/roles/MinterRole.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"../../GSN/Context.sol\";\nimport \"../Roles.sol\";\n\nabstract contract MinterRole is Context {\n using Roles for Roles.Role;\n\n event MinterAdded(address indexed account);\n event MinterRemoved(address indexed account);\n\n Roles.Role private _minters;\n\n constructor () {\n _addMinter(_msgSender());\n }\n\n modifier onlyMinter() {\n require(isMinter(_msgSender()), \"MinterRole: caller doesn't have the role\");\n _;\n }\n\n function isMinter(address account) public view returns (bool) {\n return _minters.has(account);\n }\n\n function addMinter(address account) public onlyMinter {\n _addMinter(account);\n }\n\n function renounceMinter() public {\n _removeMinter(_msgSender());\n }\n\n function _addMinter(address account) internal {\n _minters.add(account);\n emit MinterAdded(account);\n }\n\n function _removeMinter(address account) internal {\n _minters.remove(account);\n emit MinterRemoved(account);\n }\n}\n" + }, + "contracts/SideTokenFactory/SideTokenFactoryV1.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../zeppelin/ownership/Secondary.sol\";\nimport \"../SideToken/SideTokenV1.sol\";\n\ncontract SideTokenFactoryV1 is Secondary {\n event CreatedSideToken(address sideToken, string symbol);\n\n function createSideToken(string calldata name, string calldata symbol) external onlyPrimary returns(SideTokenV1) {\n SideTokenV1 sideToken = new SideTokenV1(name, symbol, primary());\n emit CreatedSideToken(address(sideToken), symbol);\n return sideToken;\n }\n}" + }, + "contracts/SideToken/SideTokenV1.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../zeppelin/token/ERC777/ERC777.sol\";\n\ncontract SideTokenV1 is ERC777 {\n address public minter;\n\n constructor(string memory _tokenName, string memory _tokenSymbol, address _minterAddr)\n ERC777(_tokenName, _tokenSymbol, new address[](0)) {\n require(_minterAddr != address(0), \"SideToken: Minter address is null\");\n minter = _minterAddr;\n }\n\n modifier onlyMinter() {\n require(_msgSender() == minter, \"SideToken: Caller is not the minter\");\n _;\n }\n function mint(\n address account,\n uint256 amount,\n bytes calldata userData,\n bytes calldata operatorData\n )\n external onlyMinter\n {\n _mint(_msgSender(), account, amount, userData, operatorData);\n }\n\n}" + }, + "contracts/AllowTokens/AllowTokensV0.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../zeppelin/math/SafeMath.sol\";\nimport \"../zeppelin/ownership/Ownable.sol\";\n\ncontract AllowTokensV0 is Ownable {\n using SafeMath for uint256;\n\n address constant private NULL_ADDRESS = address(0);\n\n mapping (address => bool) public allowedTokens;\n bool private validateAllowedTokens;\n uint256 private maxTokensAllowed;\n uint256 private minTokensAllowed;\n uint256 public dailyLimit;\n\n event AllowedTokenAdded(address indexed _tokenAddress);\n event AllowedTokenRemoved(address indexed _tokenAddress);\n event AllowedTokenValidation(bool _enabled);\n event MaxTokensAllowedChanged(uint256 _maxTokens);\n event MinTokensAllowedChanged(uint256 _minTokens);\n event DailyLimitChanged(uint256 dailyLimit);\n\n modifier notNull(address _address) {\n require(_address != NULL_ADDRESS, \"AllowTokens: Address cannot be empty\");\n _;\n }\n\n constructor(address _manager) {\n transferOwnership(_manager);\n validateAllowedTokens = true;\n maxTokensAllowed = 10000 ether;\n minTokensAllowed = 1 ether;\n dailyLimit = 100000 ether;\n }\n\n function isValidatingAllowedTokens() external view returns(bool) {\n return validateAllowedTokens;\n }\n\n function getMaxTokensAllowed() external view returns(uint256) {\n return maxTokensAllowed;\n }\n\n function getMinTokensAllowed() external view returns(uint256) {\n return minTokensAllowed;\n }\n\n function allowedTokenExist(address token) private view notNull(token) returns (bool) {\n return allowedTokens[token];\n }\n\n function isTokenAllowed(address token) public view notNull(token) returns (bool) {\n if (validateAllowedTokens) {\n return allowedTokenExist(token);\n }\n return true;\n }\n\n function addAllowedToken(address token) external onlyOwner {\n require(!allowedTokenExist(token), \"AllowTokens: Token already exists in allowedTokens\");\n allowedTokens[token] = true;\n emit AllowedTokenAdded(token);\n }\n\n function removeAllowedToken(address token) external onlyOwner {\n require(allowedTokenExist(token), \"AllowTokens: Token does not exis in allowedTokenst\");\n allowedTokens[token] = false;\n emit AllowedTokenRemoved(token);\n }\n\n function enableAllowedTokensValidation() external onlyOwner {\n validateAllowedTokens = true;\n emit AllowedTokenValidation(validateAllowedTokens);\n }\n\n function disableAllowedTokensValidation() external onlyOwner {\n // Before disabling Allowed Tokens Validations some kind of contract validation system\n // should be implemented on the Bridge for the methods receiveTokens, tokenFallback and tokensReceived\n validateAllowedTokens = false;\n emit AllowedTokenValidation(validateAllowedTokens);\n }\n\n function setMaxTokensAllowed(uint256 maxTokens) external onlyOwner {\n require(maxTokens >= minTokensAllowed, \"AllowTokens: Max Tokens should be equal or bigger than Min Token\");\n maxTokensAllowed = maxTokens;\n emit MaxTokensAllowedChanged(maxTokensAllowed);\n }\n\n function setMinTokensAllowed(uint256 minTokens) external onlyOwner {\n require(maxTokensAllowed >= minTokens, \"AllowTokens: minTokens should be equal or smaller than maxTokens\");\n minTokensAllowed = minTokens;\n emit MinTokensAllowedChanged(minTokensAllowed);\n }\n\n function changeDailyLimit(uint256 _dailyLimit) external onlyOwner {\n require(_dailyLimit >= maxTokensAllowed, \"AllowTokens: dailyLimit should be equal or bigger than maxTokens\");\n dailyLimit = _dailyLimit;\n emit DailyLimitChanged(_dailyLimit);\n }\n\n // solium-disable-next-line max-len\n function isValidTokenTransfer(address tokenToUse, uint amount, uint spentToday, bool isSideToken) external view returns (bool) {\n if(amount > maxTokensAllowed)\n return false;\n if(amount < minTokensAllowed)\n return false;\n if (spentToday + amount > dailyLimit || spentToday + amount < spentToday)\n return false;\n if(!isSideToken && !isTokenAllowed(tokenToUse))\n return false;\n return true;\n }\n\n function calcMaxWithdraw(uint spentToday) external view returns (uint) {\n uint maxWithrow = dailyLimit - spentToday;\n if (dailyLimit < spentToday)\n return 0;\n if(maxWithrow > maxTokensAllowed)\n maxWithrow = maxTokensAllowed;\n return maxWithrow;\n }\n\n}\n" + }, + "contracts/Proxies.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\nimport \"./zeppelin/upgradable/proxy/TransparentUpgradeableProxy.sol\";\n// Author: @rootstock\ncontract BridgeProxy is TransparentUpgradeableProxy {\n // solhint-disable-next-line no-empty-blocks\n constructor(address _logic, address _admin, bytes memory _data) TransparentUpgradeableProxy(_logic,_admin, _data) payable {}\n}\n\ncontract AllowTokensProxy is TransparentUpgradeableProxy {\n // solhint-disable-next-line no-empty-blocks\n constructor(address _logic, address _admin, bytes memory _data) TransparentUpgradeableProxy(_logic,_admin, _data) payable {}\n}\n\ncontract FederationProxy is TransparentUpgradeableProxy {\n // solhint-disable-next-line no-empty-blocks\n constructor(address _logic, address _admin, bytes memory _data) TransparentUpgradeableProxy(_logic,_admin, _data) payable {}\n}" + }, + "contracts/test/MainToken.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../zeppelin/token/ERC20/ERC20Detailed.sol\";\nimport \"../zeppelin/token/ERC20/ERC20.sol\";\n\ncontract MainToken is ERC20Detailed, ERC20 {\n constructor(string memory name, string memory symbol, uint8 decimals, uint totalSupply)\n ERC20Detailed(name, symbol, decimals)\n {\n _mint(msg.sender, totalSupply);\n }\n\n /**\n * ERC-677's only method implementation\n * See https://github.com/ethereum/EIPs/issues/677 for details\n */\n function transferAndCall(address _to, uint _value, bytes memory _data) public returns (bool) {\n bool result = transfer(_to, _value);\n if (!result) return false;\n\n ERC677TransferReceiver receiver = ERC677TransferReceiver(_to);\n receiver.tokenFallback(msg.sender, _value, _data);\n\n // IMPORTANT: the ERC-677 specification does not say\n // anything about the use of the receiver contract's\n // tokenFallback method return value. Given\n // its return type matches with this method's return\n // type, returning it could be a possibility.\n // We here take the more conservative approach and\n // ignore the return value, returning true\n // to signal a succesful transfer despite tokenFallback's\n // return value -- fact being tokens are transferred\n // in any case.\n return true;\n }\n}\n\ninterface ERC677TransferReceiver {\n function tokenFallback(address from, uint256 amount, bytes calldata data) external returns (bool);\n}" + }, + "contracts/test/AlternativeERC20Detailed.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../zeppelin/token/ERC20/ERC20.sol\";\n\ncontract AlternativeERC20Detailed is ERC20 {\n string private _name;\n bytes32 private _symbol;\n uint256 private _decimals;\n\n constructor(string memory aName, bytes32 aSymbol, uint256 someDecimals, uint256 aTotalSupply)\n {\n _name = aName;\n _symbol = aSymbol;\n _decimals = someDecimals;\n _mint(msg.sender, aTotalSupply);\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (bytes32) {\n return _symbol;\n }\n\n function decimals() public view returns (uint256) {\n return _decimals;\n }\n}" + }, + "contracts/test/LibUtilsHarness.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../lib/LibUtils.sol\";\n\ncontract LibUtilsHarness {\n\n function decimalsToGranularity(uint8 decimals) external pure returns (uint256) {\n return LibUtils.decimalsToGranularity(decimals);\n }\n\n function getDecimals(address tokenToUse) external view returns (uint8) {\n return LibUtils.getDecimals(tokenToUse);\n }\n\n function getGranularity(address tokenToUse) external view returns (uint256) {\n return LibUtils.getGranularity(tokenToUse);\n }\n\n function bytesToAddress(bytes memory bys) external pure returns (address addr) {\n return LibUtils.bytesToAddress(bys);\n }\n\n function toUint128(bytes memory _bytes, uint256 _start) external pure returns (uint128) {\n return LibUtils.toUint128(_bytes, _start);\n }\n\n}\n" + }, + "contracts/MultiSigWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - \n\n// Author: @rootstock\ncontract MultiSigWallet {\n\n /*\n * Events\n */\n event Confirmation(address indexed sender, uint indexed transactionId);\n event Revocation(address indexed sender, uint indexed transactionId);\n event Submission(uint indexed transactionId);\n event Execution(uint indexed transactionId);\n event ExecutionFailure(uint indexed transactionId);\n event Deposit(address indexed sender, uint value);\n event OwnerAddition(address indexed owner);\n event OwnerRemoval(address indexed owner);\n event RequirementChange(uint required);\n\n /*\n * views\n */\n uint constant public MAX_OWNER_COUNT = 50;\n\n /*\n * Storage\n */\n mapping (uint => Transaction) public transactions;\n mapping (uint => mapping (address => bool)) public confirmations;\n mapping (address => bool) public isOwner;\n address[] public owners;\n uint public required;\n uint public transactionCount;\n\n struct Transaction {\n address destination;\n uint value;\n bytes data;\n bool executed;\n }\n\n /*\n * Modifiers\n */\n modifier onlyWallet() {\n require(msg.sender == address(this), \"Only wallet allowed\");\n _;\n }\n\n modifier ownerDoesNotExist(address owner) {\n require(!isOwner[owner], \"The owner already exists\");\n _;\n }\n\n modifier ownerExists(address owner) {\n require(isOwner[owner], \"The owner does not exist\");\n _;\n }\n\n modifier transactionExists(uint transactionId) {\n require(transactions[transactionId].destination != address(0), \"Transaction does not exist\");\n _;\n }\n\n modifier confirmed(uint transactionId, address owner) {\n require(confirmations[transactionId][owner], \"Transaction is not confirmed by owner\");\n _;\n }\n\n modifier notConfirmed(uint transactionId, address owner) {\n require(!confirmations[transactionId][owner], \"Transaction is already confirmed by owner\");\n _;\n }\n\n modifier notExecuted(uint transactionId) {\n require(!transactions[transactionId].executed, \"Transaction was already executed\");\n _;\n }\n\n modifier notNull(address _address) {\n require(_address != address(0), \"Address cannot be empty\");\n _;\n }\n\n modifier validRequirement(uint ownerCount, uint _required) {\n // solium-disable-next-line max-len\n require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0, \"Required value is invalid for the current owners count\");\n _;\n }\n\n /// @dev Fallback function allows to deposit ether.\n receive ()\n external\n payable\n {\n if (msg.value > 0)\n emit Deposit(msg.sender, msg.value);\n }\n\n /*\n * Public functions\n */\n /// @dev Contract constructor sets initial owners and required number of confirmations.\n /// @param _owners List of initial owners.\n /// @param _required Number of required confirmations.\n constructor(address[] memory _owners, uint _required)\n validRequirement(_owners.length, _required)\n {\n for (uint i = 0; i < _owners.length; i++) {\n require(!isOwner[_owners[i]] && _owners[i] != address(0), \"Owners addresses are invalid\");\n isOwner[_owners[i]] = true;\n }\n owners = _owners;\n required = _required;\n }\n\n /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of new owner.\n function addOwner(address owner)\n public\n onlyWallet\n ownerDoesNotExist(owner)\n notNull(owner)\n validRequirement(owners.length + 1, required)\n {\n isOwner[owner] = true;\n owners.push(owner);\n emit OwnerAddition(owner);\n }\n\n /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner.\n function removeOwner(address owner)\n public\n onlyWallet\n ownerExists(owner)\n {\n isOwner[owner] = false;\n for (uint i = 0; i < owners.length - 1; i++)\n if (owners[i] == owner) {\n owners[i] = owners[owners.length - 1];\n break;\n }\n owners.pop(); // remove an element from the end of the array.\n if (required > owners.length)\n changeRequirement(owners.length);\n emit OwnerRemoval(owner);\n }\n\n /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n /// @param owner Address of owner to be replaced.\n /// @param newOwner Address of new owner.\n function replaceOwner(address owner, address newOwner)\n public\n onlyWallet\n ownerExists(owner)\n ownerDoesNotExist(newOwner)\n {\n for (uint i = 0; i < owners.length; i++)\n if (owners[i] == owner) {\n owners[i] = newOwner;\n break;\n }\n isOwner[owner] = false;\n isOwner[newOwner] = true;\n emit OwnerRemoval(owner);\n emit OwnerAddition(newOwner);\n }\n\n /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n /// @param _required Number of required confirmations.\n function changeRequirement(uint _required)\n public\n onlyWallet\n validRequirement(owners.length, _required)\n {\n required = _required;\n emit RequirementChange(_required);\n }\n\n /// @dev Allows an owner to submit and confirm a transaction.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return transactionId Returns transaction ID.\n function submitTransaction(address destination, uint value, bytes memory data)\n public\n returns (uint transactionId)\n {\n transactionId = addTransaction(destination, value, data);\n confirmTransaction(transactionId);\n }\n\n /// @dev Allows an owner to confirm a transaction.\n /// @param transactionId Transaction ID.\n function confirmTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n transactionExists(transactionId)\n notConfirmed(transactionId, msg.sender)\n {\n confirmations[transactionId][msg.sender] = true;\n emit Confirmation(msg.sender, transactionId);\n executeTransaction(transactionId);\n }\n\n /// @dev Allows an owner to revoke a confirmation for a transaction.\n /// @param transactionId Transaction ID.\n function revokeConfirmation(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n confirmations[transactionId][msg.sender] = false;\n emit Revocation(msg.sender, transactionId);\n }\n\n /// @dev Allows anyone to execute a confirmed transaction.\n /// @param transactionId Transaction ID.\n function executeTransaction(uint transactionId)\n public\n ownerExists(msg.sender)\n confirmed(transactionId, msg.sender)\n notExecuted(transactionId)\n {\n if (isConfirmed(transactionId)) {\n Transaction storage txn = transactions[transactionId];\n txn.executed = true;\n if (external_call(txn.destination, txn.value, txn.data.length, txn.data))\n emit Execution(transactionId);\n else {\n emit ExecutionFailure(transactionId);\n txn.executed = false;\n }\n }\n }\n\n // call has been separated into its own function in order to take advantage\n // of the Solidity's code generator to produce a loop that copies tx.data into memory.\n function external_call(address destination, uint value, uint dataLength, bytes memory data) internal returns (bool) {\n bool result;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n let x := mload(0x40) // \"Allocate\" memory for output (0x40 is where \"free memory\" pointer is stored by convention)\n let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that\n result := call(\n sub(gas(), 34710), // 34710 is the value that solidity is currently emitting\n // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +\n // callNewAccountGas (25000, in case the destination address does not exist and needs creating)\n destination,\n value,\n d,\n dataLength, // Size of the input (in bytes) - this is what fixes the padding problem\n x,\n 0 // Output is ignored, therefore the output size is zero\n )\n }\n return result;\n }\n\n /// @dev Returns the confirmation status of a transaction.\n /// @param transactionId Transaction ID.\n /// @return Confirmation status.\n function isConfirmed(uint transactionId)\n public\n view\n returns (bool)\n {\n uint count = 0;\n for (uint i = 0; i < owners.length; i++) {\n if (confirmations[transactionId][owners[i]])\n count += 1;\n if (count == required)\n return true;\n }\n return false;\n }\n\n /*\n * Internal functions\n */\n /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n /// @param destination Transaction target address.\n /// @param value Transaction ether value.\n /// @param data Transaction data payload.\n /// @return transactionId Returns transaction ID.\n function addTransaction(address destination, uint value, bytes memory data)\n internal\n notNull(destination)\n returns (uint transactionId)\n {\n transactionId = transactionCount;\n transactions[transactionId] = Transaction({\n destination: destination,\n value: value,\n data: data,\n executed: false\n });\n transactionCount += 1;\n emit Submission(transactionId);\n }\n\n /*\n * Web3 call functions\n */\n /// @dev Returns number of confirmations of a transaction.\n /// @param transactionId Transaction ID.\n /// @return count Number of confirmations.\n function getConfirmationCount(uint transactionId)\n public\n view\n returns (uint count)\n {\n for (uint i = 0; i < owners.length; i++) {\n if (confirmations[transactionId][owners[i]]) {\n count += 1;\n }\n }\n }\n\n /// @dev Returns total number of transactions after filers are applied.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return count Total number of transactions after filters are applied.\n function getTransactionCount(bool pending, bool executed)\n public\n view\n returns (uint count)\n {\n for (uint i = 0; i < transactionCount; i++) {\n if ( pending && !transactions[i].executed || executed && transactions[i].executed) {\n count += 1;\n }\n }\n }\n\n /// @dev Returns list of owners.\n /// @return List of owner addresses.\n function getOwners()\n public\n view\n returns (address[] memory)\n {\n return owners;\n }\n\n /// @dev Returns array with owner addresses, which confirmed transaction.\n /// @param transactionId Transaction ID.\n /// @return _confirmations Returns array of owner addresses.\n function getConfirmations(uint transactionId)\n public\n view\n returns (address[] memory _confirmations)\n {\n address[] memory confirmationsTemp = new address[](owners.length);\n uint count = 0;\n uint i;\n for (i = 0; i < owners.length; i++)\n if (confirmations[transactionId][owners[i]]) {\n confirmationsTemp[count] = owners[i];\n count += 1;\n }\n _confirmations = new address[](count);\n for (i = 0; i < count; i++)\n _confirmations[i] = confirmationsTemp[i];\n }\n\n /// @dev Returns list of transaction IDs in defined range.\n /// @param from Index start position of transaction array.\n /// @param to Index end position of transaction array.\n /// @param pending Include pending transactions.\n /// @param executed Include executed transactions.\n /// @return _transactionIds Returns array of transaction IDs.\n function getTransactionIds(uint from, uint to, bool pending, bool executed)\n public\n view\n returns (uint[] memory _transactionIds)\n {\n uint[] memory transactionIdsTemp = new uint[](transactionCount);\n uint count = 0;\n uint i;\n for (i = 0; i < transactionCount; i++)\n if ( pending && !transactions[i].executed || executed && transactions[i].executed)\n {\n transactionIdsTemp[count] = i;\n count += 1;\n }\n _transactionIds = new uint[](to - from);\n for (i = from; i < to; i++)\n _transactionIds[i - from] = transactionIdsTemp[i];\n }\n}" + }, + "contracts/interface/IERC1271.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Interface for verifying contract-based account signatures\n/// @notice Interface that verifies provided signature for the data\n/// @dev Interface defined by EIP-1271\ninterface IERC1271 {\n /// @notice Returns whether the provided signature is valid for the provided data\n /// @dev MUST return the bytes4 magic value 0x1626ba7e when function passes.\n /// MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5).\n /// MUST allow external calls.\n /// @param hash Hash of the data to be signed\n /// @param signature Signature byte array associated with _data\n /// @return magicValue The bytes4 magic value 0x1626ba7e\n function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);\n}" + }, + "contracts/test/nftbridge/TestTokenCreator.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ncontract TestTokenCreator {\n address public _owner;\n\n constructor() {\n _owner = msg.sender;\n }\n\n function creator() public view returns (address) {\n return _owner;\n }\n}\n" + }, + "contracts/zeppelin/introspection/ERC165Checker.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library used to query support of an interface declared via {IERC165}.\n *\n * Note that these functions return the actual result of the query: they do not\n * `revert` if an interface is not supported. It is up to the caller to decide\n * what to do in these cases.\n */\nlibrary ERC165Checker {\n // As per the EIP-165 spec, no interface should ever match 0xffffffff\n bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;\n\n /*\n * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7\n */\n bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;\n\n /**\n * @dev Returns true if `account` supports the {IERC165} interface,\n */\n function supportsERC165(address account) internal view returns (bool) {\n // Any contract that implements ERC165 must explicitly indicate support of\n // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid\n return _supportsERC165Interface(account, _INTERFACE_ID_ERC165) &&\n !_supportsERC165Interface(account, _INTERFACE_ID_INVALID);\n }\n\n /**\n * @dev Returns true if `account` supports the interface defined by\n * `interfaceId`. Support for {IERC165} itself is queried automatically.\n *\n * See {IERC165-supportsInterface}.\n */\n function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {\n // query support of both ERC165 as per the spec and support of _interfaceId\n return supportsERC165(account) &&\n _supportsERC165Interface(account, interfaceId);\n }\n\n /**\n * @dev Returns a boolean array where each value corresponds to the\n * interfaces passed in and whether they're supported or not. This allows\n * you to batch check interfaces for a contract where your expectation\n * is that some interfaces may not be supported.\n *\n * See {IERC165-supportsInterface}.\n *\n * _Available since v3.4._\n */\n function getSupportedInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool[] memory) {\n // an array of booleans corresponding to interfaceIds and whether they're supported or not\n bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);\n\n // query support of ERC165 itself\n if (supportsERC165(account)) {\n // query support of each interface in interfaceIds\n for (uint256 i = 0; i < interfaceIds.length; i++) {\n interfaceIdsSupported[i] = _supportsERC165Interface(account, interfaceIds[i]);\n }\n }\n\n return interfaceIdsSupported;\n }\n\n /**\n * @dev Returns true if `account` supports all the interfaces defined in\n * `interfaceIds`. Support for {IERC165} itself is queried automatically.\n *\n * Batch-querying can lead to gas savings by skipping repeated checks for\n * {IERC165} support.\n *\n * See {IERC165-supportsInterface}.\n */\n function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {\n // query support of ERC165 itself\n if (!supportsERC165(account)) {\n return false;\n }\n\n // query support of each interface in _interfaceIds\n for (uint256 i = 0; i < interfaceIds.length; i++) {\n if (!_supportsERC165Interface(account, interfaceIds[i])) {\n return false;\n }\n }\n\n // all interfaces supported\n return true;\n }\n\n /**\n * @notice Query if a contract implements an interface, does not check ERC165 support\n * @param account The address of the contract to query for support of an interface\n * @param interfaceId The interface identifier, as specified in ERC-165\n * @return true if the contract at account indicates support of the interface with\n * identifier interfaceId, false otherwise\n * @dev Assumes that account contains a contract that supports ERC165, otherwise\n * the behavior of this method is undefined. This precondition can be checked\n * with {supportsERC165}.\n * Interface identification is specified in ERC-165.\n */\n function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) {\n // success determines whether the staticcall succeeded and result determines\n // whether the contract at account indicates support of _interfaceId\n (bool success, bool result) = _callERC165SupportsInterface(account, interfaceId);\n\n return (success && result);\n }\n\n /**\n * @notice Calls the function with selector 0x01ffc9a7 (ERC165) and suppresses throw\n * @param account The address of the contract to query for support of an interface\n * @param interfaceId The interface identifier, as specified in ERC-165\n * @return success true if the STATICCALL succeeded, false otherwise\n * @return result true if the STATICCALL succeeded and the contract at account\n * indicates support of the interface with identifier interfaceId, false otherwise\n */\n function _callERC165SupportsInterface(address account, bytes4 interfaceId)\n private\n view\n returns (bool, bool)\n {\n bytes memory encodedParams = abi.encodeWithSelector(_INTERFACE_ID_ERC165, interfaceId);\n (bool success, bytes memory result) = account.staticcall{ gas: 30000 }(encodedParams);\n if (result.length < 32) return (false, false);\n return (success, abi.decode(result, (bool)));\n }\n}\n" + }, + "contracts/zeppelin/introspection/IERC1820Implementer.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\npragma abicoder v2;\n\n/**\n * @dev Interface for an ERC1820 implementer, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1820#interface-implementation-erc1820implementerinterface[EIP].\n * Used by contracts that will be registered as implementers in the\n * {IERC1820Registry}.\n */\ninterface IERC1820Implementer {\n /**\n * @dev Returns a special value (`ERC1820_ACCEPT_MAGIC`) if this contract\n * implements `_interfaceHash` for `_account`.\n *\n * See {IERC1820Registry-setInterfaceImplementer}.\n */\n function canImplementInterfaceForAddress(bytes32 _interfaceHash, address _account) external view returns (bytes32);\n}\n" + } + }, + "settings": { + "evmVersion": "istanbul", + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/bridge/hardhat.config.js b/bridge/hardhat.config.js index 90bd704a1..61e4db3b3 100644 --- a/bridge/hardhat.config.js +++ b/bridge/hardhat.config.js @@ -10,9 +10,13 @@ require("@nomiclabs/hardhat-etherscan"); const fs = require('fs'); const chains = require('./hardhat/helper/chains'); -const MNEMONIC = fs.existsSync('./mnemonic.key') ? fs.readFileSync('./mnemonic.key', {encoding: 'utf8'}) : ''; // Your metamask's recovery words -const ETHERESCAN_KEY = fs.existsSync('./etherscan.key') ? fs.readFileSync('./etherscan.key', {encoding: 'utf8'}) : ''; // Your Etherscan API Key to verify the contracts -const INFURA_PROJECT_ID = fs.existsSync('./infura.key') ? fs.readFileSync('./infura.key', {encoding: 'utf8'}) : ''; // Your Infura project ID +const MNEMONIC = fs.existsSync('./mnemonic.key') ? fs.readFileSync('./mnemonic.key', {encoding: 'utf8'})?.trim() : ''; // Your metamask's recovery words +const ETHERESCAN_KEY = fs.existsSync('./etherscan.key') ? fs.readFileSync('./etherscan.key', {encoding: 'utf8'})?.trim() : ''; // Your Etherscan API Key to verify the contracts +const INFURA_PROJECT_ID = fs.existsSync('./infura.key') ? fs.readFileSync('./infura.key', {encoding: 'utf8'})?.trim() : ''; // Your Infura project ID + + + + const DEFAULT_DEPLOYER_ACCOUNT_INDEX = 0; @@ -60,7 +64,6 @@ module.exports = { ropsten: ETHERESCAN_KEY, rinkeby: ETHERESCAN_KEY, goerli: ETHERESCAN_KEY, - kovan: ETHERESCAN_KEY, } }, networks: { @@ -74,29 +77,29 @@ module.exports = { tags: ['test', 'local'], }, - //Ganache - development: { - live: false, - url: 'http://127.0.0.1:8545', - network_id: chains.GANACHE_DEV_NET_CHAIN_ID, - token_symbol: 'e', - gas: 6700000, - gasPrice: 20000000000, - hardfork: 'istanbul', // London hardfork is incompatible with RSK gasPrice - tags: ['integrationTest', 'local'], - saveDeployments: false, - }, - mirrorDevelopment: { - live: false, - url: 'http://127.0.0.1:8546', - network_id: chains.GANACHE_DEV_MIRROR_CHAIN_ID, - token_symbol: 'e', - gas: 6700000, - gasPrice: 20000000000, - hardfork: 'istanbul', // London hardfork is incompatible with RSK gasPrice - tags: ['integrationTest', 'local'], - saveDeployments: false, - }, + //Ganache + development: { + live: false, + url: 'http://127.0.0.1:8545', + network_id: chains.GANACHE_DEV_NET_CHAIN_ID, + token_symbol: 'e', + gas: 6700000, + gasPrice: 20000000000, + hardfork: 'istanbul', // London hardfork is incompatible with RSK gasPrice + tags: ['integrationTest', 'local'], + saveDeployments: false, + }, + mirrorDevelopment: { + live: false, + url: 'http://127.0.0.1:8546', + network_id: chains.GANACHE_DEV_MIRROR_CHAIN_ID, + token_symbol: 'e', + gas: 6700000, + gasPrice: 20000000000, + hardfork: 'istanbul', // London hardfork is incompatible with RSK gasPrice + tags: ['integrationTest', 'local'], + saveDeployments: false, + }, // RSK rsktestnet: { live: true, @@ -111,24 +114,25 @@ module.exports = { }, tags: ['staging'], }, - rskmainnet: { - live: true, - url: 'https://public-node.rsk.co', - blockGasLimit: 6800000, - gasPrice: 60000000, // 0.06 gwei - network_id: chains.RSK_MAIN_NET_CHAIN_ID, - token_symbol: 'r', - hardfork: 'istanbul', // London hardfork is incompatible with RSK gasPrice - accounts: { - mnemonic: MNEMONIC, - }, - tags: ['prod'], - }, + // JUST TO AVOID MISTAKES + // rskmainnet: { + // live: true, + // url: 'https://public-node.rsk.co', + // blockGasLimit: 6800000, + // gasPrice: 60000000, // 0.06 gwei + // network_id: chains.RSK_MAIN_NET_CHAIN_ID, + // token_symbol: 'r', + // hardfork: 'istanbul', // London hardfork is incompatible with RSK gasPrice + // accounts: { + // mnemonic: MNEMONIC, + // }, + // tags: ['prod'], + // }, //Ethereum - kovan: { + goerli: { live: true, - url: 'https://kovan.infura.io/v3/' + INFURA_PROJECT_ID, - network_id: chains.KOVAN_TEST_NET_CHAIN_ID, + url: 'https://goerli.infura.io/v3/' + INFURA_PROJECT_ID, + network_id: chains.GOERLI_TEST_NET_CHAIN_ID, token_symbol: 'e', gas: 6700000, gasPrice: 10000000000, @@ -137,30 +141,19 @@ module.exports = { }, tags: ['staging'], }, - rinkeby: { - live: true, - url: 'https://rinkeby.infura.io/v3/' + INFURA_PROJECT_ID, - network_id: chains.RINKEBY_TEST_NET_CHAIN_ID, - token_symbol: 'e', - gas: 6700000, - gasPrice: 10000000000, - accounts: { - mnemonic: MNEMONIC, - }, - tags: ['staging'], - }, - ethmainnet: { - live: true, - url: 'https://mainnet.infura.io/ws/v3/' + INFURA_PROJECT_ID, - network_id: chains.ETHEREUM_MAIN_NET_CHAIN_ID, - token_symbol: 'e', - gas: 6700000, - gasPrice: 250000000000, - accounts: { - mnemonic: MNEMONIC, - }, - tags: ['prod'], - }, + // JUST TO AVOID MISTAKES + // ethmainnet: { + // live: true, + // url: 'https://mainnet.infura.io/ws/v3/' + INFURA_PROJECT_ID, + // network_id: chains.ETHEREUM_MAIN_NET_CHAIN_ID, + // token_symbol: 'e', + // gas: 6700000, + // gasPrice: 250000000000, + // accounts: { + // mnemonic: MNEMONIC, + // }, + // tags: ['prod'], + // }, }, }; @@ -184,7 +177,7 @@ function getMultiSigAddressesByChainId() { multiSigAddressesByChainId[chains.ETHEREUM_MAIN_NET_CHAIN_ID] = '0x040007b1804ad78a97f541bebed377dcb60e4138'; multiSigAddressesByChainId[chains.RSK_MAIN_NET_CHAIN_ID] = '0x040007b1804ad78a97f541bebed377dcb60e4138'; multiSigAddressesByChainId[chains.RSK_TEST_NET_CHAIN_ID] = '0x88f6b2bc66f4c31a3669b9b1359524abf79cfc4a'; - multiSigAddressesByChainId[chains.KOVAN_TEST_NET_CHAIN_ID] = '0x040007b1804ad78a97f541bebed377dcb60e4138'; + multiSigAddressesByChainId[chains.GOERLI_TEST_NET_CHAIN_ID] = '0x3Cf0EB5B86a2B0e58Fa6e088c91FEEFb71aEca2d'; multiSigAddressesByChainId[chains.BSC_TEST_NET_CHAIN_ID] = '0xE3848f411587C2C8658A0d6F649e7F1E403873a6'; multiSigAddressesByChainId[chains.RINKEBY_TEST_NET_CHAIN_ID] = '0x04994d7fF4938c5953A6C8411ad30083C9097348'; return multiSigAddressesByChainId; @@ -195,7 +188,7 @@ function getWrappedCurrencyAddressesByChainId() { wrappedCurrencyAddressesByChainId[chains.ETHEREUM_MAIN_NET_CHAIN_ID] = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'; wrappedCurrencyAddressesByChainId[chains.RSK_MAIN_NET_CHAIN_ID] = '0x967f8799af07df1534d48a95a5c9febe92c53ae0'; wrappedCurrencyAddressesByChainId[chains.RSK_TEST_NET_CHAIN_ID] = '0x09b6ca5e4496238a1f176aea6bb607db96c2286e'; - wrappedCurrencyAddressesByChainId[chains.KOVAN_TEST_NET_CHAIN_ID] = '0xd0A1E359811322d97991E03f863a0C30C2cF029C'; + wrappedCurrencyAddressesByChainId[chains.GOERLI_TEST_NET_CHAIN_ID] = '0x64D3251296DF05bD3Cb42D910b113F7EdAc08610'; wrappedCurrencyAddressesByChainId[chains.BSC_TEST_NET_CHAIN_ID] = '0xae13d989dac2f0debff460ac112a837c89baa7cd'; wrappedCurrencyAddressesByChainId[chains.BSC_MAIN_NET_CHAIN_ID] = '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c'; wrappedCurrencyAddressesByChainId[chains.RINKEBY_TEST_NET_CHAIN_ID] = '0x1664Bd54e994C04bD0f9F7B7e9Ad7CC45d1537B1'; @@ -207,7 +200,7 @@ function getProxyAdminAddressesByChainId() { proxyAdminAddressesByChainId[chains.ETHEREUM_MAIN_NET_CHAIN_ID] = '0xe4d351911a6d599f91a3db1843e2ecb0f851e7e6'; proxyAdminAddressesByChainId[chains.RSK_MAIN_NET_CHAIN_ID] = '0x12ed69359919fc775bc2674860e8fe2d2b6a7b5d'; proxyAdminAddressesByChainId[chains.RSK_TEST_NET_CHAIN_ID] = '0x8c35e166d2dea7a8a28aaea11ad7933cdae4b0ab'; - proxyAdminAddressesByChainId[chains.KOVAN_TEST_NET_CHAIN_ID] = '0xe4d351911a6d599f91a3db1843e2ecb0f851e7e6'; + proxyAdminAddressesByChainId[chains.GOERLI_TEST_NET_CHAIN_ID] = '0x39055c999A8528535Af012F4F4CF7B548dD97481'; proxyAdminAddressesByChainId[chains.BSC_TEST_NET_CHAIN_ID] = '0xb37Bf97A42eee6b995732530595E3d16639D9977'; proxyAdminAddressesByChainId[chains.RINKEBY_TEST_NET_CHAIN_ID] = '0x0b32Ea549AB1F9F7390442B5E9438b58A105cB5f'; return proxyAdminAddressesByChainId; @@ -218,7 +211,7 @@ function getAllowTokensProxyAddressesByChainId() { allowTokensProxyAddressesByChainId[chains.ETHEREUM_MAIN_NET_CHAIN_ID] = '0xa3fc98e0a7a979677bc14d541be770b2cb0a15f3'; allowTokensProxyAddressesByChainId[chains.RSK_MAIN_NET_CHAIN_ID] = '0xcb789036894a83a008a2aa5b3c2dde41d0605a9a'; allowTokensProxyAddressesByChainId[chains.RSK_TEST_NET_CHAIN_ID] = '0xc65bf0ae75dc1a5fc9e6f4215125692a548c773a'; - allowTokensProxyAddressesByChainId[chains.KOVAN_TEST_NET_CHAIN_ID] = '0x92bf86334583909b60f9b798a9dd7debd899fec4'; + allowTokensProxyAddressesByChainId[chains.GOERLI_TEST_NET_CHAIN_ID] = '0x17d4c0dEBef2F28c3C04fFa953b0E18575f576ED'; allowTokensProxyAddressesByChainId[chains.BSC_TEST_NET_CHAIN_ID] = '0x9a64fc2416EE2157e19DC2C79B5B22D113a9E0C3'; allowTokensProxyAddressesByChainId[chains.RINKEBY_TEST_NET_CHAIN_ID] = '0xAE3852306015df037D458a65173BBc7527F4680b'; return allowTokensProxyAddressesByChainId; @@ -229,7 +222,7 @@ function getBridgeProxyAddressesByChainId() { bridgeProxyAddressesByChainId[chains.ETHEREUM_MAIN_NET_CHAIN_ID] = '0x12ed69359919fc775bc2674860e8fe2d2b6a7b5d'; bridgeProxyAddressesByChainId[chains.RSK_MAIN_NET_CHAIN_ID] = '0x9d11937e2179dc5270aa86a3f8143232d6da0e69'; bridgeProxyAddressesByChainId[chains.RSK_TEST_NET_CHAIN_ID] = '0x684a8a976635fb7ad74a0134ace990a6a0fcce84'; - bridgeProxyAddressesByChainId[chains.KOVAN_TEST_NET_CHAIN_ID] = '0x12ed69359919fc775bc2674860e8fe2d2b6a7b5d'; + bridgeProxyAddressesByChainId[chains.GOERLI_TEST_NET_CHAIN_ID] = '0xa3aCF79Aded2DD5E2A8bd2E3D1E9f797E96972d3'; bridgeProxyAddressesByChainId[chains.BSC_TEST_NET_CHAIN_ID] = '0xd9d2f9ee990ddb1147e595ae4f69ec468a0b58d0'; bridgeProxyAddressesByChainId[chains.RINKEBY_TEST_NET_CHAIN_ID] = '0x7E339118346364d7D86AB67cb0775CBB808E65F7'; return bridgeProxyAddressesByChainId; @@ -240,7 +233,7 @@ function getFederationProxyAddressesByChainId() { federationProxyAddressesByChainId[chains.ETHEREUM_MAIN_NET_CHAIN_ID] = '0x5e29c223d99648c88610519f96e85e627b3abe17'; federationProxyAddressesByChainId[chains.RSK_MAIN_NET_CHAIN_ID] = '0x7ecfda6072942577d36f939ad528b366b020004b'; federationProxyAddressesByChainId[chains.RSK_TEST_NET_CHAIN_ID] = '0x5d663981d930e8ec108280b9d80885658148ab0f'; - federationProxyAddressesByChainId[chains.KOVAN_TEST_NET_CHAIN_ID] = '0xa347438bc288f56cb6083a79133e70dd2d1f6c2d'; + federationProxyAddressesByChainId[chains.GOERLI_TEST_NET_CHAIN_ID] = '0xF687a27475B2B7Ec363d2705CF94A067aEB248f6'; federationProxyAddressesByChainId[chains.BSC_TEST_NET_CHAIN_ID] = '0xD40F8613173E636D570c47dB3A6Ac57EA9ccac83'; federationProxyAddressesByChainId[chains.RINKEBY_TEST_NET_CHAIN_ID] = '0xBC383764ceBc13b66c04E1abeb36804a0Caaa5C6'; return federationProxyAddressesByChainId; @@ -251,7 +244,7 @@ function getSideTokenFactoryAddressesByChainId() { sideTokenFactoryAddressesByChainId[chains.ETHEREUM_MAIN_NET_CHAIN_ID] = '0xF73C60863BF2930Bde2c69dF4CB8fE700Ae713fB'; sideTokenFactoryAddressesByChainId[chains.RSK_MAIN_NET_CHAIN_ID] = '0x44fcd0854d745efdef4cfe9868efe4d4eb51ecd6'; sideTokenFactoryAddressesByChainId[chains.RSK_TEST_NET_CHAIN_ID] = '0x08C191A7B5Edaa59853705F7eaE95E3E4238D73e'; - sideTokenFactoryAddressesByChainId[chains.KOVAN_TEST_NET_CHAIN_ID] = '0x984192ad76A8FFF2edf39C260324d32d8A80512b'; + sideTokenFactoryAddressesByChainId[chains.GOERLI_TEST_NET_CHAIN_ID] = '0x281B8cE947918058cf3341125Bba4dCCd07172FF'; sideTokenFactoryAddressesByChainId[chains.BSC_TEST_NET_CHAIN_ID] = '0xe2EBFC705d473C3dDd52CB49AF0bdE3132E8831e'; sideTokenFactoryAddressesByChainId[chains.RINKEBY_TEST_NET_CHAIN_ID] = '0x1CB41Dc4603612A4da692669916e8F4dEF2994dC'; return sideTokenFactoryAddressesByChainId; diff --git a/bridge/hardhat/helper/chains.js b/bridge/hardhat/helper/chains.js index dcbecab26..9754ae572 100644 --- a/bridge/hardhat/helper/chains.js +++ b/bridge/hardhat/helper/chains.js @@ -1,7 +1,7 @@ const ETHEREUM_MAIN_NET_CHAIN_ID = 1; const RSK_MAIN_NET_CHAIN_ID = 30; const RSK_TEST_NET_CHAIN_ID = 31; -const KOVAN_TEST_NET_CHAIN_ID = 42; +const GOERLI_TEST_NET_CHAIN_ID = 5; const RINKEBY_TEST_NET_CHAIN_ID = 4; const BSC_MAIN_NET_CHAIN_ID = 56; const BSC_TEST_NET_CHAIN_ID = 97; @@ -38,7 +38,7 @@ module.exports = { ETHEREUM_MAIN_NET_CHAIN_ID: ETHEREUM_MAIN_NET_CHAIN_ID, RSK_MAIN_NET_CHAIN_ID: RSK_MAIN_NET_CHAIN_ID, RSK_TEST_NET_CHAIN_ID: RSK_TEST_NET_CHAIN_ID, - KOVAN_TEST_NET_CHAIN_ID: KOVAN_TEST_NET_CHAIN_ID, + GOERLI_TEST_NET_CHAIN_ID: GOERLI_TEST_NET_CHAIN_ID, RINKEBY_TEST_NET_CHAIN_ID: RINKEBY_TEST_NET_CHAIN_ID, BSC_MAIN_NET_CHAIN_ID: BSC_MAIN_NET_CHAIN_ID, BSC_TEST_NET_CHAIN_ID: BSC_TEST_NET_CHAIN_ID, diff --git a/bridge/hardhat/helper/tokens.js b/bridge/hardhat/helper/tokens.js index da12bbc01..8a600f65f 100644 --- a/bridge/hardhat/helper/tokens.js +++ b/bridge/hardhat/helper/tokens.js @@ -31,21 +31,11 @@ const rskMainnet = { rAMLT: {address: '0xff9ea341d9ea91cb7c54342354377f5104fd403f', typeId: '6', isSideToken: true, decimals: 18, symbol: 'rAMLT'} //rAMLT } -const kovan = { + const goerli = { WBTC: {address: '0xd1b98b6607330172f1d991521145a22bce793277', typeId: '0', isSideToken: false, decimals: 8, symbol: 'WBTC'}, //WBTC - renBTC: {address: '0x0a9add98c076448cbcfacf5e457da12ddbef4a8f', typeId: '0', isSideToken: false, decimals: 18, symbol: 'renBTC'}, //renBTC - WETH: {address: '0xd0A1E359811322d97991E03f863a0C30C2cF029C', typeId: '1', isSideToken: false, decimals: 18, symbol: 'ETH'}, //WETH - SAI: {address: '0xc7cc3413f169a027dccfeffe5208ca4f38ef0c40', typeId: '4', isSideToken: false, decimals: 18, symbol: 'SAI'}, //SAI - DAI: {address: '0x4F96Fe3b7A6Cf9725f59d353F723c1bDb64CA6Aa', typeId: '4', isSideToken: false, decimals: 18, symbol: 'DAI'}, //DAI - TUSD: {address: '0x0000000000085d4780B73119b644AE5ecd22b376', typeId: '4', isSideToken: false, decimals: 18, symbol: 'TUSD'}, //TUSD - USDC: {address: '0xe22da380ee6B445bb8273C81944ADEB6E8450422', typeId: '4', isSideToken: false, decimals: 6, symbol: 'USDC'}, //USDC - USDT: {address: '0x13512979ade267ab5100878e2e0f485b568328a4', typeId: '4', isSideToken: false, decimals: 6, symbol: 'USDT'}, //USDT - LINK: {address: '0xa36085F69e2889c224210F603D836748e7dC0088', typeId: '3', isSideToken: false, decimals: 18, symbol: 'LINK'}, //LINK - BUND: {address: '0x8d3e855f3f55109d473735ab76f753218400fe96', typeId: '3', isSideToken: false, decimals: 18, symbol: 'BUND'}, //BUND - // SideToken - eRIF: {address: '0x69f6d4d4813f8e2e618dae7572e04b6d5329e207', typeId: '5', isSideToken: true, decimals: 18, symbol: 'eRIF'}, //eRIF - eDOC: {address: '0x09a8f2041Be23e8eC3c72790C9A92089BC70FbCa', typeId: '4', isSideToken: true, decimals: 18, symbol: 'eDOC'}, //eDOC - eBPro: {address: '0xB3c9ec8833bfA0d382a183EcED27aBc079520928', typeId: '0', isSideToken: true, decimals: 18, symbol: 'eBPro'} //eBPro + DAI: {address: '0xDF1742fE5b0bFc12331D8EAec6b478DfDbD31464', typeId: '4', isSideToken: false, decimals: 18, symbol: 'DAI'}, //DAI + USDT: {address: '0xC2C527C0CACF457746Bd31B2a698Fe89de2b6d49', typeId: '4', isSideToken: false, decimals: 6, symbol: 'USDT'}, //USDT + LINK: {address: '0x326C977E6efc84E512bB9C30f76E30c160eD06FB', typeId: '3', isSideToken: false, decimals: 18, symbol: 'LINK'}, //LINK } const rskTestnet = { @@ -69,8 +59,8 @@ const tokensByChainId = (chainId) => { case chains.RSK_TEST_NET_CHAIN_ID: return rskTestnet; - case chains.KOVAN_TEST_NET_CHAIN_ID: - return kovan; + case chains.GOERLI_TEST_NET_CHAIN_ID: + return goerli; case chains.RSK_MAIN_NET_CHAIN_ID: return rskMainnet; @@ -88,6 +78,6 @@ module.exports = { tokensByChainId, ethereum, rskMainnet, - kovan, + goerli, rskTestnet, }; diff --git a/bridge/hardhat/script/addFederatorMember.js b/bridge/hardhat/script/addFederatorMember.js index 027f2be90..5f0e645a2 100644 --- a/bridge/hardhat/script/addFederatorMember.js +++ b/bridge/hardhat/script/addFederatorMember.js @@ -1,13 +1,14 @@ // How to run the script: npx hardhat run ./hardhat/script/addFederatorMemeber.js --network rsktestnetbsc const hre = require("hardhat"); +const {getFederation} = require('./utils'); async function main() { const {getNamedAccounts, deployments} = hre; const {deployer} = await getNamedAccounts(); const transactionEtherValue = 0; - const memberFederatorAddress = "0x0e6fa08809bc166ab5ce237fdccb1802fdf13b27"; + const memberFederatorAddress = "0x6f15dCB432c2f5570c247f5CAcb1F1EAfa351f89"; - const Federation = await deployments.get('FederationV2'); + const Federation = await deployments.get(getFederation(network.name)); const FederationProxy = await deployments.get('FederationProxy'); const MultiSigWallet = await deployments.get('MultiSigWallet'); diff --git a/bridge/hardhat/script/createTokensERC20Rsk.js b/bridge/hardhat/script/createTokensERC20Rsk.js index 034b7cb5b..d09d3cbc9 100644 --- a/bridge/hardhat/script/createTokensERC20Rsk.js +++ b/bridge/hardhat/script/createTokensERC20Rsk.js @@ -1,4 +1,4 @@ -// How to run the script: npx hardhat run ./hardhat/script/createTokensERC20Rsk.js --network rsktestnet kovan bsctestnet rsktestnet rsktestnetbsc +// How to run the script: npx hardhat run ./hardhat/script/createTokensERC20Rsk.js --network rsktestnet goerli bsctestnet rsktestnet rsktestnetbsc const hre = require("hardhat"); async function main() { diff --git a/bridge/hardhat/script/deleteFederatorMember.js b/bridge/hardhat/script/deleteFederatorMember.js index 940b3d810..eec935845 100644 --- a/bridge/hardhat/script/deleteFederatorMember.js +++ b/bridge/hardhat/script/deleteFederatorMember.js @@ -1,5 +1,6 @@ // How to run the script: npx hardhat run ./hardhat/script/deleteFederatorMemeber.js --network rsktestnetbsc const hre = require("hardhat"); +const {getFederation} = require('./utils'); async function main() { const {getNamedAccounts, deployments} = hre; @@ -7,7 +8,7 @@ async function main() { const oldFederatorAddress = "0x8f397ff074ff190fc650e5cab4da039a8163e12a"; - const Federation = await deployments.get('FederationV2'); + const Federation = await deployments.get(getFederation(network.name)); const FederationProxy = await deployments.get('FederationProxy'); const MultiSigWallet = await deployments.get('MultiSigWallet'); diff --git a/bridge/hardhat/script/getSideTokenAddress.js b/bridge/hardhat/script/getSideTokenAddress.js index 24bd5bb1d..bb777cbc2 100644 --- a/bridge/hardhat/script/getSideTokenAddress.js +++ b/bridge/hardhat/script/getSideTokenAddress.js @@ -4,7 +4,7 @@ const hre = require("hardhat"); const { tokensByChainId } = require('../../hardhat/helper/tokens'); async function main() { - const originalChainId = 42 + const originalChainId = 5 const tokens = tokensByChainId(originalChainId); const {deployments} = hre; diff --git a/bridge/hardhat/script/getTxStatus.js b/bridge/hardhat/script/getTxStatus.js index 4cf8e97ad..eba767a1f 100644 --- a/bridge/hardhat/script/getTxStatus.js +++ b/bridge/hardhat/script/getTxStatus.js @@ -11,7 +11,10 @@ async function main() { const bridgeContract = new web3.eth.Contract(Bridge.abi, BridgeProxy.address); - const transactionHash = "0x77a49edea913f81268cceb4499525cf6c2c8a16233d323ca135e41f79249188f" //"0x5befad2a24647508bf848e8500b9be4f0340efd078631ad3de927b264c723267" // "0xba6a21df7b69fffcf00d39b1da003ad8041b41d07887226c8c935ab106fec7e9" + const transactionHash = "0x304d2b4366d3a7c08463bd619aff36940ae5931a4d46ee436561ead2b23a1c20" //"0x5befad2a24647508bf848e8500b9be4f0340efd078631ad3de927b264c723267" // "0xba6a21df7b69fffcf00d39b1da003ad8041b41d07887226c8c935ab106fec7e9" + + const hasCrossed = await bridgeContract.methods.hasCrossed(transactionHash).call(); + console.log("Has Crossed", hasCrossed); const hasBeenClaimed = await bridgeContract.methods.hasBeenClaimed(transactionHash).call(); console.log("Has Been Claimed", hasBeenClaimed); diff --git a/bridge/hardhat/script/getWrappedCurrency.js b/bridge/hardhat/script/getWrappedCurrency.js index ff4a3e32d..f0ca1ba1c 100644 --- a/bridge/hardhat/script/getWrappedCurrency.js +++ b/bridge/hardhat/script/getWrappedCurrency.js @@ -1,4 +1,4 @@ -// How to run the script: npx hardhat run ./hardhat/script/getWrappedCurrency.js --network kovan bsctestnet rsktestnet rsktestnetbsc +// How to run the script: npx hardhat run ./hardhat/script/getWrappedCurrency.js --network goerli bsctestnet rsktestnet rsktestnetbsc const hre = require("hardhat"); async function main() { diff --git a/bridge/hardhat/script/mapTokens.js b/bridge/hardhat/script/mapTokens.js new file mode 100644 index 000000000..28fe649b0 --- /dev/null +++ b/bridge/hardhat/script/mapTokens.js @@ -0,0 +1,43 @@ +// How to run the script: npx hardhat run ./hardhat/script/addFederatorMemeber.js --network rsktestnetbsc +const hre = require("hardhat"); + +async function main() { + const {getNamedAccounts, deployments} = hre; + const {deployer} = await getNamedAccounts(); + const transactionEtherValue = 0; + const Bridge = await deployments.get('Bridge'); + const BridgeProxy = await deployments.get('BridgeProxy'); + const MultiSigWallet = await deployments.get('MultiSigWallet'); + const bridge = new web3.eth.Contract(Bridge.abi, BridgeProxy.address); + const multiSigContract = new web3.eth.Contract(MultiSigWallet.abi, MultiSigWallet.address); + +// -------------------SCRIPT TO MAP TOKEN BETWEEN BRIDGES + + const methodCallAddNewMember = bridge.methods.setSideTokenByOriginalAddressByChain( + 31, '0x8bbbd80981fe76d44854d8df305e8985c19f0e78', '0x326C977E6efc84E512bB9C30f76E30c160eD06FB' + + ); + + const result = await methodCallAddNewMember.call({ from: MultiSigWallet.address}); + console.log("Method call result", result); + + const receipt = await multiSigContract.methods.submitTransaction( + BridgeProxy.address, + transactionEtherValue, + methodCallAddNewMember.encodeABI() + ).send({ + from: deployer, + gasLimit: 3000000 + }); + + +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/bridge/hardhat/script/setOriginalSideToken.js b/bridge/hardhat/script/setOriginalSideToken.js new file mode 100644 index 000000000..266e13e75 --- /dev/null +++ b/bridge/hardhat/script/setOriginalSideToken.js @@ -0,0 +1,42 @@ +// How to run the script: npx hardhat run ./hardhat/script/addFederatorMemeber.js --network rsktestnetbsc +const hre = require("hardhat"); + +async function main() { + const {getNamedAccounts, deployments} = hre; + const {deployer} = await getNamedAccounts(); + const transactionEtherValue = 0; + const Bridge = await deployments.get('Bridge'); + const BridgeProxy = await deployments.get('BridgeProxy'); + const MultiSigWallet = await deployments.get('MultiSigWallet'); + const bridge = new web3.eth.Contract(Bridge.abi, BridgeProxy.address); + const multiSigContract = new web3.eth.Contract(MultiSigWallet.abi, MultiSigWallet.address); + +// -------------------SCRIPT TO MAP TOKEN BETWEEN BRIDGES + + const methodCallAddNewMember = bridge.methods.setOriginalTokenBySideTokenByChain( + '0x4cfE225cE54c6609a525768b13F7d87432358C57', ['0xC2C527C0CACF457746Bd31B2a698Fe89de2b6d49', 5] + ); + + const result = await methodCallAddNewMember.call({ from: MultiSigWallet.address}); + console.log("Method call result", result); + + const receipt = await multiSigContract.methods.submitTransaction( + BridgeProxy.address, + transactionEtherValue, + methodCallAddNewMember.encodeABI() + ).send({ + from: deployer, + gasLimit: 3000000 + }); + + +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/bridge/hardhat/script/utils.js b/bridge/hardhat/script/utils.js new file mode 100644 index 000000000..a897e79ec --- /dev/null +++ b/bridge/hardhat/script/utils.js @@ -0,0 +1,5 @@ +const federationsForNetwork = { + goerli: 'Federation', + rsktestnet: 'FederationV2', + }; +exports.getFederation = name => federationsForNetwork[name] || 'Federation'; \ No newline at end of file diff --git a/deploy.sh b/deploy.sh index 07960551c..e4280ee34 100644 --- a/deploy.sh +++ b/deploy.sh @@ -22,8 +22,8 @@ quit() { config() { cp $DEST_DIR/federator/config/config.sample.js $DEST_DIR/federator/config/config.js && - sed -i "s|rsktestnet-kovan|rskmainnet|g" $DEST_DIR/federator/config/config.js && - sed -i "s|kovan|ethmainnet|g" $DEST_DIR/federator/config/config.js && + sed -i "s|rsktestnet-goerli|rskmainnet|g" $DEST_DIR/federator/config/config.js && + sed -i "s|goerli|ethmainnet|g" $DEST_DIR/federator/config/config.js && return 0 quit 1 "There was a problem setting the configuration, please verify." } diff --git a/docs/ContractAddresses.md b/docs/ContractAddresses.md index 0a0cc92df..2aa9c9ca5 100644 --- a/docs/ContractAddresses.md +++ b/docs/ContractAddresses.md @@ -39,18 +39,18 @@ Between Rsk Mainnet and Ethereum [https://tokenbridge.rsk.co/](https://tokenbrid ## List of Addresses ### On RSK Testnet - - "bridge": [0x684a8a976635fb7ad74a0134ace990a6a0fcce84](https://explorer.testnet.rsk.co/address/0x684a8a976635fb7ad74a0134ace990a6a0fcce84) - - "federation": [0x5d663981d930e8ec108280b9d80885658148ab0f](https://explorer.testnet.rsk.co/address/0x5d663981d930e8ec108280b9d80885658148ab0f) - - "allowTokens": [0xc65bf0ae75dc1a5fc9e6f4215125692a548c773a](https://explorer.testnet.rsk.co/address/0xc65bf0ae75dc1a5fc9e6f4215125692a548c773a) - - "multiSigWallet": [0x88f6b2bc66f4c31a3669b9b1359524abf79cfc4a](https://explorer.testnet.rsk.co/address/0x88f6b2bc66f4c31a3669b9b1359524abf79cfc4a) + - "bridge": [0x684a8a976635fb7ad74a0134ace990a6a0fcce84](https://explorer.testnet.rsk.co/address/0x684a8a976635fb7ad74a0134ace990a6a0fcce84) + - "federation": [0x5d663981d930e8ec108280b9d80885658148ab0f](https://explorer.testnet.rsk.co/address/0x5d663981d930e8ec108280b9d80885658148ab0f) + - "allowTokens": [0xc65bf0ae75dc1a5fc9e6f4215125692a548c773a](https://explorer.testnet.rsk.co/address/0xc65bf0ae75dc1a5fc9e6f4215125692a548c773a) + - "multiSigWallet": [0x88f6b2bc66f4c31a3669b9b1359524abf79cfc4a](https://explorer.testnet.rsk.co/address/0x88f6b2bc66f4c31a3669b9b1359524abf79cfc4a) - "tRIF": [0x19f64674d8a5b4e652319f5e239efd3bc969a1fe](https://explorer.testnet.rsk.co/address/0x19f64674d8a5b4e652319f5e239efd3bc969a1fe) -### On Kovan - - "bridge": ["0x12ed69359919fc775bc2674860e8fe2d2b6a7b5d"](https://kovan.etherscan.io/address/0x12ed69359919fc775bc2674860e8fe2d2b6a7b5d) - - "federation": ["0xa347438BC288f56Cb6083A79133e70DD2d1f6c2d"](https://kovan.etherscan.io/address/0xa347438BC288f56Cb6083A79133e70DD2d1f6c2d) - - "allowTokens": [0x92BF86334583909B60F9b798A9Dd7Debd899fEc4](https://kovan.etherscan.io/address/0x92BF86334583909B60F9b798A9Dd7Debd899fEc4) - - "multiSigWallet": [0x040007b1804ad78a97f541bebed377dcb60e4138](https://kovan.etherscan.io/address/0x040007b1804ad78a97f541bebed377dcb60e4138) - - "etRIF": [0x69f6d4d4813f8e2e618dae7572e04b6d5329e207](https://kovan.etherscan.io/address/0x69f6d4d4813f8e2e618dae7572e04b6d5329e207) +### On Goerli + - "bridge": ["0x12ed69359919fc775bc2674860e8fe2d2b6a7b5d"](https://goerli.etherscan.io/address/0x12ed69359919fc775bc2674860e8fe2d2b6a7b5d) - SHOULD BE UPDATED + - "federation": ["0xa347438BC288f56Cb6083A79133e70DD2d1f6c2d"](https://goerli.etherscan.io/address/0xa347438BC288f56Cb6083A79133e70DD2d1f6c2d) - SHOULD BE UPDATED + - "allowTokens": [0x92BF86334583909B60F9b798A9Dd7Debd899fEc4](https://goerli.etherscan.io/address/0x92BF86334583909B60F9b798A9Dd7Debd899fEc4) - SHOULD BE UPDATED + - "multiSigWallet": [0x040007b1804ad78a97f541bebed377dcb60e4138](https://goerli.etherscan.io/address/0x040007b1804ad78a97f541bebed377dcb60e4138) - SHOULD BE UPDATED + - "etRIF": [0x69f6d4d4813f8e2e618dae7572e04b6d5329e207](https://goerli.etherscan.io/address/0x69f6d4d4813f8e2e618dae7572e04b6d5329e207) - SHOULD BE UPDATED ## RSK Testnet Explorer faucet and stats - https://stats.testnet.rsk.co/ @@ -58,10 +58,10 @@ Between Rsk Mainnet and Ethereum [https://tokenbridge.rsk.co/](https://tokenbrid - https://faucet.testnet.rsk.co/ - https://faucet.rifos.org/ -## Kovan (Ethereum testnet) Explorer and faucet -- https://kovan.etherscan.io/ -- https://faucet.kovan.network/ -- https://gitter.im/kovan-testnet/faucet +## Goerli (Ethereum testnet) Explorer and faucet +- https://goerli.etherscan.io/ +- https://faucet.goerli.network/ +- https://gitter.im/goerli-testnet/faucet ## Dapp -Between Rsk Testnet and Kovan [https://testnet.tokenbridge.rsk.co/](https://testnet.tokenbridge.rsk.co/) +Between Rsk Testnet and Goerli [https://testnet.tokenbridge.rsk.co/](https://testnet.tokenbridge.rsk.co/) diff --git a/federator/README.md b/federator/README.md index 3d885411e..b0583dcd5 100644 --- a/federator/README.md +++ b/federator/README.md @@ -6,7 +6,7 @@ The federators will be the owners of the contracts willing to allow to cross the ## Config -Go to /federator/config copy `config.sample.js` file and rename it to `config.js` set mainchain and sidechain to point to the json files of the networks you are using, for example rsktestnet-kovan.json and kovan.json, `make sure to set the host parameter of those files`. Add a value to the key `FEDERATOR_KEY` in the .env file, and add the private key of the member of the Federation contract. The members of the federation are controled by the MultiSig contract, same that is owner of the Bridge and AllowedTokens contracts. +Go to /federator/config copy `config.sample.js` file and rename it to `config.js` set mainchain and sidechain to point to the json files of the networks you are using, for example rsktestnet-goerli.json and goerli.json, `make sure to set the host parameter of those files`. Add a value to the key `FEDERATOR_KEY` in the .env file, and add the private key of the member of the Federation contract. The members of the federation are controled by the MultiSig contract, same that is owner of the Bridge and AllowedTokens contracts. You will also need to add an [etherscan api key](https://etherscan.io/myapikey) in this config file. ## Usage @@ -26,8 +26,8 @@ To run the federator using Docker, go to the /federator/config folder and rename ```js module.exports = { - mainchain: require('./rsktestnet-kovan.json'), - sidechain: [require('./kovan.json')], + mainchain: require('./rsktestnet-goerli.json'), + sidechain: [require('./goerli.json')], runEvery: 1, // In minutes, confirmations: 10,// Number of blocks before processing it, privateKey: process.env.FEDERATOR_KEY || '', @@ -38,9 +38,9 @@ module.exports = { } ``` -where the mainchain for example is rsktestnet and the sidechain is kovan, the .json files are in the /federator/config folder and includes the addresses of the contracts in that network and the block number when they where deployed. +where the mainchain for example is rsktestnet and the sidechain is goerli, the .json files are in the /federator/config folder and includes the addresses of the contracts in that network and the block number when they where deployed. The order of sidechain and mainchain is not important is just which one is going to be checked first, as federators are bi directionals. -Inside the .json files there is also the host to that network, for example this is the rsktestnet-kovan.json +Inside the .json files there is also the host to that network, for example this is the rsktestnet-goerli.json ```json { diff --git a/federator/config/config.sample.js b/federator/config/config.sample.js index cadcca922..8b949b245 100644 --- a/federator/config/config.sample.js +++ b/federator/config/config.sample.js @@ -1,17 +1,18 @@ -const dotenv = require('dotenv'); +const dotenv = require("dotenv"); dotenv.config(); module.exports = { mainchain: require("./rsktestnet.json"), //the json containing the smart contract addresses in rsk sidechain: [ - require("./kovan.json"), //the json containing the smart contract addresses in eth + require("./goerli.json"), //the json containing the smart contract addresses in eth ], runEvery: 2, // In minutes, - privateKey: process.env.FEDERATOR_KEY || '', + privateKey: process.env.FEDERATOR_KEY || "", storagePath: "./db", etherscanApiKey: "", runHeartbeatEvery: 1, // In hours - endpointsPort: 5000, // Server port + endpointsPort: 3000, // Server port + useNft: false, checkHttps: false, }; diff --git a/federator/config/goerli.json b/federator/config/goerli.json new file mode 100644 index 000000000..0edda3ecd --- /dev/null +++ b/federator/config/goerli.json @@ -0,0 +1,10 @@ +{ + "name": "goerli", + "bridge": "0xa3acf79aded2dd5e2a8bd2e3d1e9f797e96972d3", + "federation": "0xf687a27475b2b7ec363d2705cf94a067aeb248f6", + "multiSig": "0x3cf0eb5b86a2b0e58fa6e088c91feefb71aeca2d", + "allowTokens": "0x17d4c0debef2f28c3c04ffa953b0e18575f576ed", + "chainId": 5, + "host": "https://goerli.infura.io/v3/***REMOVED***", + "fromBlock": 7664975 +} \ No newline at end of file diff --git a/federator/config/kovan.json b/federator/config/kovan.json deleted file mode 100644 index bf3342032..000000000 --- a/federator/config/kovan.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "kovan", - "chainId": 42, - "bridge": "0x12ed69359919fc775bc2674860e8fe2d2b6a7b5d", - "federation": "0xa347438BC288f56Cb6083A79133e70DD2d1f6c2d", - "allowTokens": "0x92BF86334583909B60F9b798A9Dd7Debd899fEc4", - "host": "https://kovan.infura.io/v3/6f9ea94e89da48089bf925e53205720c", - "fromBlock": 29761089 -} \ No newline at end of file diff --git a/federator/src/contracts/IAllowTokensV0.ts b/federator/src/contracts/IAllowTokensV0.ts index 9209215b0..f02dda777 100644 --- a/federator/src/contracts/IAllowTokensV0.ts +++ b/federator/src/contracts/IAllowTokensV0.ts @@ -25,8 +25,8 @@ export class IAllowTokensV0 implements IAllowTokens { async getConfirmations(): Promise { let confirmations = 0; //for rsk regtest and ganache - if (this.chainId === 31 || this.chainId === 42) { - // rsk testnet and kovan + if (this.chainId === 31 || this.chainId === 5) { + // rsk testnet and goerli TO DO: ASK AUGUSTO ABOUT CONFIRMATIONS. confirmations = 10; } if (this.chainId === 1) { diff --git a/federator/src/lib/TransactionSender.ts b/federator/src/lib/TransactionSender.ts index d595b5228..d80c6031d 100644 --- a/federator/src/lib/TransactionSender.ts +++ b/federator/src/lib/TransactionSender.ts @@ -136,7 +136,7 @@ export class TransactionSender { r: 0, s: 0, }; - + if (await this.isRsk()) { delete rawTx.chainId; delete rawTx.r; @@ -144,7 +144,7 @@ export class TransactionSender { } rawTx.gas = this.numberToHexString(await this.getGasLimit(rawTx)); - + if (this.debuggingMode) { rawTx.gas = this.numberToHexString(100); this.logger.warn(`debugging mode enabled, forced rawTx.gas ${rawTx.gas}`); @@ -174,7 +174,7 @@ export class TransactionSender { throw new Error(`ChainId:${chainId} can't use Etherescan API`); } - const url = chainId === 1 ? 'https://api.etherscan.io/api' : 'https://api-kovan.etherscan.io/api'; + const url = chainId === 1 ? 'https://api.etherscan.io/api' : 'https://api-goerli.etherscan.io/api'; const params = new URLSearchParams(); params.append('apikey', this.etherscanApiKey); diff --git a/federator/src/lib/chainId.ts b/federator/src/lib/chainId.ts index d0a009818..625d46d06 100644 --- a/federator/src/lib/chainId.ts +++ b/federator/src/lib/chainId.ts @@ -1,5 +1,5 @@ export const RSK_TEST_NET_CHAIN_ID = 31; -export const ETH_KOVAN_CHAIN_ID = 42; +export const ETH_GOERLI_CHAIN_ID = 5; export const ETH_MAIN_NET_CHAIN_ID = 1; export const RSK_MAIN_NET_CHAIN_ID = 30; export const BSC_MAIN_NET_CHAIN_ID = 56;